public static class Aggregate.TopKFn<K,V> extends DoFn<Pair<K,V>,Pair<Integer,Pair<K,V>>>
Constructor and Description |
---|
Aggregate.TopKFn(int limit,
boolean ascending) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup(Emitter<Pair<Integer,Pair<K,V>>> emitter)
Called during the cleanup of the MapReduce job this
DoFn is
associated with. |
void |
initialize()
Initialize this DoFn.
|
void |
process(Pair<K,V> input,
Emitter<Pair<Integer,Pair<K,V>>> emitter)
Processes the records from a
PCollection . |
configure, scaleFactor, setContext
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.
public void process(Pair<K,V> input, Emitter<Pair<Integer,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.Copyright © 2013 The Apache Software Foundation. All Rights Reserved.