cascading.operation.filter
Class Sample
java.lang.Object
cascading.operation.BaseOperation<Random>
cascading.operation.filter.Sample
- All Implemented Interfaces:
- Filter<Random>, Operation<Random>, Serializable
public class Sample
- extends BaseOperation<Random>
- implements Filter<Random>
Class Sample is a Filter
that only allows the given fraction of Tuple
instances to pass.
Where fraction is between 1 and zero, inclusive. Thus to sample 50%
of the tuples in a stream, use the
fraction 0.5
.
- See Also:
- Serialized Form
Fields inherited from interface cascading.operation.Operation |
ANY |
Constructor Summary |
Sample(double fraction)
Creates a new Sample that permits percent Tuples to pass. |
Sample(long seed,
double fraction)
Creates a new Sample that permits percent Tuples to pass. |
Sample
@ConstructorProperties(value="fraction")
public Sample(double fraction)
- Creates a new Sample that permits percent Tuples to pass.
- Parameters:
fraction
- of type double
Sample
@ConstructorProperties(value={"seed","fraction"})
public Sample(long seed,
double fraction)
- Creates a new Sample that permits percent Tuples to pass. The given seed value seeds the random number generator.
- Parameters:
seed
- of type longfraction
- of type double
prepare
public void prepare(FlowProcess flowProcess,
OperationCall<Random> operationCall)
- Description copied from class:
BaseOperation
- Method prepare does nothing, and may safely be overridden.
- Specified by:
prepare
in interface Operation<Random>
- Overrides:
prepare
in class BaseOperation<Random>
isRemove
public boolean isRemove(FlowProcess flowProcess,
FilterCall<Random> 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<Random>
- Parameters:
flowProcess
- of type FlowProcessfilterCall
- of type FilterCall
- Returns:
- boolean
equals
public boolean equals(Object object)
- Overrides:
equals
in class BaseOperation<Random>
hashCode
public int hashCode()
- Overrides:
hashCode
in class BaseOperation<Random>
Copyright © 2007-2010 Concurrent, Inc. All Rights Reserved.