- Type Parameters:
T- key type
- All Known Implementing Classes:
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface PartitionAware<T>
getPartitionKey()'s owner member.
This achieves data affinity. Data and execution occurs on the same partition.
In Hazelcast, disparate data structures will be stored on the same partition, based on the partition key. For example, if "Steve" was used, then the following would be on one partition.
- a customers IMap with an entry of key "Steve"
- an orders IMap using a customer key type implementing PartitionAware with key "Steve"
- any queue named "Steve"
- any PartitionAware object with partition key "Steve"
IExecutorServicewhich needs to deal with a customer and a customer's orders, you can achieve optimal performance by putting them on the same partition.
DistributedObject also has a notion of the partition key which is of type String
to ensure that the same partition as distributed Objects Strings is used for the partition key.
- See Also:
Modifier and Type Method Description
()The key that will be used by Hazelcast to specify the partition.
getPartitionKeyT getPartitionKey()The key that will be used by Hazelcast to specify the partition. You should give the same key for objects that you want to be in the same partition.
- the key that specifies the partition