You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by vi...@apache.org on 2013/07/30 22:05:19 UTC

svn commit: r1508596 - in /hadoop/common/branches/branch-2/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/or...

Author: vinodkv
Date: Tue Jul 30 20:05:19 2013
New Revision: 1508596

URL: http://svn.apache.org/r1508596
Log:
MAPREDUCE-5385. Fixed a bug with JobContext getCacheFiles API. Contributed by Omkar Vinit Joshi.
svn merge --ignore-ancestry -c 1508595 ../../trunk/

Modified:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/map/WrappedMapper.java
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt?rev=1508596&r1=1508595&r2=1508596&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt Tue Jul 30 20:05:19 2013
@@ -60,6 +60,9 @@ Release 2.1.1-beta - UNRELEASED
 
   BUG FIXES
 
+    MAPREDUCE-5385. Fixed a bug with JobContext getCacheFiles API. (Omkar Vinit
+    Joshi via vinodkv)
+
 Release 2.1.0-beta - 2013-08-06
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java?rev=1508596&r1=1508595&r2=1508596&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapred/TestMRWithDistributedCache.java Tue Jul 30 20:05:19 2013
@@ -89,22 +89,26 @@ public class TestMRWithDistributedCache 
     @Override
     public void setup(Context context) throws IOException {
       Configuration conf = context.getConfiguration();
-      Path[] files = context.getLocalCacheFiles();
-      Path[] archives = context.getLocalCacheArchives();
+      Path[] localFiles = context.getLocalCacheFiles();
+      URI[] files = context.getCacheFiles();
+      Path[] localArchives = context.getLocalCacheArchives();
+      URI[] archives = context.getCacheArchives();
       FileSystem fs = LocalFileSystem.get(conf);
 
       // Check that 2 files and 2 archives are present
+      TestCase.assertEquals(2, localFiles.length);
+      TestCase.assertEquals(2, localArchives.length);
       TestCase.assertEquals(2, files.length);
       TestCase.assertEquals(2, archives.length);
 
       // Check lengths of the files
-      TestCase.assertEquals(1, fs.getFileStatus(files[0]).getLen());
-      TestCase.assertTrue(fs.getFileStatus(files[1]).getLen() > 1);
+      TestCase.assertEquals(1, fs.getFileStatus(localFiles[0]).getLen());
+      TestCase.assertTrue(fs.getFileStatus(localFiles[1]).getLen() > 1);
 
       // Check extraction of the archive
-      TestCase.assertTrue(fs.exists(new Path(archives[0],
+      TestCase.assertTrue(fs.exists(new Path(localArchives[0],
           "distributed.jar.inside3")));
-      TestCase.assertTrue(fs.exists(new Path(archives[1],
+      TestCase.assertTrue(fs.exists(new Path(localArchives[1],
           "distributed.jar.inside4")));
 
       // Check the class loaders

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/map/WrappedMapper.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/map/WrappedMapper.java?rev=1508596&r1=1508595&r2=1508596&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/map/WrappedMapper.java (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/map/WrappedMapper.java Tue Jul 30 20:05:19 2013
@@ -144,7 +144,7 @@ public class WrappedMapper<KEYIN, VALUEI
 
     @Override
     public URI[] getCacheFiles() throws IOException {
-      return mapContext.getCacheArchives();
+      return mapContext.getCacheFiles();
     }
 
     @Override

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java?rev=1508596&r1=1508595&r2=1508596&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/v2/TestMRJobs.java Tue Jul 30 20:05:19 2013
@@ -422,16 +422,20 @@ public class TestMRJobs {
     @Override
     public void setup(Context context) throws IOException {
       Configuration conf = context.getConfiguration();
-      Path[] files = context.getLocalCacheFiles();
-      Path[] archives = context.getLocalCacheArchives();
+      Path[] localFiles = context.getLocalCacheFiles();
+      URI[] files = context.getCacheFiles();
+      Path[] localArchives = context.getLocalCacheArchives();
+      URI[] archives = context.getCacheArchives();
 
       // Check that 4 (2 + appjar + DistrubutedCacheChecker jar) files 
       // and 2 archives are present
+      Assert.assertEquals(4, localFiles.length);
       Assert.assertEquals(4, files.length);
+      Assert.assertEquals(2, localArchives.length);
       Assert.assertEquals(2, archives.length);
 
       // Check lengths of the files
-      Map<String, Path> filesMap = pathsToMap(files);
+      Map<String, Path> filesMap = pathsToMap(localFiles);
       Assert.assertTrue(filesMap.containsKey("distributed.first.symlink"));
       Assert.assertEquals(1, localFs.getFileStatus(
         filesMap.get("distributed.first.symlink")).getLen());
@@ -440,7 +444,7 @@ public class TestMRJobs {
         filesMap.get("distributed.second.jar")).getLen() > 1);
 
       // Check extraction of the archive
-      Map<String, Path> archivesMap = pathsToMap(archives);
+      Map<String, Path> archivesMap = pathsToMap(localArchives);
       Assert.assertTrue(archivesMap.containsKey("distributed.third.jar"));
       Assert.assertTrue(localFs.exists(new Path(
         archivesMap.get("distributed.third.jar"), "distributed.jar.inside3")));