VMware Tanzu GemFire Native C++ Reference 10.3.0
apache::geode::client::AttributesMutator Class Reference

Supports modification of certain region attributes after the region has been created. More...

#include <AttributesMutator.hpp>

Public Member Functions

 AttributesMutator (const std::shared_ptr< Region > &region)
 Internal constructor. More...
 
void setCacheListener (const std::shared_ptr< CacheListener > &aListener)
 Sets cache listener for region. More...
 
void setCacheListener (const std::string &libpath, const std::string &factoryFuncName)
 Sets cache listener for region. More...
 
void setCacheLoader (const std::shared_ptr< CacheLoader > &aLoader)
 Sets cache loader for region. More...
 
void setCacheLoader (const std::string &libpath, const std::string &factoryFuncName)
 Sets cache loader for region. More...
 
void setCacheWriter (const std::shared_ptr< CacheWriter > &aWriter)
 Sets cache writer for region. More...
 
void setCacheWriter (const std::string &libpath, const std::string &factoryFuncName)
 Sets cache writer for region. More...
 
std::chrono::seconds setEntryIdleTimeout (std::chrono::seconds idleTimeout)
 Sets the idleTimeout duration for region entries. More...
 
ExpirationAction setEntryIdleTimeoutAction (ExpirationAction action)
 Set the idleTimeout Action for region entries. More...
 
std::chrono::seconds setEntryTimeToLive (std::chrono::seconds timeToLive)
 Sets the timeToLive duration for region entries. More...
 
ExpirationAction setEntryTimeToLiveAction (ExpirationAction action)
 Set the timeToLive Action for region entries. More...
 
uint32_t setLruEntriesLimit (uint32_t entriesLimit)
 Sets the Maximum entry count in the region before LRU eviction. More...
 
std::chrono::seconds setRegionIdleTimeout (std::chrono::seconds idleTimeout)
 Sets the idleTimeout duration for the region itself. More...
 
ExpirationAction setRegionIdleTimeoutAction (ExpirationAction action)
 Set the idleTimeout Action for the region itself. More...
 
std::chrono::seconds setRegionTimeToLive (std::chrono::seconds timeToLive)
 Sets the timeToLive duration for the region itself. More...
 
ExpirationAction setRegionTimeToLiveAction (ExpirationAction action)
 Set the timeToLive Action for the region itself. More...
 

Detailed Description

Supports modification of certain region attributes after the region has been created.

It is required that the attributes be completely initialized using an RegionAttributesFactory before creating the region. AttributesMutator can be applied to adjusting and tuning a subset of attributes that are modifiable at runtime.

The setter methods all return the previous value of the attribute.

See also
Region::getAttributesMutator
RegionAttributes
RegionAttributesFactory

Constructor & Destructor Documentation

◆ AttributesMutator()

apache::geode::client::AttributesMutator::AttributesMutator ( const std::shared_ptr< Region > &  region)
explicit

Internal constructor.

Use Region::getAttributesMutator() to acquire the mutator for a region.

Member Function Documentation

◆ setCacheListener() [1/2]

void apache::geode::client::AttributesMutator::setCacheListener ( const std::shared_ptr< CacheListener > &  aListener)

Sets cache listener for region.

The previous cache listener will be replaced with aListener.

Parameters
aListenercache listener

◆ setCacheListener() [2/2]

void apache::geode::client::AttributesMutator::setCacheListener ( const std::string &  libpath,
const std::string &  factoryFuncName 
)

Sets cache listener for region.

The previous cache listener will be replaced with a listener created using the factory function provided in the given library.

Parameters
libpathpath of the library containing cache listener factory function.
factoryFuncNamefactory function for creating cache listener.

◆ setCacheLoader() [1/2]

void apache::geode::client::AttributesMutator::setCacheLoader ( const std::shared_ptr< CacheLoader > &  aLoader)

Sets cache loader for region.

The previous cache loader will be replaced with aLoader.

Parameters
aLoadercache loader

◆ setCacheLoader() [2/2]

void apache::geode::client::AttributesMutator::setCacheLoader ( const std::string &  libpath,
const std::string &  factoryFuncName 
)

Sets cache loader for region.

The previous cache loader will be replaced with a loader created using the factory function provided in the given library.

Parameters
libpathpath of the library containing cache loader factory function.
factoryFuncNamefactory function for creating cache loader.

◆ setCacheWriter() [1/2]

void apache::geode::client::AttributesMutator::setCacheWriter ( const std::shared_ptr< CacheWriter > &  aWriter)

Sets cache writer for region.

The previous cache writer will be replaced with aWriter.

Parameters
aWritercache writer

◆ setCacheWriter() [2/2]

void apache::geode::client::AttributesMutator::setCacheWriter ( const std::string &  libpath,
const std::string &  factoryFuncName 
)

Sets cache writer for region.

The previous cache writer will be replaced with a writer created using the factory function provided in the given library.

Parameters
libpathpath of the library containing cache writer factory function.
factoryFuncNamefactory function for creating cache writer.

◆ setEntryIdleTimeout()

std::chrono::seconds apache::geode::client::AttributesMutator::setEntryIdleTimeout ( std::chrono::seconds  idleTimeout)

Sets the idleTimeout duration for region entries.

Parameters
idleTimeoutthe idleTimeout for entries in this region.
Returns
the previous value.
Exceptions
IllegalStateExceptionif the new idleTimeout changes entry expiration from disabled to enabled or enabled to disabled.

◆ setEntryIdleTimeoutAction()

ExpirationAction apache::geode::client::AttributesMutator::setEntryIdleTimeoutAction ( ExpirationAction  action)

Set the idleTimeout Action for region entries.

Parameters
actionthe idleTimeout ExpirationAction for entries in this region.
Returns
the previous value.

◆ setEntryTimeToLive()

std::chrono::seconds apache::geode::client::AttributesMutator::setEntryTimeToLive ( std::chrono::seconds  timeToLive)

Sets the timeToLive duration for region entries.

Parameters
timeToLivethe timeToLive for entries in this region.
Returns
the previous value.
Exceptions
IllegalStateExceptionif the new timeToLive changes entry expiration from disabled to enabled or enabled to disabled.

◆ setEntryTimeToLiveAction()

ExpirationAction apache::geode::client::AttributesMutator::setEntryTimeToLiveAction ( ExpirationAction  action)

Set the timeToLive Action for region entries.

Parameters
actionthe timeToLive ExpirationAction for entries in this region.
Returns
the previous value.

◆ setLruEntriesLimit()

uint32_t apache::geode::client::AttributesMutator::setLruEntriesLimit ( uint32_t  entriesLimit)

Sets the Maximum entry count in the region before LRU eviction.

Parameters
entriesLimitthe number of entries to allow.
Returns
the previous value.
Exceptions
IllegalStateExceptionif the new entriesLimit changes LRU from disabled to enabled or enabled to disabled.

◆ setRegionIdleTimeout()

std::chrono::seconds apache::geode::client::AttributesMutator::setRegionIdleTimeout ( std::chrono::seconds  idleTimeout)

Sets the idleTimeout duration for the region itself.

Parameters
idleTimeoutthe ExpirationAttributes for this region idleTimeout
Returns
the previous value.
Exceptions
IllegalStateExceptionif the new idleTimeout changes region expiration from disabled to enabled or enabled to disabled.

◆ setRegionIdleTimeoutAction()

ExpirationAction apache::geode::client::AttributesMutator::setRegionIdleTimeoutAction ( ExpirationAction  action)

Set the idleTimeout Action for the region itself.

Parameters
actionthe idleTimeout ExpirationAction for this region.
Returns
the previous value.

◆ setRegionTimeToLive()

std::chrono::seconds apache::geode::client::AttributesMutator::setRegionTimeToLive ( std::chrono::seconds  timeToLive)

Sets the timeToLive duration for the region itself.

Parameters
timeToLivethe ExpirationAttributes for this region timeToLive
Returns
the previous value.
Exceptions
IllegalStateExceptionif the new timeToLive changes region expiration from disabled to enabled or enabled to disabled.

◆ setRegionTimeToLiveAction()

ExpirationAction apache::geode::client::AttributesMutator::setRegionTimeToLiveAction ( ExpirationAction  action)

Set the timeToLive Action for the region itself.

Parameters
actionthe timeToLive ExpirationAction for this region.
Returns
the previous value.

Apache Geode C++ Cache API Documentation