public class LocalCachedMapOptions extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LocalCachedMapOptions.EvictionPolicy |
Modifier | Constructor and Description |
---|---|
protected |
LocalCachedMapOptions(LocalCachedMapOptions copy) |
Modifier and Type | Method and Description |
---|---|
LocalCachedMapOptions |
cacheSize(int cacheSize)
Sets cache size.
|
static LocalCachedMapOptions |
defaults()
Creates a new instance of LocalCachedMapOptions with default options.
|
LocalCachedMapOptions |
evictionPolicy(LocalCachedMapOptions.EvictionPolicy evictionPolicy)
Sets eviction policy.
|
int |
getCacheSize() |
LocalCachedMapOptions.EvictionPolicy |
getEvictionPolicy() |
long |
getMaxIdleInMillis() |
long |
getTimeToLiveInMillis() |
LocalCachedMapOptions |
invalidateEntryOnChange(boolean value)
Sets entry invalidation behavior.
|
boolean |
isInvalidateEntryOnChange() |
LocalCachedMapOptions |
maxIdle(long maxIdleInMillis)
Sets max idle time in milliseconds for each map entry in cache.
|
LocalCachedMapOptions |
maxIdle(long maxIdle,
TimeUnit timeUnit)
Sets max idle time for each map entry in cache.
|
LocalCachedMapOptions |
timeToLive(long timeToLiveInMillis)
Sets time to live in milliseconds for each map entry in cache.
|
LocalCachedMapOptions |
timeToLive(long timeToLive,
TimeUnit timeUnit)
Sets time to live for each map entry in cache.
|
protected LocalCachedMapOptions(LocalCachedMapOptions copy)
public static LocalCachedMapOptions defaults()
This is equivalent to:
new LocalCachedMapOptions() .cacheSize(0).timeToLive(0).maxIdle(0) .evictionPolicy(EvictionPolicy.NONE) .invalidateEntryOnChange(true);
public boolean isInvalidateEntryOnChange()
public LocalCachedMapOptions.EvictionPolicy getEvictionPolicy()
public int getCacheSize()
public long getTimeToLiveInMillis()
public long getMaxIdleInMillis()
public LocalCachedMapOptions cacheSize(int cacheSize)
0
then cache is unbounded.cacheSize
- - size of cachepublic LocalCachedMapOptions invalidateEntryOnChange(boolean value)
value
- - if true
then invalidation message which removes corresponding entry from cache
will be sent to all other RLocalCachedMap instances on each entry update/remove operation.
if false
then invalidation message won't be sentpublic LocalCachedMapOptions evictionPolicy(LocalCachedMapOptions.EvictionPolicy evictionPolicy)
evictionPolicy
- LRU
- uses cache with LRU (least recently used) eviction policy.
LFU
- uses cache with LFU (least frequently used) eviction policy.
NONE
- doesn't use eviction policy, but timeToLive and maxIdleTime params are still working.
public LocalCachedMapOptions timeToLive(long timeToLiveInMillis)
0
then timeout is not appliedtimeToLiveInMillis
- - time to live in millisecondspublic LocalCachedMapOptions timeToLive(long timeToLive, TimeUnit timeUnit)
0
then timeout is not appliedtimeToLive
- - time to livetimeUnit
- - time unitpublic LocalCachedMapOptions maxIdle(long maxIdleInMillis)
0
then timeout is not appliedmaxIdleInMillis
- - time to live in millisecondspublic LocalCachedMapOptions maxIdle(long maxIdle, TimeUnit timeUnit)
0
then timeout is not appliedmaxIdle
- - max idle timetimeUnit
- - time unitCopyright © 2014–2016 The Redisson Project. All rights reserved.