hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077802 - /hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
Date Fri, 04 Mar 2011 05:23:47 GMT
Author: omalley
Date: Fri Mar  4 05:23:47 2011
New Revision: 1077802

URL: http://svn.apache.org/viewvc?rev=1077802&view=rev
Log:
commit 8933b14b8b8ea76c79cf971e6440fce7735d0396
Author: Krishna Ramachandran <ramach@yahoo-inc.com>
Date:   Fri Feb 11 10:16:50 2011 -0800

    Fix Ticket 4274823 - "Distributed Cache is not adding files to class paths correctly"
    Contributed by Chris Douglas (review ramach)
    update YAHOO-CHANGES.txt
    
    +++ b/YAHOO-CHANGES.txt
    +     "Fix Distributed Cache is not adding files to class paths
    +    correctly" - Drop the host/scheme/fragment from URI(cdouglas)
    +

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

Modified: hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java?rev=1077802&r1=1077801&r2=1077802&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
(original)
+++ hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
Fri Mar  4 05:23:47 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);



Mime
View raw message