Author: omalley
Date: Fri Mar  4 04:55:44 2011
New Revision: 1077790

URL: http://svn.apache.org/viewvc?rev=1077790&view=rev
Log:
commit da37613ea207129453cb7c2ba4e761ed50b020d7
Author: Krishna Ramachandran <[email protected]>
Date:   Fri Feb 11 05:41:19 2011 -0800

    Fix 4274823 "Distributed Cache is not adding files to class paths"
    Contributed by Chris Douglas

Modified:
    
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/DistributedCache.java

Modified: 
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/DistributedCache.java?rev=1077790&r1=1077789&r2=1077790&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
 (original)
+++ 
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
 Fri Mar  4 04:55:44 2011
@@ -450,10 +450,11 @@ public class DistributedCache {
   public static void addFileToClassPath
            (Path file, Configuration conf, FileSystem fs)
         throws IOException {
+    String filepath = file.toUri().getPath();
     String classpath = conf.get("mapred.job.classpath.files");
-    conf.set("mapred.job.classpath.files", classpath == null ? file.toString()
-             : classpath
-                 + System.getProperty("path.separator") + file.toString());
+    conf.set("mapred.job.classpath.files", classpath == null
+        ? filepath
+        : classpath + System.getProperty("path.separator") + filepath);
     URI uri = fs.makeQualified(file).toUri();
     addCacheFile(uri, conf);
   }
@@ -508,10 +509,11 @@ public class DistributedCache {
   public static void addArchiveToClassPath
          (Path archive, Configuration conf, FileSystem fs)
       throws IOException {
+    String archivepath = archive.toUri().getPath();
     String classpath = conf.get("mapred.job.classpath.archives");
-    conf.set("mapred.job.classpath.archives", classpath == null ? archive
-             .toString() : classpath + System.getProperty("path.separator")
-             + archive.toString());
+    conf.set("mapred.job.classpath.archives", classpath == null
+        ? archivepath
+        : classpath + System.getProperty("path.separator") + archivepath);
     URI uri = fs.makeQualified(archive).toUri();
 
     addCacheArchive(uri, conf);


Reply via email to