public abstract class SPairFlatMapFunction<T,K,V> extends DoFn<T,R> implements org.apache.spark.api.java.function.PairFlatMapFunction<T,K,V>
PairFlatMapFunction
. Subclasses
of this class may be used against either Crunch PCollections
or Spark RDDs
.Constructor and Description |
---|
SPairFlatMapFunction() |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(Emitter<R> emitter)
Called during the cleanup of the MapReduce job this
DoFn is
associated with. |
void |
initialize()
Initialize this DoFn.
|
void |
process(T input,
Emitter<Pair<K,V>> emitter)
Processes the records from a
PCollection . |
configure, disableDeepCopy, scaleFactor, setConfiguration, setContext
public void process(T input, Emitter<Pair<K,V>> emitter)
DoFn
PCollection
.
DoFn.process(Object, Emitter)
method call. This
functionality is imposed by Hadoop's Reducer implementation: The framework will reuse the key and value
objects that are passed into the reduce, therefore the application should
clone the objects they want to keep a copy of.public final 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<T,R>
Copyright © 2016 The Apache Software Foundation. All rights reserved.