Interface GenericPartitioningStrategy
- All Superinterfaces:
PartitioningStrategy<Object>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface GenericPartitioningStrategy
extends PartitioningStrategy<Object>
A
PartitioningStrategy which allocates partitions without reference to the object being
added.-
Method Summary
Modifier and TypeMethodDescriptionintCalculates the index of the partition to use for any given object.default intDeprecated.default <T> PartitioningStrategy<T>cast()Casts thisGenericPartitioningStrategyto aPartitioningStrategyof type T.
-
Method Details
-
allocate
Calculates the index of the partition to use for any given object.- Parameters:
bucket- the bucket- Returns:
- the index
-
cast
Casts thisGenericPartitioningStrategyto aPartitioningStrategyof type T.- Type Parameters:
T- the type- Returns:
- a casted strategy
-
allocate
Deprecated.Description copied from interface:PartitioningStrategyCalculates the index of the partition to use for the object.The index must be within range of the buckets size.
- Specified by:
allocatein interfacePartitioningStrategy<Object>- Parameters:
object- the objectbucket- the bucket- Returns:
- the index
-