Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
hazelcast::client::PartitionAware< T > Class Template Referenceabstract

PartitionAware means that data will be based in the same member based on the partition key and implementing tasks will be executed on the getPartitionKey()'s owner member. More...

#include <PartitionAware.h>

+ Inheritance diagram for hazelcast::client::PartitionAware< T >:

Public Types

typedef T KEY_TYPE
 

Public Member Functions

virtual const T * getPartitionKey () const =0
 The key that will be used by Hazelcast to specify the partition. More...
 

Detailed Description

template<typename T>
class hazelcast::client::PartitionAware< T >

PartitionAware means that data will be based in the same member based on the partition key and implementing tasks will be executed on the 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.

If you have a com.hazelcast.core.IExecutorService which 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
DistributedObject
Parameters
<T>key type

Member Function Documentation

template<typename T >
virtual const T* hazelcast::client::PartitionAware< T >::getPartitionKey ( ) const
pure virtual

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.

Returns
the key that specifies the partition. If returned object is a NULL pointer, it will not be used for partition calculation.

The documentation for this class was generated from the following file: