org.apache.hadoop.mrunit.mapreduce.mock
Class MockReduceContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
java.lang.Object
org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
org.apache.hadoop.mrunit.mapreduce.mock.MockReduceContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public class MockReduceContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- extends MockContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
o.a.h.mapreduce.Reducer.reduce() expects to use a Reducer.Context
object as a parameter. We want to override the functionality
of a lot of Context to have it send the results back to us, etc.
But since Reducer.Context is an inner class of Reducer, we need to
put any subclasses of Reducer.Context in a subclass of Reducer.
This wrapper class exists for that purpose.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.commons.logging.Log LOG
inputs
protected final List<Pair<KEYIN,List<VALUEIN>>> inputs
currentKeyValue
protected Pair<KEYIN,List<VALUEIN>> currentKeyValue
context
protected final org.apache.hadoop.mapreduce.Reducer.Context context
MockReduceContextWrapper
public MockReduceContextWrapper(List<Pair<KEYIN,List<VALUEIN>>> inputs,
org.apache.hadoop.mapreduce.Counters counters,
org.apache.hadoop.conf.Configuration conf)
throws IOException,
InterruptedException
- Throws:
IOException
InterruptedException
getOutputs
public List<Pair<KEYOUT,VALUEOUT>> getOutputs()
- Returns:
- the outputs from the MockOutputCollector back to
the test harness.
makeOneUseIterator
protected static <V> Iterable<V> makeOneUseIterator(Iterator<V> parent)
getMockContext
public org.apache.hadoop.mapreduce.Reducer.Context getMockContext()
Copyright © 2012 Apache Software Foundation. All Rights Reserved.