Package com.hazelcast.partition.strategy
Class DefaultPartitioningStrategy
- java.lang.Object
-
- com.hazelcast.partition.strategy.DefaultPartitioningStrategy
-
- All Implemented Interfaces:
PartitioningStrategy
,java.io.Serializable
public class DefaultPartitioningStrategy extends java.lang.Object implements PartitioningStrategy
APartitioningStrategy
that checks if the key implementsPartitionAware
. If so, thePartitionAware.getPartitionKey()
is called. Otherwise null is returned.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultPartitioningStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getPartitionKey(java.lang.Object key)
Returns the key object that will be used by Hazelcast to specify the partition.
-
-
-
Method Detail
-
getPartitionKey
public java.lang.Object getPartitionKey(java.lang.Object key)
Description copied from interface:PartitioningStrategy
Returns the key object that will be used by Hazelcast to specify the partition.- Specified by:
getPartitionKey
in interfacePartitioningStrategy
- Parameters:
key
- actual key object used by Hazelcast to specify the partition- Returns:
- the partition key object, or null to fallback to the default partition calculation
-
-