public class CacheConfiguration<K,V>
extends javax.cache.configuration.MutableConfiguration<K,V>
IgniteConfiguration.getCacheConfiguration()
method. It defines all configuration
parameters required to start a cache within grid instance. You can have multiple caches
configured with different names within one grid.
Cache configuration is set on IgniteConfiguration.setCacheConfiguration(CacheConfiguration...)
method. This adapter is a simple bean and
can be configured from Spring XML files (or other DI frameworks).
Note that absolutely all configuration properties are optional, so users should only change what they need.
Modifier and Type | Class and Description |
---|---|
static class |
CacheConfiguration.IgniteAllNodesPredicate
Filter that accepts all nodes.
|
Modifier and Type | Field and Description |
---|---|
static IgnitePredicate<ClusterNode> |
ALL_NODES
Filter that accepts all nodes.
|
static int |
DFLT_BACKUPS
Default number of backups.
|
static CacheAtomicityMode |
DFLT_CACHE_ATOMICITY_MODE
Default atomicity mode.
|
static CacheMode |
DFLT_CACHE_MODE
Default caching mode.
|
static int |
DFLT_CACHE_SIZE
Default cache size to use with eviction policy.
|
static int |
DFLT_CONCURRENT_LOAD_ALL_THRESHOLD
Default threshold for concurrent loading of keys from
CacheStore . |
static boolean |
DFLT_COPY_ON_READ
Default value for 'copyOnRead' flag.
|
static boolean |
DFLT_EAGER_TTL
Default value for eager ttl flag.
|
static int |
DFLT_EVICT_KEY_BUFFER_SIZE
Default eviction key buffer size for batching synchronized evicts.
|
static boolean |
DFLT_EVICT_SYNCHRONIZED
Default eviction synchronized flag.
|
static int |
DFLT_EVICT_SYNCHRONIZED_CONCURRENCY_LEVEL
Default synchronous eviction concurrency level.
|
static long |
DFLT_EVICT_SYNCHRONIZED_TIMEOUT
Default synchronous eviction timeout in milliseconds.
|
static boolean |
DFLT_INVALIDATE
Default value for 'invalidate' flag that indicates if this is invalidation-based cache.
|
static boolean |
DFLT_LOAD_PREV_VAL
Default value for load previous value flag.
|
static long |
DFLT_LOCK_TIMEOUT
Default lock timeout.
|
static long |
DFLT_LONG_QRY_WARN_TIMEOUT
Default timeout after which long query warning will be printed.
|
static int |
DFLT_MAX_CONCURRENT_ASYNC_OPS
Default value for 'maxConcurrentAsyncOps'.
|
static float |
DFLT_MAX_EVICTION_OVERFLOW_RATIO
Default maximum eviction queue ratio.
|
static CacheMemoryMode |
DFLT_MEMORY_MODE
Default memory mode.
|
static int |
DFLT_NEAR_START_SIZE
Initial default near cache size.
|
static long |
DFLT_OFFHEAP_MEMORY
Default off-heap storage size is
-1 which means that off-heap storage is disabled. |
static boolean |
DFLT_READ_FROM_BACKUP
Default value for 'readFromBackup' flag.
|
static int |
DFLT_REBALANCE_BATCH_SIZE
Default rebalance batch size in bytes.
|
static long |
DFLT_REBALANCE_BATCHES_PREFETCH_COUNT
Default rebalance batches prefetch count.
|
static CacheRebalanceMode |
DFLT_REBALANCE_MODE
Default rebalance mode for distributed cache.
|
static int |
DFLT_REBALANCE_THREAD_POOL_SIZE
Deprecated.
|
static long |
DFLT_REBALANCE_THROTTLE
Time in milliseconds to wait between rebalance messages to avoid overloading CPU.
|
static long |
DFLT_REBALANCE_TIMEOUT
Default rebalance timeout (ms).
|
static int |
DFLT_SQL_ONHEAP_ROW_CACHE_SIZE
Default size for onheap SQL row cache size.
|
static int |
DFLT_START_SIZE
Initial default cache size.
|
static Boolean |
DFLT_STORE_KEEP_BINARY
Default value for keep binary in store behavior .
|
static boolean |
DFLT_SWAP_ENABLED
Default value for 'swapEnabled' flag.
|
static int |
DFLT_WRITE_BEHIND_BATCH_SIZE
Default batch size for write-behind cache store.
|
static int |
DFLT_WRITE_BEHIND_CRITICAL_SIZE
Default critical size used when flush size is not specified.
|
static boolean |
DFLT_WRITE_BEHIND_ENABLED
Default value for 'writeBehindEnabled' flag.
|
static long |
DFLT_WRITE_BEHIND_FLUSH_FREQUENCY
Default flush frequency for write-behind cache store in milliseconds.
|
static int |
DFLT_WRITE_BEHIND_FLUSH_SIZE
Default flush size for write-behind cache store.
|
static int |
DFLT_WRITE_FROM_BEHIND_FLUSH_THREAD_CNT
Default count of flush threads for write-behind cache store.
|
Constructor and Description |
---|
CacheConfiguration()
Empty constructor (all values are initialized to their defaults).
|
CacheConfiguration(javax.cache.configuration.CompleteConfiguration<K,V> cfg)
Copy constructor.
|
CacheConfiguration(String name) |
Modifier and Type | Method and Description |
---|---|
javax.cache.configuration.MutableConfiguration<K,V> |
addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryLsnrCfg) |
AffinityFunction |
getAffinity()
Gets key topology resolver to provide mapping from keys to nodes.
|
AffinityKeyMapper |
getAffinityMapper()
Affinity key mapper used to provide custom affinity key for any given key.
|
CacheAtomicityMode |
getAtomicityMode()
Gets cache atomicity mode.
|
CacheAtomicWriteOrderMode |
getAtomicWriteOrderMode()
Gets cache write ordering mode.
|
int |
getBackups()
Gets number of nodes used to back up single partition for
CacheMode.PARTITIONED cache. |
Iterable<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> |
getCacheEntryListenerConfigurations() |
CacheMode |
getCacheMode()
Gets caching mode to use.
|
javax.cache.configuration.Factory<CacheStore<? super K,? super V>> |
getCacheStoreFactory()
Gets factory for underlying persistent storage for read-through and write-through operations.
|
javax.cache.configuration.Factory<? extends CacheStoreSessionListener>[] |
getCacheStoreSessionListenerFactories()
Gets cache store session listener factories.
|
long |
getDefaultLockTimeout()
Gets default lock acquisition timeout.
|
EvictionFilter<K,V> |
getEvictionFilter()
Gets eviction filter to specify which entries should not be evicted
(except explicit evict by calling
IgniteCache.localEvict(Collection) ). |
EvictionPolicy<K,V> |
getEvictionPolicy()
Gets cache eviction policy.
|
float |
getEvictMaxOverflowRatio()
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 is if
isEvictSynchronized() returns
true ). |
int |
getEvictSynchronizedConcurrencyLevel()
Gets concurrency level for synchronized evictions.
|
int |
getEvictSynchronizedKeyBufferSize()
Gets size of the key buffer for synchronized evictions.
|
long |
getEvictSynchronizedTimeout()
Gets timeout for synchronized evictions.
|
Class<?>[] |
getIndexedTypes()
Array of key and value type pairs to be indexed (thus array length must be always even).
|
CacheInterceptor<K,V> |
getInterceptor()
Gets cache interceptor.
|
long |
getLongQueryWarningTimeout()
Gets timeout in milliseconds after which long query warning will be printed.
|
int |
getMaxConcurrentAsyncOperations()
Gets maximum number of allowed concurrent asynchronous operations.
|
CacheMemoryMode |
getMemoryMode()
Gets memory mode for cache.
|
String |
getName()
Cache name or
null if not provided, then this will be considered a default
cache which can be accessed via Ignite.cache(String) method. |
NearCacheConfiguration<K,V> |
getNearConfiguration() |
IgnitePredicate<ClusterNode> |
getNodeFilter()
Gets filter which determines on what nodes the cache should be started.
|
long |
getOffHeapMaxMemory()
Gets maximum amount of memory available to off-heap storage.
|
CachePluginConfiguration[] |
getPluginConfigurations()
Gets array of cache plugin configurations.
|
Collection<QueryEntity> |
getQueryEntities()
Gets a collection of configured query entities.
|
long |
getRebalanceBatchesPrefetchCount()
To gain better rebalancing performance supplier node can provide more than one batch at rebalancing start and
provide one new to each next demand request.
|
int |
getRebalanceBatchSize()
Gets size (in number bytes) to be loaded within a single rebalance message.
|
long |
getRebalanceDelay()
Gets delay in milliseconds upon a node joining or leaving topology (or crash) after which rebalancing
should be started automatically.
|
CacheRebalanceMode |
getRebalanceMode()
Gets rebalance mode for distributed cache.
|
int |
getRebalanceOrder()
Gets cache rebalance order.
|
int |
getRebalanceThreadPoolSize()
Deprecated.
|
long |
getRebalanceThrottle()
Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
|
long |
getRebalanceTimeout()
Gets rebalance timeout (ms).
|
Class<?>[] |
getSqlFunctionClasses()
Gets classes with methods annotated by
QuerySqlFunction
to be used as user-defined functions from SQL queries. |
int |
getSqlOnheapRowCacheSize()
Number of SQL rows which will be cached onheap to avoid deserialization on each SQL index access.
|
String |
getSqlSchema()
Gets custom name of the sql schema.
|
int |
getStartSize()
Gets initial cache size which will be used to pre-create internal
hash table after start.
|
int |
getStoreConcurrentLoadAllThreshold()
Gets the threshold used in cases when values for multiple keys are being loaded from an underlying
CacheStore in parallel. |
TopologyValidator |
getTopologyValidator()
Gets topology validator.
|
String |
getTransactionManagerLookupClassName()
Deprecated.
Use
TransactionConfiguration.getTxManagerFactory() instead. |
Collection<CacheTypeMetadata> |
getTypeMetadata()
Gets collection of type metadata objects.
|
int |
getWriteBehindBatchSize()
Maximum batch size for write-behind cache store operations.
|
long |
getWriteBehindFlushFrequency()
Frequency with which write-behind cache is flushed to the cache store in milliseconds.
|
int |
getWriteBehindFlushSize()
Maximum size of the write-behind cache.
|
int |
getWriteBehindFlushThreadCount()
Number of threads that will perform cache flushing.
|
CacheWriteSynchronizationMode |
getWriteSynchronizationMode()
Gets write synchronization mode.
|
boolean |
isCopyOnRead()
Gets flag indicating whether copy of of the value stored in cache should be created
for cache operation implying return value.
|
boolean |
isEagerTtl()
Gets flag indicating whether expired cache entries will be eagerly removed from cache.
|
boolean |
isEvictSynchronized()
Gets flag indicating whether eviction is synchronized between primary, backup and near nodes.
|
boolean |
isInvalidate()
Invalidation flag.
|
boolean |
isLoadPreviousValue()
Gets flag indicating whether value should be loaded from store if it is not in the cache
for following cache operations:
IgniteCache.putIfAbsent(Object, Object)
IgniteCache.replace(Object, Object)
IgniteCache.replace(Object, Object, Object)
IgniteCache.remove(Object, Object)
IgniteCache.getAndPut(Object, Object)
IgniteCache.getAndRemove(Object)
IgniteCache.getAndReplace(Object, Object)
IgniteCache.getAndPutIfAbsent(Object, Object)
|
boolean |
isReadFromBackup()
Gets flag indicating whether data can be read from backup.
|
boolean |
isSnapshotableIndex()
Gets flag indicating whether SQL indexes should support snapshots.
|
boolean |
isSqlEscapeAll()
If
true all the SQL table and field names will be escaped with double quotes like
({@code "tableName"." |
Boolean |
isStoreKeepBinary()
Flag indicating that
CacheStore implementation
is working with binary objects instead of Java objects. |
boolean |
isSwapEnabled()
Flag indicating whether Ignite should use swap storage by default.
|
boolean |
isWriteBehindEnabled()
Flag indicating whether Ignite should use write-behind behaviour for the cache store.
|
javax.cache.configuration.MutableConfiguration<K,V> |
removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryLsnrCfg) |
CacheConfiguration<K,V> |
setAffinity(AffinityFunction aff)
Sets affinity for cache keys.
|
CacheConfiguration<K,V> |
setAffinityMapper(AffinityKeyMapper affMapper)
Sets custom affinity mapper.
|
CacheConfiguration<K,V> |
setAtomicityMode(CacheAtomicityMode atomicityMode)
Sets cache atomicity mode.
|
CacheConfiguration<K,V> |
setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode)
Sets cache write ordering mode.
|
CacheConfiguration<K,V> |
setBackups(int backups)
Sets number of nodes used to back up single partition for
CacheMode.PARTITIONED cache. |
CacheConfiguration<K,V> |
setCacheMode(CacheMode cacheMode)
Sets caching mode.
|
CacheConfiguration<K,V> |
setCacheStoreFactory(javax.cache.configuration.Factory<? extends CacheStore<? super K,? super V>> storeFactory)
Sets factory for persistent storage for cache data.
|
CacheConfiguration<K,V> |
setCacheStoreSessionListenerFactories(javax.cache.configuration.Factory<? extends CacheStoreSessionListener>... storeSesLsnrs)
Cache store session listener factories.
|
CacheConfiguration<K,V> |
setCopyOnRead(boolean cpOnRead)
Sets copy on read flag.
|
CacheConfiguration<K,V> |
setDefaultLockTimeout(long dfltLockTimeout)
Sets default lock timeout in milliseconds.
|
CacheConfiguration<K,V> |
setEagerTtl(boolean eagerTtl)
Sets eager ttl flag.
|
CacheConfiguration<K,V> |
setEvictionFilter(EvictionFilter<K,V> evictFilter)
Sets eviction filter.
|
CacheConfiguration<K,V> |
setEvictionPolicy(EvictionPolicy evictPlc)
Sets cache eviction policy.
|
CacheConfiguration<K,V> |
setEvictMaxOverflowRatio(float evictMaxOverflowRatio)
Sets maximum eviction overflow ratio.
|
CacheConfiguration<K,V> |
setEvictSynchronized(boolean evictSync)
Sets flag indicating whether eviction is synchronized with backup nodes or near caches
(or the rest of the nodes for replicated cache).
|
CacheConfiguration<K,V> |
setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl)
Sets concurrency level for synchronized evictions.
|
CacheConfiguration<K,V> |
setEvictSynchronizedKeyBufferSize(int evictKeyBufSize)
Sets eviction key buffer size.
|
CacheConfiguration<K,V> |
setEvictSynchronizedTimeout(long evictSyncTimeout)
Sets timeout for synchronized evictions.
|
CacheConfiguration<K,V> |
setIndexedTypes(Class<?>... indexedTypes)
Array of key and value type pairs to be indexed (thus array length must be always even).
|
CacheConfiguration<K,V> |
setInterceptor(CacheInterceptor<K,V> interceptor)
Sets cache interceptor.
|
CacheConfiguration<K,V> |
setInvalidate(boolean invalidate)
Sets invalidation flag for near cache entries in this transaction.
|
CacheConfiguration<K,V> |
setLoadPreviousValue(boolean loadPrevVal)
Sets flag indicating whether value should be loaded from store if it is not in the cache
for following cache operations:
IgniteCache.putIfAbsent(Object, Object)
IgniteCache.replace(Object, Object)
IgniteCache.replace(Object, Object, Object)
IgniteCache.remove(Object, Object)
IgniteCache.getAndPut(Object, Object)
IgniteCache.getAndRemove(Object)
IgniteCache.getAndReplace(Object, Object)
IgniteCache.getAndPutIfAbsent(Object, Object)
When not set, default value is DFLT_LOAD_PREV_VAL . |
CacheConfiguration<K,V> |
setLongQueryWarningTimeout(long longQryWarnTimeout)
Sets timeout in milliseconds after which long query warning will be printed.
|
CacheConfiguration<K,V> |
setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps)
Sets maximum number of concurrent asynchronous operations.
|
CacheConfiguration<K,V> |
setMemoryMode(CacheMemoryMode memMode)
Sets memory mode for cache.
|
CacheConfiguration<K,V> |
setName(String name)
Sets cache name.
|
CacheConfiguration<K,V> |
setNearConfiguration(NearCacheConfiguration<K,V> nearCfg) |
CacheConfiguration<K,V> |
setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter)
Sets filter which determines on what nodes the cache should be started.
|
CacheConfiguration<K,V> |
setOffHeapMaxMemory(long offHeapMaxMem)
Sets maximum amount of memory available to off-heap storage.
|
CacheConfiguration<K,V> |
setPluginConfigurations(CachePluginConfiguration... pluginCfgs)
Sets cache plugin configurations.
|
CacheConfiguration<K,V> |
setQueryEntities(Collection<QueryEntity> qryEntities)
Sets query entities configuration.
|
CacheConfiguration<K,V> |
setReadFromBackup(boolean readFromBackup)
Sets read from backup flag.
|
CacheConfiguration<K,V> |
setRebalanceBatchesPrefetchCount(long rebalanceBatchesCnt)
To gain better rebalancing performance supplier node can provide more than one batch at rebalancing start and
provide one new to each next demand request.
|
CacheConfiguration<K,V> |
setRebalanceBatchSize(int rebalanceBatchSize)
Sets rebalance batch size.
|
CacheConfiguration<K,V> |
setRebalanceDelay(long rebalanceDelay)
Sets rebalance delay (see
getRebalanceDelay() for more information). |
CacheConfiguration<K,V> |
setRebalanceMode(CacheRebalanceMode rebalanceMode)
Sets cache rebalance mode.
|
CacheConfiguration<K,V> |
setRebalanceOrder(int rebalanceOrder)
Sets cache rebalance order.
|
CacheConfiguration<K,V> |
setRebalanceThreadPoolSize(int rebalancePoolSize)
Deprecated.
|
CacheConfiguration<K,V> |
setRebalanceThrottle(long rebalanceThrottle)
Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
|
CacheConfiguration<K,V> |
setRebalanceTimeout(long rebalanceTimeout)
Sets rebalance timeout (ms).
|
CacheConfiguration<K,V> |
setSnapshotableIndex(boolean snapshotableIdx)
Sets flag indicating whether SQL indexes should support snapshots.
|
CacheConfiguration<K,V> |
setSqlEscapeAll(boolean sqlEscapeAll)
If
true all the SQL table and field names will be escaped with double quotes like
({@code "tableName"." |
CacheConfiguration<K,V> |
setSqlFunctionClasses(Class<?>... cls)
Sets classes with methods annotated by
QuerySqlFunction
to be used as user-defined functions from SQL queries. |
CacheConfiguration<K,V> |
setSqlOnheapRowCacheSize(int size)
Number of SQL rows which will be cached onheap to avoid deserialization on each SQL index access.
|
CacheConfiguration<K,V> |
setSqlSchema(String sqlSchema)
Sets sql schema to be used for current cache.
|
CacheConfiguration<K,V> |
setStartSize(int startSize)
Initial size for internal hash map.
|
CacheConfiguration<K,V> |
setStoreConcurrentLoadAllThreshold(int storeConcurrentLoadAllThreshold)
Sets the concurrent load-all threshold used for cases when keys' values are being loaded from
CacheStore
in parallel. |
void |
setStoreKeepBinary(boolean storeKeepBinary)
Sets keep binary in store flag.
|
CacheConfiguration<K,V> |
setSwapEnabled(boolean swapEnabled)
Flag indicating whether swap storage is enabled or not.
|
CacheConfiguration<K,V> |
setTopologyValidator(TopologyValidator topValidator)
Sets topology validator.
|
CacheConfiguration<K,V> |
setTransactionManagerLookupClassName(String tmLookupClsName)
Deprecated.
|
CacheConfiguration<K,V> |
setTypeMetadata(Collection<CacheTypeMetadata> typeMeta)
Deprecated.
Use
setQueryEntities(java.util.Collection) instead. |
CacheConfiguration<K,V> |
setWriteBehindBatchSize(int writeBehindBatchSize)
Sets maximum batch size for write-behind cache.
|
CacheConfiguration<K,V> |
setWriteBehindEnabled(boolean writeBehindEnabled)
Sets flag indicating whether write-behind is enabled.
|
CacheConfiguration<K,V> |
setWriteBehindFlushFrequency(long writeBehindFlushFreq)
Sets write-behind flush frequency.
|
CacheConfiguration<K,V> |
setWriteBehindFlushSize(int writeBehindFlushSize)
Sets write-behind flush size.
|
CacheConfiguration<K,V> |
setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt)
Sets flush thread count for write-behind cache.
|
CacheConfiguration<K,V> |
setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync)
Sets write synchronization mode.
|
String |
toString() |
protected Object |
writeReplace()
Creates a copy of current configuration and removes all cache entry listeners.
|
equals, getCacheLoaderFactory, getCacheWriterFactory, getExpiryPolicyFactory, getKeyType, getValueType, hashCode, isManagementEnabled, isReadThrough, isStatisticsEnabled, isStoreByValue, isWriteThrough, setCacheLoaderFactory, setCacheWriterFactory, setExpiryPolicyFactory, setManagementEnabled, setReadThrough, setStatisticsEnabled, setStoreByValue, setTypes, setWriteThrough
@Deprecated public static final int DFLT_REBALANCE_THREAD_POOL_SIZE
public static final long DFLT_REBALANCE_TIMEOUT
public static final long DFLT_REBALANCE_BATCHES_PREFETCH_COUNT
public static final long DFLT_REBALANCE_THROTTLE
public static final int DFLT_BACKUPS
public static final CacheMode DFLT_CACHE_MODE
public static final CacheAtomicityMode DFLT_CACHE_ATOMICITY_MODE
public static final long DFLT_LOCK_TIMEOUT
public static final int DFLT_START_SIZE
public static final int DFLT_CACHE_SIZE
public static final int DFLT_NEAR_START_SIZE
public static final boolean DFLT_INVALIDATE
public static final CacheRebalanceMode DFLT_REBALANCE_MODE
public static final int DFLT_REBALANCE_BATCH_SIZE
public static final float DFLT_MAX_EVICTION_OVERFLOW_RATIO
public static final boolean DFLT_EVICT_SYNCHRONIZED
public static final int DFLT_EVICT_KEY_BUFFER_SIZE
public static final long DFLT_EVICT_SYNCHRONIZED_TIMEOUT
public static final int DFLT_EVICT_SYNCHRONIZED_CONCURRENCY_LEVEL
public static final boolean DFLT_EAGER_TTL
public static final long DFLT_OFFHEAP_MEMORY
-1
which means that off-heap storage is disabled.public static final boolean DFLT_SWAP_ENABLED
public static final int DFLT_MAX_CONCURRENT_ASYNC_OPS
public static final boolean DFLT_WRITE_BEHIND_ENABLED
public static final int DFLT_WRITE_BEHIND_FLUSH_SIZE
public static final int DFLT_WRITE_BEHIND_CRITICAL_SIZE
public static final long DFLT_WRITE_BEHIND_FLUSH_FREQUENCY
public static final int DFLT_WRITE_FROM_BEHIND_FLUSH_THREAD_CNT
public static final int DFLT_WRITE_BEHIND_BATCH_SIZE
public static final boolean DFLT_LOAD_PREV_VAL
public static final CacheMemoryMode DFLT_MEMORY_MODE
public static final boolean DFLT_READ_FROM_BACKUP
public static final IgnitePredicate<ClusterNode> ALL_NODES
public static final long DFLT_LONG_QRY_WARN_TIMEOUT
public static final int DFLT_SQL_ONHEAP_ROW_CACHE_SIZE
public static final Boolean DFLT_STORE_KEEP_BINARY
public static final int DFLT_CONCURRENT_LOAD_ALL_THRESHOLD
CacheStore
.public static final boolean DFLT_COPY_ON_READ
public CacheConfiguration()
public CacheConfiguration(String name)
name
- Cache name.public String getName()
null
if not provided, then this will be considered a default
cache which can be accessed via Ignite.cache(String)
method. Otherwise, if name
is provided, the cache will be accessed via Ignite.cache(String)
method.public CacheConfiguration<K,V> setName(String name)
name
- Cache name. May be null, but may not be empty string.this
for chaining.@Nullable public EvictionPolicy<K,V> getEvictionPolicy()
null
which means that evictions are disabled for cache.null
if evictions should be disabled.public CacheConfiguration<K,V> setEvictionPolicy(@Nullable EvictionPolicy evictPlc)
evictPlc
- Cache expiration policy.this
for chaining.public NearCacheConfiguration<K,V> getNearConfiguration()
public CacheConfiguration<K,V> setNearConfiguration(NearCacheConfiguration<K,V> nearCfg)
nearCfg
- Near cache configuration.this
for chaining.public CacheWriteSynchronizationMode getWriteSynchronizationMode()
public CacheConfiguration<K,V> setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync)
writeSync
- Write synchronization mode.this
for chaining.public IgnitePredicate<ClusterNode> getNodeFilter()
public CacheConfiguration<K,V> setNodeFilter(IgnitePredicate<ClusterNode> nodeFilter)
nodeFilter
- Predicate specifying on which nodes the cache should be started.this
for chaining.public boolean isEvictSynchronized()
true
and swap is disabled then IgniteCache.localEvict(Collection)
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.
Default value is defined by DFLT_EVICT_SYNCHRONIZED
.
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.
true
If eviction is synchronized with backup nodes (or the
rest of the nodes in case of replicated cache), false
if not.public CacheConfiguration<K,V> setEvictSynchronized(boolean evictSync)
evictSync
- true
if synchronized, false
if not.this
for chaining.public int getEvictSynchronizedKeyBufferSize()
Default value is defined by DFLT_EVICT_KEY_BUFFER_SIZE
.
public CacheConfiguration<K,V> setEvictSynchronizedKeyBufferSize(int evictKeyBufSize)
evictKeyBufSize
- Eviction key buffer size.this
for chaining.public int getEvictSynchronizedConcurrencyLevel()
isEvictSynchronized()
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.
Note that if synchronous evictions start lagging, it is possible that you have either
too big or too small eviction key buffer size or small eviction timeout. In that case
you will need to adjust getEvictSynchronizedKeyBufferSize()
or
getEvictSynchronizedTimeout()
values as well.
Default value is defined by DFLT_EVICT_SYNCHRONIZED_CONCURRENCY_LEVEL
.
public CacheConfiguration<K,V> setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl)
evictSyncConcurrencyLvl
- Concurrency level for synchronized evictions.this
for chaining.public long getEvictSynchronizedTimeout()
Node that initiates eviction waits for responses from remote nodes within this timeout.
Default value is defined by DFLT_EVICT_SYNCHRONIZED_TIMEOUT
.
public CacheConfiguration<K,V> setEvictSynchronizedTimeout(long evictSyncTimeout)
evictSyncTimeout
- Timeout for synchronized evictions.this
for chaining.public float getEvictMaxOverflowRatio()
isEvictSynchronized()
returns
true
).
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.
Default value is defined by DFLT_MAX_EVICTION_OVERFLOW_RATIO
and
equals to 10%
.
public CacheConfiguration<K,V> setEvictMaxOverflowRatio(float evictMaxOverflowRatio)
evictMaxOverflowRatio
- Maximum eviction overflow ratio.this
for chaining.public EvictionFilter<K,V> getEvictionFilter()
IgniteCache.localEvict(Collection)
).
If EvictionFilter.evictAllowed(Cache.Entry)
method
returns false
then eviction policy will not be notified and entry will
never be evicted.
If not provided, any entry may be evicted depending on
eviction policy
configuration.
null
.public CacheConfiguration<K,V> setEvictionFilter(EvictionFilter<K,V> evictFilter)
evictFilter
- Eviction filter.this
for chaining.public boolean isEagerTtl()
false
, expired entries will be removed on next entry access.
When not set, default value is DFLT_EAGER_TTL
.
Note that this flag only matters for entries expiring based on
ExpiryPolicy
and should not be confused with entry
evictions based on configured EvictionPolicy
.
public CacheConfiguration<K,V> setEagerTtl(boolean eagerTtl)
eagerTtl
- True
if Ignite should eagerly remove expired cache entries.this
for chaining.isEagerTtl()
public int getStartSize()
DFLT_START_SIZE
.public CacheConfiguration<K,V> setStartSize(int startSize)
startSize
- Cache start size.this
for chaining.public boolean isLoadPreviousValue()
IgniteCache.putIfAbsent(Object, Object)
IgniteCache.replace(Object, Object)
IgniteCache.replace(Object, Object, Object)
IgniteCache.remove(Object, Object)
IgniteCache.getAndPut(Object, Object)
IgniteCache.getAndRemove(Object)
IgniteCache.getAndReplace(Object, Object)
IgniteCache.getAndPutIfAbsent(Object, Object)
public CacheConfiguration<K,V> setLoadPreviousValue(boolean loadPrevVal)
IgniteCache.putIfAbsent(Object, Object)
IgniteCache.replace(Object, Object)
IgniteCache.replace(Object, Object, Object)
IgniteCache.remove(Object, Object)
IgniteCache.getAndPut(Object, Object)
IgniteCache.getAndRemove(Object)
IgniteCache.getAndReplace(Object, Object)
IgniteCache.getAndPutIfAbsent(Object, Object)
DFLT_LOAD_PREV_VAL
.loadPrevVal
- Load previous value flag.this
for chaining.public javax.cache.configuration.Factory<CacheStore<? super K,? super V>> getCacheStoreFactory()
public CacheConfiguration<K,V> setCacheStoreFactory(javax.cache.configuration.Factory<? extends CacheStore<? super K,? super V>> storeFactory)
storeFactory
- Cache store factory.this
for chaining.public Boolean isStoreKeepBinary()
CacheStore
implementation
is working with binary objects instead of Java objects.
Default value of this flag is DFLT_STORE_KEEP_BINARY
.
If set to false
, Ignite will deserialize keys and
values stored in binary format before they are passed
to cache store.
Note that setting this flag to false
can simplify
store implementation in some cases, but it can cause performance
degradation due to additional serializations and deserializations
of binary objects. You will also need to have key and value
classes on all nodes since binary will be deserialized when
store is called.
public void setStoreKeepBinary(boolean storeKeepBinary)
storeKeepBinary
- Keep binary in store flag.public int getStoreConcurrentLoadAllThreshold()
CacheStore
in parallel. In the situation when several threads load the same or intersecting set of keys
and the total number of keys to load is less or equal to this threshold then there will be no a second call to
the storage in order to load a key from thread A if the same key is already being loaded by thread B.
The threshold should be controlled wisely. On the one hand if it's set to a big value then the interaction with
a storage during the load of missing keys will be minimal. On the other hand the big value may result in
significant performance degradation because it is needed to check for every key whether it's being loaded or not.
When not set, default value is DFLT_CONCURRENT_LOAD_ALL_THRESHOLD
.public CacheConfiguration<K,V> setStoreConcurrentLoadAllThreshold(int storeConcurrentLoadAllThreshold)
CacheStore
in parallel.storeConcurrentLoadAllThreshold
- The concurrent load-all threshold.this
for chaining.public AffinityFunction getAffinity()
public CacheConfiguration<K,V> setAffinity(AffinityFunction aff)
aff
- Cache key affinity.this
for chaining.public CacheMode getCacheMode()
CacheMode.PARTITIONED
mode will be used by default (defined by DFLT_CACHE_MODE
constant).True
if cache is local.public CacheConfiguration<K,V> setCacheMode(CacheMode cacheMode)
cacheMode
- Caching mode.this
for chaining.public CacheAtomicityMode getAtomicityMode()
Default value is defined by DFLT_CACHE_ATOMICITY_MODE
.
public CacheConfiguration<K,V> setAtomicityMode(CacheAtomicityMode atomicityMode)
atomicityMode
- Cache atomicity mode.this
for chaining.public CacheAtomicWriteOrderMode getAtomicWriteOrderMode()
CacheAtomicityMode.ATOMIC
cache (for other atomicity modes it will be ignored).public CacheConfiguration<K,V> setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode)
CacheAtomicityMode.ATOMIC
cache (for other atomicity modes it will be ignored).atomicWriteOrderMode
- Cache write ordering mode.this
for chaining.public int getBackups()
CacheMode.PARTITIONED
cache.
If not set, default value is DFLT_BACKUPS
.
public CacheConfiguration<K,V> setBackups(int backups)
CacheMode.PARTITIONED
cache.
If not set, default value is DFLT_BACKUPS
.
backups
- Number of backup nodes for one partition.this
for chaining.public long getDefaultLockTimeout()
DFLT_LOCK_TIMEOUT
which is 0
and means that lock acquisition will never timeout.public CacheConfiguration<K,V> setDefaultLockTimeout(long dfltLockTimeout)
DFLT_LOCK_TIMEOUT
.dfltLockTimeout
- Default lock timeout.this
for chaining.public boolean isInvalidate()
true
, values will be invalidated (nullified) upon commit in near cache.public CacheConfiguration<K,V> setInvalidate(boolean invalidate)
false
.invalidate
- Flag to set this cache into invalidation-based mode. Default value is false
.this
for chaining.@Deprecated public String getTransactionManagerLookupClassName()
TransactionConfiguration.getTxManagerFactory()
instead.@Deprecated public CacheConfiguration<K,V> setTransactionManagerLookupClassName(String tmLookupClsName)
TransactionConfiguration.setTxManagerFactory(Factory)
instead.TransactionManager
implementation, if any.tmLookupClsName
- Name of class implementing GridCacheTmLookup interface that is used to
receive JTA transaction manager.this
for chaining.public CacheConfiguration<K,V> setRebalanceMode(CacheRebalanceMode rebalanceMode)
rebalanceMode
- Rebalance mode.this
for chaining.public CacheRebalanceMode getRebalanceMode()
Default is defined by DFLT_REBALANCE_MODE
.
public int getRebalanceOrder()
SYNC
or ASYNC
rebalance modes only.
If cache rebalance order is positive, rebalancing for this cache will be started only when rebalancing for
all caches with smaller rebalance order will be completed.
Note that cache with order 0
does not participate in ordering. This means that cache with
rebalance order 0
will never wait for any other caches. All caches with order 0
will
be rebalanced right away concurrently with each other and ordered rebalance processes.
If not set, cache order is 0, i.e. rebalancing is not ordered.public CacheConfiguration<K,V> setRebalanceOrder(int rebalanceOrder)
rebalanceOrder
- Cache rebalance order.this
for chaining.getRebalanceOrder()
public int getRebalanceBatchSize()
DFLT_REBALANCE_BATCH_SIZE
.public CacheConfiguration<K,V> setRebalanceBatchSize(int rebalanceBatchSize)
rebalanceBatchSize
- Rebalance batch size.this
for chaining.public long getRebalanceBatchesPrefetchCount()
public CacheConfiguration<K,V> setRebalanceBatchesPrefetchCount(long rebalanceBatchesCnt)
rebalanceBatchesCnt
- batches count.this
for chaining.public boolean isSwapEnabled()
DFLT_SWAP_ENABLED
constant.True
if swap storage is enabled.public CacheConfiguration<K,V> setSwapEnabled(boolean swapEnabled)
swapEnabled
- True
if swap storage is enabled.this
for chaining.public int getMaxConcurrentAsyncOperations()
If not set, default value is DFLT_MAX_CONCURRENT_ASYNC_OPS
.
If user threads do not wait for asynchronous operations to complete, it is possible to overload a system. This property enables back-pressure control by limiting number of scheduled asynchronous cache operations.
0
if unlimited.public CacheConfiguration<K,V> setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps)
maxConcurrentAsyncOps
- Maximum number of concurrent asynchronous operations.this
for chaining.getMaxConcurrentAsyncOperations()
public boolean isWriteBehindEnabled()
DFLT_WRITE_BEHIND_ENABLED
constant.True
if write-behind is enabled.public CacheConfiguration<K,V> setWriteBehindEnabled(boolean writeBehindEnabled)
writeBehindEnabled
- true
if write-behind is enabled.this
for chaining.public int getWriteBehindFlushSize()
DFLT_WRITE_BEHIND_FLUSH_SIZE
.
If this value is 0
, then flush is performed according to the flush frequency interval.
Note that you cannot set both, flush
size and flush frequency
, to 0
.public CacheConfiguration<K,V> setWriteBehindFlushSize(int writeBehindFlushSize)
writeBehindFlushSize
- Write-behind cache flush size.this
for chaining.getWriteBehindFlushSize()
public long getWriteBehindFlushFrequency()
If not provided, default value is DFLT_WRITE_BEHIND_FLUSH_FREQUENCY
.
If this value is 0
, then flush is performed according to the flush size.
Note that you cannot set both, flush
size and flush frequency
, to 0
.
public CacheConfiguration<K,V> setWriteBehindFlushFrequency(long writeBehindFlushFreq)
writeBehindFlushFreq
- Write-behind flush frequency in milliseconds.this
for chaining.getWriteBehindFlushFrequency()
public int getWriteBehindFlushThreadCount()
getWriteBehindFlushSize()
, or flush interval defined by
getWriteBehindFlushFrequency()
is elapsed.
If not provided, default value is DFLT_WRITE_FROM_BEHIND_FLUSH_THREAD_CNT
.public CacheConfiguration<K,V> setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt)
writeBehindFlushThreadCnt
- Count of flush threads.this
for chaining.getWriteBehindFlushThreadCount()
public int getWriteBehindBatchSize()
CacheWriter.writeAll(Collection)
or
CacheWriter.deleteAll(Collection)
methods.
If not provided, default value is DFLT_WRITE_BEHIND_BATCH_SIZE
.public CacheConfiguration<K,V> setWriteBehindBatchSize(int writeBehindBatchSize)
writeBehindBatchSize
- Maximum batch size.this
for chaining.getWriteBehindBatchSize()
@Deprecated public int getRebalanceThreadPoolSize()
IgniteConfiguration.getRebalanceThreadPoolSize()
instead.@Deprecated public CacheConfiguration<K,V> setRebalanceThreadPoolSize(int rebalancePoolSize)
IgniteConfiguration.getRebalanceThreadPoolSize()
instead.rebalancePoolSize
- Size of rebalancing thread pool.this
for chaining.public long getRebalanceTimeout()
Default value is DFLT_REBALANCE_TIMEOUT
.
public CacheConfiguration<K,V> setRebalanceTimeout(long rebalanceTimeout)
rebalanceTimeout
- Rebalance timeout (ms).this
for chaining.public long getRebalanceDelay()
For better efficiency user should usually make sure that new nodes get placed on
the same place of consistent hash ring as the left nodes, and that nodes are
restarted before this delay expires. To place nodes on the same place in consistent hash ring,
use IgniteConfiguration.setConsistentId(Serializable)
to make sure that a node maps to the same hash ID event if restarted. As an example,
node IP address and port combination may be used in this case.
Default value is 0
which means that repartitioning and rebalancing will start
immediately upon node leaving topology. If -1
is returned, then rebalancing
will only be started manually by calling IgniteCache.rebalance()
method or
from management console.
0
to start rebalancing immediately, -1
to
start rebalancing manually, or positive value to specify delay in milliseconds
after which rebalancing should start automatically.public CacheConfiguration<K,V> setRebalanceDelay(long rebalanceDelay)
getRebalanceDelay()
for more information).rebalanceDelay
- Rebalance delay to set.this
for chaining.public long getRebalanceThrottle()
Value of 0
means that throttling is disabled. By default throttling is disabled -
the default is defined by DFLT_REBALANCE_THROTTLE
constant.
0
to disable throttling.public CacheConfiguration<K,V> setRebalanceThrottle(long rebalanceThrottle)
Value of 0
means that throttling is
disabled. By default throttling is disabled - the default is defined by DFLT_REBALANCE_THROTTLE
constant.
rebalanceThrottle
- Time in milliseconds to wait between rebalance messages to avoid overloading of CPU,
0
to disable throttling.this
for chaining.public AffinityKeyMapper getAffinityMapper()
If not provided, then default implementation will be used. The default behavior
is described in AffinityKeyMapper
documentation.
public CacheConfiguration<K,V> setAffinityMapper(AffinityKeyMapper affMapper)
AffinityKeyMapper
documentation.affMapper
- Affinity mapper.this
for chaining.public long getOffHeapMaxMemory()
-1
- Means that off-heap storage is disabled.0
- 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.
-1
, specified by DFLT_OFFHEAP_MEMORY
constant
which means that off-heap storage is disabled by default.
Use off-heap storage to load gigabytes of data in memory without slowing down Garbage Collection. Essentially in this case you should allocate very small amount of memory to JVM and Ignite will cache most of the data in off-heap space without affecting JVM performance at all.
Note that Ignite will throw an exception if max memory is set to -1
and
offHeapValuesOnly
flag is set to true
.
public CacheConfiguration<K,V> setOffHeapMaxMemory(long offHeapMaxMem)
-1
- Means that
off-heap storage is disabled.0
- 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 infinitely. -1
,
specified by DFLT_OFFHEAP_MEMORY
constant which means that off-heap storage is disabled by default. Use off-heap storage to load gigabytes of data in memory without slowing down Garbage Collection. Essentially in this case you should allocate very small amount of memory to JVM and Ignite will cache most of the data in off-heap space without affecting JVM performance at all.
offHeapMaxMem
- Maximum memory in bytes available to off-heap memory space.this
for chaining.public CacheMemoryMode getMemoryMode()
CacheMemoryMode
for more info.
Default value is DFLT_MEMORY_MODE
.
public CacheConfiguration<K,V> setMemoryMode(CacheMemoryMode memMode)
memMode
- Memory mode.this
for chaining.@Nullable public CacheInterceptor<K,V> getInterceptor()
public CacheConfiguration<K,V> setInterceptor(CacheInterceptor<K,V> interceptor)
interceptor
- Cache interceptor.this
for chaining.public Collection<CacheTypeMetadata> getTypeMetadata()
public CacheConfiguration<K,V> setTypeMetadata(Collection<CacheTypeMetadata> typeMeta)
setQueryEntities(java.util.Collection)
instead.typeMeta
- Collection of type metadata.this
for chaining.public boolean isReadFromBackup()
false
always get data from primary node (never from backup).
Default value is defined by DFLT_READ_FROM_BACKUP
.
true
if data can be read from backup node or false
if data always
should be read from primary node and never from backup.public CacheConfiguration<K,V> setReadFromBackup(boolean readFromBackup)
readFromBackup
- true
to allow reads from backups.this
for chaining.public boolean isCopyOnRead()
CacheInterceptor
and to CacheEntryProcessor
.public CacheConfiguration<K,V> setCopyOnRead(boolean cpOnRead)
cpOnRead
- Copy on get flag.this
for chaining.isCopyOnRead()
public CacheConfiguration<K,V> setSqlFunctionClasses(Class<?>... cls)
QuerySqlFunction
to be used as user-defined functions from SQL queries.cls
- One or more classes with SQL functions.this
for chaining.@Nullable public Class<?>[] getSqlFunctionClasses()
QuerySqlFunction
to be used as user-defined functions from SQL queries.public long getLongQueryWarningTimeout()
public CacheConfiguration<K,V> setLongQueryWarningTimeout(long longQryWarnTimeout)
longQryWarnTimeout
- Timeout in milliseconds.this
for chaining.@Nullable public String getSqlSchema()
null
will be returned and
quoted case sensitive name will be used as sql schema.null
.public CacheConfiguration<K,V> setSqlSchema(String sqlSchema)
cacheName
is used instead.
sqlSchema
could not be an empty string. Has to be "\"\""
instead.sqlSchema
- Schema name for current cache according to SQL ANSI-99. Should not be null
.this
for chaining.public boolean isSqlEscapeAll()
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.public CacheConfiguration<K,V> setSqlEscapeAll(boolean sqlEscapeAll)
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.sqlEscapeAll
- Flag value.this
for chaining.public Class<?>[] getIndexedTypes()
The same key class can occur multiple times for different value classes, but each value class must be unique because SQL table will be named as value class simple name.
To expose fields of these types onto SQL level and to index them you have to use annotations
from package org.apache.ignite.cache.query.annotations
.
public CacheConfiguration<K,V> setIndexedTypes(Class<?>... indexedTypes)
The same key class can occur multiple times for different value classes, but each value class must be unique because SQL table will be named as value class simple name.
To expose fields of these types onto SQL level and to index them you have to use annotations
from package org.apache.ignite.cache.query.annotations
.
indexedTypes
- Key and value type pairs.this
for chaining.public int getSqlOnheapRowCacheSize()
setOffHeapMaxMemory(long)
public CacheConfiguration<K,V> setSqlOnheapRowCacheSize(int size)
size
- Cache size.this
for chaining.setOffHeapMaxMemory(long)
public boolean isSnapshotableIndex()
True
if SQL indexes should support snapshots.public CacheConfiguration<K,V> setSnapshotableIndex(boolean snapshotableIdx)
Default value is false
.
Note that this flag is ignored if indexes are stored in offheap memory, for offheap indexes snapshots are always enabled.
snapshotableIdx
- True
if SQL indexes should support snapshots.this
for chaining.public CachePluginConfiguration[] getPluginConfigurations()
public CacheConfiguration<K,V> setPluginConfigurations(CachePluginConfiguration... pluginCfgs)
pluginCfgs
- Cache plugin configurations.this
for chaining.public Collection<QueryEntity> getQueryEntities()
public CacheConfiguration<K,V> setQueryEntities(Collection<QueryEntity> qryEntities)
qryEntities
- Query entities.this
for chaining.public TopologyValidator getTopologyValidator()
See TopologyValidator
for details.
public CacheConfiguration<K,V> setTopologyValidator(TopologyValidator topValidator)
See TopologyValidator
for details.
topValidator
- validator.this
for chaining.public javax.cache.configuration.Factory<? extends CacheStoreSessionListener>[] getCacheStoreSessionListenerFactories()
CacheStoreSessionListener
public CacheConfiguration<K,V> setCacheStoreSessionListenerFactories(javax.cache.configuration.Factory<? extends CacheStoreSessionListener>... storeSesLsnrs)
These listeners override global listeners provided in
IgniteConfiguration.setCacheStoreSessionListenerFactories(Factory[])
configuration property.
storeSesLsnrs
- Cache store session listener factories.this
for chaining.CacheStoreSessionListener
public Iterable<javax.cache.configuration.CacheEntryListenerConfiguration<K,V>> getCacheEntryListenerConfigurations()
public javax.cache.configuration.MutableConfiguration<K,V> addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryLsnrCfg)
public javax.cache.configuration.MutableConfiguration<K,V> removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryLsnrCfg)
protected Object writeReplace()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0.final Release Date : December 29 2015