|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.operation.BaseOperation<Tuple[]> cascading.operation.aggregator.ExtentBase cascading.operation.aggregator.First
public class First
Class First is an Aggregator
that returns the first Tuple
encountered in a grouping.
Fields.ARGS
found.
If firstN
is given, Tuples with each of the first N number of Tuples encountered are returned. That is,
this Aggregator will return at maximum N tuples per grouping.
Be sure to set the GroupBy
sortFields
to control which Tuples are seen first.
Field Summary |
---|
Fields inherited from class cascading.operation.BaseOperation |
---|
fieldDeclaration, numArgs, trace |
Fields inherited from interface cascading.operation.Operation |
---|
ANY |
Constructor Summary | |
---|---|
First()
Selects and returns the first argument Tuple encountered. |
|
First(Fields fieldDeclaration)
Selects and returns the first argument Tuple encountered. |
|
First(Fields fieldDeclaration,
int firstN)
Selects and returns the first N argument Tuples encountered. |
|
First(Fields fieldDeclaration,
Tuple... ignoreTuples)
Selects and returns the first argument Tuple encountered, unless the Tuple is a member of the set ignoreTuples. |
|
First(int firstN)
Selects and returns the first N argument Tuples encountered. |
Method Summary | |
---|---|
void |
complete(FlowProcess flowProcess,
AggregatorCall<Tuple[]> aggregatorCall)
Method complete will be issued last after every TupleEntry has been passed to the
Aggregator.aggregate(cascading.flow.FlowProcess, AggregatorCall)
method. |
int |
getFirstN()
|
protected void |
performOperation(Tuple[] context,
TupleEntry entry)
|
Methods inherited from class cascading.operation.aggregator.ExtentBase |
---|
aggregate, equals, getIgnoreTuples, getResult, hashCode, prepare, start |
Methods inherited from class cascading.operation.BaseOperation |
---|
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, 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 |
Constructor Detail |
---|
public First()
@ConstructorProperties(value="firstN") public First(int firstN)
firstN
- of type int@ConstructorProperties(value="fieldDeclaration") public First(Fields fieldDeclaration)
fieldDeclaration
- of type Fields@ConstructorProperties(value={"fieldDeclaration","firstN"}) public First(Fields fieldDeclaration, int firstN)
fieldDeclaration
- of type FieldsfirstN
- of type int@ConstructorProperties(value={"fieldDeclaration","ignoreTuples"}) public First(Fields fieldDeclaration, Tuple... ignoreTuples)
fieldDeclaration
- of type FieldsignoreTuples
- of type Tuple...Method Detail |
---|
public int getFirstN()
protected void performOperation(Tuple[] context, TupleEntry entry)
performOperation
in class ExtentBase
public void complete(FlowProcess flowProcess, AggregatorCall<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<Tuple[]>
complete
in class ExtentBase
flowProcess
- of type FlowProcessaggregatorCall
- of type AggregatorCall
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |