From d9c2bf148b263c77ee39fa10b04763e4aeb7d5d5 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Tue, 1 Nov 2011 01:05:04 +0000 Subject: [PATCH] Merge -c 1195745 from trunk to branch-0.23 to fix MAPREDUCE-3220. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1195746 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 2 ++ .../mapred/TestCombineOutputCollector.java | 17 +++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 4b1af10fb79..1de4de8fb27 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1855,6 +1855,8 @@ Release 0.23.0 - Unreleased MAPREDUCE-3321. Disabled a few MR tests for 0.23. (Hitesh Shah via acmurthy) + MAPREDUCE-3220. Fixed TestCombineOutputCollector. (Devaraj K via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestCombineOutputCollector.java b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestCombineOutputCollector.java index 93560c157b1..0ffac847a4b 100644 --- a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestCombineOutputCollector.java +++ b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestCombineOutputCollector.java @@ -31,17 +31,17 @@ import org.apache.hadoop.mapred.Counters.Counter; import org.apache.hadoop.mapred.IFile.Writer; import org.apache.hadoop.mapred.Task.CombineOutputCollector; import org.apache.hadoop.mapred.Task.TaskReporter; +import org.apache.hadoop.mapreduce.MRJobConfig; import org.junit.Test; public class TestCombineOutputCollector { private CombineOutputCollector coc; Counters.Counter outCounter = new Counters.Counter() { - + private long value; @Override public void setValue(long value) { - // TODO Auto-generated method stub - + this.value = value; } @Override @@ -52,14 +52,12 @@ public class TestCombineOutputCollector { @Override public void increment(long incr) { - // TODO Auto-generated method stub - + this.value += incr; } @Override public long getValue() { - // TODO Auto-generated method stub - return 0; + return value; } @Override @@ -82,8 +80,7 @@ public class TestCombineOutputCollector { @Override public long getCounter() { - // TODO Auto-generated method stub - return 0; + return value; } @Override @@ -108,7 +105,7 @@ public class TestCombineOutputCollector { Writer mockWriter = mock(Writer.class); Configuration conf = new Configuration(); - conf.set("mapred.combine.recordsBeforeProgress", "2"); + conf.set(MRJobConfig.COMBINE_RECORDS_BEFORE_PROGRESS, "2"); coc = new CombineOutputCollector(outCounter, mockTaskReporter, conf); coc.setWriter(mockWriter);