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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.typesafe.config.Configcom.typesafe.config.ConfigvoidcheckValid(com.typesafe.config.Config reference, String... restrictToPaths) static DrillConfigcreate()Creates a DrillConfig object using the default config file name and with server-specific configuration options enabled.static DrillConfigcreate(com.typesafe.config.Config config) Creates a drill configuration using the provided config file.static DrillConfigDrillConfig loads up Drill configuration information.static DrillConfigstatic DrillConfigcreate(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig) static DrillConfigcreate(Properties testConfigurations) Do not use this method outside of test code.static DrillConfigMerged DrillConfig object for all the RM Configurations provided through various resource files.entrySet()static DrillConfigCreates aconfigurationusing the default config file name and with server-specific configuration options disabled.getAnyRefList(String path) booleangetBoolean(String path) getBooleanList(String path) getBytesList(String path) com.typesafe.config.ConfigList<? extends com.typesafe.config.Config> getConfigList(String path) doublegetDoubleList(String path) longgetDuration(String s, TimeUnit timeUnit) getDurationList(String s, TimeUnit timeUnit) <T extends Enum<T>>
TgetEnumList(Class<T> aClass, String s) <T> TgetInstance(String path, Class<T> iface, Object... constructorArgs) Get an instance of the provided interface using the configuration path provided.<T> TgetInstanceOf(String location, Class<T> clazz) intgetIntList(String path) booleancom.typesafe.config.ConfigListlonggetLongList(String path) static longcom.typesafe.config.ConfigMemorySizeList<com.typesafe.config.ConfigMemorySize> getMilliseconds(String path) getMillisecondsList(String path) getNanoseconds(String path) getNanosecondsList(String path) getNumberList(String path) com.typesafe.config.ConfigObjectList<? extends com.typesafe.config.ConfigObject> getObjectList(String path) getStringList(String path) com.typesafe.config.ConfigValuebooleanbooleanbooleanisEmpty()booleancom.typesafe.config.ConfigOriginorigin()com.typesafe.config.Configresolve()com.typesafe.config.Configresolve(com.typesafe.config.ConfigResolveOptions options) com.typesafe.config.ConfigresolveWith(com.typesafe.config.Config config) com.typesafe.config.ConfigresolveWith(com.typesafe.config.Config config, com.typesafe.config.ConfigResolveOptions configResolveOptions) com.typesafe.config.ConfigObjectroot()toString()com.typesafe.config.ConfigwithFallback(com.typesafe.config.ConfigMergeable other) com.typesafe.config.ConfigwithOnlyPath(String path) com.typesafe.config.ConfigwithoutPath(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 aconfigurationusing the default config file name and with server-specific configuration options disabled.- Returns:
DrillConfiginstance
-
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;nullspecifies 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:
DrillConfiginstance
-
create
public static DrillConfig create(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig) - Parameters:
overrideFileResourcePathname- seecreate(String)'soverrideFileResourcePathnameoverriderProps- optional property map for further overriding (after override file is assimilatedenableServerConfigs- whether to enable server-specific configuration optionsconfigInfo- seeConfigFileInfofallbackConfig- existing config which will be used as fallback- Returns:
DrillConfigobject 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:
rootin interfacecom.typesafe.config.Config
-
origin
public com.typesafe.config.ConfigOrigin origin()- Specified by:
originin interfacecom.typesafe.config.Config
-
withFallback
public com.typesafe.config.Config withFallback(com.typesafe.config.ConfigMergeable other) - Specified by:
withFallbackin interfacecom.typesafe.config.Config- Specified by:
withFallbackin interfacecom.typesafe.config.ConfigMergeable
-
resolve
public com.typesafe.config.Config resolve()- Specified by:
resolvein interfacecom.typesafe.config.Config
-
resolve
public com.typesafe.config.Config resolve(com.typesafe.config.ConfigResolveOptions options) - Specified by:
resolvein interfacecom.typesafe.config.Config
-
checkValid
- Specified by:
checkValidin interfacecom.typesafe.config.Config
-
hasPath
- Specified by:
hasPathin interfacecom.typesafe.config.Config
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacecom.typesafe.config.Config
-
entrySet
- Specified by:
entrySetin interfacecom.typesafe.config.Config
-
getBoolean
- Specified by:
getBooleanin interfacecom.typesafe.config.Config
-
getNumber
- Specified by:
getNumberin interfacecom.typesafe.config.Config
-
getInt
- Specified by:
getIntin interfacecom.typesafe.config.Config
-
getLong
- Specified by:
getLongin interfacecom.typesafe.config.Config
-
getDouble
- Specified by:
getDoublein interfacecom.typesafe.config.Config
-
getString
- Specified by:
getStringin interfacecom.typesafe.config.Config
-
getObject
- Specified by:
getObjectin interfacecom.typesafe.config.Config
-
getConfig
- Specified by:
getConfigin interfacecom.typesafe.config.Config
-
getAnyRef
- Specified by:
getAnyRefin interfacecom.typesafe.config.Config
-
getValue
- Specified by:
getValuein interfacecom.typesafe.config.Config
-
getBytes
- Specified by:
getBytesin interfacecom.typesafe.config.Config
-
getMilliseconds
- Specified by:
getMillisecondsin interfacecom.typesafe.config.Config
-
getNanoseconds
- Specified by:
getNanosecondsin interfacecom.typesafe.config.Config
-
getList
- Specified by:
getListin interfacecom.typesafe.config.Config
-
getBooleanList
- Specified by:
getBooleanListin interfacecom.typesafe.config.Config
-
getNumberList
- Specified by:
getNumberListin interfacecom.typesafe.config.Config
-
getIntList
- Specified by:
getIntListin interfacecom.typesafe.config.Config
-
getLongList
- Specified by:
getLongListin interfacecom.typesafe.config.Config
-
getDoubleList
- Specified by:
getDoubleListin interfacecom.typesafe.config.Config
-
getStringList
- Specified by:
getStringListin interfacecom.typesafe.config.Config
-
getObjectList
- Specified by:
getObjectListin interfacecom.typesafe.config.Config
-
getConfigList
- Specified by:
getConfigListin interfacecom.typesafe.config.Config
-
getAnyRefList
- Specified by:
getAnyRefListin interfacecom.typesafe.config.Config
-
getBytesList
- Specified by:
getBytesListin interfacecom.typesafe.config.Config
-
getMillisecondsList
- Specified by:
getMillisecondsListin interfacecom.typesafe.config.Config
-
getNanosecondsList
- Specified by:
getNanosecondsListin interfacecom.typesafe.config.Config
-
withOnlyPath
- Specified by:
withOnlyPathin interfacecom.typesafe.config.Config
-
withoutPath
- Specified by:
withoutPathin interfacecom.typesafe.config.Config
-
atPath
- Specified by:
atPathin interfacecom.typesafe.config.Config
-
atKey
- Specified by:
atKeyin interfacecom.typesafe.config.Config
-
withValue
- Specified by:
withValuein interfacecom.typesafe.config.Config
-
isResolved
public boolean isResolved()- Specified by:
isResolvedin interfacecom.typesafe.config.Config
-
resolveWith
public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config) - Specified by:
resolveWithin interfacecom.typesafe.config.Config
-
resolveWith
public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config, com.typesafe.config.ConfigResolveOptions configResolveOptions) - Specified by:
resolveWithin interfacecom.typesafe.config.Config
-
hasPathOrNull
- Specified by:
hasPathOrNullin interfacecom.typesafe.config.Config
-
getIsNull
- Specified by:
getIsNullin interfacecom.typesafe.config.Config
-
getEnum
- Specified by:
getEnumin interfacecom.typesafe.config.Config
-
getMemorySize
- Specified by:
getMemorySizein interfacecom.typesafe.config.Config
-
getDuration
- Specified by:
getDurationin interfacecom.typesafe.config.Config
-
getDuration
- Specified by:
getDurationin interfacecom.typesafe.config.Config
-
getPeriod
- Specified by:
getPeriodin interfacecom.typesafe.config.Config
-
getTemporal
- Specified by:
getTemporalin interfacecom.typesafe.config.Config
-
getEnumList
- Specified by:
getEnumListin interfacecom.typesafe.config.Config
-
getMemorySizeList
- Specified by:
getMemorySizeListin interfacecom.typesafe.config.Config
-
getDurationList
- Specified by:
getDurationListin interfacecom.typesafe.config.Config
-
getDurationList
- Specified by:
getDurationListin interfacecom.typesafe.config.Config
-