Package org.apache.drill.common.config
Class DrillConfig
java.lang.Object
org.apache.drill.common.config.DrillConfig
- All Implemented Interfaces:
com.typesafe.config.Config
,com.typesafe.config.ConfigMergeable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.typesafe.config.Config
com.typesafe.config.Config
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
DrillConfig loads up Drill configuration information.static DrillConfig
static DrillConfig
create
(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig) static DrillConfig
create
(Properties testConfigurations) Do not use this method outside of test code.static DrillConfig
Merged DrillConfig object for all the RM Configurations provided through various resource files.entrySet()
static DrillConfig
Creates aconfiguration
using the default config file name and with server-specific configuration options disabled.getAnyRefList
(String path) boolean
getBoolean
(String path) getBooleanList
(String path) getBytesList
(String path) com.typesafe.config.Config
List<? extends com.typesafe.config.Config>
getConfigList
(String path) double
getDoubleList
(String path) long
getDuration
(String s, TimeUnit timeUnit) getDurationList
(String s, TimeUnit timeUnit) <T extends Enum<T>>
TgetEnumList
(Class<T> aClass, String s) <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
getIntList
(String path) boolean
com.typesafe.config.ConfigList
long
getLongList
(String path) static long
com.typesafe.config.ConfigMemorySize
List<com.typesafe.config.ConfigMemorySize>
getMilliseconds
(String path) getMillisecondsList
(String path) getNanoseconds
(String path) getNanosecondsList
(String path) getNumberList
(String path) com.typesafe.config.ConfigObject
List<? extends com.typesafe.config.ConfigObject>
getObjectList
(String path) getStringList
(String path) com.typesafe.config.ConfigValue
boolean
boolean
boolean
isEmpty()
boolean
com.typesafe.config.ConfigOrigin
origin()
com.typesafe.config.Config
resolve()
com.typesafe.config.Config
resolve
(com.typesafe.config.ConfigResolveOptions options) com.typesafe.config.Config
resolveWith
(com.typesafe.config.Config config) com.typesafe.config.Config
resolveWith
(com.typesafe.config.Config config, com.typesafe.config.ConfigResolveOptions configResolveOptions) com.typesafe.config.ConfigObject
root()
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
-
Constructor Details
-
DrillConfig
public DrillConfig(com.typesafe.config.Config config)
-
-
Method Details
-
getInstance
Get an instance of the provided interface using the configuration path provided. Construct the object based on the provided constructor arguments.- Parameters:
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.- Returns:
- The new Object instance that implements the provided Interface
-
getStartupArguments
-
create
Creates a DrillConfig object using the default config file name and with server-specific configuration options enabled.- Returns:
- The new DrillConfig object.
-
forClient
Creates aconfiguration
using the default config file name and with server-specific configuration options disabled.- Returns:
DrillConfig
instance
-
create
DrillConfig loads up Drill configuration information. It does this utilizing a combination of classpath scanning and Configuration fallbacks provided by the TypeSafe configuration library. The order of precedence is as follows:Configuration values are retrieved as follows:
- Check a single copy of "drill-override.conf". If multiple copies are
on the classpath, which copy is read is indeterminate.
If a non-null value for overrideFileResourcePathname is provided, this
is used instead of "
drill-override.conf
". - Check a single copy of "drill-distrib.conf". If multiple copies are on the classpath, which copy is read is indeterminate.
- Check all copies of "
drill-module.conf
". Loading order is indeterminate. - Check a single copy of "
drill-default.conf
". If multiple copies are on the classpath, which copy is read is indeterminate.
- Parameters:
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)- Returns:
- A merged Config object.
- Check a single copy of "drill-override.conf". If multiple copies are
on the classpath, which copy is read is indeterminate.
If a non-null value for overrideFileResourcePathname is provided, this
is used instead of "
-
create
Do not use this method outside of test code. -
create
- Parameters:
overrideFileResourcePathname
- seecreate(String)
'soverrideFileResourcePathname
-
createForRM
Merged DrillConfig object for all the RM Configurations provided through various resource files. The order of precedence is as follows:Configuration values are retrieved as follows:
- Check a single copy of "drill-rm-override.conf". If multiple copies are on the classpath, which copy is read is indeterminate.
- Check a single copy of "drill-rm-distrib.conf". If multiple copies are on the classpath, which copy is read is indeterminate.
- Check a single copy of "
drill-rm-default.conf
". If multiple copies are on the classpath, which copy is read is indeterminate.
- Returns:
- A merged Config object.
-
create
Creates a drill configuration using the provided config file.- Parameters:
config
- custom configuration file- Returns:
DrillConfig
instance
-
create
public static DrillConfig create(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig) - Parameters:
overrideFileResourcePathname
- seecreate(String)
'soverrideFileResourcePathname
overriderProps
- optional property map for further overriding (after override file is assimilatedenableServerConfigs
- whether to enable server-specific configuration optionsconfigInfo
- seeConfigFileInfo
fallbackConfig
- existing config which will be used as fallback- Returns:
DrillConfig
object with all configs from passed in resource files
-
getInstanceOf
- Throws:
DrillConfigurationException
-
toString
-
getMaxDirectMemory
public static long getMaxDirectMemory() -
root
public com.typesafe.config.ConfigObject root()- Specified by:
root
in interfacecom.typesafe.config.Config
-
origin
public com.typesafe.config.ConfigOrigin origin()- Specified by:
origin
in interfacecom.typesafe.config.Config
-
withFallback
public com.typesafe.config.Config withFallback(com.typesafe.config.ConfigMergeable other) - Specified by:
withFallback
in interfacecom.typesafe.config.Config
- Specified by:
withFallback
in interfacecom.typesafe.config.ConfigMergeable
-
resolve
public com.typesafe.config.Config resolve()- Specified by:
resolve
in interfacecom.typesafe.config.Config
-
resolve
public com.typesafe.config.Config resolve(com.typesafe.config.ConfigResolveOptions options) - Specified by:
resolve
in interfacecom.typesafe.config.Config
-
checkValid
- Specified by:
checkValid
in interfacecom.typesafe.config.Config
-
hasPath
- Specified by:
hasPath
in interfacecom.typesafe.config.Config
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacecom.typesafe.config.Config
-
entrySet
- Specified by:
entrySet
in interfacecom.typesafe.config.Config
-
getBoolean
- Specified by:
getBoolean
in interfacecom.typesafe.config.Config
-
getNumber
- Specified by:
getNumber
in interfacecom.typesafe.config.Config
-
getInt
- Specified by:
getInt
in interfacecom.typesafe.config.Config
-
getLong
- Specified by:
getLong
in interfacecom.typesafe.config.Config
-
getDouble
- Specified by:
getDouble
in interfacecom.typesafe.config.Config
-
getString
- Specified by:
getString
in interfacecom.typesafe.config.Config
-
getObject
- Specified by:
getObject
in interfacecom.typesafe.config.Config
-
getConfig
- Specified by:
getConfig
in interfacecom.typesafe.config.Config
-
getAnyRef
- Specified by:
getAnyRef
in interfacecom.typesafe.config.Config
-
getValue
- Specified by:
getValue
in interfacecom.typesafe.config.Config
-
getBytes
- Specified by:
getBytes
in interfacecom.typesafe.config.Config
-
getMilliseconds
- Specified by:
getMilliseconds
in interfacecom.typesafe.config.Config
-
getNanoseconds
- Specified by:
getNanoseconds
in interfacecom.typesafe.config.Config
-
getList
- Specified by:
getList
in interfacecom.typesafe.config.Config
-
getBooleanList
- Specified by:
getBooleanList
in interfacecom.typesafe.config.Config
-
getNumberList
- Specified by:
getNumberList
in interfacecom.typesafe.config.Config
-
getIntList
- Specified by:
getIntList
in interfacecom.typesafe.config.Config
-
getLongList
- Specified by:
getLongList
in interfacecom.typesafe.config.Config
-
getDoubleList
- Specified by:
getDoubleList
in interfacecom.typesafe.config.Config
-
getStringList
- Specified by:
getStringList
in interfacecom.typesafe.config.Config
-
getObjectList
- Specified by:
getObjectList
in interfacecom.typesafe.config.Config
-
getConfigList
- Specified by:
getConfigList
in interfacecom.typesafe.config.Config
-
getAnyRefList
- Specified by:
getAnyRefList
in interfacecom.typesafe.config.Config
-
getBytesList
- Specified by:
getBytesList
in interfacecom.typesafe.config.Config
-
getMillisecondsList
- Specified by:
getMillisecondsList
in interfacecom.typesafe.config.Config
-
getNanosecondsList
- Specified by:
getNanosecondsList
in interfacecom.typesafe.config.Config
-
withOnlyPath
- Specified by:
withOnlyPath
in interfacecom.typesafe.config.Config
-
withoutPath
- Specified by:
withoutPath
in interfacecom.typesafe.config.Config
-
atPath
- Specified by:
atPath
in interfacecom.typesafe.config.Config
-
atKey
- Specified by:
atKey
in interfacecom.typesafe.config.Config
-
withValue
- Specified by:
withValue
in interfacecom.typesafe.config.Config
-
isResolved
public boolean isResolved()- Specified by:
isResolved
in interfacecom.typesafe.config.Config
-
resolveWith
public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config) - Specified by:
resolveWith
in interfacecom.typesafe.config.Config
-
resolveWith
public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config, com.typesafe.config.ConfigResolveOptions configResolveOptions) - Specified by:
resolveWith
in interfacecom.typesafe.config.Config
-
hasPathOrNull
- Specified by:
hasPathOrNull
in interfacecom.typesafe.config.Config
-
getIsNull
- Specified by:
getIsNull
in interfacecom.typesafe.config.Config
-
getEnum
- Specified by:
getEnum
in interfacecom.typesafe.config.Config
-
getMemorySize
- Specified by:
getMemorySize
in interfacecom.typesafe.config.Config
-
getDuration
- Specified by:
getDuration
in interfacecom.typesafe.config.Config
-
getDuration
- Specified by:
getDuration
in interfacecom.typesafe.config.Config
-
getPeriod
- Specified by:
getPeriod
in interfacecom.typesafe.config.Config
-
getTemporal
- Specified by:
getTemporal
in interfacecom.typesafe.config.Config
-
getEnumList
- Specified by:
getEnumList
in interfacecom.typesafe.config.Config
-
getMemorySizeList
- Specified by:
getMemorySizeList
in interfacecom.typesafe.config.Config
-
getDurationList
- Specified by:
getDurationList
in interfacecom.typesafe.config.Config
-
getDurationList
- Specified by:
getDurationList
in interfacecom.typesafe.config.Config
-