org.apache.hadoop.yarn.server.nodemanager
Class LinuxContainerExecutor
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable
public class LinuxContainerExecutor
- extends ContainerExecutor
|
Method Summary |
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. |
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 |
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,
List<String> localDirs,
List<String> logDirs)
Prepare the environment for containers in this application to execute. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinuxContainerExecutor
public LinuxContainerExecutor()
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
- Specified by:
setConf in interface org.apache.hadoop.conf.Configurable- Overrides:
setConf in class ContainerExecutor
getContainerExecutorExecutablePath
protected String getContainerExecutorExecutablePath(org.apache.hadoop.conf.Configuration conf)
init
public void init()
throws IOException
- Description copied from class:
ContainerExecutor
- Run the executor initialization steps.
Verify that the necessary configs, permissions are in place.
- Specified by:
init in class ContainerExecutor
- Throws:
IOException
startLocalizer
public void startLocalizer(org.apache.hadoop.fs.Path nmPrivateContainerTokensPath,
InetSocketAddress nmAddr,
String user,
String appId,
String locId,
List<String> localDirs,
List<String> logDirs)
throws IOException,
InterruptedException
- Description copied from class:
ContainerExecutor
- Prepare the environment for containers in this application to execute.
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
- Specified by:
startLocalizer in class ContainerExecutor
- Parameters:
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-dirs
- Throws:
IOException - For most application init failures
InterruptedException - If application init thread is halted by NM
launchContainer
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
- Description copied from class:
ContainerExecutor
- Launch the container on the node. This is a blocking call and returns only
when the container exits.
- Specified by:
launchContainer in class ContainerExecutor
- Parameters:
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 container
- Returns:
- the return status of the launch
- Throws:
IOException
signalContainer
public boolean signalContainer(String user,
String pid,
ContainerExecutor.Signal signal)
throws IOException
- Specified by:
signalContainer in class ContainerExecutor
- Throws:
IOException
deleteAsUser
public void deleteAsUser(String user,
org.apache.hadoop.fs.Path dir,
org.apache.hadoop.fs.Path... baseDirs)
- Specified by:
deleteAsUser in class ContainerExecutor
Copyright © 2012 Apache Software Foundation. All Rights Reserved.