You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 06:23:47 UTC
svn commit: r1077802 -
/hadoop/common/branches/branch-0.20-security-203/src/mapred/org/apache/hadoop/filecache/DistributedCache.java
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 <ra...@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);