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

org.apache.crunch.fn
Class ExtractKeyFn<K,V>

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

public class ExtractKeyFn<K,V>
extends MapFn<V,Pair<K,V>>

Wrapper function for converting a MapFn into a key-value pair that is used to convert from a PCollection<V> to a PTable<K, V>.

See Also:
Serialized Form

Constructor Summary
ExtractKeyFn(MapFn<V,K> mapFn)
           
 
Method Summary
 void initialize()
          Initialize this DoFn.
 Pair<K,V> map(V input)
          Maps the given input into an instance of the output type.
 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
cleanup, configure, disableDeepCopy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractKeyFn

public ExtractKeyFn(MapFn<V,K> mapFn)
Method Detail

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<V,Pair<K,V>>

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<V,Pair<K,V>>

map

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

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


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