diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java index 7906e6f..34f3ab1 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java @@ -428,7 +428,7 @@ public boolean init(String[] args) throws ParseException, IOException { + ", attemptId=" + appAttemptID.getAttemptId()); if (!fileExist(shellCommandPath) - && envs.get(DSConstants.DISTRIBUTEDSHELLSCRIPTLOCATION).isEmpty()) { + && envs.get(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LOCATION).isEmpty()) { throw new IllegalArgumentException( "No shell command or shell script specified to be executed by application master"); } @@ -459,16 +459,16 @@ public boolean init(String[] args) throws ParseException, IOException { } } - if (envs.containsKey(DSConstants.DISTRIBUTEDSHELLSCRIPTLOCATION)) { - scriptPath = envs.get(DSConstants.DISTRIBUTEDSHELLSCRIPTLOCATION); + if (envs.containsKey(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LOCATION)) { + scriptPath = envs.get(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LOCATION); - if (envs.containsKey(DSConstants.DISTRIBUTEDSHELLSCRIPTTIMESTAMP)) { + if (envs.containsKey(DSConstants.DISTRIBUTED_SHELL_SCRIPT_TIMESTAMP)) { shellScriptPathTimestamp = Long.valueOf(envs - .get(DSConstants.DISTRIBUTEDSHELLSCRIPTTIMESTAMP)); + .get(DSConstants.DISTRIBUTED_SHELL_SCRIPT_TIMESTAMP)); } - if (envs.containsKey(DSConstants.DISTRIBUTEDSHELLSCRIPTLEN)) { + if (envs.containsKey(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LEN)) { shellScriptPathLen = Long.valueOf(envs - .get(DSConstants.DISTRIBUTEDSHELLSCRIPTLEN)); + .get(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LEN)); } if (!scriptPath.isEmpty() && (shellScriptPathTimestamp <= 0 || shellScriptPathLen <= 0)) { @@ -480,8 +480,8 @@ public boolean init(String[] args) throws ParseException, IOException { } } - if (envs.containsKey(DSConstants.DISTRIBUTEDSHELLTIMELINEDOMAIN)) { - domainId = envs.get(DSConstants.DISTRIBUTEDSHELLTIMELINEDOMAIN); + if (envs.containsKey(DSConstants.DISTRIBUTED_SHELL_TIMELINE_DOMAIN)) { + domainId = envs.get(DSConstants.DISTRIBUTED_SHELL_TIMELINE_DOMAIN); } containerMemory = Integer.parseInt(cliParser.getOptionValue( diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 0e9a4e4..2ba1117 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -580,11 +580,11 @@ public boolean run() throws IOException, YarnException { // put location of shell script into env // using the env info, the application master will create the correct local resource for the // eventual containers that will be launched to execute the shell scripts - env.put(DSConstants.DISTRIBUTEDSHELLSCRIPTLOCATION, hdfsShellScriptLocation); - env.put(DSConstants.DISTRIBUTEDSHELLSCRIPTTIMESTAMP, Long.toString(hdfsShellScriptTimestamp)); - env.put(DSConstants.DISTRIBUTEDSHELLSCRIPTLEN, Long.toString(hdfsShellScriptLen)); + env.put(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LOCATION, hdfsShellScriptLocation); + env.put(DSConstants.DISTRIBUTED_SHELL_SCRIPT_TIMESTAMP, Long.toString(hdfsShellScriptTimestamp)); + env.put(DSConstants.DISTRIBUTED_SHELL_SCRIPT_LEN, Long.toString(hdfsShellScriptLen)); if (domainId != null && domainId.length() > 0) { - env.put(DSConstants.DISTRIBUTEDSHELLTIMELINEDOMAIN, domainId); + env.put(DSConstants.DISTRIBUTED_SHELL_TIMELINE_DOMAIN, domainId); } // Add AppMaster.jar location to classpath diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/DSConstants.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/DSConstants.java index fbaf2d4..c97d86f 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/DSConstants.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/DSConstants.java @@ -31,22 +31,22 @@ /** * Environment key name pointing to the shell script's location */ - public static final String DISTRIBUTEDSHELLSCRIPTLOCATION = "DISTRIBUTEDSHELLSCRIPTLOCATION"; + public static final String DISTRIBUTED_SHELL_SCRIPT_LOCATION = "DISTRIBUTED_SHELL_SCRIPT_LOCATION"; /** * Environment key name denoting the file timestamp for the shell script. * Used to validate the local resource. */ - public static final String DISTRIBUTEDSHELLSCRIPTTIMESTAMP = "DISTRIBUTEDSHELLSCRIPTTIMESTAMP"; + public static final String DISTRIBUTED_SHELL_SCRIPT_TIMESTAMP = "DISTRIBUTED_SHELL_SCRIPT_TIMESTAMP"; /** * Environment key name denoting the file content length for the shell script. * Used to validate the local resource. */ - public static final String DISTRIBUTEDSHELLSCRIPTLEN = "DISTRIBUTEDSHELLSCRIPTLEN"; + public static final String DISTRIBUTED_SHELL_SCRIPT_LEN = "DISTRIBUTED_SHELL_SCRIPT_LEN"; /** * Environment key name denoting the timeline domain ID. */ - public static final String DISTRIBUTEDSHELLTIMELINEDOMAIN = "DISTRIBUTEDSHELLTIMELINEDOMAIN"; + public static final String DISTRIBUTED_SHELL_TIMELINE_DOMAIN = "DISTRIBUTED_SHELL_TIMELINE_DOMAIN"; }