cascading.operation.filter
Class Limit
java.lang.Object
cascading.operation.BaseOperation<Limit.Context>
cascading.operation.filter.Limit
- All Implemented Interfaces:
- DeclaresResults, Filter<Limit.Context>, Operation<Limit.Context>, Traceable, Serializable
public class Limit
- extends BaseOperation<Limit.Context>
- implements Filter<Limit.Context>
Class Limit is a Filter
that will limit the number of Tuple
instances that it will
allow to pass.
Note that the limit value is roughly a suggestion. It attempts to divide the limit number by the number of concurrent
tasks, but knowing the number of tasks isn't easily available from configuration information provided to individual
tasks. Further, the number of records/lines available to a task may be less than the limit amount.
More consistent results will be received from using Sample
.
- See Also:
Sample
,
Serialized Form
Fields inherited from interface cascading.operation.Operation |
ANY |
Constructor Summary |
Limit(long limit)
Creates a new Limit class that only allows limit number of Tuple instances to pass. |
Limit
@ConstructorProperties(value="limit")
public Limit(long limit)
- Creates a new Limit class that only allows limit number of Tuple instances to pass.
- Parameters:
limit
- the number of tuples to let pass
getLimit
public long getLimit()
prepare
public void prepare(FlowProcess flowProcess,
OperationCall<Limit.Context> operationCall)
- Description copied from class:
BaseOperation
- Method prepare does nothing, and may safely be overridden.
- Specified by:
prepare
in interface Operation<Limit.Context>
- Overrides:
prepare
in class BaseOperation<Limit.Context>
isRemove
public boolean isRemove(FlowProcess flowProcess,
FilterCall<Limit.Context> filterCall)
- Description copied from interface:
Filter
- Method isRemove returns true if input should be removed from the tuple stream.
- Specified by:
isRemove
in interface Filter<Limit.Context>
- Parameters:
flowProcess
- of type FlowProcessfilterCall
- of type FilterCall
- Returns:
- boolean
equals
public boolean equals(Object object)
- Overrides:
equals
in class BaseOperation<Limit.Context>
hashCode
public int hashCode()
- Overrides:
hashCode
in class BaseOperation<Limit.Context>
Copyright © 2007-2014 Concurrent, Inc. All Rights Reserved.