hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1133778 - in /hadoop/mapreduce/branches/MR-279: CHANGES.txt mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java
Date Thu, 09 Jun 2011 10:30:02 GMT
Author: sharad
Date: Thu Jun  9 10:30:01 2011
New Revision: 1133778

URL: http://svn.apache.org/viewvc?rev=1133778&view=rev
Log:
Fix classpath construction for Task. Contributed by Vinod kumar Vavilapalli.

Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1133778&r1=1133777&r2=1133778&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Thu Jun  9 10:30:01 2011
@@ -4,6 +4,7 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
+    Fix classpath construction for Task. (vinodkv via sharad)
 
     Remove retries in dist cache so that NM's do not shutdown (mahadev)
 

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java?rev=1133778&r1=1133777&r2=1133778&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java
Thu Jun  9 10:30:01 2011
@@ -124,13 +124,18 @@ public class MRApps extends Apps {
       Map<String, String> environment) throws IOException {
 
     // Get yarn mapreduce-app classpath from generated classpath
-    // Works if compile time env is same as runtime. For e.g. tests.
+    // Works if compile time env is same as runtime. Mainly tests.
+    ClassLoader thisClassLoader =
+        Thread.currentThread().getContextClassLoader();
+    String mrAppGeneratedClasspathFile = "mrapp-generated-classpath";
     InputStream classpathFileStream =
-        Thread.currentThread().getContextClassLoader()
-            .getResourceAsStream("mrapp-generated-classpath");
+        thisClassLoader.getResourceAsStream(mrAppGeneratedClasspathFile);
     BufferedReader reader =
         new BufferedReader(new InputStreamReader(classpathFileStream));
     addToClassPath(environment, reader.readLine().trim());
+    // Put the file itself on classpath for tasks.
+    addToClassPath(environment,
+        thisClassLoader.getResource(mrAppGeneratedClasspathFile).getFile());
 
     // If runtime env is different.
     if (System.getenv().get("YARN_HOME") != null) {



Mime
View raw message