Package org.redisson.api.options
Interface ClientSideCachingOptions
- All Known Implementing Classes:
ClientSideCachingParams
public interface ClientSideCachingOptions
- Author:
- Nikita Koksharov
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientSideCachingOptions
defaults()
Creates the default optionsevictionPolicy
(ClientSideCachingOptions.EvictionPolicy evictionPolicy) Defines client cache eviction policy.Defines max idle time in milliseconds of each map entry in client cache.size
(int size) Defines client cache size.timeToLive
(Duration ttl) Defines time to live in milliseconds of each map entry in client cache.
-
Method Details
-
defaults
Creates the default options- Returns:
- options instance
-
evictionPolicy
Defines client cache eviction policy.- Parameters:
evictionPolicy
-LRU
- uses client cache with LRU (least recently used) eviction policy.LFU
- uses client cache with LFU (least frequently used) eviction policy.SOFT
- uses client cache with soft references. The garbage collector will evict items from the client cache when the JVM is running out of memory.WEAK
- uses client cache with weak references. The garbage collector will evict items from the client cache when it became weakly reachable.NONE
- doesn't use eviction policy, but timeToLive and maxIdleTime params are still working.- Returns:
- options instance
-
size
Defines client cache size.If size is
0
then client cache is unbounded.If size is
-1
then client cache is always empty and doesn't store data.- Parameters:
size
- size of client cache- Returns:
- options instance
-
timeToLive
Defines time to live in milliseconds of each map entry in client cache. If value equals to0
then timeout is not applied- Parameters:
ttl
- - time to live in milliseconds- Returns:
- LocalCachedMapOptions instance
-
maxIdle
Defines max idle time in milliseconds of each map entry in client cache. If value equals to0
then timeout is not applied- Parameters:
idleTime
- time to live in milliseconds- Returns:
- LocalCachedMapOptions instance
-