This project has retired. For details please refer to its Attic page.
PairMapFn (Apache Crunch 0.11.0 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)
          Configure this DoFn.
 void initialize()
          Initialize this DoFn.
 Pair<S,T> map(Pair<K,V> input)
          Maps the given input into an instance of the output type.
 void setConfiguration(org.apache.hadoop.conf.Configuration conf)
          Called during the setup of an initialized PType that relies on this instance.
 void setContext(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,?,?> context)
          Called during setup to pass the TaskInputOutputContext to this DoFn instance.
 
Methods inherited from class org.apache.crunch.MapFn
process, scaleFactor
 
Methods inherited from class org.apache.crunch.DoFn
disableDeepCopy
 
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
Configure this DoFn. Subclasses may override this method to modify the configuration of the Job that this DoFn instance belongs to.

Called during the job planning phase by the crunch-client.

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

setConfiguration

public void setConfiguration(org.apache.hadoop.conf.Configuration conf)
Description copied from class: DoFn
Called during the setup of an initialized PType that relies on this instance.

Overrides:
setConfiguration in class DoFn<Pair<K,V>,Pair<S,T>>
Parameters:
conf - The non-null configuration for the PType being initialized

setContext

public void setContext(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,?,?> context)
Description copied from class: DoFn
Called during setup to pass the TaskInputOutputContext to this DoFn instance. The specified TaskInputOutputContext must not be null.

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

initialize

public void initialize()
Description copied from class: DoFn
Initialize this DoFn. This initialization will happen before the actual DoFn.process(Object, Emitter) is triggered. Subclasses may override this method to do appropriate initialization.

Called during the setup of the job instance this DoFn is associated with.

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


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