K
- keyV
- valuepublic interface RMapCacheAsync<K,V> extends RMapAsync<K,V>
Async interface for map-based cache with ability to set TTL for each entry via
#put(Object, Object, long, TimeUnit)
or #putIfAbsent(Object, Object, long, TimeUnit)
And therefore has an complex lua-scripts inside.
Current redis implementation doesnt have eviction functionality.
Thus entries are checked for TTL expiration during any key/value/entry read operation.
If key/value/entry expired then it doesn't returns and clean task runs asynchronous.
Clean task deletes removes 100 expired entries at once.
In addition there is EvictionScheduler
. This scheduler
deletes expired entries in time interval between 5 seconds to 2 hours.
If eviction is not required then it's better to use RedissonMapReactive
.
Modifier and Type | Method and Description |
---|---|
io.netty.util.concurrent.Future<Boolean> |
fastPutAsync(K key,
V value,
long ttl,
TimeUnit unit)
Stores value mapped by key with specified time to live.
|
io.netty.util.concurrent.Future<Boolean> |
fastPutAsync(K key,
V value,
long ttl,
TimeUnit ttlUnit,
long maxIdleTime,
TimeUnit maxIdleUnit)
Stores value mapped by key with specified time to live and max idle time.
|
io.netty.util.concurrent.Future<V> |
putAsync(K key,
V value,
long ttl,
TimeUnit unit)
Stores value mapped by key with specified time to live.
|
io.netty.util.concurrent.Future<V> |
putAsync(K key,
V value,
long ttl,
TimeUnit ttlUnit,
long maxIdleTime,
TimeUnit maxIdleUnit)
Stores value mapped by key with specified time to live and max idle time.
|
io.netty.util.concurrent.Future<V> |
putIfAbsentAsync(K key,
V value,
long ttl,
TimeUnit unit)
If the specified key is not already associated
with a value, associate it with the given value.
|
io.netty.util.concurrent.Future<V> |
putIfAbsentAsync(K key,
V value,
long ttl,
TimeUnit ttlUnit,
long maxIdleTime,
TimeUnit maxIdleUnit)
If the specified key is not already associated
with a value, associate it with the given value.
|
io.netty.util.concurrent.Future<Integer> |
sizeAsync()
Returns the number of entries in cache.
|
addAndGetAsync, containsKeyAsync, containsValueAsync, fastPutAsync, fastPutIfAbsentAsync, fastRemoveAsync, getAllAsync, getAsync, putAllAsync, putAsync, putIfAbsentAsync, readAllEntrySetAsync, readAllKeySetAsync, readAllValuesAsync, removeAsync, removeAsync, replaceAsync, replaceAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync
io.netty.util.concurrent.Future<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit unit)
key
- value
- ttl
- - time to live for key\value entry.
If 0
then stores infinitely.unit
- io.netty.util.concurrent.Future<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
key
- value
- ttl
- - time to live for key\value entry.
If 0
then time to live doesn't affect entry expiration.ttlUnit
- maxIdleTime
- - max idle time for key\value entry.
If 0
then max idle time doesn't affect entry expiration.maxIdleUnit
-
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.io.netty.util.concurrent.Future<V> putAsync(K key, V value, long ttl, TimeUnit unit)
key
- value
- ttl
- - time to live for key\value entry.
If 0
then stores infinitely.unit
- io.netty.util.concurrent.Future<V> putAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
key
- value
- ttl
- - time to live for key\value entry.
If 0
then time to live doesn't affect entry expiration.ttlUnit
- maxIdleTime
- - max idle time for key\value entry.
If 0
then max idle time doesn't affect entry expiration.maxIdleUnit
-
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.io.netty.util.concurrent.Future<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit unit)
#put(Object, Object, long, TimeUnit)
as it not returns previous value.key
- value
- ttl
- - time to live for key\value entry.
If 0
then stores infinitely.unit
- io.netty.util.concurrent.Future<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
#put(Object, Object, long, TimeUnit, long, TimeUnit)
as it not returns previous value.key
- value
- ttl
- - time to live for key\value entry.
If 0
then time to live doesn't affect entry expiration.ttlUnit
- maxIdleTime
- - max idle time for key\value entry.
If 0
then max idle time doesn't affect entry expiration.maxIdleUnit
-
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.Copyright © 2014–2016. All rights reserved.