cascading.operation.aggregator
Class ExtremaBase
java.lang.Object
cascading.operation.BaseOperation
cascading.operation.aggregator.ExtremaBase
- All Implemented Interfaces:
- Aggregator, Operation, Serializable
- Direct Known Subclasses:
- Max, Min
public abstract class ExtremaBase
- extends BaseOperation
- implements Aggregator
Class ExtremaBase is the base class for Max and Min. The unique thing about Max and Min are that they return the original,
un-coerced, argument value, though a coerced version of the argument is used for the comparison.
- See Also:
- Serialized Form
| Fields inherited from interface cascading.operation.Operation |
ANY |
ignoreValues
protected final Collection ignoreValues
- Field ignoreValues
ExtremaBase
public ExtremaBase(Fields fieldDeclaration)
ExtremaBase
public ExtremaBase(int numArgs,
Fields fieldDeclaration)
ExtremaBase
protected ExtremaBase(Fields fieldDeclaration,
Object... ignoreValues)
start
public void start(Map context,
TupleEntry groupEntry)
- Description copied from interface:
Aggregator
- Method start initializes the aggregation procedure. The
Map context is used to
hold intermediate values. The context should be initialized here if necessary. This method will be called
before Aggregator.aggregate(Map, TupleEntry) and Aggregator.complete(java.util.Map,cascading.tuple.TupleCollector).
TupleEntry groupEntry, or groupEntry.getTuple() should not be stored directly in the context. A copy of the tuple
should be made via the new Tuple( entry.getTuple() ) copy constructor.
- Specified by:
start in interface Aggregator
- Parameters:
context - the map to be initialized (if necessary)groupEntry - is the current grouping tuple- See Also:
Aggregator.start(java.util.Map , cascading.tuple.TupleEntry)
getInitialValue
protected abstract double getInitialValue()
aggregate
public void aggregate(Map context,
TupleEntry entry)
- Description copied from interface:
Aggregator
- Method aggregate is called for each
TupleEntry value in the current grouping.
TupleEntry entry, or entry.getTuple() should not be stored directly in the context. A copy of the tuple
should be made via the new Tuple( entry.getTuple() ) copy constructor.
- Specified by:
aggregate in interface Aggregator
- Parameters:
context - the map with aggregate values so farentry - the tuple entry to add to the operation- See Also:
Aggregator.aggregate(java.util.Map, cascading.tuple.TupleEntry)
compare
protected abstract boolean compare(Number lhs,
Number rhs)
complete
public void complete(Map context,
TupleCollector outputCollector)
- Description copied from interface:
Aggregator
- Method complete will be issued last after every
TupleEntry has been passed to the
Aggregator.aggregate(Map, TupleEntry) method. Any final calculation should be completed
here and passed to the outputCollector.
- Specified by:
complete in interface Aggregator
- Parameters:
context - the aggregate map @return the final aggregate value- See Also:
Aggregator.complete(java.util.Map, cascading.tuple.TupleCollector)
Copyright © 2007-2008 Concurrent, Inc. All Rights Reserved.