Apache Ignite.NET
Apache.Ignite.Core.Cache.Configuration.CacheConfiguration Class Reference

Defines grid cache configuration. More...

Public Member Functions

 CacheConfiguration ()
 Initializes a new instance of the CacheConfiguration class. More...
 
 CacheConfiguration (string name)
 Initializes a new instance of the CacheConfiguration class. More...
 
 CacheConfiguration (string name, params Type[] queryTypes)
 Initializes a new instance of the CacheConfiguration class and populates QueryEntities according to provided query types. More...
 
 CacheConfiguration (string name, params QueryEntity[] queryEntities)
 Initializes a new instance of the CacheConfiguration class. More...
 

Public Attributes

const int DefaultRebalanceThreadPoolSize = 2
 Default size of rebalance thread pool. More...
 
const int DefaultBackups = 0
 Default number of backups. More...
 
const CacheMode DefaultCacheMode = CacheMode.Partitioned
 Default caching mode. More...
 
const CacheAtomicityMode DefaultAtomicityMode = CacheAtomicityMode.Atomic
 Default atomicity mode. More...
 
const int DefaultStartSize = 1500000
 Initial default cache size. More...
 
const int DefaultCacheSize = 100000
 Default cache size to use with eviction policy. More...
 
const bool DefaultInvalidate = false
 Default value for 'invalidate' flag that indicates if this is invalidation-based cache. More...
 
const CacheRebalanceMode DefaultRebalanceMode = CacheRebalanceMode.Async
 Default rebalance mode for distributed cache. More...
 
const int DefaultRebalanceBatchSize = 512*1024
 Default rebalance batch size in bytes. More...
 
const float DefaultMaxEvictionOverflowRatio = 10
 Default maximum eviction queue ratio. More...
 
const bool DefaultEvictSynchronized = false
 Default eviction synchronized flag. More...
 
const int DefaultEvictSynchronizedKeyBufferSize = 1024
 Default eviction key buffer size for batching synchronized evicts. More...
 
const int DefaultEvictSynchronizedConcurrencyLevel = 4
 Default synchronous eviction concurrency level. More...
 
const bool DefaultEagerTtl = true
 Default value for eager ttl flag. More...
 
const long DefaultOffHeapMaxMemory = -1
 Default off-heap storage size is { More...
 
const bool DefaultEnableSwap = false
 Default value for 'swapEnabled' flag. More...
 
const int DefaultMaxConcurrentAsyncOperations = 500
 Default value for 'maxConcurrentAsyncOps'. More...
 
const bool DefaultWriteBehindEnabled = false
 Default value for 'writeBehindEnabled' flag. More...
 
const int DefaultWriteBehindFlushSize = 10240
 Default flush size for write-behind cache store. More...
 
const int DefaultWriteBehindFlushThreadCount = 1
 Default count of flush threads for write-behind cache store. More...
 
const int DefaultWriteBehindBatchSize = 512
 Default batch size for write-behind cache store. More...
 
const bool DefaultLoadPreviousValue = false
 Default value for load previous value flag. More...
 
const CacheMemoryMode DefaultMemoryMode = CacheMemoryMode.OnheapTiered
 Default memory mode. More...
 
const bool DefaultReadFromBackup = true
 Default value for 'readFromBackup' flag. More...
 
const int DefaultSqlOnheapRowCacheSize = 10*1024
 Default size for onheap SQL row cache size. More...
 
const bool DefaultKeepVinaryInStore = true
 Default value for keep portable in store behavior . More...
 
const bool DefaultCopyOnRead = true
 Default value for 'copyOnRead' flag. More...
 
const bool DefaultReadThrough = false
 Default value for read-through behavior. More...
 
const bool DefaultWriteThrough = false
 Default value for write-through behavior. More...
 

Static Public Attributes

static readonly TimeSpan DefaultRebalanceTimeout = TimeSpan.FromMilliseconds(10000)
 Default rebalance timeout. More...
 
static readonly TimeSpan DefaultRebalanceThrottle = TimeSpan.Zero
 Time to wait between rebalance messages to avoid overloading CPU. More...
 
static readonly TimeSpan DefaultLockTimeout = TimeSpan.Zero
 Default lock timeout. More...
 
static readonly TimeSpan DefaultEvictSynchronizedTimeout = TimeSpan.FromMilliseconds(10000)
 Default synchronous eviction timeout. More...
 
static readonly TimeSpan DefaultWriteBehindFlushFrequency = TimeSpan.FromMilliseconds(5000)
 Default flush frequency for write-behind cache store. More...
 
static readonly TimeSpan DefaultLongQueryWarningTimeout = TimeSpan.FromMilliseconds(3000)
 Default timeout after which long query warning will be printed. More...
 

Properties

string Name [get, set]
 Gets or sets the cache name. More...
 
CacheWriteSynchronizationMode WriteSynchronizationMode [get, set]
 Gets or sets write synchronization mode. This mode controls whether the main caller should wait for update on other nodes to complete or not. More...
 
bool EvictSynchronized [get, set]
 Gets or sets flag indicating whether eviction is synchronized between primary, backup and near nodes. If this parameter is true and swap is disabled then ICache<TK,TV>.LocalEvict will involve all nodes where an entry is kept. If this property is set to false then eviction is done independently on different cache nodes. Note that it's not recommended to set this value to true if cache store is configured since it will allow to significantly improve cache performance. More...
 
int EvictSynchronizedKeyBufferSize [get, set]
 Gets or sets size of the key buffer for synchronized evictions. More...
 
int EvictSynchronizedConcurrencyLevel [get, set]
 Gets or sets concurrency level for synchronized evictions. This flag only makes sense with EvictSynchronized set to true. When synchronized evictions are enabled, it is possible that local eviction policy will try to evict entries faster than evictions can be synchronized with backup or near nodes. This value specifies how many concurrent synchronous eviction sessions should be allowed before the system is forced to wait and let synchronous evictions catch up with the eviction policy. More...
 
TimeSpan EvictSynchronizedTimeout [get, set]
 Gets or sets timeout for synchronized evictions More...
 
float MaxEvictionOverflowRatio [get, set]
 This value denotes the maximum size of eviction queue in percents of cache size in case of distributed cache (replicated and partitioned) and using synchronized eviction That queue is used internally as a buffer to decrease network costs for synchronized eviction. Once queue size reaches specified value all required requests for all entries in the queue are sent to remote nodes and the queue is cleared. More...
 
bool EagerTtl [get, set]
 Gets or sets flag indicating whether expired cache entries will be eagerly removed from cache. When set to false, expired entries will be removed on next entry access. More...
 
int StartSize [get, set]
 Gets or sets initial cache size which will be used to pre-create internal hash table after start. More...
 
bool LoadPreviousValue [get, set]
 Gets or sets flag indicating whether value should be loaded from store if it is not in the cache for the following cache operations:

More...
 
bool KeepBinaryInStore [get, set]
 Gets or sets the flag indicating whether ICacheStore is working with binary objects instead of deserialized objects. More...
 
CacheMode CacheMode [get, set]
 Gets or sets caching mode to use. More...
 
CacheAtomicityMode AtomicityMode [get, set]
 Gets or sets cache atomicity mode. More...
 
CacheAtomicWriteOrderMode AtomicWriteOrderMode [get, set]
 Gets or sets cache write ordering mode. More...
 
int Backups [get, set]
 Gets or sets number of nodes used to back up single partition for Configuration.CacheMode.Partitioned cache. More...
 
TimeSpan LockTimeout [get, set]
 Gets or sets default lock acquisition timeout. More...
 
bool Invalidate [get, set]
 Invalidation flag. If true, values will be invalidated (nullified) upon commit in near cache. More...
 
CacheRebalanceMode RebalanceMode [get, set]
 Gets or sets cache rebalance mode. More...
 
int RebalanceBatchSize [get, set]
 Gets or sets size (in number bytes) to be loaded within a single rebalance message. Rebalancing algorithm will split total data set on every node into multiple batches prior to sending data. More...
 
bool EnableSwap [get, set]
 Flag indicating whether Ignite should use swap storage by default. More...
 
int MaxConcurrentAsyncOperations [get, set]
 Gets or sets maximum number of allowed concurrent asynchronous operations, 0 for unlimited. More...
 
bool WriteBehindEnabled [get, set]
 Flag indicating whether Ignite should use write-behind behaviour for the cache store. More...
 
int WriteBehindFlushSize [get, set]
 Maximum size of the write-behind cache. If cache size exceeds this value, all cached items are flushed to the cache store and write cache is cleared. More...
 
TimeSpan WriteBehindFlushFrequency [get, set]
 Frequency with which write-behind cache is flushed to the cache store. This value defines the maximum time interval between object insertion/deletion from the cache at the moment when corresponding operation is applied to the cache store. If this value is 0, then flush is performed according to the flush size. Note that you cannot set both WriteBehindFlushSize and WriteBehindFlushFrequency to 0. More...
 
int WriteBehindFlushThreadCount [get, set]
 Number of threads that will perform cache flushing. Cache flushing is performed when cache size exceeds value defined by WriteBehindFlushSize, or flush interval defined by WriteBehindFlushFrequency is elapsed. More...
 
int WriteBehindBatchSize [get, set]
 Maximum batch size for write-behind cache store operations. Store operations (get or remove) are combined in a batch of this size to be passed to ICacheStore.WriteAll or ICacheStore.DeleteAll methods. More...
 
TimeSpan RebalanceTimeout [get, set]
 Gets or sets rebalance timeout. More...
 
TimeSpan RebalanceDelay [get, set]
 Gets or sets delay upon a node joining or leaving topology (or crash) after which rebalancing should be started automatically. Rebalancing should be delayed if you plan to restart nodes after they leave topology, or if you plan to start multiple nodes at once or one after another and don't want to repartition and rebalance until all nodes are started. More...
 
TimeSpan RebalanceThrottle [get, set]
 Time to wait between rebalance messages to avoid overloading of CPU or network. When rebalancing large data sets, the CPU or network can get over-consumed with rebalancing messages, which consecutively may slow down the application performance. This parameter helps tune the amount of time to wait between rebalance messages to make sure that rebalancing process does not have any negative performance impact. Note that application will continue to work properly while rebalancing is still in progress. Value of 0 means that throttling is disabled. More...
 
long OffHeapMaxMemory [get, set]
 Gets or sets maximum amount of memory available to off-heap storage. Possible values are -1 means that off-heap storage is disabled. 0 means that Ignite will not limit off-heap storage (it's up to user to properly add and remove entries from cache to ensure that off-heap storage does not grow indefinitely. Any positive value specifies the limit of off-heap storage in bytes. More...
 
CacheMemoryMode MemoryMode [get, set]
 Gets or sets memory mode for cache. More...
 
bool ReadFromBackup [get, set]
 Gets or sets flag indicating whether data can be read from backup. More...
 
bool CopyOnRead [get, set]
 Gets or sets flag indicating whether copy of the value stored in cache should be created for cache operation implying return value. More...
 
TimeSpan LongQueryWarningTimeout [get, set]
 Gets or sets the timeout after which long query warning will be printed. More...
 
bool SqlEscapeAll [get, set]
 If true all the SQL table and field names will be escaped with double quotes like ({ "tableName"."fieldsName"}). This enforces case sensitivity for field names and also allows having special characters in table and field names. More...
 
int SqlOnheapRowCacheSize [get, set]
 Number of SQL rows which will be cached onheap to avoid deserialization on each SQL index access. This setting only makes sense when offheap is enabled for this cache. More...
 
IFactory< ICacheStoreCacheStoreFactory [get, set]
 Gets or sets the factory for underlying persistent storage for read-through and write-through operations. More...
 
bool ReadThrough [get, set]
 Gets or sets a value indicating whether read-through should be enabled for cache operations. More...
 
bool WriteThrough [get, set]
 Gets or sets a value indicating whether write-through should be enabled for cache operations. More...
 
ICollection< QueryEntityQueryEntities [get, set]
 Gets or sets the query entity configuration. More...
 
NearCacheConfiguration NearConfiguration [get, set]
 Gets or sets the near cache configuration. More...
 
IEvictionPolicy EvictionPolicy [get, set]
 Gets or sets the eviction policy. Null value means disabled evictions. More...
 
IAffinityFunction AffinityFunction [get, set]
 Gets or sets the affinity function to provide mapping from keys to nodes. More...
 

Detailed Description

Constructor & Destructor Documentation

Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheConfiguration ( )
Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheConfiguration ( string  name)
Parameters
nameCache name.
Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheConfiguration ( string  name,
params Type[]  queryTypes 
)
Parameters
nameCache name.
queryTypesCollection of types to be registered as query entities. These types should use QuerySqlFieldAttribute to configure query fields and properties.
Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheConfiguration ( string  name,
params QueryEntity[]  queryEntities 
)
Parameters
nameCache name.
queryEntitiesQuery entities.

Member Data Documentation

const CacheAtomicityMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultAtomicityMode = CacheAtomicityMode.Atomic
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultBackups = 0
const CacheMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultCacheMode = CacheMode.Partitioned
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultCacheSize = 100000
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultCopyOnRead = true
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEagerTtl = true
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEnableSwap = false
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEvictSynchronized = false
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEvictSynchronizedConcurrencyLevel = 4
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEvictSynchronizedKeyBufferSize = 1024
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultEvictSynchronizedTimeout = TimeSpan.FromMilliseconds(10000)
static
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultInvalidate = false
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultKeepVinaryInStore = true
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultLoadPreviousValue = false
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultLockTimeout = TimeSpan.Zero
static
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultLongQueryWarningTimeout = TimeSpan.FromMilliseconds(3000)
static
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultMaxConcurrentAsyncOperations = 500
const float Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultMaxEvictionOverflowRatio = 10
const CacheMemoryMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultMemoryMode = CacheMemoryMode.OnheapTiered
const long Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultOffHeapMaxMemory = -1
-1} which means that off-heap storage is disabled. </summary>
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultReadFromBackup = true
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultReadThrough = false
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultRebalanceBatchSize = 512*1024
const CacheRebalanceMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultRebalanceMode = CacheRebalanceMode.Async
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultRebalanceThreadPoolSize = 2
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultRebalanceThrottle = TimeSpan.Zero
static
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultRebalanceTimeout = TimeSpan.FromMilliseconds(10000)
static
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultSqlOnheapRowCacheSize = 10*1024
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultStartSize = 1500000
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindBatchSize = 512
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindEnabled = false
readonly TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindFlushFrequency = TimeSpan.FromMilliseconds(5000)
static
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindFlushSize = 10240
const int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindFlushThreadCount = 1
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteThrough = false

Property Documentation

IAffinityFunction Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.AffinityFunction
getset

Predefined implementations: RendezvousAffinityFunction, FairAffinityFunction.

CacheAtomicityMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.AtomicityMode
getset
CacheAtomicWriteOrderMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.AtomicWriteOrderMode
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.Backups
getset
CacheMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheMode
getset
IFactory<ICacheStore> Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheStoreFactory
getset

See ReadThrough and WriteThrough properties to enable read-through and write-through behavior so that cache store is invoked on get and/or put operations.

If both ReadThrough and WriteThrough are false, cache store will be invoked only on ICache<TK,TV>.LoadCache calls.

bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CopyOnRead
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EagerTtl
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EnableSwap
getset
IEvictionPolicy Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictionPolicy
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictSynchronized
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictSynchronizedConcurrencyLevel
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictSynchronizedKeyBufferSize
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictSynchronizedTimeout
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.Invalidate
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.KeepBinaryInStore
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.LoadPreviousValue
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.LockTimeout
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.LongQueryWarningTimeout
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.MaxConcurrentAsyncOperations
getset
float Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.MaxEvictionOverflowRatio
getset
CacheMemoryMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.MemoryMode
getset
string Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.Name
getset
NearCacheConfiguration Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.NearConfiguration
getset
long Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.OffHeapMaxMemory
getset
ICollection<QueryEntity> Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.QueryEntities
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.ReadFromBackup
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.ReadThrough
getset

When in read-through mode, cache misses that occur due to cache entries not existing as a result of performing a "get" operations will appropriately cause the configured ICacheStore (see CacheStoreFactory) to be invoked.

int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.RebalanceBatchSize
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.RebalanceDelay
getset
CacheRebalanceMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.RebalanceMode
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.RebalanceThrottle
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.RebalanceTimeout
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.SqlEscapeAll
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.SqlOnheapRowCacheSize
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.StartSize
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindBatchSize
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindEnabled
getset
TimeSpan Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindFlushFrequency
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindFlushSize
getset
int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindFlushThreadCount
getset
CacheWriteSynchronizationMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteSynchronizationMode
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteThrough
getset

When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured ICacheStore (see CacheStoreFactory) to be invoked.