org.apache.hadoop.mrunit.mock
Class MockOutputCollector<K,V>
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockOutputCollector
public MockOutputCollector(org.apache.hadoop.conf.Configuration config)
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 Apache Software Foundation. All Rights Reserved.