public class LinuxContainerExecutor extends ContainerExecutor
ContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.SignalTASK_LAUNCH_SCRIPT_PERMISSION| Constructor and Description |
|---|
LinuxContainerExecutor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSchedPriorityCommand(List<String> command) |
void |
buildMainArgs(List<String> command,
String user,
String appId,
String locId,
InetSocketAddress nmAddr,
List<String> localDirs) |
void |
deleteAsUser(String user,
org.apache.hadoop.fs.Path dir,
org.apache.hadoop.fs.Path... baseDirs) |
protected String |
getContainerExecutorExecutablePath(org.apache.hadoop.conf.Configuration conf) |
void |
init()
Run the executor initialization steps.
|
boolean |
isContainerProcessAlive(String user,
String pid) |
int |
launchContainer(Container container,
org.apache.hadoop.fs.Path nmPrivateCotainerScriptPath,
org.apache.hadoop.fs.Path nmPrivateTokensPath,
String user,
String appId,
org.apache.hadoop.fs.Path containerWorkDir,
List<String> localDirs,
List<String> logDirs)
Launch the container on the node.
|
void |
mountCgroups(List<String> cgroupKVs,
String hierarchy) |
int |
reacquireContainer(String user,
org.apache.hadoop.yarn.api.records.ContainerId containerId)
Recover an already existing container.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
boolean |
signalContainer(String user,
String pid,
ContainerExecutor.Signal signal) |
void |
startLocalizer(org.apache.hadoop.fs.Path nmPrivateContainerTokensPath,
InetSocketAddress nmAddr,
String user,
String appId,
String locId,
LocalDirsHandlerService dirsHandler)
Prepare the environment for containers in this application to execute.
|
activateContainer, deactivateContainer, getConf, getPidFilePath, getProcessId, getRunCommand, getRunCommand, isContainerActive, localizeClasspathJar, logOutput, writeLaunchEnvpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class ContainerExecutorprotected String getContainerExecutorExecutablePath(org.apache.hadoop.conf.Configuration conf)
public void init()
throws IOException
ContainerExecutorinit in class ContainerExecutorIOExceptionpublic void startLocalizer(org.apache.hadoop.fs.Path nmPrivateContainerTokensPath,
InetSocketAddress nmAddr,
String user,
String appId,
String locId,
LocalDirsHandlerService dirsHandler)
throws IOException,
InterruptedException
ContainerExecutorFor $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 ContainerExecutornmPrivateContainerTokensPath - path to localized credentials, rsrc by NMnmAddr - RPC address to contact NMuser - user name of application ownerappId - id of the applicationdirsHandler - NM local dirs service, for nm-local-dirs and nm-log-dirsIOException - For most application init failuresInterruptedException - If application init thread is halted by NMpublic void buildMainArgs(List<String> command, String user, String appId, String locId, InetSocketAddress nmAddr, List<String> localDirs)
public int launchContainer(Container container, org.apache.hadoop.fs.Path nmPrivateCotainerScriptPath, org.apache.hadoop.fs.Path nmPrivateTokensPath, String user, String appId, org.apache.hadoop.fs.Path containerWorkDir, List<String> localDirs, List<String> logDirs) throws IOException
ContainerExecutorlaunchContainer in class ContainerExecutorcontainer - the container to be launchednmPrivateCotainerScriptPath - the path for launch scriptnmPrivateTokensPath - the path for tokens for the containeruser - the user of the containerappId - the appId of the containercontainerWorkDir - the work dir for the containerlocalDirs - nm-local-dirs to be used for this containerlogDirs - nm-log-dirs to be used for this containerIOExceptionpublic int reacquireContainer(String user, org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException, InterruptedException
ContainerExecutorreacquireContainer in class ContainerExecutoruser - the user of the containercontainerId - The ID of the container to reacquireIOExceptionInterruptedExceptionpublic boolean signalContainer(String user, String pid, ContainerExecutor.Signal signal) throws IOException
signalContainer in class ContainerExecutorIOExceptionpublic void deleteAsUser(String user, org.apache.hadoop.fs.Path dir, org.apache.hadoop.fs.Path... baseDirs)
deleteAsUser in class ContainerExecutorpublic boolean isContainerProcessAlive(String user, String pid) throws IOException
isContainerProcessAlive in class ContainerExecutorIOExceptionpublic void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException
IOExceptionCopyright © 2016 Apache Software Foundation. All Rights Reserved.