VMware GemFire Native .NET Reference  9.2.4
Apache::Geode::Client::AttributesFactory< TKey, TValue > Class Template Reference

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

Inherits UMWrap< apache::geode::client::AttributesFactory >.

Public Member Functions

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

Factory class to create instances of RegionAttributes.

An AttributesFactory 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 CreateRegionAttributes 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

◆ AttributesFactory() [1/2]

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

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

◆ AttributesFactory() [2/2]

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

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

Parameters
regionAttributesattributes used to initialize this AttributesFactory

Member Function Documentation

◆ CreateRegionAttributes()

template<class TKey , class TValue >
RegionAttributes<TKey, TValue> ^ Apache::Geode::Client::AttributesFactory< TKey, TValue >::CreateRegionAttributes ( )

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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< TKey, TValue >::SetEntryIdleTimeout ( ExpirationAction  action,
System::UInt32  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 >
void Apache::Geode::Client::AttributesFactory< TKey, TValue >::SetEntryTimeToLive ( ExpirationAction  action,
System::UInt32  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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< 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 >
void Apache::Geode::Client::AttributesFactory< TKey, TValue >::SetRegionIdleTimeout ( ExpirationAction  action,
System::UInt32  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 >
void Apache::Geode::Client::AttributesFactory< TKey, TValue >::SetRegionTimeToLive ( ExpirationAction  action,
System::UInt32  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.

VMware GemFire .NET Cache API Documentation