Merge -r 1210547:1210548 from trunk to branch. FIXES: MAPREDUCE-3389
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1210550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
63c0db36e2
commit
6a70420d9d
|
@ -194,6 +194,9 @@ Release 0.23.1 - Unreleased
|
|||
MAPREDUCE-3485. DISKS_FAILED -101 error code should be defined in same location as
|
||||
ABORTED_CONTAINER_EXIT_STATUS. (Ravi Gummadi via mahadev)
|
||||
|
||||
MAPREDUCE-3389. MRApps loads the 'mrapp-generated-classpath' file with
|
||||
classpath from the build machine. (tucu)
|
||||
|
||||
Release 0.23.0 - 2011-11-01
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -22,6 +22,7 @@ import static org.apache.hadoop.yarn.util.StringHelper._join;
|
|||
import static org.apache.hadoop.yarn.util.StringHelper._split;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -180,18 +181,23 @@ public class MRApps extends Apps {
|
|||
String mrAppGeneratedClasspathFile = "mrapp-generated-classpath";
|
||||
classpathFileStream =
|
||||
thisClassLoader.getResourceAsStream(mrAppGeneratedClasspathFile);
|
||||
// Put the file itself on classpath for tasks.
|
||||
String classpathElement = thisClassLoader.getResource(mrAppGeneratedClasspathFile).getFile();
|
||||
if (classpathElement.contains("!")) {
|
||||
classpathElement = classpathElement.substring(0, classpathElement.indexOf("!"));
|
||||
}
|
||||
else {
|
||||
classpathElement = new File(classpathElement).getParent();
|
||||
}
|
||||
Apps.addToEnvironment(
|
||||
environment,
|
||||
Environment.CLASSPATH.name(), classpathElement);
|
||||
|
||||
reader = new BufferedReader(new InputStreamReader(classpathFileStream));
|
||||
String cp = reader.readLine();
|
||||
if (cp != null) {
|
||||
Apps.addToEnvironment(environment, Environment.CLASSPATH.name(), cp.trim());
|
||||
}
|
||||
// Put the file itself on classpath for tasks.
|
||||
Apps.addToEnvironment(
|
||||
environment,
|
||||
Environment.CLASSPATH.name(),
|
||||
thisClassLoader.getResource(mrAppGeneratedClasspathFile).getFile()
|
||||
.split("!")[0]);
|
||||
|
||||
}
|
||||
// Add standard Hadoop classes
|
||||
for (String c : ApplicationConstants.APPLICATION_CLASSPATH) {
|
||||
Apps.addToEnvironment(environment, Environment.CLASSPATH.name(), c);
|
||||
|
|
Loading…
Reference in New Issue