Package org.redisson.micronaut.cache
Class BaseCacheConfiguration
java.lang.Object
org.redisson.micronaut.cache.BaseCacheConfiguration
- All Implemented Interfaces:
io.micronaut.core.naming.Named
- Direct Known Subclasses:
RedissonCacheConfiguration,RedissonCacheNativeConfiguration
Micronaut Cache settings.
- Author:
- Nikita Koksharov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCodec()<K,V> MapOptions <K, V> intgetName()voidRedis data codec applied to cache entries.voidsetExpireAfterAccess(Duration expireAfterAccess) Cache entry time to live duration applied after each read operation.voidsetExpireAfterWrite(Duration expireAfterWrite) Cache entry time to live duration applied after each write operation.voidSetsMapLoaderobject used to load entries during read-operations execution.voidsetMaxSize(int maxSize) Max size of this cache.voidsetWriteBehindBatchSize(int writeBehindBatchSize) Sets write behind tasks batch size.voidsetWriteBehindDelay(int writeBehindDelay) Sets write behind tasks execution delay.voidsetWriteMode(MapOptions.WriteMode writeMode) Sets write mode.voidSetsMapWriterobject used for write-through operations.
-
Constructor Details
-
BaseCacheConfiguration
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getCodec
-
setCodec
Redis data codec applied to cache entries. Default is Kryo5Codec codec- Parameters:
codec- - data codec- See Also:
-
getExpireAfterWrite
-
setExpireAfterWrite
Cache entry time to live duration applied after each write operation.- Parameters:
expireAfterWrite- - time to live duration
-
getExpireAfterAccess
-
setExpireAfterAccess
Cache entry time to live duration applied after each read operation.- Parameters:
expireAfterAccess- - time to live duration
-
getMaxSize
public int getMaxSize() -
setMaxSize
public void setMaxSize(int maxSize) Max size of this cache. Superfluous elements are evicted using LRU algorithm.- Parameters:
maxSize- - max size If0the cache is unbounded (default).
-
setWriteBehindBatchSize
public void setWriteBehindBatchSize(int writeBehindBatchSize) Sets write behind tasks batch size. During MapWriter methods execution all updates accumulated into a batch of specified size.Default is
50- Parameters:
writeBehindBatchSize- - size of batch
-
setWriteBehindDelay
public void setWriteBehindDelay(int writeBehindDelay) Sets write behind tasks execution delay. All updates would be applied with lag not more than specified delay.Default is
1000milliseconds- Parameters:
writeBehindDelay- - delay in milliseconds
-
setWriter
SetsMapWriterobject used for write-through operations.- Parameters:
writer- object
-
setWriteMode
Sets write mode.Default is
MapOptions.WriteMode.WRITE_THROUGH- Parameters:
writeMode- - write mode
-
setLoader
SetsMapLoaderobject used to load entries during read-operations execution.- Parameters:
loader- object
-
getMapOptions
-
getOldMapOptions
-