Class RedissonMapCache<K,V>
- Type Parameters:
K- keyV- value
- All Implemented Interfaces:
ConcurrentMap<K,,V> Map<K,,V> RDestroyable,RExpirable,RExpirableAsync,RMap<K,,V> RMapAsync<K,,V> RMapCache<K,,V> RMapCacheAsync<K,,V> RObject,RObjectAsync
- Direct Known Subclasses:
MapCacheNativeWrapper,RedissonTransactionalMapCache
Map-based cache with ability to set TTL for each entry via
put(Object, Object, long, TimeUnit) or putIfAbsent(Object, Object, long, TimeUnit) methods.
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 RedissonMap object.
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
FieldsFields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name -
Constructor Summary
ConstructorsConstructorDescriptionRedissonMapCache(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapCacheOptions<K, V> options, WriteBehindService writeBehindService) RedissonMapCache(EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapCacheOptions<K, V> options, WriteBehindService writeBehindService) -
Method Summary
Modifier and TypeMethodDescriptionAdds the givendeltato the current value by mappedkey.addAndGetOperationAsync(K key, Number value) intaddListener(MapEntryListener listener) Adds map entry listeneraddListenerAsync(MapEntryListener listener) Adds map entry listenervoidclear()Clears map without removing options data used during map creation.booleanClear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync(String... keys) If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .containsKeyOperationAsync(String name, Object key) containsValueAsync(Object value) Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalseDelete object in async modevoiddestroy()Destroys object when it's not necessary anymore.booleanUseRExpirable.expire(Duration)insteadbooleanSets a timeout for this object.booleanSets an expiration date for this object.expireAsync(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)insteadexpireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync(Duration duration) Set a timeout for object.expireAsync(Instant instant) Set an expire date for object.booleanexpireAt(long timestamp) UseRExpirable.expire(Instant)insteadbooleanUseRExpirable.expire(Instant)insteadexpireAtAsync(long timestamp) UseRExpirableAsync.expireAsync(Instant)insteadexpireAtAsync(long timestamp, String param, String... keys) expireAtAsync(Date timestamp) UseRExpirableAsync.expireAsync(Instant)insteadintexpireEntries(Set<K> keys, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entries by keys.expireEntriesAsync(Set<K> keys, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entries by keys.intexpireEntriesIfNotSet(Set<K> keys, Duration ttl, Duration maxIdleTime) Sets time to live and max idle time of specified entries by keys.expireEntriesIfNotSetAsync(Set<K> keys, Duration ttl, Duration maxIdleTime) booleanexpireEntry(K key, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entry by key.expireEntryAsync(K key, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entry by key.booleanexpireEntryIfNotSet(K key, Duration ttl, Duration maxIdleTime) Sets time to live and max idle time of specified entry by key.expireEntryIfNotSetAsync(K key, Duration ttl, Duration maxIdleTime) booleanexpireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.booleanexpireIfGreater(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.booleanexpireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.booleanexpireIfLess(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.booleanexpireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.booleanexpireIfNotSet(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync(Instant time) Sets an expiration date for this object only if it hasn't been set before.booleanexpireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.booleanexpireIfSet(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync(Instant time) Sets an expiration date for this object only if it has been already set.booleanStores value mapped by key with specified time to live.booleanStores value mapped by key with specified time to live and max idle time.fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit) Stores value mapped by key with specified time to live.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.booleanfastPutIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.booleanfastPutIfAbsent(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.fastPutIfAbsentAsync(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.fastPutIfAbsentOperationAsync(K key, V value) fastPutIfExistsOperationAsync(K key, V value) fastPutOperationAsync(K key, V value) fastPutOperationAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) fastRemoveOperationAsync(K... keys) fastRemoveOperationBatchAsync(K... keys) fastReplaceOperationAsync(K key, V value) getAllOperationAsync(Set<K> keys) getAllWithTTLOnly(Set<K> keys) Returns map slice contained the mappings with definedkeys.getAllWithTTLOnlyAsync(Set<K> keys) Returns map slice contained the mappings with definedkeys.getAllWithTTLOnlyOperationAsync(Set<K> keys) longReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.getOperationAsync(K key) protected RTopicgetWithTTLOnly(K key) Returns the value mapped by definedkeyornullif value is absent.getWithTTLOnlyAsync(K key) Returns the value mapped by definedkeyornullif value is absent.Stores value mapped by key with specified time to live.Stores value mapped by key with specified time to live and max idle time.voidAssociates the specifiedvaluewith the specifiedkeyin batch.putAllAsync(Map<? extends K, ? extends V> map, long ttl, TimeUnit ttlUnit) Associates the specifiedvaluewith the specifiedkeyin batch.putAllOperationAsync(Map<? extends K, ? extends V> map) Stores value mapped by key with specified time to live.Stores value mapped by key with specified time to live and max idle time.putIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.putIfAbsent(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.putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.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.putIfAbsentOperationAsync(K key, V value) putIfExistsOperationAsync(K key, V value) putOperationAsync(K key, V value) putOperationAsync(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta, long ttlTimeoutDelta) randomEntriesAsync(int count) Returns random map entries from this map limited bycountrandomKeysAsync(int count) Returns random keys from this map limited bycountRead all map entries at onceRead all keys at onceRead all map as local instance at onceRead all values at oncelongReturns remaining time of the object in milliseconds.longremainTimeToLive(K key) Remaining time to live of map entry associated with akey.Returns remaining time of the object in milliseconds.remainTimeToLiveAsync(K key) Remaining time to live of map entry associated with akey.voidremoveListener(int listenerId) Removes object event listenerremoveListenerAsync(int listenerId) Removes object event listenerremoveOperationAsync(Object key, Object value) removeOperationAsync(K key) renameAsync(String nn) Rename current object key tonewNamein async moderenamenxAsync(String nn) Rename current object key tonewNamein async mode only if new key is not existsreplaceOperationAsync(K key, V value) replaceOperationAsync(K key, V oldValue, V newValue) scanIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) scanKeyIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) voidsetMaxSize(int maxSize) Sets max size of the map and overrides current value.voidsetMaxSize(int maxSize, EvictionMode mode) Sets max size of the map and overrides current value.setMaxSizeAsync(int maxSize) Sets max size of the map and overrides current value.setMaxSizeAsync(int maxSize, EvictionMode mode) Sets max size of the map and overrides current value.Returns bytes amount used by object in Redis memory.booleantrySetMaxSize(int maxSize) Tries to set max size of the map.booleantrySetMaxSize(int maxSize, EvictionMode mode) Tries to set max size of the map.trySetMaxSizeAsync(int maxSize) Tries to set max size of the map.trySetMaxSizeAsync(int maxSize, EvictionMode mode) Tries to set max size of the map.booleanupdateEntryExpiration(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) UseRMapCache.expireEntry(Object, Duration, Duration)instead.updateEntryExpirationAsync(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Methods inherited from class org.redisson.RedissonMap
addAndGetAsync, addListener, addListenerAsync, checkKey, checkValue, compute, computeAsync, computeIfAbsent, computeIfAbsentAsync, computeIfPresent, computeIfPresentAsync, containsKey, containsKeyAsync, containsKeyAsync, containsValue, encodeMapKeys, entryIterator, entrySet, entrySet, entrySet, entrySet, equals, fastPut, fastPutAsync, fastPutIfAbsent, fastPutIfAbsentAsync, fastPutIfExists, fastPutIfExistsAsync, fastRemove, fastRemoveAsync, fastReplace, fastReplaceAsync, get, getAll, getAllAsync, getAllAsync, getAsync, getAsync, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, hashCode, hasNoLoader, hasNoWriter, isEmpty, keyIterator, keySet, keySet, keySet, keySet, loadAll, loadAll, loadAllAsync, loadAllAsync, loadAllMapAsync, loadValue, loadValue, mapReduce, mapWriterFuture, mapWriterFuture, merge, mergeAsync, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfExists, putIfExistsAsync, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, removeAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, scanIterator, scanKeyIterator, size, sizeAsync, valueIterator, values, values, values, values, valueSize, valueSizeAsyncMethods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, addListenerId, addTrackingListener, addTrackingListenerAsync, checkNotBatch, copy, copy, copy, copyAndReplace, copyAndReplace, copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getListenerIdsByName, getLockByMapKey, getLockByValue, getName, getNameByListenerId, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, mapName, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenerAsync, removeListenerId, removeListeners, removeTrackingListener, removeTrackingListenerAsync, rename, renameAsync, renameAsync, renamenx, renamenxAsync, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RMap
addListener, containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, fastReplace, get, getAll, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, keySet, keySet, keySet, keySet, loadAll, loadAll, mapReduce, put, putAll, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSizeMethods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, addListenerAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, containsKeyAsync, fastPutAsync, fastPutIfAbsentAsync, fastPutIfExistsAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, loadAllAsync, loadAllAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, putIfExistsAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, valueSizeAsyncMethods inherited from interface org.redisson.api.RMapCacheAsync
sizeAsyncMethods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Field Details
-
publishCommand
-
-
Constructor Details
-
RedissonMapCache
public RedissonMapCache(EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapCacheOptions<K, V> options, WriteBehindService writeBehindService) -
RedissonMapCache
public RedissonMapCache(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapCacheOptions<K, V> options, WriteBehindService writeBehindService)
-
-
Method Details
-
trySetMaxSize
public boolean trySetMaxSize(int maxSize) Description copied from interface:RMapCacheTries to set max size of the map. Superfluous elements are evicted using LRU algorithm.- Specified by:
trySetMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max size- Returns:
trueif max size has been successfully set, otherwisefalse. If0the cache is unbounded (default).
-
trySetMaxSize
Description copied from interface:RMapCacheTries to set max size of the map. Superfluous elements are evicted using defined algorithm.- Specified by:
trySetMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
trueif max size has been successfully set, otherwisefalse.
-
trySetMaxSizeAsync
Description copied from interface:RMapCacheAsyncTries to set max size of the map. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
trySetMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max size- Returns:
trueif max size has been successfully set, otherwisefalse.
-
trySetMaxSizeAsync
Description copied from interface:RMapCacheAsyncTries to set max size of the map. Superfluous elements are evicted using defined algorithm.- Specified by:
trySetMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
trueif max size has been successfully set, otherwisefalse.
-
computeIfAbsent
Description copied from interface:RMapCacheIf the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
computeIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then stores infinitely.mappingFunction- the mapping function to compute a value- Returns:
- current associated value
-
computeIfAbsentAsync
public RFuture<V> computeIfAbsentAsync(K key, Duration ttl, Function<? super K, ? extends V> mappingFunction) Description copied from interface:RMapCacheAsyncIf the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
computeIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then stores infinitely.mappingFunction- the mapping function to compute a value- Returns:
- current associated value
-
setMaxSize
public void setMaxSize(int maxSize) Description copied from interface:RMapCacheSets max size of the map and overrides current value. Superfluous elements are evicted using LRU algorithm.- Specified by:
setMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max size If0the cache is unbounded (default).
-
setMaxSize
Description copied from interface:RMapCacheSets max size of the map and overrides current value. Superfluous elements are evicted using defined algorithm.- Specified by:
setMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode
-
setMaxSizeAsync
Description copied from interface:RMapCacheAsyncSets max size of the map and overrides current value. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
setMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max size- Returns:
- void
-
setMaxSizeAsync
Description copied from interface:RMapCacheAsyncSets max size of the map and overrides current value. Superfluous elements are evicted using defined algorithm.- Specified by:
setMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
- void
-
containsKeyOperationAsync
- Overrides:
containsKeyOperationAsyncin classRedissonMap<K,V>
-
containsValueAsync
Description copied from interface:RMapAsyncReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValueAsyncin interfaceRMapAsync<K,V> - Overrides:
containsValueAsyncin classRedissonMap<K,V> - Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
getAllOperationAsync
- Overrides:
getAllOperationAsyncin classRedissonMap<K,V>
-
putIfAbsent
Description copied from interface:RMapCacheIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
putIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- current associated value
-
putIfAbsentAsync
Description copied from interface:RMapCacheAsyncIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- previous associated value
-
putIfAbsent
public V putIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
- Specified by:
putIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- current associated value
-
putIfAbsentAsync
public RFuture<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
removeOperationAsync
- Overrides:
removeOperationAsyncin classRedissonMap<K,V>
-
getOperationAsync
- Overrides:
getOperationAsyncin classRedissonMap<K,V>
-
put
Description copied from interface:RMapCacheStores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
-
putOperationAsync
- Overrides:
putOperationAsyncin classRedissonMap<K,V>
-
putIfExistsOperationAsync
- Overrides:
putIfExistsOperationAsyncin classRedissonMap<K,V>
-
putIfAbsentOperationAsync
- Overrides:
putIfAbsentOperationAsyncin classRedissonMap<K,V>
-
putAll
Description copied from interface:RMapCacheAssociates the specifiedvaluewith the specifiedkeyin batch.If
MapWriteris defined then new map entries will be stored in write-through mode. -
putAllAsync
Description copied from interface:RMapCacheAsyncAssociates the specifiedvaluewith the specifiedkeyin batch.If
MapWriteris defined then new map entries are stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
map- - mappings to be stored in this mapttl- - time to live for all key\value entries. If0then stores infinitely.ttlUnit- - time unit- Returns:
- void
-
addAndGet
Description copied from interface:RMapAdds the givendeltato the current value by mappedkey.Works only with codecs below
-
addAndGetOperationAsync
- Overrides:
addAndGetOperationAsyncin classRedissonMap<K,V>
-
fastPut
Description copied from interface:RMapCacheStores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCache.put(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash and the value was updated.
-
fastPutAsync
Description copied from interface:RMapCacheAsyncStores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCacheAsync.putAsync(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash and the value was updated.
-
fastPut
public boolean fastPut(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheStores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCache.put(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash and the value was updated.
-
fastPutAsync
public RFuture<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncStores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCacheAsync.putAsync(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash and the value was updated.
-
fastPutOperationAsync
-
updateEntryExpiration
public boolean updateEntryExpiration(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheUseRMapCache.expireEntry(Object, Duration, Duration)instead.- Specified by:
updateEntryExpirationin interfaceRMapCache<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
updateEntryExpirationAsync
public RFuture<Boolean> updateEntryExpirationAsync(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsync- Specified by:
updateEntryExpirationAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntry
Description copied from interface:RMapCacheUpdates time to live and max idle time of specified entry by key. Entry expires when specified time to live or max idle time was reached.Returns
falseif entry already expired or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryin interfaceRMapCache<K,V> - Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntryAsync
Description copied from interface:RMapCacheAsyncUpdates time to live and max idle time of specified entry by key. Entry expires when specified time to live or max idle time was reached.Returns
falseif entry already expired or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntryIfNotSet
Description copied from interface:RMapCacheSets time to live and max idle time of specified entry by key. If these parameters weren't set before. Entry expires when specified time to live or max idle time was reached.Returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryIfNotSetin interfaceRMapCache<K,V> - Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.
-
expireEntryIfNotSetAsync
-
expireEntriesIfNotSet
Description copied from interface:RMapCacheSets time to live and max idle time of specified entries by keys. If these parameters weren't set before. Entries expire when specified time to live or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfNotSetin interfaceRMapCache<K,V> - Parameters:
keys- map keysttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfNotSetAsync
-
expireEntries
Description copied from interface:RMapCacheUpdates time to live and max idle time of specified entries by keys. Entries expires when specified time to live or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesin interfaceRMapCache<K,V> - Parameters:
keys- map keysttl- time to live for key\value entries. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entries. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entries are stored infinitely.- Returns:
- amount of updated entries.
-
expireEntriesAsync
Description copied from interface:RMapCacheAsyncUpdates time to live and max idle time of specified entries by keys. Entries expires when specified time to live or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
keys- map keysttl- time to live for key\value entries. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entries. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entries are stored infinitely.- Returns:
- amount of updated entries.
-
putAsync
Description copied from interface:RMapCacheAsyncStores value mapped by key with specified time to live. Entry expires after specified time to live. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Specified by:
putAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- previous associated value
-
put
Description copied from interface:RMapCacheStores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
putAsync
public RFuture<V> putAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncStores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
putOperationAsync
-
getWithTTLOnly
Description copied from interface:RMapCacheReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getWithTTLOnlyin interfaceRMapCache<K,V> - Parameters:
key- the key- Returns:
- the value mapped by defined
keyornullif value is absent
-
getWithTTLOnlyAsync
Description copied from interface:RMapCacheAsyncReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getWithTTLOnlyAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- the key- Returns:
- the value mapped by defined
keyornullif value is absent
-
getAllWithTTLOnly
Description copied from interface:RMapCacheReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getAllWithTTLOnlyin interfaceRMapCache<K,V> - Parameters:
keys- map keys- Returns:
- Map slice
-
getAllWithTTLOnlyAsync
Description copied from interface:RMapCacheAsyncReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getAllWithTTLOnlyAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
keys- map keys- Returns:
- Map slice
-
getAllWithTTLOnlyOperationAsync
-
remainTimeToLive
Description copied from interface:RMapCacheRemaining time to live of map entry associated with akey.- Specified by:
remainTimeToLivein interfaceRMapCache<K,V> - Parameters:
key- - map key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RMapCacheAsyncRemaining time to live of map entry associated with akey.- Specified by:
remainTimeToLiveAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
removeOperationAsync
- Overrides:
removeOperationAsyncin classRedissonMap<K,V>
-
fastRemoveOperationBatchAsync
- Overrides:
fastRemoveOperationBatchAsyncin classRedissonMap<K,V>
-
fastRemoveOperationAsync
- Overrides:
fastRemoveOperationAsyncin classRedissonMap<K,V>
-
scanKeyIteratorAsync
public RFuture<ScanResult<Object>> scanKeyIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) - Overrides:
scanKeyIteratorAsyncin classRedissonMap<K,V>
-
scanIteratorAsync
public RFuture<ScanResult<Map.Entry<Object,Object>>> scanIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) - Overrides:
scanIteratorAsyncin classRedissonMap<K,V>
-
fastPutOperationAsync
- Overrides:
fastPutOperationAsyncin classRedissonMap<K,V>
-
fastPutIfExistsOperationAsync
- Overrides:
fastPutIfExistsOperationAsyncin classRedissonMap<K,V>
-
fastPutIfAbsentOperationAsync
- Overrides:
fastPutIfAbsentOperationAsyncin classRedissonMap<K,V>
-
fastPutIfAbsent
Description copied from interface:RMapCacheIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
Works faster than usual
RMapCache.putIfAbsent(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash
-
fastPutIfAbsent
public boolean fastPutIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
Works faster than usual
RMapCache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash.
-
fastPutIfAbsentAsync
public RFuture<Boolean> fastPutIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncIf the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
Works faster than usual
RMapCacheAsync.putIfAbsentAsync(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash
-
replaceOperationAsync
- Overrides:
replaceOperationAsyncin classRedissonMap<K,V>
-
fastReplaceOperationAsync
- Overrides:
fastReplaceOperationAsyncin classRedissonMap<K,V>
-
replaceOperationAsync
- Overrides:
replaceOperationAsyncin classRedissonMap<K,V>
-
putAllOperationAsync
- Overrides:
putAllOperationAsyncin classRedissonMap<K,V>
-
addListener
Description copied from interface:RMapCacheAdds map entry listener- Specified by:
addListenerin interfaceRMapCache<K,V> - Parameters:
listener- - entry listener- Returns:
- listener id
- See Also:
-
getTopic
-
addListenerAsync
Description copied from interface:RMapCacheAsyncAdds map entry listener- Specified by:
addListenerAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
listener- - entry listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObjectRemoves object event listener- Specified by:
removeListenerin interfaceRMapCache<K,V> - Specified by:
removeListenerin interfaceRObject- Overrides:
removeListenerin classRedissonMap<K,V> - Parameters:
listenerId- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsyncRemoves object event listener- Specified by:
removeListenerAsyncin interfaceRObjectAsync- Overrides:
removeListenerAsyncin classRedissonMap<K,V> - Parameters:
listenerId- - listener id
-
sizeInMemoryAsync
Description copied from interface:RObjectAsyncReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsyncin interfaceRObjectAsync- Overrides:
sizeInMemoryAsyncin classRedissonObject- Returns:
- size in bytes
-
copyAsync
- Overrides:
copyAsyncin classRedissonObject
-
renameAsync
Description copied from interface:RObjectAsyncRename current object key tonewNamein async mode- Specified by:
renameAsyncin interfaceRObjectAsync- Overrides:
renameAsyncin classRedissonObject- Parameters:
nn- - new name of object- Returns:
- void
-
renamenxAsync
Description copied from interface:RObjectAsyncRename current object key tonewNamein async mode only if new key is not exists- Specified by:
renamenxAsyncin interfaceRObjectAsync- Overrides:
renamenxAsyncin classRedissonObject- Parameters:
nn- - new name of object- Returns:
trueif object has been renamed successfully andfalseotherwise
-
clear
public void clear() -
clearAsync
Description copied from interface:RMapAsyncClears map without removing options data used during map creation.- Specified by:
clearAsyncin interfaceRMapAsync<K,V> - Overrides:
clearAsyncin classRedissonMap<K,V> - Returns:
trueif map was clearedfalseif not
-
deleteAsync
Description copied from interface:RObjectAsyncDelete object in async mode- Specified by:
deleteAsyncin interfaceRObjectAsync- Overrides:
deleteAsyncin classRedissonObject- Returns:
trueif object was deletedfalseif not
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
readAllKeySetAsync
Description copied from interface:RMapAsyncRead all keys at once- Specified by:
readAllKeySetAsyncin interfaceRMapAsync<K,V> - Overrides:
readAllKeySetAsyncin classRedissonMap<K,V> - Returns:
- keys
-
randomKeysAsync
Description copied from interface:RMapAsyncReturns random keys from this map limited bycount- Specified by:
randomKeysAsyncin interfaceRMapAsync<K,V> - Overrides:
randomKeysAsyncin classRedissonMap<K,V> - Parameters:
count- - keys amount to return- Returns:
- random keys
-
randomEntriesAsync
Description copied from interface:RMapAsyncReturns random map entries from this map limited bycount- Specified by:
randomEntriesAsyncin interfaceRMapAsync<K,V> - Overrides:
randomEntriesAsyncin classRedissonMap<K,V> - Parameters:
count- - entries amount to return- Returns:
- random entries
-
readAllEntrySetAsync
Description copied from interface:RMapAsyncRead all map entries at once- Specified by:
readAllEntrySetAsyncin interfaceRMapAsync<K,V> - Overrides:
readAllEntrySetAsyncin classRedissonMap<K,V> - Returns:
- entries
-
readAllMapAsync
Description copied from interface:RMapAsyncRead all map as local instance at once- Specified by:
readAllMapAsyncin interfaceRMapAsync<K,V> - Overrides:
readAllMapAsyncin classRedissonMap<K,V> - Returns:
- map
-
readAllValuesAsync
Description copied from interface:RMapAsyncRead all values at once- Specified by:
readAllValuesAsyncin interfaceRMapAsync<K,V> - Overrides:
readAllValuesAsyncin classRedissonMap<K,V> - Returns:
- values
-
destroy
public void destroy()Description copied from interface:RDestroyableDestroys object when it's not necessary anymore.- Specified by:
destroyin interfaceRDestroyable- Overrides:
destroyin classRedissonMap<K,V>
-
expire
Description copied from interface:RExpirableUseRExpirable.expire(Duration)instead- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Duration)instead- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirableReturns remaining time of the object in milliseconds.- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsyncReturns remaining time of the object in milliseconds.- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirableReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTimein interfaceRExpirable- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
getExpireTimeAsync
Description copied from interface:RExpirableAsyncReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsyncin interfaceRExpirableAsync- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
clearExpireAsync
-