Class DrillConfig

java.lang.Object
org.apache.drill.common.config.DrillConfig
All Implemented Interfaces:
com.typesafe.config.Config, com.typesafe.config.ConfigMergeable

public class DrillConfig extends Object
  • Constructor Details Link icon

    • DrillConfig Link icon

      public DrillConfig(com.typesafe.config.Config config)
  • Method Details Link icon

    • getInstance Link icon

      public <T> T getInstance(String path, Class<T> iface, Object... constructorArgs)
      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 Link icon

      public List<String> getStartupArguments()
    • create Link icon

      public static DrillConfig create()
      Creates a DrillConfig object using the default config file name and with server-specific configuration options enabled.
      Returns:
      The new DrillConfig object.
    • forClient Link icon

      public static DrillConfig forClient()
      Creates a configuration using the default config file name and with server-specific configuration options disabled.
      Returns:
      DrillConfig instance
    • create Link icon

      public static DrillConfig create(String overrideFileResourcePathname)
      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.
    • create Link icon

      public static DrillConfig create(Properties testConfigurations)
      Do not use this method outside of test code.
    • create Link icon

      public static DrillConfig create(String overrideFileResourcePathname, boolean enableServerConfigs)
      Parameters:
      overrideFileResourcePathname - see create(String)'s overrideFileResourcePathname
    • createForRM Link icon

      public static DrillConfig 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 Link icon

      public static DrillConfig create(com.typesafe.config.Config config)
      Creates a drill configuration using the provided config file.
      Parameters:
      config - custom configuration file
      Returns:
      DrillConfig instance
    • create Link icon

      public static DrillConfig create(String overrideFileResourcePathname, Properties overriderProps, boolean enableServerConfigs, ConfigFileInfo configInfo, com.typesafe.config.ConfigMergeable fallbackConfig)
      Parameters:
      overrideFileResourcePathname - see create(String)'s overrideFileResourcePathname
      overriderProps - optional property map for further overriding (after override file is assimilated
      enableServerConfigs - whether to enable server-specific configuration options
      configInfo - see ConfigFileInfo
      fallbackConfig - existing config which will be used as fallback
      Returns:
      DrillConfig object with all configs from passed in resource files
    • getInstanceOf Link icon

      public <T> T getInstanceOf(String location, Class<T> clazz) throws DrillConfigurationException
      Throws:
      DrillConfigurationException
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • getMaxDirectMemory Link icon

      public static long getMaxDirectMemory()
    • root Link icon

      public com.typesafe.config.ConfigObject root()
      Specified by:
      root in interface com.typesafe.config.Config
    • origin Link icon

      public com.typesafe.config.ConfigOrigin origin()
      Specified by:
      origin in interface com.typesafe.config.Config
    • withFallback Link icon

      public com.typesafe.config.Config withFallback(com.typesafe.config.ConfigMergeable other)
      Specified by:
      withFallback in interface com.typesafe.config.Config
      Specified by:
      withFallback in interface com.typesafe.config.ConfigMergeable
    • resolve Link icon

      public com.typesafe.config.Config resolve()
      Specified by:
      resolve in interface com.typesafe.config.Config
    • resolve Link icon

      public com.typesafe.config.Config resolve(com.typesafe.config.ConfigResolveOptions options)
      Specified by:
      resolve in interface com.typesafe.config.Config
    • checkValid Link icon

      public void checkValid(com.typesafe.config.Config reference, String... restrictToPaths)
      Specified by:
      checkValid in interface com.typesafe.config.Config
    • hasPath Link icon

      public boolean hasPath(String path)
      Specified by:
      hasPath in interface com.typesafe.config.Config
    • isEmpty Link icon

      public boolean isEmpty()
      Specified by:
      isEmpty in interface com.typesafe.config.Config
    • entrySet Link icon

      public Set<Map.Entry<String,com.typesafe.config.ConfigValue>> entrySet()
      Specified by:
      entrySet in interface com.typesafe.config.Config
    • getBoolean Link icon

      public boolean getBoolean(String path)
      Specified by:
      getBoolean in interface com.typesafe.config.Config
    • getNumber Link icon

      public Number getNumber(String path)
      Specified by:
      getNumber in interface com.typesafe.config.Config
    • getInt Link icon

      public int getInt(String path)
      Specified by:
      getInt in interface com.typesafe.config.Config
    • getLong Link icon

      public long getLong(String path)
      Specified by:
      getLong in interface com.typesafe.config.Config
    • getDouble Link icon

      public double getDouble(String path)
      Specified by:
      getDouble in interface com.typesafe.config.Config
    • getString Link icon

      public String getString(String path)
      Specified by:
      getString in interface com.typesafe.config.Config
    • getObject Link icon

      public com.typesafe.config.ConfigObject getObject(String path)
      Specified by:
      getObject in interface com.typesafe.config.Config
    • getConfig Link icon

      public com.typesafe.config.Config getConfig(String path)
      Specified by:
      getConfig in interface com.typesafe.config.Config
    • getAnyRef Link icon

      public Object getAnyRef(String path)
      Specified by:
      getAnyRef in interface com.typesafe.config.Config
    • getValue Link icon

      public com.typesafe.config.ConfigValue getValue(String path)
      Specified by:
      getValue in interface com.typesafe.config.Config
    • getBytes Link icon

      public Long getBytes(String path)
      Specified by:
      getBytes in interface com.typesafe.config.Config
    • getMilliseconds Link icon

      public Long getMilliseconds(String path)
      Specified by:
      getMilliseconds in interface com.typesafe.config.Config
    • getNanoseconds Link icon

      public Long getNanoseconds(String path)
      Specified by:
      getNanoseconds in interface com.typesafe.config.Config
    • getList Link icon

      public com.typesafe.config.ConfigList getList(String path)
      Specified by:
      getList in interface com.typesafe.config.Config
    • getBooleanList Link icon

      public List<Boolean> getBooleanList(String path)
      Specified by:
      getBooleanList in interface com.typesafe.config.Config
    • getNumberList Link icon

      public List<Number> getNumberList(String path)
      Specified by:
      getNumberList in interface com.typesafe.config.Config
    • getIntList Link icon

      public List<Integer> getIntList(String path)
      Specified by:
      getIntList in interface com.typesafe.config.Config
    • getLongList Link icon

      public List<Long> getLongList(String path)
      Specified by:
      getLongList in interface com.typesafe.config.Config
    • getDoubleList Link icon

      public List<Double> getDoubleList(String path)
      Specified by:
      getDoubleList in interface com.typesafe.config.Config
    • getStringList Link icon

      public List<String> getStringList(String path)
      Specified by:
      getStringList in interface com.typesafe.config.Config
    • getObjectList Link icon

      public List<? extends com.typesafe.config.ConfigObject> getObjectList(String path)
      Specified by:
      getObjectList in interface com.typesafe.config.Config
    • getConfigList Link icon

      public List<? extends com.typesafe.config.Config> getConfigList(String path)
      Specified by:
      getConfigList in interface com.typesafe.config.Config
    • getAnyRefList Link icon

      public List<? extends Object> getAnyRefList(String path)
      Specified by:
      getAnyRefList in interface com.typesafe.config.Config
    • getBytesList Link icon

      public List<Long> getBytesList(String path)
      Specified by:
      getBytesList in interface com.typesafe.config.Config
    • getMillisecondsList Link icon

      public List<Long> getMillisecondsList(String path)
      Specified by:
      getMillisecondsList in interface com.typesafe.config.Config
    • getNanosecondsList Link icon

      public List<Long> getNanosecondsList(String path)
      Specified by:
      getNanosecondsList in interface com.typesafe.config.Config
    • withOnlyPath Link icon

      public com.typesafe.config.Config withOnlyPath(String path)
      Specified by:
      withOnlyPath in interface com.typesafe.config.Config
    • withoutPath Link icon

      public com.typesafe.config.Config withoutPath(String path)
      Specified by:
      withoutPath in interface com.typesafe.config.Config
    • atPath Link icon

      public com.typesafe.config.Config atPath(String path)
      Specified by:
      atPath in interface com.typesafe.config.Config
    • atKey Link icon

      public com.typesafe.config.Config atKey(String key)
      Specified by:
      atKey in interface com.typesafe.config.Config
    • withValue Link icon

      public com.typesafe.config.Config withValue(String path, com.typesafe.config.ConfigValue value)
      Specified by:
      withValue in interface com.typesafe.config.Config
    • isResolved Link icon

      public boolean isResolved()
      Specified by:
      isResolved in interface com.typesafe.config.Config
    • resolveWith Link icon

      public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config)
      Specified by:
      resolveWith in interface com.typesafe.config.Config
    • resolveWith Link icon

      public com.typesafe.config.Config resolveWith(com.typesafe.config.Config config, com.typesafe.config.ConfigResolveOptions configResolveOptions)
      Specified by:
      resolveWith in interface com.typesafe.config.Config
    • hasPathOrNull Link icon

      public boolean hasPathOrNull(String s)
      Specified by:
      hasPathOrNull in interface com.typesafe.config.Config
    • getIsNull Link icon

      public boolean getIsNull(String s)
      Specified by:
      getIsNull in interface com.typesafe.config.Config
    • getEnum Link icon

      public <T extends Enum<T>> T getEnum(Class<T> aClass, String s)
      Specified by:
      getEnum in interface com.typesafe.config.Config
    • getMemorySize Link icon

      public com.typesafe.config.ConfigMemorySize getMemorySize(String s)
      Specified by:
      getMemorySize in interface com.typesafe.config.Config
    • getDuration Link icon

      public long getDuration(String s, TimeUnit timeUnit)
      Specified by:
      getDuration in interface com.typesafe.config.Config
    • getDuration Link icon

      public Duration getDuration(String s)
      Specified by:
      getDuration in interface com.typesafe.config.Config
    • getPeriod Link icon

      public Period getPeriod(String s)
      Specified by:
      getPeriod in interface com.typesafe.config.Config
    • getTemporal Link icon

      public TemporalAmount getTemporal(String s)
      Specified by:
      getTemporal in interface com.typesafe.config.Config
    • getEnumList Link icon

      public <T extends Enum<T>> List<T> getEnumList(Class<T> aClass, String s)
      Specified by:
      getEnumList in interface com.typesafe.config.Config
    • getMemorySizeList Link icon

      public List<com.typesafe.config.ConfigMemorySize> getMemorySizeList(String s)
      Specified by:
      getMemorySizeList in interface com.typesafe.config.Config
    • getDurationList Link icon

      public List<Long> getDurationList(String s, TimeUnit timeUnit)
      Specified by:
      getDurationList in interface com.typesafe.config.Config
    • getDurationList Link icon

      public List<Duration> getDurationList(String s)
      Specified by:
      getDurationList in interface com.typesafe.config.Config