This project has retired. For details please refer to its Attic page.
PairMapFn (Apache Crunch 0.3.0-incubating API)

org.apache.crunch.fn
Class PairMapFn<K,V,S,T>

java.lang.Object
  extended by org.apache.crunch.DoFn<S,T>
      extended by org.apache.crunch.MapFn<Pair<K,V>,Pair<S,T>>
          extended by org.apache.crunch.fn.PairMapFn<K,V,S,T>
All Implemented Interfaces:
Serializable

public class PairMapFn<K,V,S,T>
extends MapFn<Pair<K,V>,Pair<S,T>>

See Also:
Serialized Form

Constructor Summary
PairMapFn(MapFn<K,S> keys, MapFn<V,T> values)
           
 
Method Summary
 void cleanup(Emitter<Pair<S,T>> emitter)
          Called during the cleanup of the MapReduce job this DoFn is associated with.
 void configure(org.apache.hadoop.conf.Configuration conf)
          Called during the job planning phase.
 void initialize()
          Called during the setup of the MapReduce job this DoFn is associated with.
 Pair<S,T> map(Pair<K,V> input)
          Maps the given input into an instance of the output type.
 void setConfigurationForTest(org.apache.hadoop.conf.Configuration conf)
          Sets a Configuration instance to be used during unit tests.
 
Methods inherited from class org.apache.crunch.MapFn
process, scaleFactor
 
Methods inherited from class org.apache.crunch.DoFn
setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairMapFn

public PairMapFn(MapFn<K,S> keys,
                 MapFn<V,T> values)
Method Detail

configure

public void configure(org.apache.hadoop.conf.Configuration conf)
Description copied from class: DoFn
Called during the job planning phase. Subclasses may override this method in order to modify the configuration of the Job that this DoFn instance belongs to.

Overrides:
configure in class DoFn<Pair<K,V>,Pair<S,T>>
Parameters:
conf - The Configuration instance for the Job.

initialize

public void initialize()
Description copied from class: DoFn
Called during the setup of the MapReduce job this DoFn is associated with. Subclasses may override this method to do appropriate initialization.

Overrides:
initialize in class DoFn<Pair<K,V>,Pair<S,T>>

map

public Pair<S,T> map(Pair<K,V> input)
Description copied from class: MapFn
Maps the given input into an instance of the output type.

Specified by:
map in class MapFn<Pair<K,V>,Pair<S,T>>

cleanup

public void cleanup(Emitter<Pair<S,T>> emitter)
Description copied from class: DoFn
Called during the cleanup of the MapReduce job this DoFn is associated with. Subclasses may override this method to do appropriate cleanup.

Overrides:
cleanup in class DoFn<Pair<K,V>,Pair<S,T>>
Parameters:
emitter - The emitter that was used for output

setConfigurationForTest

public void setConfigurationForTest(org.apache.hadoop.conf.Configuration conf)
Description copied from class: DoFn
Sets a Configuration instance to be used during unit tests.

Overrides:
setConfigurationForTest in class DoFn<Pair<K,V>,Pair<S,T>>
Parameters:
conf - The Configuration instance.


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