Package org.apache.drill.yarn.core
Class DrillOnYarnConfig
java.lang.Object
org.apache.drill.yarn.core.DrillOnYarnConfig
Configuration used within the Drill-on-YARN code. Configuration comes from four
sources (in order of precedence):
- System properties
- $SITE_DIR/drill-on-yarn.conf
- Distribution-specific properties in $SITE_HOME/conf/doy-distrib.conf
- Drill-on-YARN defaults in drill-on-yarn-defaults.conf. (Which should be disjoint from the Drill settings.)
- Drill properties (via the Drill override system)
Defines constants for each property, including some defined in Drill. This provides a uniform property access interface even if some properties migrate between DoY and Drill proper.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Key used for the Drill archive file in the AM launch config.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static DrillOnYarnConfig
static final String
static String
Name of the subdirectory of the container directory that will hold localized Drill distribution files.static final String
static final String
static final String
static final String
static final String
The name of the Drill site archive stored in dfs.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
int
static String
clusterGroupKey
(int index, String key) static com.typesafe.config.Config
config()
protected void
doLoad
(ClassLoader cl) Load the config.void
dump()
void
dumpEnv
(PrintStream out) static String
findSuffix
(String baseName) Return Drill's class path scan.com.typesafe.config.Config
Returns the DFS path to the localized Drill archive.protected String
All environment variable access goes through this function to allow unit tests to replace this function to set test values.Return the app ID file to use for this client run.Return the Drill home on this machine as inferred from the config file contents or location.getPairs()
Get the location of Drill home on a remote machine, relative to the container working directory.Get the optional remote site directory name.Returns the DFS path to the localized site archive.boolean
static DrillOnYarnConfig
instance()
static DrillOnYarnConfig
load()
void
Retrieve the AM Drill home location from the DRILL_HOME variable set in the drill-am.sh launch script.void
Obtain Drill home from the DRILL_HOME environment variable set by drill-config.sh, which is called from drill-on-yarn.sh.
-
Field Details
-
DEFAULTS_FILE_NAME
- See Also:
-
DISTRIB_FILE_NAME
- See Also:
-
CONFIG_FILE_NAME
- See Also:
-
DRILL_ON_YARN_PARENT
- See Also:
-
DOY_CLIENT_PARENT
-
DOY_AM_PARENT
-
DOY_DRILLBIT_PARENT
-
FILES_PARENT
-
DFS_PARENT
-
HTTP_PARENT
-
YARN_PARENT
-
HADOOP_PARENT
-
CLIENT_PARENT
-
APP_NAME
-
CLUSTER_ID
- See Also:
-
DFS_CONNECTION
-
DFS_APP_DIR
-
YARN_QUEUE
-
YARN_PRIORITY
-
DRILL_ARCHIVE_PATH
-
DRILL_DIR_NAME
-
DRILL_ARCHIVE_KEY
Key used for the Drill archive file in the AM launch config. -
SITE_ARCHIVE_KEY
-
LOCALIZE_DRILL
-
CONF_AS_SITE
-
DRILL_HOME
-
SITE_DIR
-
JAVA_LIB_PATH
-
HADOOP_HOME
-
HADOOP_CLASSPATH
-
HBASE_CLASSPATH
-
MEMORY_KEY
- See Also:
-
VCORES_KEY
- See Also:
-
DISKS_KEY
- See Also:
-
VM_ARGS_KEY
- See Also:
-
HEAP_KEY
- See Also:
-
AM_MEMORY
-
AM_VCORES
-
AM_DISKS
-
AM_NODE_LABEL_EXPR
-
AM_HEAP
-
AM_VM_ARGS
-
AM_POLL_PERIOD_MS
-
AM_TICK_PERIOD_MS
-
AM_PREFIX_CLASSPATH
-
AM_CLASSPATH
-
AM_DEBUG_LAUNCH
-
AM_ENABLE_AUTO_SHUTDOWN
-
DRILLBIT_MEMORY
-
DRILLBIT_VCORES
-
DRILLBIT_DISKS
-
DRILLBIT_VM_ARGS
-
DRILLBIT_HEAP
-
DRILLBIT_DIRECT_MEM
-
DRILLBIT_CODE_CACHE
-
DRILLBIT_LOG_GC
-
DRILLBIT_PREFIX_CLASSPATH
-
DRILLBIT_EXTN_CLASSPATH
-
DRILLBIT_CLASSPATH
-
DRILLBIT_MAX_RETRIES
-
DRILLBIT_DEBUG_LAUNCH
-
DRILLBIT_HTTP_PORT
- See Also:
-
DISABLE_YARN_LOGS
-
DRILLBIT_USER_PORT
- See Also:
-
DRILLBIT_BIT_PORT
- See Also:
-
DRILLBIT_USE_HTTPS
- See Also:
-
DRILLBIT_MAX_EXTRA_NODES
-
DRILLBIT_REQUEST_TIMEOUT_SEC
-
ZK_CONNECT
- See Also:
-
ZK_ROOT
- See Also:
-
ZK_FAILURE_TIMEOUT_MS
- See Also:
-
ZK_RETRY_COUNT
- See Also:
-
ZK_RETRY_DELAY_MS
- See Also:
-
HTTP_ENABLED
-
HTTP_ENABLE_SSL
-
HTTP_PORT
-
HTTP_AUTH_TYPE
-
HTTP_REST_KEY
-
HTTP_SESSION_MAX_IDLE_SECS
-
HTTP_DOCS_LINK
-
HTTP_REFRESH_SECS
-
HTTP_USER_NAME
-
HTTP_PASSWORD
-
AUTH_TYPE_NONE
- See Also:
-
AUTH_TYPE_DRILL
- See Also:
-
AUTH_TYPE_SIMPLE
- See Also:
-
CLIENT_POLL_SEC
-
CLIENT_START_WAIT_SEC
-
CLIENT_STOP_WAIT_SEC
-
CLUSTERS
-
LOCAL_DIR_NAME
Name of the subdirectory of the container directory that will hold localized Drill distribution files. This name must be consistent between AM launch request and AM launch, and between Drillbit launch request and Drillbit launch. This name is fixed; there is no reason for the user to change it as it is visible only in the YARN container environment. -
APP_ID_ENV_VAR
- See Also:
-
DRILL_ARCHIVE_ENV_VAR
- See Also:
-
SITE_ARCHIVE_ENV_VAR
- See Also:
-
DRILL_HOME_ENV_VAR
- See Also:
-
DRILL_SITE_ENV_VAR
- See Also:
-
AM_HEAP_ENV_VAR
- See Also:
-
AM_JAVA_OPTS_ENV_VAR
- See Also:
-
DRILL_CLASSPATH_ENV_VAR
- See Also:
-
DRILL_CLASSPATH_PREFIX_ENV_VAR
- See Also:
-
DOY_LIBPATH_ENV_VAR
- See Also:
-
DRILL_DEBUG_ENV_VAR
- See Also:
-
SITE_ARCHIVE_NAME
The name of the Drill site archive stored in dfs. Since the archive is created by the client as a temp file, it's local name has no meaning; we use this standard name on dfs.- See Also:
-
instance
-
-
Constructor Details
-
DrillOnYarnConfig
protected DrillOnYarnConfig()
-
-
Method Details
-
append
-
load
- Throws:
DoyConfigException
-
doLoad
Load the config.- Parameters:
cl
- class loader to use for resource searches (except defaults). Allows test to specify a specialized version.Implemented in a way that allows unit testing. The parseUrl( ) methods let us mock the files; the load( ) methods seem to not actually use the provided class loader.
- Throws:
DoyConfigException
-
getDrillConfig
-
getClassPathScan
Return Drill's class path scan. This is used only in the main thread during initialization. Not needed by the client, so done in an unsynchronized, lazy fashion.- Returns:
- Drill's class path scan
-
setClientPaths
Obtain Drill home from the DRILL_HOME environment variable set by drill-config.sh, which is called from drill-on-yarn.sh. When debugging, DRILL_HOME must be set in the environment.This information is required only by the client to prepare for uploads to DFS.
- Throws:
DoyConfigException
-
getEnv
All environment variable access goes through this function to allow unit tests to replace this function to set test values. (The Java environment is immutable, so it is not possible for unit tests to change the actual environment.)- Parameters:
key
- key to allow unit tests to replace this function- Returns:
- environment variable
-
setAmDrillHome
Retrieve the AM Drill home location from the DRILL_HOME variable set in the drill-am.sh launch script.- Throws:
DoyConfigException
-
getConfig
public com.typesafe.config.Config getConfig() -
instance
-
config
public static com.typesafe.config.Config config() -
getLocalDrillHome
Return the Drill home on this machine as inferred from the config file contents or location.- Returns:
- Drill home
-
dump
public void dump() -
dumpEnv
-
getPairs
-
clusterGroupKey
-
clusterGroupCount
public int clusterGroupCount() -
findSuffix
-
getRemoteDrillHome
Get the location of Drill home on a remote machine, relative to the container working directory. Used when constructing a launch context. Assumes either the absolute path from the config file, or a constructed path to the localized Drill on the remote node. YARN examples use "./foo" to refer to container resources. But, since we cannot be sure when such a path is evaluated, we explicitly use YARN's PWD environment variable to get the absolute path.- Returns:
- the remote path, with the "$PWD" environment variable.
- Throws:
DoyConfigException
-
getRemoteSiteDir
Get the optional remote site directory name. This name will include the absolute path for a non-localized application. It will return the path relative to the container for a localized application. In the localized case, the site archive is tar'ed relative to the site directory so that its contents are unarchived directly into the YARN-provided folder (with the name of the archive) key. That is, if the site directory on the client is /var/drill/my-site, the contents of the tar file will be "./drill-override.conf", etc., and the remote location is $PWD/site-key/drill-override.conf, where site-key is the key name used to localize the site archive.- Returns:
- remote site directory name
-
getLocalAppIdFile
Return the app ID file to use for this client run. The file is in the directory that holds the site dir (if a site dir is used), else the directory that holds Drill home (otherwise.) Not that the file does NOT go into the site dir or Drill home as we upload these directories (via archives) to DFS so we don't want to change them by adding a file.It turns out that Drill allows two distinct clusters to share the same ZK root and/or cluster ID (just not the same combination), so the file name contains both parts.
- Returns:
- local app id file
-
hasSiteDir
public boolean hasSiteDir() -
getLocalSiteDir
-
getDrillArchiveDfsPath
Returns the DFS path to the localized Drill archive. This is an AM-only method as it relies on an environment variable set by the client. It is set only if the application is localized, it is not set for a non-localized run.- Returns:
- the DFS path to the localized Drill archive
-
getSiteArchiveDfsPath
Returns the DFS path to the localized site archive. This is an AM-only method as it relies on an environment variable set by the client. This variable is optional; if not set then the AM can infer that the application does not use a site archive (configuration files reside in $DRILL_HOME/conf), or the application is not localized.- Returns:
- the DFS path to the localized site archive
-