Return-Path: X-Original-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 48C219B1E for ; Thu, 5 Jan 2012 19:51:09 +0000 (UTC) Received: (qmail 25795 invoked by uid 500); 5 Jan 2012 19:51:09 -0000 Delivered-To: apmail-hadoop-mapreduce-commits-archive@hadoop.apache.org Received: (qmail 25721 invoked by uid 500); 5 Jan 2012 19:51:08 -0000 Mailing-List: contact mapreduce-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-dev@hadoop.apache.org Delivered-To: mailing list mapreduce-commits@hadoop.apache.org Received: (qmail 25713 invoked by uid 99); 5 Jan 2012 19:51:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2012 19:51:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2012 19:51:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DDB5F2388993; Thu, 5 Jan 2012 19:50:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1227789 - in /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/jav... Date: Thu, 05 Jan 2012 19:50:43 -0000 To: mapreduce-commits@hadoop.apache.org From: tucu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120105195043.DDB5F2388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tucu Date: Thu Jan 5 19:50:43 2012 New Revision: 1227789 URL: http://svn.apache.org/viewvc?rev=1227789&view=rev Log: Merge -r 1227237:1227238 from trunk to branch. FIXES: MAPREDUCE-1744 Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/filecache/DistributedCache.java hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt?rev=1227789&r1=1227788&r2=1227789&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/CHANGES.txt Thu Jan 5 19:50:43 2012 @@ -357,6 +357,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3615. Fix some ant test failures. (Thomas Graves via sseth) + MAPREDUCE-1744. DistributedCache creates its own FileSytem instance when + adding a file/archive to the path. (Dick King via tucu) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java?rev=1227789&r1=1227788&r2=1227789&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java Thu Jan 5 19:50:43 2012 @@ -1030,7 +1030,7 @@ public class Job extends JobContextImpl public void addFileToClassPath(Path file) throws IOException { ensureState(JobState.DEFINE); - DistributedCache.addFileToClassPath(file, conf); + DistributedCache.addFileToClassPath(file, conf, file.getFileSystem(conf)); } /** @@ -1045,7 +1045,7 @@ public class Job extends JobContextImpl public void addArchiveToClassPath(Path archive) throws IOException { ensureState(JobState.DEFINE); - DistributedCache.addArchiveToClassPath(archive, conf); + DistributedCache.addArchiveToClassPath(archive, conf, archive.getFileSystem(conf)); } /** Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/filecache/DistributedCache.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/filecache/DistributedCache.java?rev=1227789&r1=1227788&r2=1227789&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/filecache/DistributedCache.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/filecache/DistributedCache.java Thu Jan 5 19:50:43 2012 @@ -269,7 +269,7 @@ public class DistributedCache { /** * Add an file path to the current set of classpath entries It adds the file * to cache as well. Intended to be used by user code. - * + * * @param file Path of the file to be added * @param conf Configuration that contains the classpath setting * @deprecated Use {@link Job#addFileToClassPath(Path)} instead @@ -277,12 +277,25 @@ public class DistributedCache { @Deprecated public static void addFileToClassPath(Path file, Configuration conf) throws IOException { + addFileToClassPath(file, conf, file.getFileSystem(conf)); + } + + /** + * Add a file path to the current set of classpath entries. It adds the file + * to cache as well. Intended to be used by user code. + * + * @param file Path of the file to be added + * @param conf Configuration that contains the classpath setting + * @param fs FileSystem with respect to which {@code archivefile} should + * be interpreted. + */ + public static void addFileToClassPath + (Path file, Configuration conf, FileSystem fs) + throws IOException { String classpath = conf.get(MRJobConfig.CLASSPATH_FILES); conf.set(MRJobConfig.CLASSPATH_FILES, classpath == null ? file.toString() : classpath + "," + file.toString()); - FileSystem fs = FileSystem.get(conf); URI uri = fs.makeQualified(file).toUri(); - addCacheFile(uri, conf); } @@ -318,10 +331,23 @@ public class DistributedCache { @Deprecated public static void addArchiveToClassPath(Path archive, Configuration conf) throws IOException { + addArchiveToClassPath(archive, conf, archive.getFileSystem(conf)); + } + + /** + * Add an archive path to the current set of classpath entries. It adds the + * archive to cache as well. Intended to be used by user code. + * + * @param archive Path of the archive to be added + * @param conf Configuration that contains the classpath setting + * @param fs FileSystem with respect to which {@code archive} should be interpreted. + */ + public static void addArchiveToClassPath + (Path archive, Configuration conf, FileSystem fs) + throws IOException { String classpath = conf.get(MRJobConfig.CLASSPATH_ARCHIVES); conf.set(MRJobConfig.CLASSPATH_ARCHIVES, classpath == null ? archive .toString() : classpath + "," + archive.toString()); - FileSystem fs = FileSystem.get(conf); URI uri = fs.makeQualified(archive).toUri(); addCacheArchive(uri, conf); Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java?rev=1227789&r1=1227788&r2=1227789&view=diff ============================================================================== --- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java (original) +++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMROldApiJobs.java Thu Jan 5 19:50:43 2012 @@ -196,7 +196,7 @@ public class TestMROldApiJobs { file.close(); } - DistributedCache.addFileToClassPath(TestMRJobs.APP_JAR, conf); + DistributedCache.addFileToClassPath(TestMRJobs.APP_JAR, conf, fs); conf.setOutputCommitter(CustomOutputCommitter.class); conf.setInputFormat(TextInputFormat.class); conf.setOutputKeyClass(LongWritable.class);