com.cloudera.crunch.lib
Class Aggregate.TopKFn<K,V>
java.lang.Object
com.cloudera.crunch.DoFn<Pair<K,V>,Pair<Boolean,Pair<K,V>>>
com.cloudera.crunch.lib.Aggregate.TopKFn<K,V>
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- Aggregate
public static class Aggregate.TopKFn<K,V>
- extends DoFn<Pair<K,V>,Pair<Boolean,Pair<K,V>>>
- See Also:
- Serialized Form
Methods inherited from class com.cloudera.crunch.DoFn |
configure, getConfiguration, getCounter, getCounter, getStatus, getTaskAttemptID, progress, scaleFactor, setConfigurationForTest, setContext, setStatus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Aggregate.TopKFn
public Aggregate.TopKFn(int limit,
boolean ascending)
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<Pair<K,V>,Pair<Boolean,Pair<K,V>>>
process
public void process(Pair<K,V> input,
Emitter<Pair<Boolean,Pair<K,V>>> emitter)
- Description copied from class:
DoFn
- Processes the records from a
PCollection
.
- Specified by:
process
in class DoFn<Pair<K,V>,Pair<Boolean,Pair<K,V>>>
- Parameters:
input
- The input recordemitter
- The emitter to send the output to
cleanup
public void cleanup(Emitter<Pair<Boolean,Pair<K,V>>> emitter)
- Description copied from class:
DoFn
- Called during the cleanup of the MapReduce job this
DoFn
is associated with. Subclasses may override this method to do
appropriate cleanup.
- Overrides:
cleanup
in class DoFn<Pair<K,V>,Pair<Boolean,Pair<K,V>>>
- Parameters:
emitter
- The emitter that was used for output
Copyright © 2012. All Rights Reserved.