public class Limit extends BaseOperation<Limit.Context> implements Filter<Limit.Context>
Filter
that will limit the number of Tuple
instances that it will
allow to pass.
Sample
.Sample
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Limit.Context |
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
Limit(long limit)
Creates a new Limit class that only allows limit number of Tuple instances to pass.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
long |
getLimit() |
int |
hashCode() |
boolean |
isRemove(FlowProcess flowProcess,
FilterCall<Limit.Context> filterCall)
Method isRemove returns true if input should be removed from the tuple stream.
|
void |
prepare(FlowProcess flowProcess,
OperationCall<Limit.Context> operationCall)
Method prepare does nothing, and may safely be overridden.
|
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
@ConstructorProperties(value="limit") public Limit(long limit)
limit
- the number of tuples to let passpublic long getLimit()
public void prepare(FlowProcess flowProcess, OperationCall<Limit.Context> operationCall)
BaseOperation
prepare
in interface Operation<Limit.Context>
prepare
in class BaseOperation<Limit.Context>
public boolean isRemove(FlowProcess flowProcess, FilterCall<Limit.Context> filterCall)
Filter
isRemove
in interface Filter<Limit.Context>
flowProcess
- of type FlowProcessfilterCall
- of type FilterCallpublic boolean equals(java.lang.Object object)
equals
in class BaseOperation<Limit.Context>
public int hashCode()
hashCode
in class BaseOperation<Limit.Context>
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.