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:
parent
5f7e991659
commit
b451dd7aaa
@ -1892,6 +1892,8 @@ Release 0.23.0 - Unreleased
|
|||||||
MAPREDUCE-3321. Disabled a few MR tests for 0.23. (Hitesh Shah via
|
MAPREDUCE-3321. Disabled a few MR tests for 0.23. (Hitesh Shah via
|
||||||
acmurthy)
|
acmurthy)
|
||||||
|
|
||||||
|
MAPREDUCE-3220. Fixed TestCombineOutputCollector. (Devaraj K via acmurthy)
|
||||||
|
|
||||||
Release 0.22.0 - Unreleased
|
Release 0.22.0 - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -31,17 +31,17 @@
|
|||||||
import org.apache.hadoop.mapred.IFile.Writer;
|
import org.apache.hadoop.mapred.IFile.Writer;
|
||||||
import org.apache.hadoop.mapred.Task.CombineOutputCollector;
|
import org.apache.hadoop.mapred.Task.CombineOutputCollector;
|
||||||
import org.apache.hadoop.mapred.Task.TaskReporter;
|
import org.apache.hadoop.mapred.Task.TaskReporter;
|
||||||
|
import org.apache.hadoop.mapreduce.MRJobConfig;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class TestCombineOutputCollector {
|
public class TestCombineOutputCollector {
|
||||||
private CombineOutputCollector<String, Integer> coc;
|
private CombineOutputCollector<String, Integer> coc;
|
||||||
|
|
||||||
Counters.Counter outCounter = new Counters.Counter() {
|
Counters.Counter outCounter = new Counters.Counter() {
|
||||||
|
private long value;
|
||||||
@Override
|
@Override
|
||||||
public void setValue(long value) {
|
public void setValue(long value) {
|
||||||
// TODO Auto-generated method stub
|
this.value = value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -52,14 +52,12 @@ public void setDisplayName(String displayName) {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void increment(long incr) {
|
public void increment(long incr) {
|
||||||
// TODO Auto-generated method stub
|
this.value += incr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getValue() {
|
public long getValue() {
|
||||||
// TODO Auto-generated method stub
|
return value;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -82,8 +80,7 @@ public String makeEscapedCompactString() {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getCounter() {
|
public long getCounter() {
|
||||||
// TODO Auto-generated method stub
|
return value;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -108,7 +105,7 @@ public void testCustomCollect() throws Throwable {
|
|||||||
Writer<String, Integer> mockWriter = mock(Writer.class);
|
Writer<String, Integer> mockWriter = mock(Writer.class);
|
||||||
|
|
||||||
Configuration conf = new Configuration();
|
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 = new CombineOutputCollector<String, Integer>(outCounter, mockTaskReporter, conf);
|
||||||
coc.setWriter(mockWriter);
|
coc.setWriter(mockWriter);
|
||||||
|
Loading…
Reference in New Issue
Block a user