VMware Tanzu GemFire Native .NET Reference 10.3.0
Apache::Geode::Client::RegionAttributesFactory< TKey, TValue > Class Template Reference

Factory class to create instances of RegionAttributes. More...

#include <RegionAttributesFactory.hpp>

Public Member Functions

RegionAttributes< TKey, TValue > ^ Create ()
 Creates a RegionAttributes with the current settings. More...
 
 RegionAttributesFactory ()
 Creates a new RegionAttributesFactory ready to create a RegionAttributes with default settings. More...
 
 RegionAttributesFactory (RegionAttributes< TKey, TValue >^ regionAttributes)
 Creates a new instance of RegionAttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheListener (ICacheListener< TKey, TValue >^ cacheListener)
 Sets the CacheListener for the RegionAttributes being created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheListener (String^ libPath, String^ factoryFunctionName)
 Sets the library path for the library that will be invoked for the listener of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheLoader (ICacheLoader< TKey, TValue >^ cacheLoader)
 Sets the cache loader for the RegionAttributes being created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheLoader (String^ libPath, String^ factoryFunctionName)
 Sets the library path for the library that will be invoked for the loader of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheWriter (ICacheWriter< TKey, TValue >^ cacheWriter)
 Sets the cache writer for the RegionAttributes being created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCacheWriter (String^ libPath, String^ factoryFunctionName)
 Sets the library path for the library that will be invoked for the writer of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCachingEnabled (bool cachingEnabled)
 Set caching enabled flag for this region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetCloningEnabled (bool cloningEnabled)
 Set cloning enabled flag for this region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetConcurrencyChecksEnabled (bool concurrencyChecksEnabled)
 Sets concurrency checks enabled flag for this region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetConcurrencyLevel (System::Int32 concurrencyLevel)
 Sets the concurrency level of the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetDiskPolicy (DiskPolicyType diskPolicy)
 Sets the disk policy type for the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetEntryIdleTimeout (ExpirationAction action, TimeSpan idleTimeout)
 Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetEntryTimeToLive (ExpirationAction action, TimeSpan timeToLive)
 Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetInitialCapacity (System::Int32 initialCapacity)
 Sets the entry initial capacity for the RegionAttributes being created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetLoadFactor (Single loadFactor)
 Sets the entry load factor for the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetLruEntriesLimit (System::UInt32 entriesLimit)
 Sets a limit on the number of entries that will be held in the cache. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPartitionResolver (IPartitionResolver< TKey, TValue >^ partitionresolver)
 Sets the PartitionResolver for the RegionAttributes being created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPartitionResolver (String^ libPath, String^ factoryFunctionName)
 Sets the library path for the library that will be invoked for the partition resolver of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPersistenceManager (IPersistenceManager< TKey, TValue >^ persistenceManager)
 Sets the PersistenceManager object that will be invoked for the persistence of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPersistenceManager (IPersistenceManager< TKey, TValue >^ persistenceManager, Properties< String^, String^>^ config)
 Sets the PersistenceManager object that will be invoked for the persistence of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPersistenceManager (String^ libPath, String^ factoryFunctionName)
 Sets the library path for the library that will be invoked for the persistence of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPersistenceManager (String^ libPath, String^ factoryFunctionName, Properties< String^, String^>^ config)
 Sets the library path for the library that will be invoked for the persistence of the region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetPoolName (String^ poolName)
 Set the pool name for a Thin Client region. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetRegionIdleTimeout (ExpirationAction action, TimeSpan idleTimeout)
 Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created. More...
 
RegionAttributesFactory< TKey, TValue > ^ SetRegionTimeToLive (ExpirationAction action, TimeSpan timeToLive)
 Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created. More...
 

Detailed Description

template<class TKey, class TValue>
class Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >

Factory class to create instances of RegionAttributes.

An RegionAttributesFactory instance maintains state for creating RegionAttributes instances. The setter methods are used to change the settings that will be used for creating the next attributes instance with the Create method. If you create a factory with the default constructor, then the factory is set up to create attributes with all default settings. You can also create a factory by providing a preset RegionAttributes.

Once a RegionAttributes is created, it can only be modified after it has been used to create a Region, and then only by using an AttributesMutator obtained from the region.

Attributes

Callbacks

[default: null]

User-implemented plug-in for loading data on cache misses.
see SetCacheLoader, RegionAttributes.CacheLoader

[default: null]

User-implemented plug-in for intercepting cache modifications, e.g. for writing to an external data source.
see SetCacheWriter, RegionAttributes.CacheWriter

[default: null]

User-implemented plug-in for receiving and handling cache-related events.
see SetCacheListener, RegionAttributes.CacheListener

[default: null]
User-implemented plug-in for custom partitioning.
see SetPartitionResolver, RegionAttributes.PartitionResolver

Expiration

RegionTimeToLive [default: no expiration]

Expiration configuration for the entire region based on the lastModifiedTime ( CacheStatistics.LastModifiedTime ).
see SetRegionTimeToLive, RegionAttributes.RegionTimeToLive, AttributesMutator.SetRegionTimeToLive

RegionIdleTimeout [default: no expiration]

Expiration configuration for the entire region based on the lastAccessedTime ( CacheStatistics.LastAccessedTime ).
see SetRegionIdleTimeout, RegionAttributes.RegionIdleTimeout, AttributesMutator.SetRegionIdleTimeout

EntryTimeToLive [default: no expiration]

Expiration configuration for individual entries based on the lastModifiedTime ( CacheStatistics.LastModifiedTime ).
see SetEntryTimeToLive, RegionAttributes.EntryTimeToLive, AttributesMutator.SetEntryTimeToLive

EntryIdleTimeout [default: no expiration]
Expiration configuration for individual entries based on the lastAccessedTime ( CacheStatistics.LastAccessedTime ).
see SetEntryIdleTimeout, RegionAttributes.EntryIdleTimeout, AttributesMutator.SetEntryIdleTimeout

Storage

InitialCapacity [default: 16]

The initial capacity of the map used for storing the entries.
see SetInitialCapacity, RegionAttributes.InitialCapacity

LoadFactor [default: 0.75]

The load factor of the map used for storing the entries.
see SetLoadFactor, RegionAttributes.LoadFactor

ConcurrencyLevel [default: 16]

The allowed concurrency among updates to values in the region is guided by the concurrencyLevel, which is used as a hint for internal sizing. The actual concurrency will vary. Ideally, you should choose a value to accommodate as many threads as will ever concurrently modify values in the region. Using a significantly higher value than you need can waste space and time, and a significantly lower value can lead to thread contention. But overestimates and underestimates within an order of magnitude do not usually have much noticeable impact. A value of one is appropriate when it is known that only one thread will modify and all others will only read.
see SetConcurrencyLevel, RegionAttributes.ConcurrencyLevel

See also
RegionAttributes, AttributesMutator, Region.CreateSubRegion

Constructor & Destructor Documentation

◆ RegionAttributesFactory() [1/2]

template<class TKey , class TValue >
Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::RegionAttributesFactory ( )
inline

Creates a new RegionAttributesFactory ready to create a RegionAttributes with default settings.

◆ RegionAttributesFactory() [2/2]

template<class TKey , class TValue >
Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::RegionAttributesFactory ( RegionAttributes< TKey, TValue >^  regionAttributes)

Creates a new instance of RegionAttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes.

Parameters
regionAttributesattributes used to initialize this RegionAttributesFactory

Member Function Documentation

◆ Create()

template<class TKey , class TValue >
RegionAttributes< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::Create ( )

Creates a RegionAttributes with the current settings.

Returns
the newly created RegionAttributes
Exceptions
IllegalStateExceptionif the current settings violate the compatibility rules.

◆ SetCacheListener() [1/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheListener ( ICacheListener< TKey, TValue >^  cacheListener)

Sets the CacheListener for the RegionAttributes being created.

Parameters
cacheListeneruser-defined cache listener, or null for no cache listener

◆ SetCacheListener() [2/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheListener ( String^  libPath,
String^  factoryFunctionName 
)

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

Parameters
libPathlibrary pathname containing the factory function.
factoryFunctionNameName of factory function that creates a CacheListener for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheListener for a managed library.

◆ SetCacheLoader() [1/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheLoader ( ICacheLoader< TKey, TValue >^  cacheLoader)

Sets the cache loader for the RegionAttributes being created.

Parameters
cacheLoadera user-defined cache loader, or null for no cache loader

◆ SetCacheLoader() [2/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheLoader ( String^  libPath,
String^  factoryFunctionName 
)

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

Parameters
libPathlibrary pathname containing the factory function.
factoryFunctionNameName of factory function that creates a CacheLoader for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheLoader for a managed library.

◆ SetCacheWriter() [1/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheWriter ( ICacheWriter< TKey, TValue >^  cacheWriter)

Sets the cache writer for the RegionAttributes being created.

Parameters
cacheWriteruser-defined cache writer, or null for no cache writer

◆ SetCacheWriter() [2/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCacheWriter ( String^  libPath,
String^  factoryFunctionName 
)

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

Parameters
libPathlibrary pathname containing the factory function.
factoryFunctionNameName of factory function that creates a CacheWriter for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an ICacheWriter for a managed library.

◆ SetCachingEnabled()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::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 ScopeType.Local scope.

Parameters
cachingEnabledif true, cache data for this region in this process.

◆ SetCloningEnabled()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetCloningEnabled ( bool  cloningEnabled)

Set cloning enabled flag for this region.

If set to false, then there is no cloning will take place in case of delta. Delta will be applied on the old value which will change old value in-place.

The default if not set is 'false' of ScopeType.Local scope.

Parameters
cloningEnabledif true, clone old value before applying delta so that in-place change would not occour..

◆ SetConcurrencyChecksEnabled()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetConcurrencyChecksEnabled ( bool  concurrencyChecksEnabled)

Sets concurrency checks enabled flag for this region.

If set to false, then the version checks will not occur.

The default if not set is 'true'

Parameters
concurrencyChecksEnabledif true, version checks for region entries will occur.

◆ SetConcurrencyLevel()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetConcurrencyLevel ( System::Int32  concurrencyLevel)

Sets the concurrency level of the next RegionAttributes created.

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

Parameters
concurrencyLevelthe concurrency level of the entry map
Exceptions
IllegalArgumentExceptionif concurrencyLevel is nonpositive

◆ SetDiskPolicy()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetDiskPolicy ( DiskPolicyType  diskPolicy)

Sets the disk policy type for the next RegionAttributes created.

Parameters
diskPolicythe disk policy to use for the region

◆ SetEntryIdleTimeout()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetEntryIdleTimeout ( ExpirationAction  action,
TimeSpan  idleTimeout 
)

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

Parameters
actionThe expiration action for which to set the timeout.
idleTimeoutthe idleTimeout in seconds for entries in this region.

◆ SetEntryTimeToLive()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetEntryTimeToLive ( ExpirationAction  action,
TimeSpan  timeToLive 
)

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

Parameters
actionThe expiration action for which to set the timeout.
timeToLivethe timeToLive in seconds for entries in this region.

◆ SetInitialCapacity()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetInitialCapacity ( System::Int32  initialCapacity)

Sets the entry initial capacity for the RegionAttributes being created.

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

Parameters
initialCapacitythe initial capacity of the entry map
Exceptions
IllegalArgumentExceptionif initialCapacity is nonpositive

◆ SetLoadFactor()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetLoadFactor ( Single  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
Exceptions
IllegalArgumentExceptionif loadFactor is nonpositive

◆ SetLruEntriesLimit()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetLruEntriesLimit ( System::UInt32  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.

Parameters
entriesLimitThe limit of the number of entries before eviction starts. Defaults to 0, meaning no LRU actions will used.

◆ SetPartitionResolver() [1/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPartitionResolver ( IPartitionResolver< TKey, TValue >^  partitionresolver)

Sets the PartitionResolver for the RegionAttributes being created.

Parameters
partitionresolveruser-defined partition resolver, or null for no partition resolver

◆ SetPartitionResolver() [2/2]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPartitionResolver ( String^  libPath,
String^  factoryFunctionName 
)

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

Parameters
libPathlibrary pathname containing the factory function.
factoryFunctionNameName of factory function that creates a PartitionResolver for a native library, or the name of the method in the form {Namespace}.{Class Name}.{Method Name} that creates an IPartitionResolver for a managed library.

◆ SetPersistenceManager() [1/4]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPersistenceManager ( IPersistenceManager< TKey, TValue >^  persistenceManager)

Sets the PersistenceManager object that will be invoked for the persistence of the region.

Parameters
persistenceManagerPersistence Manager object

◆ SetPersistenceManager() [2/4]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPersistenceManager ( IPersistenceManager< TKey, TValue >^  persistenceManager,
Properties< String^, String^>^  config 
)

Sets the PersistenceManager object that will be invoked for the persistence of the region.

Parameters
persistenceManagerPersistence Manager object
configThe configuration properties to use for the PersistenceManager.

◆ SetPersistenceManager() [3/4]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPersistenceManager ( String^  libPath,
String^  factoryFunctionName 
)

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.

Parameters
libPathThe path of the PersistenceManager shared library.
factoryFunctionNameThe name of the factory function to create an instance of PersistenceManager object.

◆ SetPersistenceManager() [4/4]

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPersistenceManager ( String^  libPath,
String^  factoryFunctionName,
Properties< String^, String^>^  config 
)

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.

Parameters
libPathThe path of the PersistenceManager shared library.
factoryFunctionNameThe name of the factory function to create an instance of PersistenceManager object.
configThe configuration properties to use for the PersistenceManager.

◆ SetPoolName()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetPoolName ( String^  poolName)

Set the pool name for a Thin Client region.

The pool with the name specified must be already created.

Parameters
poolNameThe name of the pool to attach to this region.

◆ SetRegionIdleTimeout()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetRegionIdleTimeout ( ExpirationAction  action,
TimeSpan  idleTimeout 
)

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

Parameters
actionThe expiration action for which to set the timeout.
idleTimeoutthe idleTimeout in seconds for the region as a whole.

◆ SetRegionTimeToLive()

template<class TKey , class TValue >
RegionAttributesFactory< TKey, TValue > ^ Apache::Geode::Client::RegionAttributesFactory< TKey, TValue >::SetRegionTimeToLive ( ExpirationAction  action,
TimeSpan  timeToLive 
)

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

Parameters
actionThe expiration action for which to set the timeout.
timeToLivethe timeToLive in seconds for the region as a whole.

Apache Geode C++ Cache .NET API Documentation