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...
 
 CacheConfiguration (CacheConfiguration other)
 Initializes a new instance of the CacheConfiguration class, performing a deep copy of specified cache configuration. 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 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 bool DefaultEagerTtl = true
 Default value for eager ttl 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 bool DefaultReadFromBackup = true
 Default value for 'readFromBackup' flag. 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...
 
const bool DefaultWriteBehindCoalescing = true
 Default value for WriteBehindCoalescing. More...
 
const PartitionLossPolicy DefaultPartitionLossPolicy = PartitionLossPolicy.Ignore
 Default value for PartitionLossPolicy. 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 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 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...
 
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...
 
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...
 
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<K, V>.WriteAll or ICacheStore<K, V>.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...
 
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...
 
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...
 
IFactory< IExpiryPolicyExpiryPolicyFactory [get, set]
 Gets or sets the factory for IExpiryPolicy to be used for all cache operations, unless ICache<TK,TV>.WithExpiryPolicy is called. More...
 
bool EnableStatistics [get, set]
 Gets or sets a value indicating whether statistics gathering is enabled on a cache. These statistics can be retrieved via ICache<TK,TV>.GetMetrics(). More...
 
ICollection< ICachePluginConfigurationPluginConfigurations [get, set]
 Gets or sets the plugin configurations. More...
 
string MemoryPolicyName [get, set]
 Gets or sets the name of the MemoryPolicyConfiguration for this cache. See IgniteConfiguration.MemoryConfiguration. More...
 
bool WriteBehindCoalescing [get, set]
 Gets or sets write coalescing flag for write-behind cache store operations. Store operations (get or remove) with the same key are combined or coalesced to single, resulting operation to reduce pressure to underlying cache store. More...
 
PartitionLossPolicy PartitionLossPolicy [get, set]
 Gets or sets the partition loss policy. This policy defines how Ignite will react to a situation when all nodes for some partition leave the cluster. More...
 
string GroupName [get, set]
 Gets or sets the cache group name. Caches with the same group name share single underlying 'physical' cache (partition set), but are logically isolated. 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.
Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.CacheConfiguration ( CacheConfiguration  other)
Parameters
otherThe other configuration to perfrom deep copy from.

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.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 PartitionLossPolicy Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultPartitionLossPolicy = PartitionLossPolicy.Ignore
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.DefaultWriteBehindBatchSize = 512
const bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.DefaultWriteBehindCoalescing = true
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.

CacheAtomicityMode Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.AtomicityMode
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.EnableStatistics
getset
IEvictionPolicy Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.EvictionPolicy
getset
IFactory<IExpiryPolicy> Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.ExpiryPolicyFactory
getset

Default is null, which means no expiration.

string Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.GroupName
getset

Since underlying cache is shared, the following configuration properties should be the same within group: AffinityFunction, CacheMode, PartitionLossPolicy, MemoryPolicyName

Grouping caches reduces overall overhead, since internal data structures are shared.

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

This property is obsolete, use IgniteConfiguration.LongQueryWarningTimeout instead.

int Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.MaxConcurrentAsyncOperations
getset
string Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.MemoryPolicyName
getset
string Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.Name
getset
NearCacheConfiguration Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.NearConfiguration
getset
PartitionLossPolicy Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.PartitionLossPolicy
getset
ICollection<ICachePluginConfiguration> Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.PluginConfigurations
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.WriteBehindBatchSize
getset
bool Apache.Ignite.Core.Cache.Configuration.CacheConfiguration.WriteBehindCoalescing
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.