public static final class Partitioner.Default extends Object implements Partitioner<Object>
Partitioner.defaultPartitioner()
.Partitioner.Default
HASH_CODE
Modifier and Type | Method and Description |
---|---|
int |
getPartition(Object item,
int partitionCount)
Returns the partition ID of the given item.
|
void |
init(DefaultPartitionStrategy defaultPartitioning)
Callback that injects the Hazelcast's default partitioning strategy into
this partitioner so it can be consulted by the
Partitioner.getPartition(Object, int) method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultPartitioner
public void init(@Nonnull DefaultPartitionStrategy defaultPartitioning)
Partitioner
Partitioner.getPartition(Object, int)
method.
The creation of instances of the Partitioner
type is done in
user's code, but the Hazelcast partitioning strategy only becomes
available after the partitioner is deserialized on each target member.
This method solves the lifecycle mismatch.
init
in interface Partitioner<Object>
public int getPartition(@Nonnull Object item, int partitionCount)
Partitioner
getPartition
in interface Partitioner<Object>
partitionCount
- the total number of partitions in use by the underlying Hazelcast instanceCopyright © 2024 Hazelcast, Inc.. All rights reserved.