Hazelcast C++ Client
Public Types | Public Member Functions | Static Public Attributes | List of all members
hazelcast::client::config::NearCacheConfig< K, V > Class Template Reference

Contains the configuration for a Near Cache. More...

#include <NearCacheConfig.h>

+ Inheritance diagram for hazelcast::client::config::NearCacheConfig< K, V >:

Public Types

enum  LocalUpdatePolicy { INVALIDATE, CACHE }
 Local Update Policy enum. More...
 

Public Member Functions

 NearCacheConfig (const char *cacheName)
 
 NearCacheConfig (const char *cacheName, InMemoryFormat memoryFormat)
 
 NearCacheConfig (int32_t timeToLiveSeconds, int32_t maxIdleSeconds, bool invalidateOnChange, InMemoryFormat inMemoryFormat, boost::shared_ptr< EvictionConfig< K, V > > evictConfig)
 
 NearCacheConfig (const NearCacheConfig< K, V > &config)
 
const std::string & getName () const
 Gets the name of the Near Cache. More...
 
NearCacheConfigsetName (const std::string &name)
 Sets the name of the Near Cache. More...
 
int32_t getTimeToLiveSeconds () const
 Gets the maximum number of seconds for each entry to stay in the Near Cache. More...
 
NearCacheConfigsetTimeToLiveSeconds (int32_t timeToLiveSeconds)
 Sets the maximum number of seconds for each entry to stay in the Near Cache. More...
 
int32_t getMaxIdleSeconds () const
 Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read). More...
 
NearCacheConfigsetMaxIdleSeconds (int32_t maxIdleSeconds)
 Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read). More...
 
bool isInvalidateOnChange () const
 True to evict the cached entries if the entries are changed (updated or removed). More...
 
NearCacheConfigsetInvalidateOnChange (bool invalidateOnChange)
 True to evict the cached entries if the entries are changed (updated or removed). More...
 
const InMemoryFormat & getInMemoryFormat () const
 Gets the data type used to store entries. More...
 
virtual NearCacheConfigsetInMemoryFormat (const InMemoryFormat &inMemoryFormat)
 Sets the data type used to store entries. More...
 
bool isCacheLocalEntries () const
 If true, cache local entries also. More...
 
NearCacheConfigsetCacheLocalEntries (bool cacheLocalEntries)
 True to cache local entries also. More...
 
const LocalUpdatePolicygetLocalUpdatePolicy () const
 
NearCacheConfigsetLocalUpdatePolicy (const LocalUpdatePolicy &localUpdatePolicy)
 
const boost::shared_ptr< EvictionConfig< K, V > > & getEvictionConfig () const
 The eviction configuration. More...
 
NearCacheConfigsetEvictionConfig (const boost::shared_ptr< EvictionConfig< K, V > > &evictionConfig)
 Sets the eviction configuration. More...
 
std::ostream & operator<< (std::ostream &out)
 

Static Public Attributes

static const int32_t DEFAULT_TTL_SECONDS = 0
 Default value of the time to live in seconds.
 
static const int32_t DEFAULT_MAX_IDLE_SECONDS = 0
 Default value of the idle time for eviction in seconds.
 
static const InMemoryFormat DEFAULT_MEMORY_FORMAT = BINARY
 Default value for the in-memory format.
 

Detailed Description

template<typename K, typename V>
class hazelcast::client::config::NearCacheConfig< K, V >

Contains the configuration for a Near Cache.

Member Enumeration Documentation

Local Update Policy enum.

Enumerator
INVALIDATE 

INVALIDATE POLICY.

CACHE 

CACHE ON UPDATE POLICY.

Member Function Documentation

template<typename K, typename V>
const boost::shared_ptr<EvictionConfig<K, V> >& hazelcast::client::config::NearCacheConfig< K, V >::getEvictionConfig ( ) const
inline

The eviction configuration.

Returns
The eviction configuration.
template<typename K, typename V>
const InMemoryFormat& hazelcast::client::config::NearCacheConfig< K, V >::getInMemoryFormat ( ) const
inline

Gets the data type used to store entries.

Possible values: BINARY (default): keys and values are stored as binary data. OBJECT: values are stored in their object forms.

Returns
The data type used to store entries.
template<typename K, typename V>
int32_t hazelcast::client::config::NearCacheConfig< K, V >::getMaxIdleSeconds ( ) const
inline

Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).

Entries that are not read (touched) more than max-idle-seconds value will get removed from the Near Cache.

Returns
Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
template<typename K, typename V>
const std::string& hazelcast::client::config::NearCacheConfig< K, V >::getName ( ) const
inline

Gets the name of the Near Cache.

Returns
The name of the Near Cache.
template<typename K, typename V>
int32_t hazelcast::client::config::NearCacheConfig< K, V >::getTimeToLiveSeconds ( ) const
inline

Gets the maximum number of seconds for each entry to stay in the Near Cache.

Entries that are older than time-to-live-seconds will get automatically evicted from the Near Cache.

Returns
The maximum number of seconds for each entry to stay in the Near Cache.
template<typename K, typename V>
bool hazelcast::client::config::NearCacheConfig< K, V >::isCacheLocalEntries ( ) const
inline

If true, cache local entries also.

This is useful when in-memory-format for Near Cache is different than the map's one.

Returns
True if local entries are cached also.
template<typename K, typename V>
bool hazelcast::client::config::NearCacheConfig< K, V >::isInvalidateOnChange ( ) const
inline

True to evict the cached entries if the entries are changed (updated or removed).

When true, the member listens for cluster-wide changes on the entries and invalidates them on change. Changes done on the local member always invalidate the cache.

Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setCacheLocalEntries ( bool  cacheLocalEntries)
inline

True to cache local entries also.

This is useful when in-memory-format for Near Cache is different than the map's one.

Parameters
cacheLocalEntriesTrue to cache local entries also.
Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setEvictionConfig ( const boost::shared_ptr< EvictionConfig< K, V > > &  evictionConfig)
inline

Sets the eviction configuration.

Parameters
evictionConfigThe eviction configuration.
Returns
This Near Cache config instance.
template<typename K, typename V>
virtual NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setInMemoryFormat ( const InMemoryFormat &  inMemoryFormat)
inlinevirtual

Sets the data type used to store entries.

Possible values: BINARY (default): keys and values are stored as binary data. OBJECT: values are stored in their object forms.

Parameters
inMemoryFormatThe data type used to store entries.
Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setInvalidateOnChange ( bool  invalidateOnChange)
inline

True to evict the cached entries if the entries are changed (updated or removed).

If set to true, the member will listen for cluster-wide changes on the entries and invalidate them on change. Changes done on the local member always invalidate the cache.

Parameters
invalidateOnChangeTrue to evict the cached entries if the entries are changed (updated or removed), false otherwise.
Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setMaxIdleSeconds ( int32_t  maxIdleSeconds)
inline

Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).

Entries that are not read (touched) more than max-idle-seconds value will get removed from the Near Cache. Any integer between 0 and Integer.MAX_VALUE. 0 means Integer.MAX_VALUE. Default is 0.

Parameters
maxIdleSecondsMaximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setName ( const std::string &  name)
inline

Sets the name of the Near Cache.

Parameters
nameThe name of the Near Cache.
Returns
This Near Cache config instance.
template<typename K, typename V>
NearCacheConfig& hazelcast::client::config::NearCacheConfig< K, V >::setTimeToLiveSeconds ( int32_t  timeToLiveSeconds)
inline

Sets the maximum number of seconds for each entry to stay in the Near Cache.

Entries that are older than time-to-live-seconds will get automatically evicted from the Near Cache. Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.

Parameters
timeToLiveSecondsThe maximum number of seconds for each entry to stay in the Near Cache.
Returns
This Near Cache config instance.

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