Skip to content

Commit

Permalink
YARN-11256. Remove redundant params from the function defination
Browse files Browse the repository at this point in the history
  • Loading branch information
Samrat002 committed Aug 30, 2022
1 parent c334ba8 commit 3b0ad9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Expand Up @@ -340,10 +340,8 @@ public int launchContainer(ContainerStartContext ctx)
}

shExec = buildCommandExecutor(sb.getWrapperScriptPath().toString(),
containerIdStr, user, pidFile, container.getResource(),
new File(containerWorkDir.toUri().getPath()),
container.getLaunchContext().getEnvironment(),
numaCommands);
user, pidFile, new File(containerWorkDir.toUri().getPath()),
container, numaCommands);

if (isContainerActive(containerId)) {
shExec.execute();
Expand Down Expand Up @@ -405,24 +403,24 @@ public int relaunchContainer(ContainerStartContext ctx)
* Create a new {@link ShellCommandExecutor} using the parameters.
*
* @param wrapperScriptPath the path to the script to execute
* @param containerIdStr the container ID
* @param user the application owner's username
* @param pidFile the path to the container's PID file
* @param resource this parameter controls memory and CPU limits.
* @param workDir 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.
* @param environment the container environment
* @param container the container reference
* @param numaCommands list of prefix numa commands
* @return the new {@link ShellCommandExecutor}
* @see ShellCommandExecutor
*/
protected CommandExecutor buildCommandExecutor(String wrapperScriptPath,
String containerIdStr, String user, Path pidFile, Resource resource,
File workDir, Map<String, String> environment, String[] numaCommands) {
String user, Path pidFile, File workDir,
Container container, String[] numaCommands) {


String[] command = getRunCommand(wrapperScriptPath,
containerIdStr, user, pidFile, this.getConf(), resource);
container.getContainerId().toString(), user, pidFile, this.getConf(),
container.getResource());

// check if numa commands are passed and append it as prefix commands
if(numaCommands != null && numaCommands.length!=0) {
Expand All @@ -433,7 +431,7 @@ protected CommandExecutor buildCommandExecutor(String wrapperScriptPath,
return new ShellCommandExecutor(
command,
workDir,
environment,
container.getLaunchContext().getEnvironment(),
0L,
false);
}
Expand Down
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
Expand Down Expand Up @@ -717,11 +718,11 @@ public void startLocalizer(LocalizerStartContext ctx) throws IOException,

@Override
protected CommandExecutor buildCommandExecutor(String wrapperScriptPath,
String containerIdStr, String userName, Path pidFile, Resource resource,
File wordDir, Map<String, String> environment, String[] numaCommands) {
String userName, Path pidFile, File wordDir,
Container container, String[] numaCommands) {
return new WintuilsProcessStubExecutor(
wordDir.toString(),
containerIdStr, userName, pidFile.toString(),
container.getContainerId().toString(), userName, pidFile.toString(),
"cmd /c " + wrapperScriptPath);
}

Expand Down

0 comments on commit 3b0ad9d

Please sign in to comment.