Package org.redisson.api.options
Class ClientSideCachingParams
java.lang.Object
org.redisson.api.options.ClientSideCachingParams
- All Implemented Interfaces:
ClientSideCachingOptions
- Author:
- Nikita Koksharov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.redisson.api.options.ClientSideCachingOptions
ClientSideCachingOptions.EvictionPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevictionPolicy(ClientSideCachingOptions.EvictionPolicy evictionPolicy) Defines client cache eviction policy.longintgetSize()longgetTtl()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.
-
Constructor Details
-
ClientSideCachingParams
public ClientSideCachingParams()
-
-
Method Details
-
evictionPolicy
public ClientSideCachingOptions evictionPolicy(ClientSideCachingOptions.EvictionPolicy evictionPolicy) Description copied from interface:ClientSideCachingOptionsDefines client cache eviction policy.- Specified by:
evictionPolicyin interfaceClientSideCachingOptions- 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
Description copied from interface:ClientSideCachingOptionsDefines client cache size.If size is
0then client cache is unbounded.If size is
-1then client cache is always empty and doesn't store data.- Specified by:
sizein interfaceClientSideCachingOptions- Parameters:
size- size of client cache- Returns:
- options instance
-
timeToLive
Description copied from interface:ClientSideCachingOptionsDefines time to live in milliseconds of each map entry in client cache. If value equals to0then timeout is not applied- Specified by:
timeToLivein interfaceClientSideCachingOptions- Parameters:
ttl- - time to live in milliseconds- Returns:
- LocalCachedMapOptions instance
-
maxIdle
Description copied from interface:ClientSideCachingOptionsDefines max idle time in milliseconds of each map entry in client cache. If value equals to0then timeout is not applied- Specified by:
maxIdlein interfaceClientSideCachingOptions- Parameters:
idleTime- time to live in milliseconds- Returns:
- LocalCachedMapOptions instance
-
getEvictionPolicy
-
getSize
public int getSize() -
getTtl
public long getTtl() -
getIdleTime
public long getIdleTime()
-