K
- keyV
- valuepublic interface RMapCache<K,V> extends RMap<K,V>, RMapCacheAsync<K,V>
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 map entry 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 |
---|---|
V |
put(K key,
V value,
long ttl,
TimeUnit unit) |
V |
putIfAbsent(K key,
V value,
long ttl,
TimeUnit unit) |
int |
size()
Returns the number of entries in cache.
|
addAndGet, entryIterator, fastPut, fastRemove, filterEntries, filterKeys, filterValues, getAll, keyIterator, valueIterator
putIfAbsent, remove, replace, replace
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, values
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getName, isExists, migrate, move, rename, renamenx
putAsync, putIfAbsentAsync, sizeAsync
addAndGetAsync, containsKeyAsync, containsValueAsync, fastPutAsync, fastRemoveAsync, getAllAsync, getAsync, putAllAsync, putAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync
Copyright © 2014–2015. All rights reserved.