public class LinuxContainerExecutor extends ContainerExecutor
ContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.Signal
TASK_LAUNCH_SCRIPT_PERMISSION
Constructor and Description |
---|
LinuxContainerExecutor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSchedPriorityCommand(List<String> command) |
void |
deleteAsUser(String user,
Path dir,
Path... baseDirs) |
protected String |
getContainerExecutorExecutablePath(Configuration conf) |
void |
init()
Run the executor initialization steps.
|
int |
launchContainer(Container container,
Path nmPrivateCotainerScriptPath,
Path nmPrivateTokensPath,
String user,
String appId,
Path containerWorkDir,
List<String> localDirs,
List<String> logDirs)
Launch the container on the node.
|
void |
mountCgroups(List<String> cgroupKVs,
String hierarchy) |
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
boolean |
signalContainer(String user,
String pid,
ContainerExecutor.Signal signal) |
void |
startLocalizer(Path nmPrivateContainerTokensPath,
InetSocketAddress nmAddr,
String user,
String appId,
String locId,
List<String> localDirs,
List<String> logDirs)
Prepare the environment for containers in this application to execute.
|
activateContainer, deactivateContainer, getConf, getPidFilePath, getProcessId, getRunCommand, isContainerActive, logOutput
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
setConf
in class ContainerExecutor
protected String getContainerExecutorExecutablePath(Configuration conf)
public void init() throws IOException
ContainerExecutor
init
in class ContainerExecutor
IOException
public void startLocalizer(Path nmPrivateContainerTokensPath, InetSocketAddress nmAddr, String user, String appId, String locId, List<String> localDirs, List<String> logDirs) throws IOException, InterruptedException
ContainerExecutor
startLocalizer
in class ContainerExecutor
nmPrivateContainerTokensPath
- path to localized credentials, rsrc by NMnmAddr
- RPC address to contact NMuser
- user name of application ownerappId
- id of the applicationlocalDirs
- nm-local-dirslogDirs
- nm-log-dirsIOException
- For most application init failuresInterruptedException
- If application init thread is halted by NMpublic int launchContainer(Container container, Path nmPrivateCotainerScriptPath, Path nmPrivateTokensPath, String user, String appId, Path containerWorkDir, List<String> localDirs, List<String> logDirs) throws IOException
ContainerExecutor
launchContainer
in class ContainerExecutor
container
- 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 containerIOException
public boolean signalContainer(String user, String pid, ContainerExecutor.Signal signal) throws IOException
signalContainer
in class ContainerExecutor
IOException
public void deleteAsUser(String user, Path dir, Path... baseDirs)
deleteAsUser
in class ContainerExecutor
public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.