public class WindowsSecureContainerExecutor extends DefaultContainerExecutor
DefaultContainerExecutor.LocalWrapperScriptBuilderContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.Signal| Modifier and Type | Field and Description |
|---|---|
static String |
LOCALIZER_PID_FORMAT |
lfsDIRECTORY_CONTENTS, TASK_LAUNCH_SCRIPT_PERMISSION, TOKEN_FILE_NAME_FMT, WILDCARD| Constructor and Description |
|---|
WindowsSecureContainerExecutor() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.hadoop.util.Shell.CommandExecutor |
buildCommandExecutor(String wrapperScriptPath,
String containerIdStr,
String userName,
org.apache.hadoop.fs.Path pidFile,
org.apache.hadoop.yarn.api.records.Resource resource,
File wordDir,
Map<String,String> environment,
String[] numaCommands)
Create a new
Shell.ShellCommandExecutor using the parameters. |
protected void |
copyFile(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst,
String owner)
Copy a file using the
DefaultContainerExecutor.lfs FileContext. |
protected void |
createDir(org.apache.hadoop.fs.Path dirPath,
org.apache.hadoop.fs.permission.FsPermission perms,
boolean createParent,
String owner)
Use the
DefaultContainerExecutor.lfs FileContext to create the target directory. |
protected DefaultContainerExecutor.LocalWrapperScriptBuilder |
getLocalWrapperScriptBuilder(String containerIdStr,
org.apache.hadoop.fs.Path containerWorkDir)
Create a
DefaultContainerExecutor.LocalWrapperScriptBuilder for the given container ID
and path that is appropriate to the current platform. |
protected String[] |
getRunCommand(String command,
String groupId,
String userName,
org.apache.hadoop.fs.Path pidFile,
org.apache.hadoop.conf.Configuration conf)
Return a command line to execute the given command in the OS shell.
|
protected void |
killContainer(String pid,
ContainerExecutor.Signal signal)
Send a specified signal to the specified pid
|
org.apache.hadoop.fs.Path |
localizeClasspathJar(org.apache.hadoop.fs.Path jarPath,
org.apache.hadoop.fs.Path target,
String owner)
This function localizes the JAR file on-demand.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
protected void |
setScriptExecutable(org.apache.hadoop.fs.Path script,
String owner)
Make a file executable using the
DefaultContainerExecutor.lfs FileContext. |
void |
startLocalizer(LocalizerStartContext ctx)
Prepare the environment for containers in this application to execute.
|
clearLogDirPermissions, containerIsAlive, createContainerLocalizer, deleteAsUser, execContainer, getLogDirPermissions, getWorkingDir, init, isContainerAlive, launchContainer, postComplete, reacquireContainer, reapContainer, relaunchContainer, setNumactl, setNumaResourceAllocator, signalContainer, symLink, updateYarnSysFSactivateContainer, cleanupBeforeRelaunch, deactivateContainer, getConf, getExposedPorts, getIpAndHost, getLocalIpAndHost, getLocalResources, getNMEnvVar, getPidFilePath, getProcessId, getRunCommand, getRunCommandForOther, getRunCommandForWindows, isContainerActive, logOutput, pauseContainer, prepareContainer, readDirAsUser, resumeContainer, start, stop, writeLaunchEnv, writeLaunchEnvpublic static final String LOCALIZER_PID_FORMAT
public WindowsSecureContainerExecutor()
throws IOException,
URISyntaxException
IOExceptionURISyntaxExceptionpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class ContainerExecutorprotected String[] getRunCommand(String command, String groupId, String userName, org.apache.hadoop.fs.Path pidFile, org.apache.hadoop.conf.Configuration conf)
ContainerExecutorgetRunCommand in class ContainerExecutorcommand - the command to executegroupId - the job owner's GIDuserName - the job owner's usernamepidFile - the path to the container's PID fileconf - the configurationprotected DefaultContainerExecutor.LocalWrapperScriptBuilder getLocalWrapperScriptBuilder(String containerIdStr, org.apache.hadoop.fs.Path containerWorkDir)
DefaultContainerExecutorDefaultContainerExecutor.LocalWrapperScriptBuilder for the given container ID
and path that is appropriate to the current platform.getLocalWrapperScriptBuilder in class DefaultContainerExecutorcontainerIdStr - the container IDcontainerWorkDir - the container's working directoryDefaultContainerExecutor.LocalWrapperScriptBuilderprotected void copyFile(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst,
String owner)
throws IOException
DefaultContainerExecutorDefaultContainerExecutor.lfs FileContext.copyFile in class DefaultContainerExecutorsrc - the file to copydst - where to copy the fileowner - the owner of the new copy. Used only in secure Windows
clustersIOException - when the copy failsWindowsSecureContainerExecutorprotected void createDir(org.apache.hadoop.fs.Path dirPath,
org.apache.hadoop.fs.permission.FsPermission perms,
boolean createParent,
String owner)
throws IOException
DefaultContainerExecutorDefaultContainerExecutor.lfs FileContext to create the target directory.createDir in class DefaultContainerExecutordirPath - the target directoryperms - the target permissions for the target directorycreateParent - whether the parent directories should also be createdowner - the user as whom the target directory should be created.
Used only on secure Windows hosts.IOException - if there's a failure performing a file operationWindowsSecureContainerExecutorprotected void setScriptExecutable(org.apache.hadoop.fs.Path script,
String owner)
throws IOException
DefaultContainerExecutorDefaultContainerExecutor.lfs FileContext.setScriptExecutable in class DefaultContainerExecutorscript - the path to make executableowner - the new owner for the file. Used only in secure Windows
clustersIOException - when the change mode operation failsWindowsSecureContainerExecutorpublic org.apache.hadoop.fs.Path localizeClasspathJar(org.apache.hadoop.fs.Path jarPath,
org.apache.hadoop.fs.Path target,
String owner)
throws IOException
ContainerExecutorlocalizeClasspathJar in class ContainerExecutorjarPath - the path to the JAR to localizetarget - the directory where the JAR file should be localizedowner - the name of the user who should own the localized fileIOException - if localization failspublic void startLocalizer(LocalizerStartContext ctx) 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 DefaultContainerExecutorctx - LocalizerStartContext that encapsulates necessary information
for starting a localizer.IOException - for most application init failuresInterruptedException - if application init thread is halted by NMprotected org.apache.hadoop.util.Shell.CommandExecutor buildCommandExecutor(String wrapperScriptPath, String containerIdStr, String userName, org.apache.hadoop.fs.Path pidFile, org.apache.hadoop.yarn.api.records.Resource resource, File wordDir, Map<String,String> environment, String[] numaCommands)
DefaultContainerExecutorShell.ShellCommandExecutor using the parameters.buildCommandExecutor in class DefaultContainerExecutorwrapperScriptPath - the path to the script to executecontainerIdStr - the container IDuserName - the application owner's usernamepidFile - the path to the container's PID fileresource - this parameter controls memory and CPU limits.wordDir - If not-null, specifies the directory which should be set
as the current working directory for the command. If null,
the current working directory is not modified.environment - the container environmentnumaCommands - list of prefix numa commandsShell.ShellCommandExecutorShell.ShellCommandExecutorprotected void killContainer(String pid, ContainerExecutor.Signal signal) throws IOException
DefaultContainerExecutorkillContainer in class DefaultContainerExecutorpid - the pid of the process [group] to signal.signal - signal to sendIOException - if the command to kill the process failsCopyright © 2008–2024 Apache Software Foundation. All rights reserved.