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
This commit is contained in:
Arun Murthy 2011-11-01 01:05:04 +00:00
parent 85ab392795
commit d9c2bf148b
2 changed files with 9 additions and 10 deletions

View File

@ -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

View File

@ -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<String, Integer> 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<String, Integer> 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<String, Integer>(outCounter, mockTaskReporter, conf);
coc.setWriter(mockWriter);