public class ContainerLaunch extends Object implements Callable<Integer>
Modifier and Type | Class and Description |
---|---|
static class |
ContainerLaunch.ShellScriptBuilder |
Modifier and Type | Field and Description |
---|---|
protected Application |
app |
protected AtomicBoolean |
completed |
protected Container |
container |
static String |
CONTAINER_PRE_LAUNCH_STDERR |
static String |
CONTAINER_PRE_LAUNCH_STDOUT |
static String |
CONTAINER_SCRIPT |
protected AtomicBoolean |
containerAlreadyLaunched |
protected LocalDirsHandlerService |
dirsHandler |
protected org.apache.hadoop.yarn.event.Dispatcher |
dispatcher |
protected ContainerExecutor |
exec |
static String |
FINAL_CONTAINER_TOKENS_FILE |
protected org.apache.hadoop.fs.Path |
pidFilePath |
protected AtomicBoolean |
shouldPauseContainer |
Constructor and Description |
---|
ContainerLaunch(Context context,
org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.yarn.event.Dispatcher dispatcher,
ContainerExecutor exec,
Application app,
Container container,
LocalDirsHandlerService dirsHandler,
ContainerManagerImpl containerManager) |
Modifier and Type | Method and Description |
---|---|
Integer |
call() |
void |
cleanupContainer()
Cleanup the container.
|
static String |
expandEnvironment(String var,
org.apache.hadoop.fs.Path containerLogDir) |
protected List<String> |
getContainerLocalDirs(List<String> localDirs) |
protected List<String> |
getContainerLogDirs(List<String> logDirs) |
protected String |
getContainerPrivateDir(String appIdStr,
String containerIdStr) |
static String |
getExitCodeFile(String pidFile) |
protected Map<org.apache.hadoop.fs.Path,List<String>> |
getLocalizedResources() |
protected List<String> |
getNMFilecacheDirs(List<String> localDirs) |
protected String |
getPidFileSubpath(String appIdStr,
String containerIdStr) |
static String |
getRelativeContainerLogDir(String appIdStr,
String containerIdStr) |
protected List<String> |
getUserLocalDirs(List<String> localDirs) |
protected void |
handleContainerExitCode(int exitCode,
org.apache.hadoop.fs.Path containerLogDir) |
protected void |
handleContainerExitWithFailure(org.apache.hadoop.yarn.api.records.ContainerId containerID,
int ret,
org.apache.hadoop.fs.Path containerLogDir,
StringBuilder diagnosticInfo)
Tries to tail and fetch TAIL_SIZE_IN_BYTES of data from the error log.
|
protected int |
launchContainer(ContainerStartContext ctx) |
void |
pauseContainer()
Pause the container.
|
void |
resumeContainer()
Resume the container.
|
void |
sanitizeEnv(Map<String,String> environment,
org.apache.hadoop.fs.Path pwd,
List<org.apache.hadoop.fs.Path> appDirs,
List<String> userLocalDirs,
List<String> containerLogDirs,
Map<org.apache.hadoop.fs.Path,List<String>> resources,
org.apache.hadoop.fs.Path nmPrivateClasspathJarDir) |
protected void |
setContainerCompletedStatus(int exitCode) |
void |
signalContainer(org.apache.hadoop.yarn.api.records.SignalContainerCommand command)
Send a signal to the container.
|
static ContainerExecutor.Signal |
translateCommandToSignal(org.apache.hadoop.yarn.api.records.SignalContainerCommand command) |
protected boolean |
validateContainerState() |
public static final String CONTAINER_PRE_LAUNCH_STDOUT
public static final String CONTAINER_PRE_LAUNCH_STDERR
public static final String CONTAINER_SCRIPT
public static final String FINAL_CONTAINER_TOKENS_FILE
protected final org.apache.hadoop.yarn.event.Dispatcher dispatcher
protected final ContainerExecutor exec
protected final Application app
protected final Container container
protected AtomicBoolean containerAlreadyLaunched
protected AtomicBoolean shouldPauseContainer
protected AtomicBoolean completed
protected org.apache.hadoop.fs.Path pidFilePath
protected final LocalDirsHandlerService dirsHandler
public ContainerLaunch(Context context, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.yarn.event.Dispatcher dispatcher, ContainerExecutor exec, Application app, Container container, LocalDirsHandlerService dirsHandler, ContainerManagerImpl containerManager)
public static String expandEnvironment(String var, org.apache.hadoop.fs.Path containerLogDir)
protected boolean validateContainerState()
protected Map<org.apache.hadoop.fs.Path,List<String>> getLocalizedResources() throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
protected int launchContainer(ContainerStartContext ctx) throws IOException, org.apache.hadoop.yarn.exceptions.ConfigurationException
IOException
org.apache.hadoop.yarn.exceptions.ConfigurationException
protected void setContainerCompletedStatus(int exitCode)
protected void handleContainerExitCode(int exitCode, org.apache.hadoop.fs.Path containerLogDir)
protected void handleContainerExitWithFailure(org.apache.hadoop.yarn.api.records.ContainerId containerID, int ret, org.apache.hadoop.fs.Path containerLogDir, StringBuilder diagnosticInfo)
containerID
- ret
- containerLogDir
- diagnosticInfo
- public void cleanupContainer() throws IOException
IOException
public void signalContainer(org.apache.hadoop.yarn.api.records.SignalContainerCommand command) throws IOException
IOException
public static ContainerExecutor.Signal translateCommandToSignal(org.apache.hadoop.yarn.api.records.SignalContainerCommand command)
public void pauseContainer() throws IOException
IOException
- in case of errors.public void resumeContainer() throws IOException
IOException
- in case of error.public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr)
protected String getContainerPrivateDir(String appIdStr, String containerIdStr)
public void sanitizeEnv(Map<String,String> environment, org.apache.hadoop.fs.Path pwd, List<org.apache.hadoop.fs.Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<org.apache.hadoop.fs.Path,List<String>> resources, org.apache.hadoop.fs.Path nmPrivateClasspathJarDir) throws IOException
IOException
Copyright © 2018 Apache Software Foundation. All Rights Reserved.