Package com.hazelcast.jet.core
Class Partitioner.Default
- java.lang.Object
-
- com.hazelcast.jet.core.Partitioner.Default
-
- All Implemented Interfaces:
Partitioner<java.lang.Object>
,java.io.Serializable
- Enclosing interface:
- Partitioner<T>
public static final class Partitioner.Default extends java.lang.Object implements Partitioner<java.lang.Object>
Partitioner which applies the default Hazelcast partitioning strategy. Instances should be retrieved fromPartitioner.defaultPartitioner()
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.hazelcast.jet.core.Partitioner
Partitioner.Default
-
-
Field Summary
-
Fields inherited from interface com.hazelcast.jet.core.Partitioner
HASH_CODE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPartition(java.lang.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 thePartitioner.getPartition(Object, int)
method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hazelcast.jet.core.Partitioner
getConstantPartitioningKey
-
-
-
-
Method Detail
-
init
public void init(@Nonnull DefaultPartitionStrategy defaultPartitioning)
Description copied from interface:Partitioner
Callback that injects the Hazelcast's default partitioning strategy into this partitioner so it can be consulted by thePartitioner.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.- Specified by:
init
in interfacePartitioner<java.lang.Object>
-
getPartition
public int getPartition(@Nonnull java.lang.Object item, int partitionCount)
Description copied from interface:Partitioner
Returns the partition ID of the given item.- Specified by:
getPartition
in interfacePartitioner<java.lang.Object>
partitionCount
- the total number of partitions in use by the underlying Hazelcast instance
-
-