diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 87f3947b3cd..16324c52b17 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -122,6 +122,9 @@ Release 2.0.0 - UNRELEASED MAPREDUCE-4105. Yarn RackResolver ignores rack configurations. (Ahmed Radwan via tomwhite) + MAPREDUCE-3869. Fix classpath for DistributedShell application. (Devaraj K + via sseth) + Release 0.23.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 39fe08a4417..3b962a3048f 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -78,7 +78,6 @@ import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnRemoteException; import org.apache.hadoop.yarn.ipc.YarnRPC; -import org.apache.hadoop.yarn.security.client.ClientRMSecurityInfo; import org.apache.hadoop.yarn.util.ConverterUtils; import org.apache.hadoop.yarn.util.Records; @@ -506,22 +505,20 @@ public class Client { // It should be provided out of the box. // For now setting all required classpaths including // the classpath to "." for the application jar - String classPathEnv = "${CLASSPATH}" - + ":./*" - + ":$HADOOP_CONF_DIR" - + ":$HADOOP_COMMON_HOME/share/hadoop/common/*" - + ":$HADOOP_COMMON_HOME/share/hadoop/common/lib/*" - + ":$HADOOP_HDFS_HOME/share/hadoop/hdfs/*" - + ":$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*" - + ":$YARN_HOME/modules/*" - + ":$YARN_HOME/lib/*" - + ":./log4j.properties:"; + StringBuilder classPathEnv = new StringBuilder("${CLASSPATH}:./*"); + for (String c : conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH) + .split(",")) { + classPathEnv.append(':'); + classPathEnv.append(c.trim()); + } + classPathEnv.append(":./log4j.properties"); - // add the runtime classpath needed for tests to work + // add the runtime classpath needed for tests to work String testRuntimeClassPath = Client.getTestRuntimeClasspath(); - classPathEnv += ":" + testRuntimeClassPath; + classPathEnv.append(':'); + classPathEnv.append(testRuntimeClassPath); - env.put("CLASSPATH", classPathEnv); + env.put("CLASSPATH", classPathEnv.toString()); amContainer.setEnvironment(env);