DockerContainerExecutor
class has several
limitations, not the least of which is that if used, all containers
are launched in Docker containers. The LinuxContainerExecutor
supports selectively launching containers in Docker containers and should
be used instead.@Deprecated public class DockerContainerExecutor extends ContainerExecutor
ContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.Signal
Modifier and Type | Field and Description |
---|---|
static String |
DOCKER_CONTAINER_EXECUTOR_SCRIPT
Deprecated.
|
static String |
DOCKER_CONTAINER_EXECUTOR_SESSION_SCRIPT
Deprecated.
|
static String |
DOCKER_IMAGE_PATTERN
Deprecated.
|
DIRECTORY_CONTENTS, TASK_LAUNCH_SCRIPT_PERMISSION, WILDCARD
Constructor and Description |
---|
DockerContainerExecutor()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
containerIsAlive(String pid)
Deprecated.
Returns true if the process with the specified pid is alive.
|
protected void |
copyFile(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst,
String owner)
Deprecated.
|
protected void |
createDir(org.apache.hadoop.fs.Path dirPath,
org.apache.hadoop.fs.permission.FsPermission perms,
boolean createParent,
String user)
Deprecated.
|
void |
deleteAsUser(DeletionAsUserContext ctx)
Deprecated.
Delete specified directories as a given user.
|
protected org.apache.hadoop.fs.Path |
getWorkingDir(List<String> localDirs,
String user,
String appId)
Deprecated.
|
void |
init()
Deprecated.
Run the executor initialization steps.
|
boolean |
isContainerAlive(ContainerLivenessContext ctx)
Deprecated.
Check if a container is alive.
|
protected void |
killContainer(String pid,
ContainerExecutor.Signal signal)
Deprecated.
Send a specified signal to the specified pid
|
int |
launchContainer(ContainerStartContext ctx)
Deprecated.
Launch the container on the node.
|
boolean |
signalContainer(ContainerSignalContext ctx)
Deprecated.
Signal container with the specified signal.
|
void |
startLocalizer(LocalizerStartContext ctx)
Deprecated.
Prepare the environment for containers in this application to execute.
|
void |
symLink(String target,
String symlink)
Deprecated.
Create a symlink file which points to the target.
|
void |
writeLaunchEnv(OutputStream out,
Map<String,String> environment,
Map<org.apache.hadoop.fs.Path,List<String>> resources,
List<String> command,
org.apache.hadoop.fs.Path logDir,
String user)
Deprecated.
Filter the environment variables that may conflict with the ones set in
the docker image and write them out to an OutputStream.
|
activateContainer, deactivateContainer, getConf, getIpAndHost, getLocalIpAndHost, getNMEnvVar, getPidFilePath, getProcessId, getRunCommand, getRunCommand, getRunCommandForOther, getRunCommandForWindows, isContainerActive, localizeClasspathJar, logOutput, pauseContainer, reacquireContainer, readDirAsUser, resumeContainer, setConf, updateEnvForWhitelistVars, writeLaunchEnv
public static final String DOCKER_CONTAINER_EXECUTOR_SCRIPT
public static final String DOCKER_CONTAINER_EXECUTOR_SESSION_SCRIPT
public static final String DOCKER_IMAGE_PATTERN
protected void copyFile(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst, String owner) throws IOException
IOException
public void init() throws IOException
ContainerExecutor
init
in class ContainerExecutor
IOException
- if initialization failspublic void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException
ContainerExecutor
For $x in local.dirs create $x/$user/$appId Copy $nmLocal/appTokens -> $N/$user/$appId For $rsrc in private resources Copy $rsrc -> $N/$user/filecache/[idef] For $rsrc in job resources Copy $rsrc -> $N/$user/$appId/filecache/idef
startLocalizer
in class ContainerExecutor
ctx
- LocalizerStartContext that encapsulates necessary information
for starting a localizer.IOException
- for most application init failuresInterruptedException
- if application init thread is halted by NMpublic int launchContainer(ContainerStartContext ctx) throws IOException
ContainerExecutor
launchContainer
in class ContainerExecutor
ctx
- Encapsulates information necessary for launching containers.IOException
- if the container launch failspublic void writeLaunchEnv(OutputStream out, Map<String,String> environment, Map<org.apache.hadoop.fs.Path,List<String>> resources, List<String> command, org.apache.hadoop.fs.Path logDir, String user) throws IOException
writeLaunchEnv
in class ContainerExecutor
out
- the output stream to which the environment is written (usually
a script file which will be executed by the Launcher)environment
- the environment variables and their valuesresources
- the resources which have been localized for this
container. Symlinks will be created to these localized resourcescommand
- the command that will be runlogDir
- the log dir to which to copy debugging informationuser
- the username of the job ownerIOException
- if there's an issue writing out the launch file.public boolean signalContainer(ContainerSignalContext ctx) throws IOException
ContainerExecutor
signalContainer
in class ContainerExecutor
ctx
- Encapsulates information necessary for signaling containers.IOException
- if signaling the container failspublic boolean isContainerAlive(ContainerLivenessContext ctx) throws IOException
ContainerExecutor
isContainerAlive
in class ContainerExecutor
ctx
- Encapsulates information necessary for container liveness check.IOException
- if there is a failure while checking the container
statuspublic static boolean containerIsAlive(String pid) throws IOException
pid
- String pidIOException
protected void killContainer(String pid, ContainerExecutor.Signal signal) throws IOException
pid
- the pid of the process [group] to signal.signal
- signal to send
(for logging).IOException
public void deleteAsUser(DeletionAsUserContext ctx) throws IOException, InterruptedException
ContainerExecutor
deleteAsUser
in class ContainerExecutor
ctx
- Encapsulates information necessary for deletion.IOException
- if delete failsInterruptedException
- if interrupted while waiting for the deletion
operation to completepublic void symLink(String target, String symlink) throws IOException
ContainerExecutor
symLink
in class ContainerExecutor
target
- The target for symlinksymlink
- the symlink fileIOException
- Error when creating symlinksprotected void createDir(org.apache.hadoop.fs.Path dirPath, org.apache.hadoop.fs.permission.FsPermission perms, boolean createParent, String user) throws IOException
IOException
protected org.apache.hadoop.fs.Path getWorkingDir(List<String> localDirs, String user, String appId) throws IOException
IOException
Copyright © 2018 Apache Software Foundation. All Rights Reserved.