Class RedissonMap<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> RObject,RObjectAsync
- Direct Known Subclasses:
RedissonLocalCachedMap,RedissonMapCache,RedissonMapCacheNative,RedissonTransactionalMap
ConcurrentMap
and Map- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name -
Constructor Summary
ConstructorsConstructorDescriptionRedissonMap(Codec codec, CommandAsyncExecutor commandExecutor, String name) RedissonMap(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) RedissonMap(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) -
Method Summary
Modifier and TypeMethodDescriptionAdds the givendeltato the current value by mappedkey.addAndGetAsync(K key, Number value) Adds the givendeltato the current value by mappedkey.addAndGetOperationAsync(K key, Number value) intaddListener(ObjectListener listener) Adds object event listeneraddListenerAsync(ObjectListener listener) Adds object event listenerprotected voidprotected voidcheckValue(Object value) voidclear()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) computeAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Computes a new mapping for the specified key and its current mapped value.computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfAbsentAsync(K key, Function<? super K, ? extends V> mappingFunction) Computes a mapping for the specified key if it's not mapped before.computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) computeIfPresentAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Computes a mapping for the specified key only if it's already mapped.booleancontainsKey(Object key) Returnstrueif this map contains map entry mapped by specifiedkey, otherwisefalsecontainsKeyAsync(Object key) Returnstrueif this map contains map entry mapped by specifiedkey, otherwisefalsecontainsKeyAsync(Object key, CompletableFuture<V> promise) containsKeyOperationAsync(String name, Object key) booleancontainsValue(Object value) Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalsecontainsValueAsync(Object value) Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalsevoiddestroy()Destroys object when it's not necessary anymore.protected voidencodeMapKeys(Collection<Object> params, Map<?, ?> map) entryIterator(String pattern, int count) entrySet()Returns map entries collection.entrySet(int count) Returns map entries collection.Returns map entries collection.Returns map entries collection.booleanbooleanUseRExpirable.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)insteadbooleanexpireIfGreater(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 the specifiedvaluemapped by specifiedkey.fastPutAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkey.booleanfastPutIfAbsent(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.fastPutIfAbsentAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.fastPutIfAbsentOperationAsync(K key, V value) booleanfastPutIfExists(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.fastPutIfExistsAsync(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.fastPutIfExistsOperationAsync(K key, V value) fastPutOperationAsync(K key, V value) longfastRemove(K... keys) Removes map entries mapped by specifiedkeys.fastRemoveAsync(K... keys) Removes map entries mapped by specifiedkeys.fastRemoveOperationAsync(K... keys) fastRemoveOperationBatchAsync(K... keys) booleanfastReplace(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.fastReplaceAsync(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.fastReplaceOperationAsync(K key, V value) Returns the value mapped by definedkeyornullif value is absent.Returns map slice contained the mappings with definedkeys.getAllAsync(Set<K> keys) Returns map slice contained the mappings with definedkeys.getAllAsync(Set<K> keys, long threadId) getAllOperationAsync(Set<K> keys) Returns the value mapped by definedkeyornullif value is absent.getCountDownLatch(K key) ReturnsRCountDownLatchinstance associated with keylongReturns 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.getFairLock(K key) ReturnsRLockinstance associated with keyReturnsRLockinstance associated with keygetOperationAsync(K key) ReturnsRPermitExpirableSemaphoreinstance associated with keygetReadWriteLock(K key) ReturnsRReadWriteLockinstance associated with keygetSemaphore(K key) ReturnsRSemaphoreinstance associated with keyinthashCode()protected booleanprotected booleanbooleanisEmpty()keyIterator(String pattern, int count) keySet()Returns key set of this map.keySet(int count) Returns key set of this map.Returns key set of this map.Returns key set of this map.voidloadAll(boolean replaceExistingValues, int parallelism) Loads all map entries to this Redis map usingMapLoader.voidLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.loadAllAsync(boolean replaceExistingValues, int parallelism) Loads all map entries to this Redis map usingMapLoader.loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism) Loads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.protected CompletionStage<Map<K, V>> loadAllMapAsync(Spliterator<K> spliterator, boolean replaceExistingValues, int parallelism, long threadId) protected CompletableFuture<V> protected CompletableFuture<V> <KOut,VOut>
RMapReduce<K, V, KOut, VOut> ReturnsRMapReduceobject associated with this mapprotected final <M> RFuture<M> mapWriterFuture(RFuture<M> future, MapWriterTask task) protected final <M> RFuture<M> mapWriterFuture(RFuture<M> future, MapWriterTask task, Function<M, Boolean> condition) mergeAsync(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Associates specified key with the given value if key isn't already associated with a value.Stores the specifiedvaluemapped by specifiedkey.final voidStores map entries specified inmapobject in batch mode.voidStores map entries specified inmapobject in batch mode.putAllAsync(Map<? extends K, ? extends V> map) Stores map entries specified inmapobject in batch mode.putAllAsync(Map<? extends K, ? extends V> map, int batchSize) Stores map entries specified inmapobject in batch mode.putAllOperationAsync(Map<? extends K, ? extends V> map) Stores the specifiedvaluemapped by specifiedkey.putIfAbsent(K key, V value) Stores the specifiedvaluemapped bykeyonly if there is no value with specifiedkeystored before.putIfAbsentAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.putIfAbsentOperationAsync(K key, V value) putIfExists(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.putIfExistsAsync(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.putIfExistsOperationAsync(K key, V value) putOperationAsync(K key, V value) randomEntries(int count) Returns random map entries from this map limited bycountrandomEntriesAsync(int count) Returns random map entries from this map limited bycountrandomKeys(int count) Returns random keys from this map limited bycountrandomKeysAsync(int count) Returns random keys from this map limited bycountRead all map entries at onceRead all map entries at onceRead all keys at onceRead all keys at onceRead all map as local instance at onceRead all map as local instance at onceRead all values at onceRead all values at oncelongReturns remaining time of the object in milliseconds.Returns remaining time of the object in milliseconds.Removes map entry by specifiedkeyand returns value.booleanRemoves map entry only if it exists with specifiedkeyandvalue.removeAsync(Object key, Object value) Removes map entry only if it exists with specifiedkeyandvalue.removeAsync(K key) Removes map entry by specifiedkeyand returns value.voidremoveListener(int listenerId) Removes object event listenerremoveListenerAsync(int listenerId) Removes object event listenerremoveOperationAsync(Object key, Object value) removeOperationAsync(K key) Replaces previous value with a newvaluemapped by specifiedkey.booleanReplaces previousoldValuewith anewValuemapped by specifiedkey.replaceAsync(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.replaceAsync(K key, V oldValue, V newValue) Replaces previousoldValuewith anewValuemapped by specifiedkey.replaceOperationAsync(K key, V value) replaceOperationAsync(K key, V oldValue, V newValue) scanIterator(String name, RedisClient client, String startPos, String pattern, int count) scanIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) scanKeyIterator(String name, RedisClient client, String startPos, String pattern, int count) scanKeyIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) intsize()Returns size of this mapvalueIterator(String pattern, int count) values()Returns values collection of this map.values(int count) Returns values collection of this map.Returns values collection of this map.Returns values collection of this map.intReturns size of value mapped by specifiedkeyin bytesvalueSizeAsync(K key) Returns size of value mapped by key in bytesMethods 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, copyAsync, delete, deleteAsync, 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, renameAsync, renamenx, renamenxAsync, renamenxAsync, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, 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
forEach, getOrDefault, 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
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods 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, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Constructor Details
-
RedissonMap
public RedissonMap(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) -
RedissonMap
-
RedissonMap
public RedissonMap(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService)
-
-
Method Details
-
mapReduce
Description copied from interface:RMapReturnsRMapReduceobject associated with this map -
getPermitExpirableSemaphore
Description copied from interface:RMapReturnsRPermitExpirableSemaphoreinstance associated with key- Specified by:
getPermitExpirableSemaphorein interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- permitExpirableSemaphore
-
getSemaphore
Description copied from interface:RMapReturnsRSemaphoreinstance associated with key- Specified by:
getSemaphorein interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- semaphore
-
getCountDownLatch
Description copied from interface:RMapReturnsRCountDownLatchinstance associated with key- Specified by:
getCountDownLatchin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- countdownlatch
-
getFairLock
Description copied from interface:RMapReturnsRLockinstance associated with key- Specified by:
getFairLockin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- fairlock
-
getLock
Description copied from interface:RMapReturnsRLockinstance associated with key -
getReadWriteLock
Description copied from interface:RMapReturnsRReadWriteLockinstance associated with key- Specified by:
getReadWriteLockin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- readWriteLock
-
size
public int size() -
merge
-
mergeAsync
public RFuture<V> mergeAsync(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncAssociates specified key with the given value if key isn't already associated with a value. Otherwise, replaces the associated value with the results of the given remapping function, or removes if the result isnull.- Specified by:
mergeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - value to be merged with the existing value associated with the key or to be associated with the key, if no existing valueremappingFunction- - the function is invoked with the existing value to compute new value- Returns:
- new value associated with the specified key or
nullif no value associated with the key
-
computeAsync
public RFuture<V> computeAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncComputes a new mapping for the specified key and its current mapped value.- Specified by:
computeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyremappingFunction- - function to compute a value- Returns:
- the new value associated with the specified key, or
nullif none
-
compute
-
computeIfAbsentAsync
Description copied from interface:RMapAsyncComputes a mapping for the specified key if it's not mapped before.- Specified by:
computeIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keymappingFunction- - function to compute a value- Returns:
- current or new computed value associated with
the specified key, or
nullif the computed value is null
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfPresentAsync
public RFuture<V> computeIfPresentAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncComputes a mapping for the specified key only if it's already mapped.- Specified by:
computeIfPresentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyremappingFunction- - function to compute a value- Returns:
- the new value associated with the specified key, or null if none
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceConcurrentMap<K,V> - Specified by:
computeIfPresentin interfaceMap<K,V>
-
sizeAsync
Description copied from interface:RMapAsyncReturns size of this map -
valueSize
Description copied from interface:RMapReturns size of value mapped by specifiedkeyin bytes -
valueSizeAsync
Description copied from interface:RMapAsyncReturns size of value mapped by key in bytes- Specified by:
valueSizeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
- size of value
-
checkKey
-
isEmpty
public boolean isEmpty() -
containsKey
Description copied from interface:RMapReturnstrueif this map contains map entry mapped by specifiedkey, otherwisefalse- Specified by:
containsKeyin interfaceMap<K,V> - Specified by:
containsKeyin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
trueif this map contains map entry mapped by specifiedkey, otherwisefalse
-
containsKeyAsync
Description copied from interface:RMapAsyncReturnstrueif this map contains map entry mapped by specifiedkey, otherwisefalse- Specified by:
containsKeyAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
trueif this map contains map entry mapped by specifiedkey, otherwisefalse
-
containsKeyOperationAsync
-
containsKeyAsync
-
containsValue
Description copied from interface:RMapReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValuein interfaceMap<K,V> - Specified by:
containsValuein interfaceRMap<K,V> - Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
containsValueAsync
Description copied from interface:RMapAsyncReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValueAsyncin interfaceRMapAsync<K,V> - Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
getAll
Description copied from interface:RMapReturns 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.The returned map is NOT backed by the original map.
-
randomKeys
Description copied from interface:RMapReturns random keys from this map limited bycount- Specified by:
randomKeysin interfaceRMap<K,V> - Parameters:
count- - keys amount to return- Returns:
- random keys
-
randomEntries
Description copied from interface:RMapReturns random map entries from this map limited bycount- Specified by:
randomEntriesin interfaceRMap<K,V> - Parameters:
count- - entries amount to return- Returns:
- random entries
-
randomKeysAsync
Description copied from interface:RMapAsyncReturns random keys from this map limited bycount- Specified by:
randomKeysAsyncin interfaceRMapAsync<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> - Parameters:
count- - entries amount to return- Returns:
- random entries
-
getAllAsync
Description copied from interface:RMapAsyncReturns 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.The returned map is NOT backed by the original map.
- Specified by:
getAllAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keys- Returns:
- Map slice
-
getAllAsync
-
hasNoLoader
protected boolean hasNoLoader() -
getAllOperationAsync
-
get
Description copied from interface:RMapReturns 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. -
put
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkey. Returns previous value if map entry with specifiedkeyalready existed.If
MapWriteris defined then map entry is stored in write-through mode. -
remove
Description copied from interface:RMapRemoves map entry by specifiedkeyand returns value.If
MapWriteris defined thenkeyis deleted in write-through mode. -
putAll
Description copied from interface:RMapStores map entries specified inmapobject in batch mode.If
MapWriteris defined then map entries will be stored in write-through mode. -
putAll
Description copied from interface:RMapStores map entries specified inmapobject in batch mode. Batch inserted by chunks limited bybatchSizevalue to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriteris defined then map entries are stored in write-through mode. -
putAllAsync
Description copied from interface:RMapAsyncStores map entries specified inmapobject in batch mode. Batch inserted by chunks limited bybatchSizevalue to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriteris defined then map entries are stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapAsync<K,V> - Parameters:
map- mappings to be stored in this mapbatchSize- - size of map entries batch- Returns:
- void
-
putAllAsync
Description copied from interface:RMapAsyncStores map entries specified inmapobject in batch mode.If
MapWriteris defined then map entries will be stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapAsync<K,V> - Parameters:
map- mappings to be stored in this map- Returns:
- void
-
mapWriterFuture
-
mapWriterFuture
protected final <M> RFuture<M> mapWriterFuture(RFuture<M> future, MapWriterTask task, Function<M, Boolean> condition) -
putAllOperationAsync
-
clear
public void clear() -
keySet
Description copied from interface:RMapReturns key set of this map. Keys are loaded in batch. Batch size is10. -
keySet
Description copied from interface:RMapReturns key set of this map. Ifpatternis not null then only keys match this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillo
-
keySet
Description copied from interface:RMapReturns key set of this map. Ifpatternis not null then only keys match this pattern are loaded. Keys are loaded in batch. Batch size is defined bycountparam.Use
org.redisson.client.codec.StringCodecfor Map keys.Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillo
-
keySet
Description copied from interface:RMapReturns key set of this map. Keys are loaded in batch. Batch size is defined bycountparam. -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is10. -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is defined bycountparam. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is10. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is defined bycountparam. -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is10. -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is10. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is defined bycountparam. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is defined bycountparam. -
readAllKeySet
Description copied from interface:RMapRead all keys at once- Specified by:
readAllKeySetin interfaceRMap<K,V> - Returns:
- keys
-
readAllKeySetAsync
Description copied from interface:RMapAsyncRead all keys at once- Specified by:
readAllKeySetAsyncin interfaceRMapAsync<K,V> - Returns:
- keys
-
readAllValues
Description copied from interface:RMapRead all values at once- Specified by:
readAllValuesin interfaceRMap<K,V> - Returns:
- values
-
readAllValuesAsync
Description copied from interface:RMapAsyncRead all values at once- Specified by:
readAllValuesAsyncin interfaceRMapAsync<K,V> - Returns:
- values
-
readAllEntrySet
Description copied from interface:RMapRead all map entries at once- Specified by:
readAllEntrySetin interfaceRMap<K,V> - Returns:
- entries
-
readAllEntrySetAsync
Description copied from interface:RMapAsyncRead all map entries at once- Specified by:
readAllEntrySetAsyncin interfaceRMapAsync<K,V> - Returns:
- entries
-
readAllMap
Description copied from interface:RMapRead all map as local instance at once- Specified by:
readAllMapin interfaceRMap<K,V> - Returns:
- map
-
readAllMapAsync
Description copied from interface:RMapAsyncRead all map as local instance at once- Specified by:
readAllMapAsyncin interfaceRMapAsync<K,V> - Returns:
- map
-
putIfExists
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if mapping already exists.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key doesn't exist in the hash and value hasn't been set. Previous value if key already exists in the hash and new value has been stored.
-
putIfExistsAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is doesn't exists in the hash and value hasn't been set. Previous value if key already exists in the hash and new value has been stored.
-
putIfExistsOperationAsync
-
putIfAbsent
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if there is no value with specifiedkeystored before.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V> - Specified by:
putIfAbsentin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
-
putIfAbsentAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
-
hasNoWriter
protected boolean hasNoWriter() -
putIfAbsentOperationAsync
-
fastPutIfAbsent
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but not returning the previous value associated withRMap.putIfAbsent(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key is a new one in the hash and value was set.falseif key already exists in the hash and change hasn't been made.
-
fastPutIfAbsentAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but not returning the previous value associated withRMapAsync.putIfAbsentAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key is a new one in the hash and value was set.falseif key already exists in the hash and change hasn't been made.
-
fastPutIfAbsentOperationAsync
-
fastPutIfExists
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if mapping already exists.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but doesn't return previous value associated withRMap.putIfExists(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key already exists in the hash and new value has been stored.falseif key doesn't exist in the hash and value hasn't been set.
-
fastPutIfExistsAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but doesn't return previous value associated withRMapAsync.putIfExistsAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key already exists in the hash and new value has been stored.falseif key doesn't exist in the hash and value hasn't been set.
-
fastPutIfExistsOperationAsync
-
remove
Description copied from interface:RMapRemoves map entry only if it exists with specifiedkeyandvalue.If
MapWriteris defined thenkeyis deleted in write-through mode. -
removeAsync
Description copied from interface:RMapAsyncRemoves map entry only if it exists with specifiedkeyandvalue.If
MapWriteris defined thenkeyis deleted in write-through mode.- Specified by:
removeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif map entry has been removed otherwisefalse.
-
removeOperationAsync
-
checkValue
-
encodeMapKeys
-
replace
Description copied from interface:RMapReplaces previousoldValuewith anewValuemapped by specifiedkey. Returnsfalseif previous value doesn't exist or equal tooldValue.If
MapWriteris defined thennewValueis written in write-through mode. -
replaceAsync
Description copied from interface:RMapAsyncReplaces previousoldValuewith anewValuemapped by specifiedkey. Returnsfalseif previous value doesn't exist or equal tooldValue.If
MapWriteris defined thennewValueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyoldValue- - map old valuenewValue- - map new value- Returns:
trueif value has been replaced otherwisefalse.
-
replaceOperationAsync
-
replace
Description copied from interface:RMapReplaces previous value with a newvaluemapped by specifiedkey. Returnsnullif there is no map entry stored before and doesn't store new map entry.If
MapWriteris defined then newvalueis written in write-through mode.- Specified by:
replacein interfaceConcurrentMap<K,V> - Specified by:
replacein interfaceMap<K,V> - Specified by:
replacein interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
- previous associated value
or
nullif there is no map entry stored before and doesn't store new map entry
-
replaceAsync
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey. Returnsnullif there is no map entry stored before and doesn't store new map entry.If
MapWriteris defined then newvalueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
- previous associated value
or
nullif there is no map entry stored before and doesn't store new map entry
-
replaceOperationAsync
-
fastReplace
Description copied from interface:RMapReplaces previous value with a newvaluemapped by specifiedkey.Works faster than
but not returning the previous value.RMap.replace(Object, Object)Returns
trueif key exists and value was updated orfalseif key doesn't exists and value wasn't updated.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastReplacein interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key exists and value was updated.falseif key doesn't exists and value wasn't updated.
-
fastReplaceAsync
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey.Works faster than
but not returning the previous value.RMapAsync.replaceAsync(Object, Object)Returns
trueif key exists and value was updated orfalseif key doesn't exists and value wasn't updated.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastReplaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key exists and value was updated.falseif key doesn't exists and value wasn't updated.
-
fastReplaceOperationAsync
-
getOperationAsync
-
getAsync
Description copied from interface:RMapAsyncReturns 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. -
getAsync
-
loadAll
public void loadAll(boolean replaceExistingValues, int parallelism) Description copied from interface:RMapLoads all map entries to this Redis map usingMapLoader. -
loadAllAsync
Description copied from interface:RMapAsyncLoads all map entries to this Redis map usingMapLoader.- Specified by:
loadAllAsyncin interfaceRMapAsync<K,V> - Parameters:
replaceExistingValues- -trueif existed values should be replaced,falseotherwise.parallelism- - parallelism level, used to increase speed of process execution- Returns:
- void
-
loadAllMapAsync
protected CompletionStage<Map<K,V>> loadAllMapAsync(Spliterator<K> spliterator, boolean replaceExistingValues, int parallelism, long threadId) -
loadAll
Description copied from interface:RMapLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter. -
loadAllAsync
public RFuture<Void> loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism) Description copied from interface:RMapAsyncLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.- Specified by:
loadAllAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keysreplaceExistingValues- -trueif existed values should be replaced,falseotherwise.parallelism- - parallelism level, used to increase speed of process execution- Returns:
- void
-
putAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkey. Returns previous value if map entry with specifiedkeyalready existed.If
MapWriteris defined then map entry is stored in write-through mode. -
putOperationAsync
-
removeAsync
Description copied from interface:RMapAsyncRemoves map entry by specifiedkeyand returns value.If
MapWriteris defined thenkeyis deleted in write-through mode.- Specified by:
removeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
- deleted value,
nullif map entry doesn't exist
-
removeOperationAsync
-
fastPutAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkey.Works faster than
but not returning previous value.RMapAsync.putAsync(Object, Object)Returns
trueif key is a new key in the hash and value was set orfalseif key already exists in the hash and the value was updated.If
MapWriteris defined then map entry is stored in write-through mode.- Specified by:
fastPutAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- 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
-
fastPut
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkey.Works faster than
but not returning previous value.RMap.put(Object, Object)Returns
trueif key is a new key in the hash and value was set orfalseif key already exists in the hash and the value was updated.If
MapWriteris defined then map entry is stored in write-through mode. -
fastRemoveAsync
Description copied from interface:RMapAsyncRemoves map entries mapped by specifiedkeys.Works faster than
but not returning the value.RMapAsync.removeAsync(Object)If
MapWriteris defined thenkeysare deleted in write-through mode.- Specified by:
fastRemoveAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
fastRemoveOperationBatchAsync
-
fastRemoveOperationAsync
-
fastRemove
Description copied from interface:RMapRemoves map entries mapped by specifiedkeys.Works faster than
but not returning the value.RMap.remove(Object)If
MapWriteris defined thenkeysare deleted in write-through mode.- Specified by:
fastRemovein interfaceRMap<K,V> - Parameters:
keys- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
scanIterator
public ScanResult<Map.Entry<Object,Object>> scanIterator(String name, RedisClient client, String startPos, String pattern, int count) -
scanKeyIterator
public ScanResult<Object> scanKeyIterator(String name, RedisClient client, String startPos, String pattern, int count) -
scanKeyIteratorAsync
public RFuture<ScanResult<Object>> scanKeyIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) -
scanIteratorAsync
public RFuture<ScanResult<Map.Entry<Object,Object>>> scanIteratorAsync(String name, RedisClient client, String startPos, String pattern, int count) -
addAndGet
Description copied from interface:RMapAdds the givendeltato the current value by mappedkey.Works only with codecs below
-
addAndGetAsync
Description copied from interface:RMapAsyncAdds the givendeltato the current value by mappedkey.Works only with codecs below
- Specified by:
addAndGetAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- the value to add- Returns:
- the updated value
-
addAndGetOperationAsync
-
equals
-
hashCode
public int hashCode() -
keyIterator
-
valueIterator
-
entryIterator
-
loadValue
-
loadValue
-
clearAsync
Description copied from interface:RMapAsyncClears map without removing options data used during map creation.- Specified by:
clearAsyncin interfaceRMapAsync<K,V> - Returns:
trueif map was clearedfalseif not
-
destroy
public void destroy()Description copied from interface:RDestroyableDestroys object when it's not necessary anymore.- Specified by:
destroyin interfaceRDestroyable
-
addListener
Description copied from interface:RObjectAdds object event listener- Specified by:
addListenerin interfaceRMap<K,V> - Specified by:
addListenerin interfaceRObject- Overrides:
addListenerin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
addListenerAsync
Description copied from interface:RObjectAsyncAdds object event listener- Specified by:
addListenerAsyncin interfaceRMapAsync<K,V> - Specified by:
addListenerAsyncin interfaceRObjectAsync- Overrides:
addListenerAsyncin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObjectRemoves object event listener- Specified by:
removeListenerin interfaceRObject- Overrides:
removeListenerin classRedissonObject- Parameters:
listenerId- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsyncRemoves object event listener- Specified by:
removeListenerAsyncin interfaceRObjectAsync- Overrides:
removeListenerAsyncin classRedissonObject- Parameters:
listenerId- - listener id
-
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
-
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
-
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.
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-