Merge MAPREDUCE-3869 from trunk. Fix classpath for DistributedShell application. (Contributed by Devaraj K)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1311524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Siddharth Seth 2012-04-10 00:02:57 +00:00
parent de5069a6a1
commit 5f535af454
2 changed files with 14 additions and 14 deletions

View File

@ -122,6 +122,9 @@ Release 2.0.0 - UNRELEASED
MAPREDUCE-4105. Yarn RackResolver ignores rack configurations. MAPREDUCE-4105. Yarn RackResolver ignores rack configurations.
(Ahmed Radwan via tomwhite) (Ahmed Radwan via tomwhite)
MAPREDUCE-3869. Fix classpath for DistributedShell application. (Devaraj K
via sseth)
Release 0.23.3 - UNRELEASED Release 0.23.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -78,7 +78,6 @@
import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnRemoteException; import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
import org.apache.hadoop.yarn.ipc.YarnRPC; 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.ConverterUtils;
import org.apache.hadoop.yarn.util.Records; import org.apache.hadoop.yarn.util.Records;
@ -506,22 +505,20 @@ else if (amMemory > maxMem) {
// It should be provided out of the box. // It should be provided out of the box.
// For now setting all required classpaths including // For now setting all required classpaths including
// the classpath to "." for the application jar // the classpath to "." for the application jar
String classPathEnv = "${CLASSPATH}" StringBuilder classPathEnv = new StringBuilder("${CLASSPATH}:./*");
+ ":./*" for (String c : conf.get(YarnConfiguration.YARN_APPLICATION_CLASSPATH)
+ ":$HADOOP_CONF_DIR" .split(",")) {
+ ":$HADOOP_COMMON_HOME/share/hadoop/common/*" classPathEnv.append(':');
+ ":$HADOOP_COMMON_HOME/share/hadoop/common/lib/*" classPathEnv.append(c.trim());
+ ":$HADOOP_HDFS_HOME/share/hadoop/hdfs/*" }
+ ":$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*" classPathEnv.append(":./log4j.properties");
+ ":$YARN_HOME/modules/*"
+ ":$YARN_HOME/lib/*"
+ ":./log4j.properties:";
// add the runtime classpath needed for tests to work // add the runtime classpath needed for tests to work
String testRuntimeClassPath = Client.getTestRuntimeClasspath(); String testRuntimeClassPath = Client.getTestRuntimeClasspath();
classPathEnv += ":" + testRuntimeClassPath; classPathEnv.append(':');
classPathEnv.append(testRuntimeClassPath);
env.put("CLASSPATH", classPathEnv); env.put("CLASSPATH", classPathEnv.toString());
amContainer.setEnvironment(env); amContainer.setEnvironment(env);