2323 */
2424public abstract class AuronConfiguration {
2525
26- public static final ConfigOption <Integer > BATCH_SIZE = ConfigOptions .key ("auron.batchSize" )
27- .description ("Suggested batch size for arrow batches." )
28- .intType ()
29- .defaultValue (10000 );
30-
31- public static final ConfigOption <Double > MEMORY_FRACTION = ConfigOptions .key ("auron.memoryFraction" )
32- .description ("Suggested fraction of off-heap memory used in native execution. "
26+ public static final ConfigOption <Integer > BATCH_SIZE = new ConfigOption <>(Integer .class )
27+ .withKey ("auron.batchSize" )
28+ .withDescription ("Suggested batch size for arrow batches." )
29+ .withDefaultValue (10000 );
30+
31+ public static final ConfigOption <Double > MEMORY_FRACTION = new ConfigOption <>(Double .class )
32+ .withKey ("auron.memoryFraction" )
33+ .withDescription ("Suggested fraction of off-heap memory used in native execution. "
3334 + "actual off-heap memory usage is expected to be spark.executor.memoryOverhead * fraction." )
34- .doubleType ()
35- .defaultValue (0.6 );
35+ .withDefaultValue (0.6 );
3636
37- public static final ConfigOption <String > NATIVE_LOG_LEVEL = ConfigOptions . key ( "auron.native.log.level" )
38- .description ( "Log level for native execution. " )
39- .stringType ( )
40- .defaultValue ("info" );
37+ public static final ConfigOption <String > NATIVE_LOG_LEVEL = new ConfigOption <>( String . class )
38+ .withKey ( "auron. native.log.level " )
39+ .withDescription ( "Log level for native execution." )
40+ .withDefaultValue ("info" );
4141
4242 public abstract <T > Optional <T > getOptional (ConfigOption <T > option );
4343
44- public abstract <T > Optional <T > getOptional (String key );
45-
4644 public <T > T get (ConfigOption <T > option ) {
4745 return getOptional (option ).orElseGet (() -> getOptionDefaultValue (option ));
4846 }
@@ -57,18 +55,6 @@ public String getString(ConfigOption<String> configOption) {
5755 return getOptional (configOption ).orElseGet (() -> getOptionDefaultValue (configOption ));
5856 }
5957
60- /**
61- * Returns the value associated with the given config option as a string. If no value is mapped
62- * under any key of the option, it returns the specified default instead of the option's default
63- * value.
64- *
65- * @param configOption The configuration option
66- * @return the (default) value associated with the given config option
67- */
68- public String getString (ConfigOption <String > configOption , String overrideDefault ) {
69- return getOptional (configOption ).orElse (overrideDefault );
70- }
71-
7258 /**
7359 * Returns the value associated with the given config option as an integer.
7460 *
@@ -79,19 +65,6 @@ public int getInteger(ConfigOption<Integer> configOption) {
7965 return getOptional (configOption ).orElseGet (() -> getOptionDefaultValue (configOption ));
8066 }
8167
82- /**
83- * Returns the value associated with the given config option as an integer. If no value is
84- * mapped under any key of the option, it returns the specified default instead of the option's
85- * default value.
86- *
87- * @param configOption The configuration option
88- * @param overrideDefault The value to return if no value was mapped for any key of the option
89- * @return the configured value associated with the given config option, or the overrideDefault
90- */
91- public int getInteger (ConfigOption <Integer > configOption , int overrideDefault ) {
92- return getOptional (configOption ).orElse (overrideDefault );
93- }
94-
9568 /**
9669 * Returns the value associated with the given config option as a long integer.
9770 *
@@ -102,19 +75,6 @@ public long getLong(ConfigOption<Long> configOption) {
10275 return getOptional (configOption ).orElseGet (() -> getOptionDefaultValue (configOption ));
10376 }
10477
105- /**
106- * Returns the value associated with the given config option as a long integer. If no value is
107- * mapped under any key of the option, it returns the specified default instead of the option's
108- * default value.
109- *
110- * @param configOption The configuration option
111- * @param overrideDefault The value to return if no value was mapped for any key of the option
112- * @return the configured value associated with the given config option, or the overrideDefault
113- */
114- public long getLong (ConfigOption <Long > configOption , long overrideDefault ) {
115- return getOptional (configOption ).orElse (overrideDefault );
116- }
117-
11878 /**
11979 * Returns the value associated with the given config option as a boolean.
12080 *
@@ -148,19 +108,6 @@ public float getFloat(ConfigOption<Float> configOption) {
148108 return getOptional (configOption ).orElseGet (() -> getOptionDefaultValue (configOption ));
149109 }
150110
151- /**
152- * Returns the value associated with the given config option as a float. If no value is mapped
153- * under any key of the option, it returns the specified default instead of the option's default
154- * value.
155- *
156- * @param configOption The configuration option
157- * @param overrideDefault The value to return if no value was mapped for any key of the option
158- * @return the configured value associated with the given config option, or the overrideDefault
159- */
160- public float getFloat (ConfigOption <Float > configOption , float overrideDefault ) {
161- return getOptional (configOption ).orElse (overrideDefault );
162- }
163-
164111 /**
165112 * Returns the value associated with the given config option as a {@code double}.
166113 *
@@ -171,19 +118,6 @@ public double getDouble(ConfigOption<Double> configOption) {
171118 return getOptional (configOption ).orElseGet (() -> getOptionDefaultValue (configOption ));
172119 }
173120
174- /**
175- * Returns the value associated with the given config option as a {@code double}. If no value is
176- * mapped under any key of the option, it returns the specified default instead of the option's
177- * default value.
178- *
179- * @param configOption The configuration option
180- * @param overrideDefault The value to return if no value was mapped for any key of the option
181- * @return the configured value associated with the given config option, or the overrideDefault
182- */
183- public double getDouble (ConfigOption <Double > configOption , double overrideDefault ) {
184- return getOptional (configOption ).orElse (overrideDefault );
185- }
186-
187121 /**
188122 * Returns the value associated with the given config option as a {@code double}.
189123 *
0 commit comments