MAPREDUCE-3220. Fixed TestCombineOutputCollector. Contributed by Devaraj K.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1195745 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2011-11-01 01:04:15 +00:00
parent 5f7e991659
commit b451dd7aaa
2 changed files with 9 additions and 10 deletions

View File

@ -1892,6 +1892,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.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 void setDisplayName(String displayName) {
@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 String makeEscapedCompactString() {
@Override
public long getCounter() {
// TODO Auto-generated method stub
return 0;
return value;
}
@Override
@ -108,7 +105,7 @@ public void testCustomCollect() throws Throwable {
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);