public class FirstNBuffer extends BaseOperation implements Buffer
First
Aggregator
which by contract sees all the values in the grouping.
By default it returns one Tuple.
Order can be controlled through the prior GroupBy
or CoGroup
pipes.
This class is used by Unique
.fieldDeclaration, numArgs, trace
Constructor and Description |
---|
FirstNBuffer()
Selects and returns the first argument Tuple encountered.
|
FirstNBuffer(Fields fieldDeclaration)
Selects and returns the first argument Tuple encountered.
|
FirstNBuffer(Fields fieldDeclaration,
int firstN)
Selects and returns the first N argument Tuples encountered.
|
FirstNBuffer(int firstN)
Selects and returns the first N argument Tuples encountered.
|
Modifier and Type | Method and Description |
---|---|
int |
getFirstN() |
void |
operate(FlowProcess flowProcess,
BufferCall bufferCall)
Method operate is called once for each grouping.
|
cleanup, equals, flush, getFieldDeclaration, getNumArgs, getTrace, hashCode, isSafe, prepare, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare
public FirstNBuffer()
@ConstructorProperties(value="firstN") public FirstNBuffer(int firstN)
firstN
- of type int@ConstructorProperties(value="fieldDeclaration") public FirstNBuffer(Fields fieldDeclaration)
fieldDeclaration
- of type Fields@ConstructorProperties(value={"fieldDeclaration","firstN"}) public FirstNBuffer(Fields fieldDeclaration, int firstN)
fieldDeclaration
- of type FieldsfirstN
- of type intpublic int getFirstN()
public void operate(FlowProcess flowProcess, BufferCall bufferCall)
Buffer
BufferCall
passes in an Iterator
that returns an argument TupleEntry
for each value in the grouping defined by the
argument selector on the parent Every pipe instance.
TupleEntry entry, or entry.getTuple() should not be stored directly in a collection or modified.
A copy of the tuple should be made via the new Tuple( entry.getTuple() )
copy constructor.
This method is called for every unique group, whether or not there are values in the arguments Iterator.Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.