org.apache.hadoop.mrunit.mock
Class MockOutputCollector<K,V>

java.lang.Object
  extended by org.apache.hadoop.mrunit.mock.MockOutputCollector<K,V>
All Implemented Interfaces:
org.apache.hadoop.mapred.OutputCollector<K,V>

public class MockOutputCollector<K,V>
extends Object
implements org.apache.hadoop.mapred.OutputCollector<K,V>

OutputCollector to use in the test framework for Mapper and Reducer classes. Accepts a set of output (k, v) pairs and returns them to the framework for validation.


Constructor Summary
MockOutputCollector(org.apache.hadoop.conf.Configuration config)
           
 
Method Summary
 void collect(K key, V value)
          Accepts another (key, value) pair as an output of this mapper/reducer.
 List<Pair<K,V>> getOutputs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockOutputCollector

public MockOutputCollector(org.apache.hadoop.conf.Configuration config)
Method Detail

collect

public void collect(K key,
                    V value)
             throws IOException
Accepts another (key, value) pair as an output of this mapper/reducer.

Specified by:
collect in interface org.apache.hadoop.mapred.OutputCollector<K,V>
Throws:
IOException

getOutputs

public List<Pair<K,V>> getOutputs()
Returns:
The outputs generated by the mapper/reducer being tested


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.