org.apache.hadoop.conf.Configurablepublic class WindowsSecureContainerExecutor extends DefaultContainerExecutor
DefaultContainerExecutor.LocalWrapperScriptBuilderContainerExecutor.DelayedProcessKiller, ContainerExecutor.ExitCode, ContainerExecutor.Signal| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
LOCALIZER_PID_FORMAT |
lfsDIRECTORY_CONTENTS, TASK_LAUNCH_SCRIPT_PERMISSION, TOKEN_FILE_NAME_FMT, WILDCARD| Constructor | Description |
|---|---|
WindowsSecureContainerExecutor() |
| Modifier and Type | Method | Description |
|---|---|---|
protected org.apache.hadoop.util.Shell.CommandExecutor |
buildCommandExecutor(java.lang.String wrapperScriptPath,
java.lang.String containerIdStr,
java.lang.String userName,
org.apache.hadoop.fs.Path pidFile,
org.apache.hadoop.yarn.api.records.Resource resource,
java.io.File wordDir,
java.util.Map<java.lang.String,java.lang.String> environment,
java.lang.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,
java.lang.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,
java.lang.String owner) |
Use the
DefaultContainerExecutor.lfs FileContext to create the target directory. |
protected DefaultContainerExecutor.LocalWrapperScriptBuilder |
getLocalWrapperScriptBuilder(java.lang.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 java.lang.String[] |
getRunCommand(java.lang.String command,
java.lang.String groupId,
java.lang.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(java.lang.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,
java.lang.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,
java.lang.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 java.lang.String LOCALIZER_PID_FORMAT
public WindowsSecureContainerExecutor()
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurablesetConf in class ContainerExecutorprotected java.lang.String[] getRunCommand(java.lang.String command,
java.lang.String groupId,
java.lang.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(java.lang.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,
java.lang.String owner)
throws java.io.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
clustersjava.io.IOException - when the copy failsWindowsSecureContainerExecutorprotected void createDir(org.apache.hadoop.fs.Path dirPath,
org.apache.hadoop.fs.permission.FsPermission perms,
boolean createParent,
java.lang.String owner)
throws java.io.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.java.io.IOException - if there's a failure performing a file operationWindowsSecureContainerExecutorprotected void setScriptExecutable(org.apache.hadoop.fs.Path script,
java.lang.String owner)
throws java.io.IOException
DefaultContainerExecutorDefaultContainerExecutor.lfs FileContext.setScriptExecutable in class DefaultContainerExecutorscript - the path to make executableowner - the new owner for the file. Used only in secure Windows
clustersjava.io.IOException - when the change mode operation failsWindowsSecureContainerExecutorpublic org.apache.hadoop.fs.Path localizeClasspathJar(org.apache.hadoop.fs.Path jarPath,
org.apache.hadoop.fs.Path target,
java.lang.String owner)
throws java.io.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 filejava.io.IOException - if localization failspublic void startLocalizer(LocalizerStartContext ctx) throws java.io.IOException, java.lang.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.java.io.IOException - for most application init failuresjava.lang.InterruptedException - if application init thread is halted by NMprotected org.apache.hadoop.util.Shell.CommandExecutor buildCommandExecutor(java.lang.String wrapperScriptPath,
java.lang.String containerIdStr,
java.lang.String userName,
org.apache.hadoop.fs.Path pidFile,
org.apache.hadoop.yarn.api.records.Resource resource,
java.io.File wordDir,
java.util.Map<java.lang.String,java.lang.String> environment,
java.lang.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(java.lang.String pid,
ContainerExecutor.Signal signal)
throws java.io.IOException
DefaultContainerExecutorkillContainer in class DefaultContainerExecutorpid - the pid of the process [group] to signal.signal - signal to sendjava.io.IOException - if the command to kill the process failsCopyright © 2008–2025 Apache Software Foundation. All rights reserved.