public 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
|Modifier and Type||Method and Description|
Stores value with specified time to live.
Read all elements at once
Returns the number of elements in cache.
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getCodec, getName, isExists, migrate, move, rename, renamenx
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
value- to add
ttl- - time to live for key\value entry. If
0then stores infinitely.
unit- - time unit
trueif value has been added.
falseif value already been in collection.
Copyright © 2014–2016 The Redisson Project. All rights reserved.