This project has retired. For details please refer to its
Attic page.
ExtractKeyFn (Apache Crunch 0.3.0-incubating API)
org.apache.crunch.fn
Class ExtractKeyFn<K,V>
java.lang.Object
org.apache.crunch.DoFn<S,T>
org.apache.crunch.MapFn<V,Pair<K,V>>
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
Method Summary |
void |
initialize()
Called during the setup of the MapReduce job this DoFn is
associated with. |
Pair<K,V> |
map(V input)
Maps the given input into an instance of the output type. |
ExtractKeyFn
public ExtractKeyFn(MapFn<V,K> mapFn)
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<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 © 2012 The Apache Software Foundation. All Rights Reserved.