org.apache.hadoop.yarn.server.nodemanager
Class LinuxContainerExecutor

java.lang.Object
  extended by org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
      extended by org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable

public class LinuxContainerExecutor
extends ContainerExecutor


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
ContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.Signal
 
Field Summary
 
Fields inherited from class org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
isSetsidAvailable, TASK_LAUNCH_SCRIPT_PERMISSION
 
Constructor Summary
LinuxContainerExecutor()
           
 
Method Summary
protected  void addSchedPriorityCommand(List<String> command)
           
 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 org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor
activateContainer, deactivateContainer, getConf, getPidFilePath, getProcessId, getRunCommand, isContainerActive, logOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinuxContainerExecutor

public LinuxContainerExecutor()
Method Detail

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)

addSchedPriorityCommand

protected void addSchedPriorityCommand(List<String> command)

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 NM
nmAddr - RPC address to contact NM
user - user name of application owner
appId - id of the application
localDirs - nm-local-dirs
logDirs - 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 launched
nmPrivateCotainerScriptPath - the path for launch script
nmPrivateTokensPath - the path for tokens for the container
user - the user of the container
appId - the appId of the container
containerWorkDir - the work dir for the container
localDirs - nm-local-dirs to be used for this container
logDirs - 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 © 2013 Apache Software Foundation. All Rights Reserved.