public static final class Partitioner.Default extends Object implements Partitioner<Object>
Partitioner.defaultPartitioner().Partitioner.DefaultHASH_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, waitdefaultPartitionerpublic void init(@Nonnull DefaultPartitionStrategy defaultPartitioning)
PartitionerPartitioner.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)
PartitionergetPartition in interface Partitioner<Object>partitionCount - the total number of partitions in use by the underlying Hazelcast instanceCopyright © 2021 Hazelcast, Inc.. All rights reserved.