From 7f9b4c4e8b2c276b96fc88e7de96ce284939e9f0 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Thu, 14 Feb 2013 04:22:41 +0000 Subject: [PATCH] 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 --- hadoop-mapreduce-project/CHANGES.txt | 2 ++ .../mapred/LocalClientProtocolProvider.java | 4 ++++ .../hadoop/mapred/TestLineRecordReader.java | 1 + .../hadoop/mapred/lib/TestChainMapReduce.java | 1 + .../TestClientProtocolProviderImpls.java | 22 ++++--------------- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index aa4a9eff15f..9af7d37d9d8 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/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 diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalClientProtocolProvider.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalClientProtocolProvider.java index 9dfffd5c284..5b7e3a0b92a 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalClientProtocolProvider.java +++ b/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); } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLineRecordReader.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLineRecordReader.java index 17bf9cff257..69253f4dbd1 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLineRecordReader.java +++ b/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); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestChainMapReduce.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestChainMapReduce.java index 28eeb89b13f..37cb91f023b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/lib/TestChainMapReduce.java +++ b/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); diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestClientProtocolProviderImpls.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestClientProtocolProviderImpls.java index 74148aea710..e71c0383bd3 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestClientProtocolProviderImpls.java +++ b/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