Forráskód Böngészése

MAPREDUCE-4994. Addendum fixing testcases failures. (sandyr via tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1446043 13f79535-47bb-0310-9956-ffa450edef68
Alejandro Abdelnur 12 éve
szülő
commit
7f9b4c4e8b

+ 2 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -20,6 +20,8 @@ Release 2.0.4-beta - UNRELEASED
     MAPREDUCE-5000. Fixes getCounters when speculating by fixing the selection
     of the best attempt for a task. (Jason Lowe via sseth)
 
+    MAPREDUCE-4994. Addendum fixing testcases failures. (sandyr via tucu)
+
 Release 2.0.3-alpha - 2013-02-06 
 
   INCOMPATIBLE CHANGES

+ 4 - 0
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalClientProtocolProvider.java

@@ -37,6 +37,10 @@ public class LocalClientProtocolProvider extends ClientProtocolProvider {
     if (!MRConfig.LOCAL_FRAMEWORK_NAME.equals(framework)) {
       return null;
     }
+    if (conf.get("mapreduce.job.maps") == null) {
+      conf.setInt("mapreduce.job.maps", 1);
+    }
+
     return new LocalJobRunner(conf);
   }
 

+ 1 - 0
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLineRecordReader.java

@@ -98,6 +98,7 @@ public class TestLineRecordReader extends TestCase {
       InterruptedException, ClassNotFoundException {
     Configuration conf = new Configuration();
     conf.set("textinputformat.record.delimiter", "\t\n");
+    conf.setInt("mapreduce.job.maps", 1);
     FileSystem localFs = FileSystem.getLocal(conf);
     // cleanup
     localFs.delete(workDir, true);

+ 1 - 0
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestChainMapReduce.java

@@ -82,6 +82,7 @@ public class TestChainMapReduce extends HadoopTestCase {
 
     JobConf conf = createJobConf();
     conf.setBoolean("localFS", isLocalFS());
+    conf.setInt("mapreduce.job.maps", 1);
 
     cleanFlags(conf);
 

+ 4 - 18
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestClientProtocolProviderImpls.java

@@ -42,24 +42,10 @@ public class TestClientProtocolProviderImpls extends TestCase {
 
     }
 
-    try {
-      conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.LOCAL_FRAMEWORK_NAME);
-      conf.set(JTConfig.JT_IPC_ADDRESS, "127.0.0.1:0");
-
-      new Cluster(conf);
-      fail("Cluster with Local Framework name should use local JT address");
-    } catch (IOException e) {
-
-    }
-
-    try {
-      conf.set(JTConfig.JT_IPC_ADDRESS, "local");
-      Cluster cluster = new Cluster(conf);
-      assertTrue(cluster.getClient() instanceof LocalJobRunner);
-      cluster.close();
-    } catch (IOException e) {
-
-    }
+    conf.set(MRConfig.FRAMEWORK_NAME, "local");
+    Cluster cluster = new Cluster(conf);
+    assertTrue(cluster.getClient() instanceof LocalJobRunner);
+    cluster.close();
   }
 
   @Test