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
public class BaseCacheConfiguration extends Object implements io.micronaut.core.naming.Named
Micronaut Cache settings.- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description BaseCacheConfiguration(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodecgetCodec()DurationgetExpireAfterAccess()DurationgetExpireAfterWrite()MapOptions<Object,Object>getMapOptions()intgetMaxSize()StringgetName()voidsetCodec(Codec codec)Redis 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.voidsetLoader(MapLoader<Object,Object> loader)SetsMapLoaderobject 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.voidsetWriter(MapWriter<Object,Object> writer)SetsMapWriterobject used for write-through operations.
-
-
-
Constructor Detail
-
BaseCacheConfiguration
public BaseCacheConfiguration(String name)
-
-
Method Detail
-
getName
@NonNull public String getName()
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getCodec
public Codec getCodec()
-
setCodec
public void setCodec(Codec codec)
Redis data codec applied to cache entries. Default is MarshallingCodec codec- Parameters:
codec- - data codec- See Also:
Codec,MarshallingCodec
-
getExpireAfterWrite
public Duration getExpireAfterWrite()
-
setExpireAfterWrite
public void setExpireAfterWrite(Duration expireAfterWrite)
Cache entry time to live duration applied after each write operation.- Parameters:
expireAfterWrite- - time to live duration
-
getExpireAfterAccess
public Duration getExpireAfterAccess()
-
setExpireAfterAccess
public void setExpireAfterAccess(Duration expireAfterAccess)
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
public void setWriter(MapWriter<Object,Object> writer)
SetsMapWriterobject used for write-through operations.- Parameters:
writer- object
-
setWriteMode
public void setWriteMode(MapOptions.WriteMode writeMode)
Sets write mode.Default is
MapOptions.WriteMode.WRITE_THROUGH- Parameters:
writeMode- - write mode
-
setLoader
public void setLoader(MapLoader<Object,Object> loader)
SetsMapLoaderobject used to load entries during read-operations execution.- Parameters:
loader- object
-
getMapOptions
public MapOptions<Object,Object> getMapOptions()
-
-