Apache Geode Native C++ Reference 1.15.0
apache::geode::client::RegionFactory Class Reference

Provides for the configuration and creation of instances of Region. More...

#include <RegionFactory.hpp>

Public Member Functions

std::shared_ptr< Regioncreate (std::string name)
 Create a Region of the given name. More...
 
RegionFactorysetCacheListener (const std::shared_ptr< CacheListener > &aListener)
 Sets the CacheListener for the next RegionAttributes created. More...
 
RegionFactorysetCacheListener (const std::string &libpath, const std::string &factoryFuncName)
 Sets the library path for the library that will be invoked for the listener of the region. More...
 
RegionFactorysetCacheLoader (const std::shared_ptr< CacheLoader > &cacheLoader)
 Sets the cache loader for the next RegionAttributes created. More...
 
RegionFactorysetCacheLoader (const std::string &libpath, const std::string &factoryFuncName)
 Sets the library path for the library that will be invoked for the loader of the region. More...
 
RegionFactorysetCacheWriter (const std::shared_ptr< CacheWriter > &cacheWriter)
 Sets the cache writer for the next RegionAttributes created. More...
 
RegionFactorysetCacheWriter (const std::string &libpath, const std::string &factoryFuncName)
 Sets the library path for the library that will be invoked for the writer of the region. More...
 
RegionFactorysetCachingEnabled (bool cachingEnabled)
 Set caching enabled flag for this region. More...
 
RegionFactorysetConcurrencyChecksEnabled (bool enable)
 Enables or disables concurrent modification checks. More...
 
RegionFactorysetConcurrencyLevel (uint8_t concurrencyLevel)
 Sets the concurrency level tof the next RegionAttributes created. More...
 
RegionFactorysetDiskPolicy (const DiskPolicyType diskPolicy)
 Sets the Disk policy type for the next RegionAttributes created. More...
 
RegionFactorysetEntryIdleTimeout (ExpirationAction action, std::chrono::seconds idleTimeout)
 Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created. More...
 
RegionFactorysetEntryTimeToLive (ExpirationAction action, std::chrono::seconds timeToLive)
 Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created. More...
 
RegionFactorysetInitialCapacity (int initialCapacity)
 Sets the entry initial capacity for the next RegionAttributes created. More...
 
RegionFactorysetLoadFactor (float loadFactor)
 Sets the entry load factor for the next RegionAttributes created. More...
 
RegionFactorysetLruEntriesLimit (const uint32_t entriesLimit)
 Sets a limit on the number of entries that will be held in the cache. More...
 
RegionFactorysetPartitionResolver (const std::shared_ptr< PartitionResolver > &aResolver)
 Sets the PartitionResolver for the next RegionAttributes created. More...
 
RegionFactorysetPartitionResolver (const std::string &libpath, const std::string &factoryFuncName)
 Sets the library path for the library that will be invoked for the partition resolver of the region. More...
 
RegionFactorysetPersistenceManager (const std::shared_ptr< PersistenceManager > &persistenceManager, const std::shared_ptr< Properties > &config=nullptr)
 Sets the PersistenceManager for the next RegionAttributes created. More...
 
RegionFactorysetPersistenceManager (const std::string &libpath, const std::string &factoryFuncName, const std::shared_ptr< Properties > &config=nullptr)
 Sets the library path for the library that will be invoked for the persistence of the region. More...
 
RegionFactorysetRegionIdleTimeout (ExpirationAction action, std::chrono::seconds idleTimeout)
 Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created. More...
 
RegionFactorysetRegionTimeToLive (ExpirationAction action, std::chrono::seconds timeToLive)
 Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created. More...
 

Detailed Description

Provides for the configuration and creation of instances of Region.

Member Function Documentation

◆ create()

std::shared_ptr< Region > apache::geode::client::RegionFactory::create ( std::string  name)

Create a Region of the given name.

Parameters
namethe name of the Region.
Exceptions
RegionExistsExceptionif a region is already in this cache
CacheClosedExceptionif the cache is closed

◆ setCacheListener() [1/2]

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

Sets the CacheListener for the next RegionAttributes created.

Parameters
aListenera user defined CacheListener, nullptr if no listener
Returns
a reference to this

◆ setCacheListener() [2/2]

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

Sets the library path for the library that will be invoked for the listener of the region.

Returns
a reference to this

◆ setCacheLoader() [1/2]

RegionFactory & apache::geode::client::RegionFactory::setCacheLoader ( const std::shared_ptr< CacheLoader > &  cacheLoader)

Sets the cache loader for the next RegionAttributes created.

Parameters
cacheLoaderthe cache loader or nullptr if no loader
Returns
a reference to this

◆ setCacheLoader() [2/2]

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

Sets the library path for the library that will be invoked for the loader of the region.

Returns
a reference to this

◆ setCacheWriter() [1/2]

RegionFactory & apache::geode::client::RegionFactory::setCacheWriter ( const std::shared_ptr< CacheWriter > &  cacheWriter)

Sets the cache writer for the next RegionAttributes created.

Parameters
cacheWriterthe cache writer or nullptr if no cache writer
Returns
a reference to this

◆ setCacheWriter() [2/2]

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

Sets the library path for the library that will be invoked for the writer of the region.

Returns
a reference to this

◆ setCachingEnabled()

RegionFactory & apache::geode::client::RegionFactory::setCachingEnabled ( bool  cachingEnabled)

Set caching enabled flag for this region.

If set to false, then no data is stored in the local process, but events and distributions will still occur, and the region can still be used to put and remove, etc... The default if not set is 'true', 'false' is illegal for regions of 'local' scope. This also requires that interestLists are turned off for the region.

Parameters
cachingEnabledif true, cache data for this region in this process.
Returns
a reference to this

◆ setConcurrencyChecksEnabled()

RegionFactory & apache::geode::client::RegionFactory::setConcurrencyChecksEnabled ( bool  enable)

Enables or disables concurrent modification checks.

Since
7.0
Parameters
enablewhether to perform concurrency checks on operations
Returns
a reference to this

◆ setConcurrencyLevel()

RegionFactory & apache::geode::client::RegionFactory::setConcurrencyLevel ( uint8_t  concurrencyLevel)

Sets the concurrency level tof the next RegionAttributes created.

This value is used in initializing the map that holds the entries.

Parameters
concurrencyLevelthe concurrency level of the entry map
Returns
a reference to this
Exceptions
IllegalArgumentExceptionif concurrencyLevel is nonpositive

◆ setDiskPolicy()

RegionFactory & apache::geode::client::RegionFactory::setDiskPolicy ( const DiskPolicyType  diskPolicy)

Sets the Disk policy type for the next RegionAttributes created.

Parameters
diskPolicythe type of disk policy to use for the region
Returns
a reference to this
Exceptions
IllegalArgumentExceptionif diskPolicyType is Invalid

◆ setEntryIdleTimeout()

RegionFactory & apache::geode::client::RegionFactory::setEntryIdleTimeout ( ExpirationAction  action,
std::chrono::seconds  idleTimeout 
)

Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created.

Parameters
actionthe expiration action for entries in this region.
idleTimeoutthe idleTimeout for entries in this region.
Returns
a reference to this

◆ setEntryTimeToLive()

RegionFactory & apache::geode::client::RegionFactory::setEntryTimeToLive ( ExpirationAction  action,
std::chrono::seconds  timeToLive 
)

Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created.

Parameters
actionthe expiration action for entries in this region.
timeToLivethe timeToLive for entries in this region.
Returns
a reference to this

◆ setInitialCapacity()

RegionFactory & apache::geode::client::RegionFactory::setInitialCapacity ( int  initialCapacity)

Sets the entry initial capacity for the next RegionAttributes created.

This value is used in initializing the map that holds the entries.

Parameters
initialCapacitythe initial capacity of the entry map
Returns
a reference to this
Exceptions
IllegalArgumentExceptionif initialCapacity is negative.

◆ setLoadFactor()

RegionFactory & apache::geode::client::RegionFactory::setLoadFactor ( float  loadFactor)

Sets the entry load factor for the next RegionAttributes created.

This value is used in initializing the map that holds the entries.

Parameters
loadFactorthe load factor of the entry map
Returns
a reference to this
Exceptions
IllegalArgumentExceptionif loadFactor is nonpositive

◆ setLruEntriesLimit()

RegionFactory & apache::geode::client::RegionFactory::setLruEntriesLimit ( const uint32_t  entriesLimit)

Sets a limit on the number of entries that will be held in the cache.

If a new entry is added while at the limit, the cache will evict the least recently used entry. Defaults to 0, meaning no LRU actions will used.

Parameters
entriesLimitnumber of enteries to keep in region
Returns
a reference to this

◆ setPartitionResolver() [1/2]

RegionFactory & apache::geode::client::RegionFactory::setPartitionResolver ( const std::shared_ptr< PartitionResolver > &  aResolver)

Sets the PartitionResolver for the next RegionAttributes created.

Parameters
aResolvera user defined PartitionResolver, nullptr if no resolver
Returns
a reference to this

◆ setPartitionResolver() [2/2]

RegionFactory & apache::geode::client::RegionFactory::setPartitionResolver ( const std::string &  libpath,
const std::string &  factoryFuncName 
)

Sets the library path for the library that will be invoked for the partition resolver of the region.

Returns
a reference to this

◆ setPersistenceManager() [1/2]

RegionFactory & apache::geode::client::RegionFactory::setPersistenceManager ( const std::shared_ptr< PersistenceManager > &  persistenceManager,
const std::shared_ptr< Properties > &  config = nullptr 
)

Sets the PersistenceManager for the next RegionAttributes created.

Parameters
persistenceManagera user defined PersistenceManager, nullptr if no persistenceManager
Returns
a reference to this

◆ setPersistenceManager() [2/2]

RegionFactory & apache::geode::client::RegionFactory::setPersistenceManager ( const std::string &  libpath,
const std::string &  factoryFuncName,
const std::shared_ptr< Properties > &  config = nullptr 
)

Sets the library path for the library that will be invoked for the persistence of the region.

If the region is being created from a client on a server, or on a server directly, then this must be used to set the PersistenceManager.

Returns
a reference to this

◆ setRegionIdleTimeout()

RegionFactory & apache::geode::client::RegionFactory::setRegionIdleTimeout ( ExpirationAction  action,
std::chrono::seconds  idleTimeout 
)

Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created.

Parameters
actionthe expiration action for entries in this region.
idleTimeoutthe idleTimeout for the region as a whole.
Returns
a reference to this

◆ setRegionTimeToLive()

RegionFactory & apache::geode::client::RegionFactory::setRegionTimeToLive ( ExpirationAction  action,
std::chrono::seconds  timeToLive 
)

Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created.

Parameters
actionthe expiration action for entries in this region.
timeToLivethe timeToLive for the region as a whole.
Returns
a reference to this

Apache Geode C++ Cache API Documentation