org.apache.hadoop.mrunit.mapreduce.mock
Class MockMapContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
java.lang.Object
org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
org.apache.hadoop.mrunit.mapreduce.mock.MockMapContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public class MockMapContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- extends MockContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
o.a.h.mapreduce.Mapper.map() expects to use a Mapper.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 Mapper.Context is an inner
class of Mapper, we need to put any subclasses of Mapper.Context in a
subclass of Mapper.
This wrapper class exists for that purpose.
Constructor Summary |
MockMapContextWrapper(List<Pair<KEYIN,VALUEIN>> inputs,
org.apache.hadoop.mapreduce.Counters counters,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.mapreduce.InputSplit inputSplit)
|
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,VALUEIN>> inputs
currentKeyValue
protected Pair<KEYIN,VALUEIN> currentKeyValue
context
protected final org.apache.hadoop.mapreduce.Mapper.Context context
inputSplit
protected org.apache.hadoop.mapreduce.InputSplit inputSplit
MockMapContextWrapper
public MockMapContextWrapper(List<Pair<KEYIN,VALUEIN>> inputs,
org.apache.hadoop.mapreduce.Counters counters,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.mapreduce.InputSplit inputSplit)
throws IOException,
InterruptedException
- Throws:
IOException
InterruptedException
getOutputs
public List<Pair<KEYOUT,VALUEOUT>> getOutputs()
- Returns:
- the outputs from the MockOutputCollector back to the test harness.
getMockContext
public org.apache.hadoop.mapreduce.Mapper.Context getMockContext()
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.