This project has retired. For details please refer to its Attic page.
CombineFn.AggregatorCombineFn (Apache Crunch 0.4.0-incubating API)

org.apache.crunch
Class CombineFn.AggregatorCombineFn<K,V>

java.lang.Object
  extended by org.apache.crunch.DoFn<Pair<S,Iterable<T>>,Pair<S,T>>
      extended by org.apache.crunch.CombineFn<K,V>
          extended by org.apache.crunch.CombineFn.AggregatorCombineFn<K,V>
All Implemented Interfaces:
Serializable
Enclosing class:
CombineFn<S,T>

public static class CombineFn.AggregatorCombineFn<K,V>
extends CombineFn<K,V>

A CombineFn that delegates all of the actual work to an Aggregator instance.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.crunch.CombineFn
CombineFn.Aggregator<T>, CombineFn.AggregatorCombineFn<K,V>, CombineFn.AggregatorFactory<T>, CombineFn.FirstNAggregator<V>, CombineFn.LastNAggregator<V>, CombineFn.MaxBigInts, CombineFn.MaxDoubles, CombineFn.MaxFloats, CombineFn.MaxInts, CombineFn.MaxLongs, CombineFn.MaxNAggregator<V extends Comparable<V>>, CombineFn.MinBigInts, CombineFn.MinDoubles, CombineFn.MinFloats, CombineFn.MinInts, CombineFn.MinLongs, CombineFn.MinNAggregator<V extends Comparable<V>>, CombineFn.PairAggregator<V1,V2>, CombineFn.QuadAggregator<A,B,C,D>, CombineFn.SimpleAggregator<T>, CombineFn.StringConcatAggregator, CombineFn.SumBigInts, CombineFn.SumDoubles, CombineFn.SumFloats, CombineFn.SumInts, CombineFn.SumLongs, CombineFn.TripAggregator<A,B,C>, CombineFn.TupleNAggregator
 
Field Summary
 
Fields inherited from class org.apache.crunch.CombineFn
MAX_BIGINTS, MAX_DOUBLES, MAX_FLOATS, MAX_INTS, MAX_LONGS, MIN_BIGINTS, MIN_DOUBLES, MIN_FLOATS, MIN_INTS, MIN_LONGS, SUM_BIGINTS, SUM_DOUBLES, SUM_FLOATS, SUM_INTS, SUM_LONGS
 
Constructor Summary
CombineFn.AggregatorCombineFn(CombineFn.Aggregator<V> aggregator)
           
 
Method Summary
 void initialize()
          Initialize this DoFn.
 void process(Pair<K,Iterable<V>> input, Emitter<Pair<K,V>> emitter)
          Processes the records from a PCollection.
 
Methods inherited from class org.apache.crunch.CombineFn
aggregator, aggregatorFactory, FIRST_N, LAST_N, MAX_BIGINTS, MAX_BIGINTS, MAX_DOUBLES, MAX_DOUBLES, MAX_FLOATS, MAX_FLOATS, MAX_INTS, MAX_INTS, MAX_LONGS, MAX_LONGS, MIN_BIGINTS, MIN_BIGINTS, MIN_DOUBLES, MIN_DOUBLES, MIN_FLOATS, MIN_FLOATS, MIN_INTS, MIN_INTS, MIN_LONGS, MIN_LONGS, pairAggregator, quadAggregator, STRING_CONCAT, STRING_CONCAT, SUM_BIGINTS, SUM_DOUBLES, SUM_FLOATS, SUM_INTS, SUM_LONGS, tripAggregator, tupleAggregator
 
Methods inherited from class org.apache.crunch.DoFn
cleanup, configure, scaleFactor, setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombineFn.AggregatorCombineFn

public CombineFn.AggregatorCombineFn(CombineFn.Aggregator<V> aggregator)
Method Detail

initialize

public void initialize()
Description copied from class: DoFn
Initialize this DoFn. This initialization will happen before the actual 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.

Overrides:
initialize in class DoFn<Pair<K,Iterable<V>>,Pair<K,V>>

process

public void process(Pair<K,Iterable<V>> input,
                    Emitter<Pair<K,V>> emitter)
Description copied from class: DoFn
Processes the records from a PCollection.

Note: Crunch can reuse a single input record object whose content changes on each 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.

Specified by:
process in class DoFn<Pair<K,Iterable<V>>,Pair<K,V>>
Parameters:
input - The input record.
emitter - The emitter to send the output to


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.