Class AbstractLauncher
java.lang.Object
org.apache.hadoop.yarn.service.containerlaunch.AbstractLauncher
Launcher of applications: base class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(String cmd) voidaddLocalResource(String subPath, org.apache.hadoop.yarn.api.records.LocalResource resource) voidaddLocalResource(String subPath, org.apache.hadoop.yarn.api.records.LocalResource resource, String mountPath) org.apache.hadoop.yarn.api.records.ContainerLaunchContextComplete the launch context (copy in env vars, etc).Get the launch commands.getEnv()Get the env vars to work onprotected voidThis is critical for an insecure cluster -it passes down the username to YARN, and so gives the code running in containers the rights it needs to work with data.voidvoidsetClasspath(ClasspathConstructor classpath) Utility method to set up the classpathvoidsetDockerHostname(String dockerHostname) voidsetDockerImage(String dockerImage) voidsetDockerNetwork(String dockerNetwork) voidSet an environment variable in the launch contextvoidsetRetryContext(int maxRetries, int retryInterval, long failuresValidityInterval) voidsetRunPrivilegedContainer(boolean runPrivilegedContainer) voidsetYarnDockerMode(boolean yarnDockerMode)
-
Field Details
-
CLASSPATH
- See Also:
-
ENV_DOCKER_CONTAINER_MOUNTS
- See Also:
-
envVars
Env vars; set up at final launch stage -
containerLaunchContext
protected final org.apache.hadoop.yarn.api.records.ContainerLaunchContext containerLaunchContext -
commands
-
localResources
-
mountPaths
-
yarnDockerMode
protected boolean yarnDockerMode -
dockerImage
-
dockerNetwork
-
dockerHostname
-
runPrivilegedContainer
protected boolean runPrivilegedContainer
-
-
Constructor Details
-
AbstractLauncher
public AbstractLauncher(org.apache.hadoop.yarn.service.ServiceContext context)
-
-
Method Details
-
setYarnDockerMode
public void setYarnDockerMode(boolean yarnDockerMode) -
getEnv
Get the env vars to work on- Returns:
- env vars
-
getCommands
Get the launch commands.- Returns:
- the live list of commands
-
addLocalResource
public void addLocalResource(String subPath, org.apache.hadoop.yarn.api.records.LocalResource resource) -
addLocalResource
-
addCommand
-
completeContainerLaunch
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext completeContainerLaunch() throws IOExceptionComplete the launch context (copy in env vars, etc).- Returns:
- the container to launch
- Throws:
IOException
-
setRetryContext
public void setRetryContext(int maxRetries, int retryInterval, long failuresValidityInterval) -
propagateUsernameInInsecureCluster
This is critical for an insecure cluster -it passes down the username to YARN, and so gives the code running in containers the rights it needs to work with data.- Throws:
IOException- problems working with current user
-
setClasspath
Utility method to set up the classpath- Parameters:
classpath- classpath to use
-
setEnv
Set an environment variable in the launch context- Parameters:
var- variable namevalue- value (must be non null)
-
putEnv
-
setDockerImage
-
setDockerNetwork
-
setDockerHostname
-
setRunPrivilegedContainer
public void setRunPrivilegedContainer(boolean runPrivilegedContainer) -
getDockerImage
-