Class IdentityMapper<K,V>

java.lang.Object
org.apache.hadoop.mapred.MapReduceBase
org.apache.hadoop.mapred.lib.IdentityMapper<K,V>
All Implemented Interfaces:
Closeable, AutoCloseable, Closeable, JobConfigurable, Mapper<K,V,K,V>

@Public @Stable public class IdentityMapper<K,V> extends MapReduceBase implements Mapper<K,V,K,V>
Implements the identity function, mapping inputs directly to outputs.
  • Constructor Details

    • IdentityMapper

      public IdentityMapper()
  • Method Details

    • map

      public void map(K key, V val, OutputCollector<K,V> output, Reporter reporter) throws IOException
      The identity function. Input key/value pair is written directly to output.
      Specified by:
      map in interface Mapper<K,V,K,V>
      Parameters:
      key - the input key.
      val - the input value.
      output - collects mapped keys and values.
      reporter - facility to report progress.
      Throws:
      IOException