public class DrillConfig extends Object
Constructor and Description |
---|
DrillConfig(com.typesafe.config.Config config) |
Modifier and Type | Method and Description |
---|---|
com.typesafe.config.Config |
atKey(String key) |
com.typesafe.config.Config |
atPath(String path) |
void |
checkValid(com.typesafe.config.Config reference,
String... restrictToPaths) |
static DrillConfig |
create()
Creates a DrillConfig object using the default config file name
and with server-specific configuration options enabled.
|
static DrillConfig |
create(com.typesafe.config.Config config)
Creates a drill configuration using the provided config file.
|
static DrillConfig |
create(Properties testConfigurations)
Do not use this method outside of test code.
|
static DrillConfig |
create(String overrideFileResourcePathname)
DrillConfig loads up Drill configuration information.
|
static DrillConfig |
create(String overrideFileResourcePathname,
boolean enableServerConfigs) |
static DrillConfig |
create(String overrideFileResourcePathname,
Properties overriderProps,
boolean enableServerConfigs,
ConfigFileInfo configInfo,
com.typesafe.config.ConfigMergeable fallbackConfig) |
static DrillConfig |
createForRM()
Merged DrillConfig object for all the RM Configurations provided through various resource files.
|
Set<Map.Entry<String,com.typesafe.config.ConfigValue>> |
entrySet() |
static DrillConfig |
forClient()
Creates a
configuration using the default config file
name and with server-specific configuration options disabled. |
Object |
getAnyRef(String path) |
List<? extends Object> |
getAnyRefList(String path) |
boolean |
getBoolean(String path) |
List<Boolean> |
getBooleanList(String path) |
Long |
getBytes(String path) |
List<Long> |
getBytesList(String path) |
com.typesafe.config.Config |
getConfig(String path) |
List<? extends com.typesafe.config.Config> |
getConfigList(String path) |
double |
getDouble(String path) |
List<Double> |
getDoubleList(String path) |
<T> T |
getInstance(String path,
Class<T> iface,
Object... constructorArgs)
Get an instance of the provided interface using the configuration path provided.
|
<T> T |
getInstanceOf(String location,
Class<T> clazz) |
int |
getInt(String path) |
List<Integer> |
getIntList(String path) |
com.typesafe.config.ConfigList |
getList(String path) |
long |
getLong(String path) |
List<Long> |
getLongList(String path) |
static long |
getMaxDirectMemory() |
Long |
getMilliseconds(String path) |
List<Long> |
getMillisecondsList(String path) |
Long |
getNanoseconds(String path) |
List<Long> |
getNanosecondsList(String path) |
Number |
getNumber(String path) |
List<Number> |
getNumberList(String path) |
com.typesafe.config.ConfigObject |
getObject(String path) |
List<? extends com.typesafe.config.ConfigObject> |
getObjectList(String path) |
List<String> |
getStartupArguments() |
String |
getString(String path) |
List<String> |
getStringList(String path) |
com.typesafe.config.ConfigValue |
getValue(String path) |
boolean |
hasPath(String path) |
boolean |
isEmpty() |
com.typesafe.config.ConfigOrigin |
origin() |
com.typesafe.config.Config |
resolve() |
com.typesafe.config.Config |
resolve(com.typesafe.config.ConfigResolveOptions options) |
com.typesafe.config.ConfigObject |
root() |
String |
toString() |
com.typesafe.config.Config |
withFallback(com.typesafe.config.ConfigMergeable other) |
com.typesafe.config.Config |
withOnlyPath(String path) |
com.typesafe.config.Config |
withoutPath(String path) |
com.typesafe.config.Config |
withValue(String path,
com.typesafe.config.ConfigValue value) |
public <T> T getInstance(String path, Class<T> iface, Object... constructorArgs)
path
- The configuration path to use.iface
- The Interface or Superclass of the instance you requested.constructorArgs
- Any arguments required for constructing the requested type.public static DrillConfig create()
public static DrillConfig forClient()
configuration
using the default config file
name and with server-specific configuration options disabled.DrillConfig
instancepublic static DrillConfig create(String overrideFileResourcePathname)
Configuration values are retrieved as follows:
drill-override.conf
".drill-module.conf
". Loading order is
indeterminate.drill-default.conf
". If multiple
copies are on the classpath, which copy is read is indeterminate.overrideFileResourcePathname
- the classpath resource pathname of the file to use for
configuration override purposes; null
specifies to use the
default pathname (ConfigConstants.CONFIG_OVERRIDE_RESOURCE_PATHNAME
) (does
not specify to suppress trying to load an
overrides file)public static DrillConfig create(Properties testConfigurations)
public static DrillConfig create(String overrideFileResourcePathname, boolean enableServerConfigs)
overrideFileResourcePathname
- see create(String)
's overrideFileResourcePathname
public static DrillConfig createForRM()
Configuration values are retrieved as follows:
drill-rm-default.conf
". If multiple
copies are on the classpath, which copy is read is indeterminate.public static DrillConfig create(com.typesafe.config.Config config)
config
- custom configuration fileDrillConfig
instancepublic static DrillConfig create(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig)
overrideFileResourcePathname
- see create(String)
's overrideFileResourcePathname
overriderProps
- optional property map for further overriding (after override file
is assimilatedenableServerConfigs
- whether to enable server-specific configuration optionsconfigInfo
- see ConfigFileInfo
fallbackConfig
- existing config which will be used as fallbackDrillConfig
object with all configs from passed in resource filespublic <T> T getInstanceOf(String location, Class<T> clazz) throws DrillConfigurationException
DrillConfigurationException
public static long getMaxDirectMemory()
public com.typesafe.config.ConfigObject root()
root
in interface com.typesafe.config.Config
public com.typesafe.config.ConfigOrigin origin()
origin
in interface com.typesafe.config.Config
public com.typesafe.config.Config withFallback(com.typesafe.config.ConfigMergeable other)
withFallback
in interface com.typesafe.config.Config
withFallback
in interface com.typesafe.config.ConfigMergeable
public com.typesafe.config.Config resolve()
resolve
in interface com.typesafe.config.Config
public com.typesafe.config.Config resolve(com.typesafe.config.ConfigResolveOptions options)
resolve
in interface com.typesafe.config.Config
public void checkValid(com.typesafe.config.Config reference, String... restrictToPaths)
checkValid
in interface com.typesafe.config.Config
public boolean hasPath(String path)
hasPath
in interface com.typesafe.config.Config
public boolean isEmpty()
isEmpty
in interface com.typesafe.config.Config
public Set<Map.Entry<String,com.typesafe.config.ConfigValue>> entrySet()
entrySet
in interface com.typesafe.config.Config
public boolean getBoolean(String path)
getBoolean
in interface com.typesafe.config.Config
public Number getNumber(String path)
getNumber
in interface com.typesafe.config.Config
public int getInt(String path)
getInt
in interface com.typesafe.config.Config
public long getLong(String path)
getLong
in interface com.typesafe.config.Config
public double getDouble(String path)
getDouble
in interface com.typesafe.config.Config
public String getString(String path)
getString
in interface com.typesafe.config.Config
public com.typesafe.config.ConfigObject getObject(String path)
getObject
in interface com.typesafe.config.Config
public com.typesafe.config.Config getConfig(String path)
getConfig
in interface com.typesafe.config.Config
public Object getAnyRef(String path)
getAnyRef
in interface com.typesafe.config.Config
public com.typesafe.config.ConfigValue getValue(String path)
getValue
in interface com.typesafe.config.Config
public Long getBytes(String path)
getBytes
in interface com.typesafe.config.Config
public Long getMilliseconds(String path)
getMilliseconds
in interface com.typesafe.config.Config
public Long getNanoseconds(String path)
getNanoseconds
in interface com.typesafe.config.Config
public com.typesafe.config.ConfigList getList(String path)
getList
in interface com.typesafe.config.Config
public List<Boolean> getBooleanList(String path)
getBooleanList
in interface com.typesafe.config.Config
public List<Number> getNumberList(String path)
getNumberList
in interface com.typesafe.config.Config
public List<Integer> getIntList(String path)
getIntList
in interface com.typesafe.config.Config
public List<Long> getLongList(String path)
getLongList
in interface com.typesafe.config.Config
public List<Double> getDoubleList(String path)
getDoubleList
in interface com.typesafe.config.Config
public List<String> getStringList(String path)
getStringList
in interface com.typesafe.config.Config
public List<? extends com.typesafe.config.ConfigObject> getObjectList(String path)
getObjectList
in interface com.typesafe.config.Config
public List<? extends com.typesafe.config.Config> getConfigList(String path)
getConfigList
in interface com.typesafe.config.Config
public List<? extends Object> getAnyRefList(String path)
getAnyRefList
in interface com.typesafe.config.Config
public List<Long> getBytesList(String path)
getBytesList
in interface com.typesafe.config.Config
public List<Long> getMillisecondsList(String path)
getMillisecondsList
in interface com.typesafe.config.Config
public List<Long> getNanosecondsList(String path)
getNanosecondsList
in interface com.typesafe.config.Config
public com.typesafe.config.Config withOnlyPath(String path)
withOnlyPath
in interface com.typesafe.config.Config
public com.typesafe.config.Config withoutPath(String path)
withoutPath
in interface com.typesafe.config.Config
public com.typesafe.config.Config atPath(String path)
atPath
in interface com.typesafe.config.Config
public com.typesafe.config.Config atKey(String key)
atKey
in interface com.typesafe.config.Config
public com.typesafe.config.Config withValue(String path, com.typesafe.config.ConfigValue value)
withValue
in interface com.typesafe.config.Config
Copyright © 1970 The Apache Software Foundation. All rights reserved.