K
- keyV
- valuepublic interface RMapCacheReactive<K,V> extends RMapReactive<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)
method.
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 |
---|---|
org.reactivestreams.Publisher<V> |
put(K key,
V value,
long ttl,
TimeUnit unit) |
org.reactivestreams.Publisher<V> |
putIfAbsent(K key,
V value,
long ttl,
TimeUnit unit) |
org.reactivestreams.Publisher<Integer> |
size()
Returns the number of entries in cache.
|
addAndGet, containsKey, containsValue, entryIterator, fastPut, fastRemove, get, getAll, keyIterator, put, putAll, putIfAbsent, remove, remove, replace, replace, valueIterator
clearExpire, expire, expireAt, expireAt, remainTimeToLive
org.reactivestreams.Publisher<Integer> size()
size
in interface RMapReactive<K,V>
Copyright © 2014–2016. All rights reserved.