|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crunch.DoFn<S,T> org.apache.crunch.MapFn<V,Pair<K,V>> org.apache.crunch.fn.ExtractKeyFn<K,V>
public class ExtractKeyFn<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>
.
Constructor Summary | |
---|---|
ExtractKeyFn(MapFn<V,K> mapFn)
|
Method Summary | |
---|---|
void |
configure(org.apache.hadoop.conf.Configuration conf)
Configure this DoFn. |
void |
initialize()
Initialize this DoFn. |
Pair<K,V> |
map(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 |
---|
cleanup, disableDeepCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtractKeyFn(MapFn<V,K> mapFn)
Method Detail |
---|
public void setConfiguration(org.apache.hadoop.conf.Configuration conf)
DoFn
PType
that
relies on this instance.
setConfiguration
in class DoFn<V,Pair<K,V>>
conf
- The configuration for the PType
being initializedpublic void setContext(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,?,?> context)
DoFn
TaskInputOutputContext
to this
DoFn
instance.
setContext
in class DoFn<V,Pair<K,V>>
public void configure(org.apache.hadoop.conf.Configuration conf)
DoFn
Called during the job planning phase by the crunch-client.
configure
in class DoFn<V,Pair<K,V>>
conf
- The Configuration instance for the Job.public void initialize()
DoFn
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.
initialize
in class DoFn<V,Pair<K,V>>
public Pair<K,V> map(V input)
MapFn
map
in class MapFn<V,Pair<K,V>>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |