|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.operation.BaseOperation<Long[]>
cascading.operation.aggregator.Count
public class Count
Class Count is an Aggregator that calculates the number of items in the current group.
| Field Summary | |
|---|---|
static String |
FIELD_NAME
Field COUNT |
| Fields inherited from class cascading.operation.BaseOperation |
|---|
fieldDeclaration, numArgs, trace |
| Fields inherited from interface cascading.operation.Operation |
|---|
ANY |
| Constructor Summary | |
|---|---|
Count()
Constructor Count creates a new Count instance using the defalt field declaration of name 'count'. |
|
Count(Fields fieldDeclaration)
Constructor Count creates a new Count instance and returns a field with the given fieldDeclaration name. |
|
| Method Summary | |
|---|---|
void |
aggregate(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
Method aggregate is called for each TupleEntry value in the current grouping. |
void |
complete(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
Method complete will be issued last after every TupleEntry has been passed to the
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. |
protected Tuple |
getResult(AggregatorCall<Long[]> aggregatorCall)
|
void |
start(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
Method start initializes the aggregation procedure and is called for every unique grouping. |
| Methods inherited from class cascading.operation.BaseOperation |
|---|
cleanup, getFieldDeclaration, getNumArgs, getTrace, prepare, printOperationInternal, toString, toStringInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface cascading.operation.Operation |
|---|
cleanup, getFieldDeclaration, getNumArgs, prepare |
| Field Detail |
|---|
public static final String FIELD_NAME
| Constructor Detail |
|---|
public Count()
public Count(Fields fieldDeclaration)
fieldDeclaration - of type Fields| Method Detail |
|---|
public void start(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
AggregatorAggregator.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.
start in interface Aggregator<Long[]>flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCall
public void aggregate(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
AggregatorTupleEntry 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.
aggregate in interface Aggregator<Long[]>flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCall
public void complete(FlowProcess flowProcess,
AggregatorCall<Long[]> aggregatorCall)
AggregatorTupleEntry has been passed to the
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. Any final calculation should be completed here and passed to the outputCollector.
complete in interface Aggregator<Long[]>flowProcess - of type FlowProcessaggregatorCall - of type AggregatorCallprotected Tuple getResult(AggregatorCall<Long[]> aggregatorCall)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||