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 | Field and Description |
---|---|
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 boolean |
DFLT_COPY_ON_READ
Default value for 'copyOnRead' flag.
|
static CacheDistributionMode |
DFLT_DISTRIBUTION_MODE
Default value for cache distribution mode.
|
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_NEAR_SYNCHRONIZED
Default near nodes eviction synchronized flag.
|
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 int |
DFLT_MAX_CONCURRENT_ASYNC_OPS
Default value for 'maxConcurrentAsyncOps'.
|
static float |
DFLT_MAX_EVICTION_OVERFLOW_RATIO
Default maximum eviction queue ratio.
|
static int |
DFLT_MAX_QUERY_ITERATOR_CNT
Default maximum number of query iterators that can be stored.
|
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_QUERY_INDEX_ENABLED
Default value for 'queryIndexEnabled' flag.
|
static long |
DFLT_QUERY_TIMEOUT
Default query timeout.
|
static boolean |
DFLT_READ_FROM_BACKUP
Default value for 'readFromBackup' flag.
|
static int |
DFLT_REBALANCE_BATCH_SIZE
Default rebalance batch size in bytes.
|
static CacheRebalanceMode |
DFLT_REBALANCE_MODE
Default rebalance mode for distributed cache.
|
static int |
DFLT_REBALANCE_THREAD_POOL_SIZE
Default size of rebalance thread pool.
|
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_START_SIZE
Initial default cache size.
|
static boolean |
DFLT_SWAP_ENABLED
Default value for 'swapEnabled' flag.
|
static long |
DFLT_TIME_TO_LIVE
Default time to live.
|
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 cfg)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
CacheAffinityFunction |
getAffinity()
Gets key topology resolver to provide mapping from keys to nodes.
|
CacheAffinityKeyMapper |
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. |
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.
|
long |
getDefaultLockTimeout()
Gets default lock acquisition timeout.
|
long |
getDefaultQueryTimeout()
Gets default query timeout.
|
long |
getDefaultTimeToLive()
Gets time to live for all objects in cache.
|
CacheDistributionMode |
getDistributionMode()
Gets cache distribution mode.
|
CacheEvictionFilter<K,V> |
getEvictionFilter()
Gets eviction filter to specify which entries should not be evicted
(except explicit evict by calling
IgniteCache.localEvict(Collection) ). |
CacheEvictionPolicy<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.
|
String |
getIndexingSpiName()
Gets name of the SPI to use for indexing.
|
CacheInterceptor<K,V> |
getInterceptor()
Gets cache interceptor.
|
int |
getMaxConcurrentAsyncOperations()
Gets maximum number of allowed concurrent asynchronous operations.
|
int |
getMaximumQueryIteratorCount()
Gets maximum number of query iterators that can be stored.
|
CacheMemoryMode |
getMemoryMode()
Gets memory mode for cache.
|
String |
getName()
Cache name.
|
CacheEvictionPolicy<K,V> |
getNearEvictionPolicy()
Gets eviction policy for
near cache which is different from the one used for
partitioned cache. |
int |
getNearStartSize()
Gets initial cache size for near cache which will be used to pre-create internal
hash table after start.
|
long |
getOffHeapMaxMemory()
Gets maximum amount of memory available to off-heap storage.
|
CacheQueryConfiguration |
getQueryConfiguration()
Gets query configuration.
|
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()
Gets size of rebalancing thread pool.
|
long |
getRebalanceThrottle()
Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
|
long |
getRebalanceTimeout()
Gets rebalance timeout (ms).
|
int |
getStartSize()
Gets initial cache size which will be used to pre-create internal
hash table after start.
|
String |
getTransactionManagerLookupClassName()
Gets class name of transaction manager finder for integration for JEE app servers.
|
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 |
isEvictNearSynchronized()
Gets flag indicating whether eviction on primary node is synchronized with
near nodes where entry is kept.
|
boolean |
isEvictSynchronized()
Gets flag indicating whether eviction is synchronized between primary and
backup nodes on partitioned cache.
|
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 |
isQueryIndexEnabled()
Flag indicating whether Ignite should attempt to index value and/or key instances
stored in cache.
|
boolean |
isReadFromBackup()
Gets flag indicating whether data can be read from backup.
|
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.
|
void |
setAffinity(CacheAffinityFunction aff)
Sets affinity for cache keys.
|
void |
setAffinityMapper(CacheAffinityKeyMapper affMapper)
Sets custom affinity mapper.
|
void |
setAtomicityMode(CacheAtomicityMode atomicityMode)
Sets cache atomicity mode.
|
void |
setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode)
Sets cache write ordering mode.
|
void |
setBackups(int backups)
Sets number of nodes used to back up single partition for
CacheMode.PARTITIONED cache. |
void |
setCacheMode(CacheMode cacheMode)
Sets caching mode.
|
void |
setCacheStoreFactory(javax.cache.configuration.Factory<? extends CacheStore<? super K,? super V>> storeFactory)
Sets factory fpr persistent storage for cache data.
|
void |
setCopyOnRead(boolean cpOnGet)
Set copy on get flag.
|
void |
setDefaultLockTimeout(long dfltLockTimeout)
Sets default lock timeout in milliseconds.
|
void |
setDefaultQueryTimeout(long dfltQryTimeout)
Sets default query timeout,
0 for never. |
void |
setDefaultTimeToLive(long ttl)
Sets time to live for all objects in cache.
|
void |
setDistributionMode(CacheDistributionMode distro)
Sets cache distribution mode.
|
void |
setEagerTtl(boolean eagerTtl)
Sets eager ttl flag.
|
void |
setEvictionFilter(CacheEvictionFilter<K,V> evictFilter)
Sets eviction filter.
|
void |
setEvictionPolicy(CacheEvictionPolicy evictPlc)
Sets cache eviction policy.
|
void |
setEvictMaxOverflowRatio(float evictMaxOverflowRatio)
Sets maximum eviction overflow ratio.
|
void |
setEvictNearSynchronized(boolean evictNearSync)
Sets flag indicating whether eviction is synchronized with near nodes.
|
void |
setEvictSynchronized(boolean evictSync)
Sets flag indicating whether eviction is synchronized with backup nodes (or the rest of the nodes for replicated
cache).
|
void |
setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl)
Sets concurrency level for synchronized evictions.
|
void |
setEvictSynchronizedKeyBufferSize(int evictKeyBufSize)
Sets eviction key buffer size.
|
void |
setEvictSynchronizedTimeout(long evictSyncTimeout)
Sets timeout for synchronized evictions.
|
void |
setIndexingSpiName(String indexingSpiName)
Sets name of the SPI to use for indexing.
|
void |
setInterceptor(CacheInterceptor<K,V> interceptor)
Sets cache interceptor.
|
void |
setInvalidate(boolean invalidate)
Sets invalidation flag for near cache entries in this transaction.
|
void |
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 . |
void |
setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps)
Sets maximum number of concurrent asynchronous operations.
|
void |
setMaximumQueryIteratorCount(int maxQryIterCnt)
Sets maximum number of query iterators that can be stored.
|
void |
setMemoryMode(CacheMemoryMode memMode)
Sets memory mode for cache.
|
void |
setName(String name)
Sets cache name.
|
void |
setNearEvictionPolicy(CacheEvictionPolicy nearEvictPlc)
Sets eviction policy for near cache.
|
void |
setNearStartSize(int nearStartSize)
Start size for near cache.
|
void |
setOffHeapMaxMemory(long offHeapMaxMem)
Sets maximum amount of memory available to off-heap storage.
|
void |
setQueryConfiguration(CacheQueryConfiguration qryCfg)
Sets query configuration.
|
void |
setQueryIndexEnabled(boolean qryIdxEnabled)
Flag indicating whether query indexing is enabled or not.
|
void |
setReadFromBackup(boolean readFromBackup)
Sets read from backup flag.
|
void |
setRebalanceBatchSize(int rebalanceBatchSize)
Sets rebalance batch size.
|
void |
setRebalanceDelay(long rebalanceDelay)
Sets rebalance delay (see
getRebalanceDelay() for more information). |
void |
setRebalanceMode(CacheRebalanceMode rebalanceMode)
Sets cache rebalance mode.
|
void |
setRebalanceOrder(int rebalanceOrder)
Sets cache rebalance order.
|
void |
setRebalanceThreadPoolSize(int rebalancePoolSize)
Sets size of rebalancing thread pool.
|
void |
setRebalanceThrottle(long rebalanceThrottle)
Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
|
void |
setRebalanceTimeout(long rebalanceTimeout)
Sets rebalance timeout (ms).
|
void |
setStartSize(int startSize)
Initial size for internal hash map.
|
void |
setSwapEnabled(boolean swapEnabled)
Flag indicating whether swap storage is enabled or not.
|
void |
setTransactionManagerLookupClassName(String tmLookupClsName)
Sets look up mechanism for available
TransactionManager implementation, if any. |
void |
setTypeMetadata(Collection<CacheTypeMetadata> typeMeta)
Sets collection of type metadata objects.
|
void |
setWriteBehindBatchSize(int writeBehindBatchSize)
Sets maximum batch size for write-behind cache.
|
void |
setWriteBehindEnabled(boolean writeBehindEnabled)
Sets flag indicating whether write-behind is enabled.
|
void |
setWriteBehindFlushFrequency(long writeBehindFlushFreq)
Sets write-behind flush frequency.
|
void |
setWriteBehindFlushSize(int writeBehindFlushSize)
Sets write-behind flush size.
|
void |
setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt)
Sets flush thread count for write-behind cache.
|
void |
setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync)
Sets write synchronization mode.
|
String |
toString() |
addCacheEntryListenerConfiguration, equals, getCacheEntryListenerConfigurations, getCacheLoaderFactory, getCacheWriterFactory, getExpiryPolicyFactory, getKeyType, getValueType, hashCode, isManagementEnabled, isReadThrough, isStatisticsEnabled, isStoreByValue, isWriteThrough, removeCacheEntryListenerConfiguration, setCacheLoaderFactory, setCacheWriterFactory, setExpiryPolicyFactory, setManagementEnabled, setReadThrough, setStatisticsEnabled, setStoreByValue, setTypes, setWriteThrough
public static final int DFLT_REBALANCE_THREAD_POOL_SIZE
public static final long DFLT_REBALANCE_TIMEOUT
public static final long DFLT_REBALANCE_THROTTLE
public static final long DFLT_TIME_TO_LIVE
public static final int DFLT_BACKUPS
public static final CacheMode DFLT_CACHE_MODE
public static final CacheAtomicityMode DFLT_CACHE_ATOMICITY_MODE
public static final CacheDistributionMode DFLT_DISTRIBUTION_MODE
public static final long DFLT_QUERY_TIMEOUT
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 boolean DFLT_EVICT_NEAR_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_QUERY_INDEX_ENABLED
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 int DFLT_MAX_QUERY_ITERATOR_CNT
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 boolean DFLT_COPY_ON_READ
public CacheConfiguration()
public CacheConfiguration(javax.cache.configuration.CompleteConfiguration cfg)
cfg
- Configuration to copy.public String getName()
null
, then this will be considered a default
cache which can be accessed via Ignite.jcache(String)
method. Otherwise, if name
is provided, the cache will be accessed via Ignite.jcache(String)
method.public void setName(String name)
name
- Cache name. May be null, but may not be empty string.public long getDefaultTimeToLive()
0
which means that objects never expire.public void setDefaultTimeToLive(long ttl)
ttl
- Time to live for all objects in cache.@Nullable public CacheEvictionPolicy<K,V> getEvictionPolicy()
null
which means that evictions are disabled for cache.null
if evictions should be disabled.public void setEvictionPolicy(@Nullable CacheEvictionPolicy evictPlc)
evictPlc
- Cache expiration policy.public CacheDistributionMode getDistributionMode()
getCacheMode()
is set to CacheMode.PARTITIONED
or CacheMode.REPLICATED
mode.
If not set, default value is DFLT_DISTRIBUTION_MODE
.
public void setDistributionMode(CacheDistributionMode distro)
distro
- Distribution mode.public CacheWriteSynchronizationMode getWriteSynchronizationMode()
public void setWriteSynchronizationMode(CacheWriteSynchronizationMode writeSync)
writeSync
- Write synchronization mode.@Nullable public CacheEvictionPolicy<K,V> getNearEvictionPolicy()
near
cache which is different from the one used for
partitioned
cache. By default, returns null
which means that evictions are disabled for near cache.null
if evictions should be disabled.public void setNearEvictionPolicy(@Nullable CacheEvictionPolicy nearEvictPlc)
CacheMode.PARTITIONED
caching
mode.nearEvictPlc
- Eviction policy for near cache.public boolean isEvictSynchronized()
true
and
swap is disabled then CacheProjection.evict(Object)
and all its variations will involve all nodes where an entry is kept -
this is a group of nodes responsible for partition to which
corresponding key belongs. If this property is set to false
then
eviction is done independently on 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 void setEvictSynchronized(boolean evictSync)
evictSync
- true
if synchronized, false
if not.public void setEvictNearSynchronized(boolean evictNearSync)
evictNearSync
- true
if synchronized, false
if not.public boolean isEvictNearSynchronized()
true
and
is defined by DFLT_EVICT_NEAR_SYNCHRONIZED
.
Note that in most cases this property should be set to true
to keep
cache consistency. But there may be the cases when user may use some
special near eviction policy to have desired control over near cache
entry set.
true
If eviction is synchronized with near nodes in
partitioned cache, false
if not.public int getEvictSynchronizedKeyBufferSize()
Default value is defined by DFLT_EVICT_KEY_BUFFER_SIZE
.
public void setEvictSynchronizedKeyBufferSize(int evictKeyBufSize)
evictKeyBufSize
- Eviction key buffer size.public int getEvictSynchronizedConcurrencyLevel()
isEvictNearSynchronized()
or 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 void setEvictSynchronizedConcurrencyLevel(int evictSyncConcurrencyLvl)
evictSyncConcurrencyLvl
- Concurrency level for synchronized evictions.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 void setEvictSynchronizedTimeout(long evictSyncTimeout)
evictSyncTimeout
- Timeout for synchronized evictions.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 void setEvictMaxOverflowRatio(float evictMaxOverflowRatio)
evictMaxOverflowRatio
- Maximum eviction overflow ratio.public CacheEvictionFilter<K,V> getEvictionFilter()
IgniteCache.localEvict(Collection)
).
If CacheEvictionFilter.evictAllowed(javax.cache.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 void setEvictionFilter(CacheEvictionFilter<K,V> evictFilter)
evictFilter
- Eviction filter.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 CacheEvictionPolicy
.
public void setEagerTtl(boolean eagerTtl)
eagerTtl
- True
if Ignite should eagerly remove expired cache entries.isEagerTtl()
public int getStartSize()
DFLT_START_SIZE
.public void setStartSize(int startSize)
startSize
- Cache start size.public int getNearStartSize()
DFLT_NEAR_START_SIZE
.public void setNearStartSize(int nearStartSize)
CacheMode.PARTITIONED
caching mode.nearStartSize
- Start size for near cache.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 void 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.public javax.cache.configuration.Factory<CacheStore<? super K,? super V>> getCacheStoreFactory()
public void setCacheStoreFactory(javax.cache.configuration.Factory<? extends CacheStore<? super K,? super V>> storeFactory)
storeFactory
- Cache store factory.public CacheAffinityFunction getAffinity()
public void setAffinity(CacheAffinityFunction aff)
aff
- Cache key affinity.public CacheMode getCacheMode()
CacheMode.REPLICATED
mode will be used by default (defined by DFLT_CACHE_MODE
constant).True
if cache is local.public void setCacheMode(CacheMode cacheMode)
cacheMode
- Caching mode.public CacheAtomicityMode getAtomicityMode()
Default value is defined by DFLT_CACHE_ATOMICITY_MODE
.
public void setAtomicityMode(CacheAtomicityMode atomicityMode)
atomicityMode
- Cache atomicity mode.public CacheAtomicWriteOrderMode getAtomicWriteOrderMode()
CacheAtomicityMode.ATOMIC
cache (for other atomicity modes it will be ignored).public void setAtomicWriteOrderMode(CacheAtomicWriteOrderMode atomicWriteOrderMode)
CacheAtomicityMode.ATOMIC
cache (for other atomicity modes it will be ignored).atomicWriteOrderMode
- Cache write ordering mode.public int getBackups()
CacheMode.PARTITIONED
cache.
If not set, default value is DFLT_BACKUPS
.
public void setBackups(int backups)
CacheMode.PARTITIONED
cache.
If not set, default value is DFLT_BACKUPS
.
backups
- Number of backup nodes for one partition.public long getDefaultLockTimeout()
DFLT_LOCK_TIMEOUT
which is 0
and means that lock acquisition will never timeout.public void setDefaultLockTimeout(long dfltLockTimeout)
DFLT_LOCK_TIMEOUT
.dfltLockTimeout
- Default lock timeout.public long getDefaultQueryTimeout()
DFLT_QUERY_TIMEOUT
. 0
(zero)
means that the query will never timeout and will wait for completion.0
for never.public void setDefaultQueryTimeout(long dfltQryTimeout)
0
for never. For more information see getDefaultQueryTimeout()
.dfltQryTimeout
- Default query timeout.public boolean isInvalidate()
true
, values will be invalidated (nullified) upon commit in near cache.public void setInvalidate(boolean invalidate)
false
.invalidate
- Flag to set this cache into invalidation-based mode. Default value is false
.public String getTransactionManagerLookupClassName()
public void setTransactionManagerLookupClassName(String tmLookupClsName)
TransactionManager
implementation, if any.tmLookupClsName
- Name of class implementing GridCacheTmLookup interface that is used to
receive JTA transaction manager.public void setRebalanceMode(CacheRebalanceMode rebalanceMode)
rebalanceMode
- Rebalance mode.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 (except caches with rebalance order 0
) will be completed.
Note that cache with order 0
does not participate in ordering. This means that cache with
rebalance order 1
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 void setRebalanceOrder(int rebalanceOrder)
rebalanceOrder
- Cache rebalance order.getRebalanceOrder()
public int getRebalanceBatchSize()
DFLT_REBALANCE_BATCH_SIZE
.public void setRebalanceBatchSize(int rebalanceBatchSize)
rebalanceBatchSize
- Rebalance batch size.public boolean isSwapEnabled()
DFLT_SWAP_ENABLED
constant.
Note that this flag may be overridden for cache projection created with flag
CacheFlag.SKIP_SWAP
.
True
if swap storage is enabled.public void setSwapEnabled(boolean swapEnabled)
swapEnabled
- True
if swap storage is enabled.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 void setMaxConcurrentAsyncOperations(int maxConcurrentAsyncOps)
maxConcurrentAsyncOps
- Maximum number of concurrent asynchronous operations.getMaxConcurrentAsyncOperations()
public boolean isQueryIndexEnabled()
false
, then all indexing annotations
inside of any class will be ignored. By default query indexing is disabled and
defined via DFLT_QUERY_INDEX_ENABLED
constant.True
if query indexing is enabled.getMemoryMode()
public void setQueryIndexEnabled(boolean qryIdxEnabled)
qryIdxEnabled
- True
if query indexing is enabled.public boolean isWriteBehindEnabled()
DFLT_WRITE_BEHIND_ENABLED
constant.True
if write-behind is enabled.public void setWriteBehindEnabled(boolean writeBehindEnabled)
writeBehindEnabled
- true
if write-behind is enabled.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 void setWriteBehindFlushSize(int writeBehindFlushSize)
writeBehindFlushSize
- Write-behind cache flush size.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 void setWriteBehindFlushFrequency(long writeBehindFlushFreq)
writeBehindFlushFreq
- Write-behind flush frequency in milliseconds.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 void setWriteBehindFlushThreadCount(int writeBehindFlushThreadCnt)
writeBehindFlushThreadCnt
- Count of flush threads.getWriteBehindFlushThreadCount()
public int getWriteBehindBatchSize()
CacheWriter.writeAll(Collection)
or
CacheWriter.deleteAll(Collection)
methods.
If not provided, default value is DFLT_WRITE_BEHIND_BATCH_SIZE
.public void setWriteBehindBatchSize(int writeBehindBatchSize)
writeBehindBatchSize
- Maximum batch size.getWriteBehindBatchSize()
public int getRebalanceThreadPoolSize()
Default value is DFLT_REBALANCE_THREAD_POOL_SIZE
.
public void setRebalanceThreadPoolSize(int rebalancePoolSize)
rebalancePoolSize
- Size of rebalancing thread pool.public long getRebalanceTimeout()
Default value is DFLT_REBALANCE_TIMEOUT
.
public void setRebalanceTimeout(long rebalanceTimeout)
rebalanceTimeout
- Rebalance timeout (ms).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 CacheRendezvousAffinityFunction.setHashIdResolver(CacheAffinityNodeHashResolver)
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 GridCache.forceRepartition()
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 void setRebalanceDelay(long rebalanceDelay)
getRebalanceDelay()
for more information).rebalanceDelay
- Rebalance delay to set.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 void 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.public CacheAffinityKeyMapper getAffinityMapper()
If not provided, then default implementation will be used. The default behavior
is described in CacheAffinityKeyMapper
documentation.
public void setAffinityMapper(CacheAffinityKeyMapper affMapper)
CacheAffinityKeyMapper
documentation.affMapper
- Affinity mapper.public String getIndexingSpiName()
This property becomes useful in rare cases when more than one indexing SPI is configured. In majority of the cases default value should be used.
IndexingSpi
public void setIndexingSpiName(String indexingSpiName)
This property becomes useful in rare cases when more than one indexing SPI is configured. In majority of the cases default value should be used.
indexingSpiName
- Name.IndexingSpi
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 void 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.public int getMaximumQueryIteratorCount()
Default value is DFLT_MAX_QUERY_ITERATOR_CNT
.
public void setMaximumQueryIteratorCount(int maxQryIterCnt)
maxQryIterCnt
- Maximum number of query iterators that can be stored.public CacheMemoryMode getMemoryMode()
CacheMemoryMode
for more info.
Default value is DFLT_MEMORY_MODE
.
public void setMemoryMode(CacheMemoryMode memMode)
memMode
- Memory mode.@Nullable public CacheInterceptor<K,V> getInterceptor()
public void setInterceptor(CacheInterceptor<K,V> interceptor)
interceptor
- Cache interceptor.public Collection<CacheTypeMetadata> getTypeMetadata()
public void setTypeMetadata(Collection<CacheTypeMetadata> typeMeta)
typeMeta
- Collection of type metadata.public CacheQueryConfiguration getQueryConfiguration()
public void setQueryConfiguration(CacheQueryConfiguration qryCfg)
qryCfg
- Query configuration.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 void setReadFromBackup(boolean readFromBackup)
readFromBackup
- true
to allow reads from backups.public boolean isCopyOnRead()
CacheInterceptor
and to IgniteEntryProcessor
.
Copies are not created for immutable types, see IgniteImmutable
.
IgniteImmutable
public void setCopyOnRead(boolean cpOnGet)
cpOnGet
- Copy on get flag.isCopyOnRead()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015