V
- valuepublic interface RSetCache<V> extends Set<V>, RExpirable, RSetCacheAsync<V>
Set-based cache with ability to set TTL for each object.
Current Redis implementation doesn't have set entry eviction functionality.
Thus values are checked for TTL expiration during any value read operation.
If 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 RSet
.
Modifier and Type | Method and Description |
---|---|
boolean |
add(V value,
long ttl,
TimeUnit unit)
Stores value with specified time to live.
|
Iterator<V> |
iterator(String pattern)
Returns values iterator matches
pattern . |
<KOut,VOut> |
mapReduce()
Returns
RMapReduce object associated with this map |
Set<V> |
readAll()
Read all elements at once
|
int |
size()
Returns the number of elements in cache.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlink
addAsync, readAllAsync, sizeAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsync
Iterator<V> iterator(String pattern)
pattern
.pattern
- for values<KOut,VOut> RCollectionMapReduce<V,KOut,VOut> mapReduce()
RMapReduce
object associated with this mapKOut
- output keyVOut
- output valueboolean add(V value, long ttl, TimeUnit unit)
value
- to addttl
- - time to live for key\value entry.
If 0
then stores infinitely.unit
- - time unittrue
if value has been added. false
if value already been in collection.int size()
Copyright © 2014–2018 The Redisson Project. All rights reserved.