org.apache.hadoop.mapred.lib
Class InverseMapper
java.lang.Object
org.apache.hadoop.mapred.MapReduceBase
org.apache.hadoop.mapred.lib.InverseMapper
- All Implemented Interfaces:
- Closeable, JobConfigurable, Mapper
public class InverseMapper
- extends MapReduceBase
- implements Mapper
A Mapper
that swaps keys and values.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InverseMapper
public InverseMapper()
map
public void map(WritableComparable key,
Writable value,
OutputCollector output,
Reporter reporter)
throws IOException
- The inverse function. Input keys and values are swapped.
- Specified by:
map
in interface Mapper
- Parameters:
key
- the keyvalue
- the valuesoutput
- collects mapped keys and values
- Throws:
IOException
Copyright © 2006 The Apache Software Foundation