|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Aggregator<C>
An Aggregator takes the set of all values associated with a unique grouping and returns
zero or more values. Max, Min,
Count, and Average are good examples.
start(cascading.flow.FlowProcess, AggregatorCall)
method provides a mechanism for maintaining a 'context' object to hold intermedite values.
Note TupleEntry instances are reused internally so should not be stored. Instead use the TupleEntry or Tuple
copy constructors to make safe copies.
AggregatorCall,
OperationCall| Field Summary |
|---|
| Fields inherited from interface cascading.operation.Operation |
|---|
ANY |
| Method Summary | |
|---|---|
void |
aggregate(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
Method aggregate is called for each TupleEntry value in the current grouping. |
void |
complete(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
Method complete will be issued last after every TupleEntry has been passed to the
aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. |
void |
start(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
Method start initializes the aggregation procedure and is called for every unique grouping. |
| Methods inherited from interface cascading.operation.Operation |
|---|
cleanup, getFieldDeclaration, getNumArgs, prepare |
| Method Detail |
|---|
void start(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
aggregate(cascading.flow.FlowProcess, AggregatorCall) call,
new HashMap() should be set on the AggregatorCall instance when OperationCall.getContext() is null.
On the next grouping, start() will be called again, but this time with the old Map instance. In this case,
map.clear() should be invoked before returning.
flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCall
void aggregate(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
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.
flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCall
void complete(FlowProcess flowProcess,
AggregatorCall<C> aggregatorCall)
TupleEntry has been passed to the
aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. Any final calculation should be completed
here and passed to the outputCollector.
flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCall
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||