This project has retired. For details please refer to its Attic page.
CompositeMapFn (Apache Crunch 0.9.0 API)

org.apache.crunch.fn
Class CompositeMapFn<R,S,T>

java.lang.Object
  extended by org.apache.crunch.DoFn<S,T>
      extended by org.apache.crunch.MapFn<R,T>
          extended by org.apache.crunch.fn.CompositeMapFn<R,S,T>
All Implemented Interfaces:
Serializable

public class CompositeMapFn<R,S,T>
extends MapFn<R,T>

See Also:
Serialized Form

Constructor Summary
CompositeMapFn(MapFn<R,S> first, MapFn<S,T> second)
           
 
Method Summary
 void cleanup(Emitter<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.
 MapFn<R,S> getFirst()
           
 MapFn<S,T> getSecond()
           
 void initialize()
          Initialize this DoFn.
 T map(R 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, getConfiguration, getContext, getCounter, getCounter, getStatus, getTaskAttemptID, increment, increment, increment, increment, progress, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeMapFn

public CompositeMapFn(MapFn<R,S> first,
                      MapFn<S,T> second)
Method Detail

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<R,T>
Parameters:
conf - The 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.

Overrides:
setContext in class DoFn<R,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<R,T>

getFirst

public MapFn<R,S> getFirst()

getSecond

public MapFn<S,T> getSecond()

map

public T map(R input)
Description copied from class: MapFn
Maps the given input into an instance of the output type.

Specified by:
map in class MapFn<R,T>

cleanup

public void cleanup(Emitter<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<R,T>
Parameters:
emitter - The emitter that was used for output

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<R,T>
Parameters:
conf - The Configuration instance for the Job.


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