|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.operation.BaseOperation<cascading.util.Pair<Long[],Tuple>> 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 default 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<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
Method aggregate is called for each TupleEntry value in the current grouping. |
void |
complete(FlowProcess flowProcess,
AggregatorCall<cascading.util.Pair<Long[],Tuple>> 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<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
|
void |
prepare(FlowProcess flowProcess,
OperationCall<cascading.util.Pair<Long[],Tuple>> operationCall)
Method prepare does nothing, and may safely be overridden. |
void |
start(FlowProcess flowProcess,
AggregatorCall<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
Method start initializes the aggregation procedure and is called for every unique grouping. |
Methods inherited from class cascading.operation.BaseOperation |
---|
cleanup, equals, flush, getFieldDeclaration, getNumArgs, getTrace, hashCode, isSafe, printOperationInternal, toString, toStringInternal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface cascading.operation.Operation |
---|
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe |
Field Detail |
---|
public static final String FIELD_NAME
Constructor Detail |
---|
public Count()
@ConstructorProperties(value="fieldDeclaration") public Count(Fields fieldDeclaration)
fieldDeclaration
- of type FieldsMethod Detail |
---|
public void prepare(FlowProcess flowProcess, OperationCall<cascading.util.Pair<Long[],Tuple>> operationCall)
BaseOperation
prepare
in interface Operation<cascading.util.Pair<Long[],Tuple>>
prepare
in class BaseOperation<cascading.util.Pair<Long[],Tuple>>
public void start(FlowProcess flowProcess, AggregatorCall<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
Aggregator
Aggregator.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<cascading.util.Pair<Long[],Tuple>>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallpublic void aggregate(FlowProcess flowProcess, AggregatorCall<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
Aggregator
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.
aggregate
in interface Aggregator<cascading.util.Pair<Long[],Tuple>>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallpublic void complete(FlowProcess flowProcess, AggregatorCall<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
Aggregator
TupleEntry
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<cascading.util.Pair<Long[],Tuple>>
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCallprotected Tuple getResult(AggregatorCall<cascading.util.Pair<Long[],Tuple>> aggregatorCall)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |