Interface Partitioner<T>
-
- Type Parameters:
T
-
- All Known Implementing Classes:
CroppedPartitioner
,LongRangePartitioner
,RangePartitioner
public interface Partitioner<T>
Locates an element in a partition based on its key.- Author:
- Antonin Delpeuch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPartition(T key)
Retrieves the partition id given a key.int
numPartitions()
Returns the number of partitions assumed by this partitioner.
-
-
-
Method Detail
-
getPartition
int getPartition(T key)
Retrieves the partition id given a key.- Parameters:
key
-- Returns:
-
numPartitions
int numPartitions()
Returns the number of partitions assumed by this partitioner.
-
-