From b1c781b2be4bb208da7996187fd58779bcaf3303 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 27 Mar 2013 11:42:32 +0000 Subject: [PATCH] MAPREDUCE-5006. Fix failing streaming tests due to MAPREDUCE-4994. Contributed by Sandy Ryza. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1461537 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/mapred/LocalClientProtocolProvider.java | 4 +--- .../org/apache/hadoop/streaming/TestStreamReduceNone.java | 1 + .../apache/hadoop/streaming/TestStreamXmlRecordReader.java | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index bf2cf35742d..9ebe603027c 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -110,6 +110,9 @@ Release 2.0.5-beta - UNRELEASED MAPREDUCE-3757. [Rumen] Fixed Rumen Folder to adjust shuffleFinished and sortFinished times when needed. (Ravi Gummadi via tgraves) + MAPREDUCE-5006. Fix failing streaming tests due to MAPREDUCE-4994. + (Sandy Ryza via tomwhite) + Release 2.0.4-alpha - UNRELEASED 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 5b7e3a0b92a..3d6aa62adce 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,9 +37,7 @@ 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); - } + conf.setInt(JobContext.NUM_MAPS, 1); return new LocalJobRunner(conf); } diff --git a/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamReduceNone.java b/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamReduceNone.java index 5da9e03a48b..766402184ce 100644 --- a/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamReduceNone.java +++ b/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamReduceNone.java @@ -68,6 +68,7 @@ public class TestStreamReduceNone "-reducer", "org.apache.hadoop.mapred.lib.IdentityReducer", "-numReduceTasks", "0", "-jobconf", "mapreduce.task.files.preserve.failedtasks=true", + "-jobconf", "mapreduce.job.maps=1", "-jobconf", "stream.tmpdir="+System.getProperty("test.build.data","/tmp") }; } diff --git a/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamXmlRecordReader.java b/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamXmlRecordReader.java index 7a1c6f6106b..da0bdae484c 100644 --- a/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamXmlRecordReader.java +++ b/hadoop-tools/hadoop-streaming/src/test/java/org/apache/hadoop/streaming/TestStreamXmlRecordReader.java @@ -54,6 +54,8 @@ public class TestStreamXmlRecordReader extends TestStreaming { protected String[] genArgs() { args.add("-inputreader"); args.add("StreamXmlRecordReader,begin=,end="); + args.add("-jobconf"); + args.add("mapreduce.job.maps=1"); return super.genArgs(); } }