MAPREDUCE-3884. PWD should be first in the classpath of MR tasks (tucu)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1292424 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
efbc58f30c
commit
267bebeab0
@ -133,6 +133,8 @@ Release 0.23.2 - UNRELEASED
|
|||||||
MAPREDUCE-3798. Fixed failing TestJobCleanup.testCusomCleanup() and moved it
|
MAPREDUCE-3798. Fixed failing TestJobCleanup.testCusomCleanup() and moved it
|
||||||
to the maven build. (Ravi Prakash via vinodkv)
|
to the maven build. (Ravi Prakash via vinodkv)
|
||||||
|
|
||||||
|
MAPREDUCE-3884. PWD should be first in the classpath of MR tasks (tucu)
|
||||||
|
|
||||||
Release 0.23.1 - 2012-02-17
|
Release 0.23.1 - 2012-02-17
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -230,6 +230,9 @@ public static void setClasspath(Map<String, String> environment,
|
|||||||
boolean userClassesTakesPrecedence =
|
boolean userClassesTakesPrecedence =
|
||||||
conf.getBoolean(MRJobConfig.MAPREDUCE_JOB_USER_CLASSPATH_FIRST, false);
|
conf.getBoolean(MRJobConfig.MAPREDUCE_JOB_USER_CLASSPATH_FIRST, false);
|
||||||
|
|
||||||
|
Apps.addToEnvironment(environment,
|
||||||
|
Environment.CLASSPATH.name(),
|
||||||
|
Environment.PWD.$());
|
||||||
if (!userClassesTakesPrecedence) {
|
if (!userClassesTakesPrecedence) {
|
||||||
MRApps.setMRFrameworkClasspath(environment, conf);
|
MRApps.setMRFrameworkClasspath(environment, conf);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ public class TestMRApps {
|
|||||||
Job job = Job.getInstance();
|
Job job = Job.getInstance();
|
||||||
Map<String, String> environment = new HashMap<String, String>();
|
Map<String, String> environment = new HashMap<String, String>();
|
||||||
MRApps.setClasspath(environment, job.getConfiguration());
|
MRApps.setClasspath(environment, job.getConfiguration());
|
||||||
assertEquals("$HADOOP_CONF_DIR:" +
|
assertEquals("$PWD:$HADOOP_CONF_DIR:" +
|
||||||
"$HADOOP_COMMON_HOME/share/hadoop/common/*:" +
|
"$HADOOP_COMMON_HOME/share/hadoop/common/*:" +
|
||||||
"$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:" +
|
"$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:" +
|
||||||
"$HADOOP_HDFS_HOME/share/hadoop/hdfs/*:" +
|
"$HADOOP_HDFS_HOME/share/hadoop/hdfs/*:" +
|
||||||
@ -152,7 +152,7 @@ public class TestMRApps {
|
|||||||
}
|
}
|
||||||
String env_str = env.get("CLASSPATH");
|
String env_str = env.get("CLASSPATH");
|
||||||
assertSame("MAPREDUCE_JOB_USER_CLASSPATH_FIRST set, but not taking effect!",
|
assertSame("MAPREDUCE_JOB_USER_CLASSPATH_FIRST set, but not taking effect!",
|
||||||
env_str.indexOf("job.jar"), 0);
|
env_str.indexOf("$PWD:job.jar"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSetClasspathWithNoUserPrecendence() {
|
@Test public void testSetClasspathWithNoUserPrecendence() {
|
||||||
@ -166,7 +166,7 @@ public class TestMRApps {
|
|||||||
}
|
}
|
||||||
String env_str = env.get("CLASSPATH");
|
String env_str = env.get("CLASSPATH");
|
||||||
assertNotSame("MAPREDUCE_JOB_USER_CLASSPATH_FIRST false, but taking effect!",
|
assertNotSame("MAPREDUCE_JOB_USER_CLASSPATH_FIRST false, but taking effect!",
|
||||||
env_str.indexOf("job.jar"), 0);
|
env_str.indexOf("$PWD:job.jar"), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user