org.apache.hadoop.mrunit.mapreduce.mock
Class MockMapContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

java.lang.Object
  extended by org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
      extended by 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.


Field Summary
protected  org.apache.hadoop.mapreduce.Mapper.Context context
           
protected  Pair<KEYIN,VALUEIN> currentKeyValue
           
protected  List<Pair<KEYIN,VALUEIN>> inputs
           
protected  org.apache.hadoop.mapreduce.InputSplit inputSplit
           
protected static org.apache.commons.logging.Log LOG
           
 
Fields inherited from class org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper
conf, counters, outputs
 
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)
           
 
Method Summary
 org.apache.hadoop.mapreduce.Mapper.Context getMockContext()
           
 List<Pair<KEYOUT,VALUEOUT>> getOutputs()
           
 
Methods inherited from class org.apache.hadoop.mrunit.mapreduce.mock.MockContextWrapper
createCommon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

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
Method Detail

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.