public interface PartitionSelectorStrategy
Modifier and Type | Method and Description |
---|---|
int |
selectPartition(java.lang.Object key,
int partitionCount)
Determine the partition based on a key.
|
int selectPartition(java.lang.Object key, int partitionCount)
someValue % partitionCount
. The caller will apply
that same modulo operation (as well as enforcing absolute value) if the
value exceeds partitionCount - 1.key
- the keypartitionCount
- the number of partitions