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
,RedissonTransactionalMap
ConcurrentMap
and Map
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Constructor Summary
ConstructorDescriptionRedissonMap
(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 givendelta
to the current value by mappedkey
.addAndGetAsync
(K key, Number value) Adds the givendelta
to the current value by mappedkey
.addAndGetOperationAsync
(K key, Number value) int
addListener
(ObjectListener listener) Adds object event listeneraddListenerAsync
(ObjectListener listener) Adds object event listenerprotected void
protected void
checkValue
(Object value) void
clear()
Clears map without removing options data used during map creation.boolean
Clear 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.boolean
containsKey
(Object key) Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
containsKeyAsync
(Object key) Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
containsKeyAsync
(Object key, CompletableFuture<V> promise) containsKeyOperationAsync
(String name, Object key) boolean
containsValue
(Object value) Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
containsValueAsync
(Object value) Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
void
destroy()
Destroys object when it's not necessary anymore.protected void
encodeMapKeys
(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.boolean
boolean
UseRExpirable.expire(Duration)
insteadboolean
Sets a timeout for this object.boolean
Sets 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.boolean
expireAt
(long timestamp) UseRExpirable.expire(Instant)
insteadboolean
UseRExpirable.expire(Instant)
insteadexpireAtAsync
(long timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
(long timestamp, String param, String... keys) expireAtAsync
(Date timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadboolean
expireIfGreater
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.boolean
expireIfGreater
(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.boolean
expireIfLess
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.boolean
expireIfLess
(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.boolean
expireIfNotSet
(Duration duration) Sets a timeout for this object only if it hasn't been set before.boolean
expireIfNotSet
(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.boolean
expireIfSet
(Duration duration) Sets a timeout for this object only if it has been already set.boolean
expireIfSet
(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.boolean
Stores the specifiedvalue
mapped by specifiedkey
.fastPutAsync
(K key, V value) Stores the specifiedvalue
mapped by specifiedkey
.boolean
fastPutIfAbsent
(K key, V value) Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.fastPutIfAbsentAsync
(K key, V value) Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.fastPutIfAbsentOperationAsync
(K key, V value) boolean
fastPutIfExists
(K key, V value) Stores the specifiedvalue
mapped bykey
only if mapping already exists.fastPutIfExistsAsync
(K key, V value) Stores the specifiedvalue
mapped bykey
only if mapping already exists.fastPutIfExistsOperationAsync
(K key, V value) fastPutOperationAsync
(K key, V value) long
fastRemove
(K... keys) Removes map entries mapped by specifiedkeys
.fastRemoveAsync
(K... keys) Removes map entries mapped by specifiedkeys
.fastRemoveOperationAsync
(K... keys) fastRemoveOperationBatchAsync
(K... keys) boolean
fastReplace
(K key, V value) Replaces previous value with a newvalue
mapped by specifiedkey
.fastReplaceAsync
(K key, V value) Replaces previous value with a newvalue
mapped by specifiedkey
.fastReplaceOperationAsync
(K key, V value) Returns the value mapped by definedkey
ornull
if value is absent.Returns map slice contained the mappings with definedkeys
.getAllAsync
(Set<K> keys) Returns map slice contained the mappings with definedkeys
.getAllOperationAsync
(Set<K> keys) Returns the value mapped by definedkey
ornull
if value is absent.getCountDownLatch
(K key) ReturnsRCountDownLatch
instance associated with keylong
Expiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutgetFairLock
(K key) ReturnsRLock
instance associated with keyReturnsRLock
instance associated with keygetOperationAsync
(K key) ReturnsRPermitExpirableSemaphore
instance associated with keygetReadWriteLock
(K key) ReturnsRReadWriteLock
instance associated with keygetSemaphore
(K key) ReturnsRSemaphore
instance associated with keyint
hashCode()
protected boolean
protected boolean
boolean
isEmpty()
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.void
loadAll
(boolean replaceExistingValues, int parallelism) Loads all map entries to this Redis map usingMapLoader
.void
Loads map entries usingMapLoader
whose keys are listed in definedkeys
parameter.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 usingMapLoader
whose keys are listed in definedkeys
parameter.protected CompletionStage
<Map<K, V>> loadAllMapAsync
(Spliterator<K> spliterator, boolean replaceExistingValues, int parallelism) protected CompletableFuture
<V> protected CompletableFuture
<V> <KOut,
VOut>
RMapReduce<K, V, KOut, VOut> ReturnsRMapReduce
object 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 specifiedvalue
mapped by specifiedkey
.final void
Stores map entries specified inmap
object in batch mode.void
Stores map entries specified inmap
object in batch mode.putAllAsync
(Map<? extends K, ? extends V> map) Stores map entries specified inmap
object in batch mode.putAllAsync
(Map<? extends K, ? extends V> map, int batchSize) Stores map entries specified inmap
object in batch mode.putAllOperationAsync
(Map<? extends K, ? extends V> map) Stores the specifiedvalue
mapped by specifiedkey
.putIfAbsent
(K key, V value) Stores the specifiedvalue
mapped bykey
only if there is no value with specifiedkey
stored before.putIfAbsentAsync
(K key, V value) Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.putIfAbsentOperationAsync
(K key, V value) putIfExists
(K key, V value) Stores the specifiedvalue
mapped bykey
only if mapping already exists.putIfExistsAsync
(K key, V value) Stores the specifiedvalue
mapped bykey
only 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 bycount
randomEntriesAsync
(int count) Returns random map entries from this map limited bycount
randomKeys
(int count) Returns random keys from this map limited bycount
randomKeysAsync
(int count) Returns random keys from this map limited bycount
Read 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 oncelong
Remaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutRemoves map entry by specifiedkey
and returns value.boolean
Removes map entry only if it exists with specifiedkey
andvalue
.removeAsync
(Object key, Object value) Removes map entry only if it exists with specifiedkey
andvalue
.removeAsync
(K key) Removes map entry by specifiedkey
and returns value.void
removeListener
(int listenerId) Removes object event listenerremoveListenerAsync
(int listenerId) Removes object event listenerremoveOperationAsync
(Object key, Object value) removeOperationAsync
(K key) Replaces previous value with a newvalue
mapped by specifiedkey
.boolean
Replaces previousoldValue
with anewValue
mapped by specifiedkey
.replaceAsync
(K key, V value) Replaces previous value with a newvalue
mapped by specifiedkey
.replaceAsync
(K key, V oldValue, V newValue) Replaces previousoldValue
with anewValue
mapped 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) int
size()
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.int
Returns size of value mapped by specifiedkey
in bytesvalueSizeAsync
(K key) Returns size of value mapped by key in bytesMethods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, addTrackingListener, addTrackingListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenerAsync, removeTrackingListener, removeTrackingListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.ConcurrentMap
forEach, getOrDefault, replaceAll
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
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:RMap
ReturnsRMapReduce
object associated with this map -
getPermitExpirableSemaphore
Description copied from interface:RMap
ReturnsRPermitExpirableSemaphore
instance associated with key- Specified by:
getPermitExpirableSemaphore
in interfaceRMap<K,
V> - Parameters:
key
- - map key- Returns:
- permitExpirableSemaphore
-
getSemaphore
Description copied from interface:RMap
ReturnsRSemaphore
instance associated with key- Specified by:
getSemaphore
in interfaceRMap<K,
V> - Parameters:
key
- - map key- Returns:
- semaphore
-
getCountDownLatch
Description copied from interface:RMap
ReturnsRCountDownLatch
instance associated with key- Specified by:
getCountDownLatch
in interfaceRMap<K,
V> - Parameters:
key
- - map key- Returns:
- countdownlatch
-
getFairLock
Description copied from interface:RMap
ReturnsRLock
instance associated with key- Specified by:
getFairLock
in interfaceRMap<K,
V> - Parameters:
key
- - map key- Returns:
- fairlock
-
getLock
Description copied from interface:RMap
ReturnsRLock
instance associated with key -
getReadWriteLock
Description copied from interface:RMap
ReturnsRReadWriteLock
instance associated with key- Specified by:
getReadWriteLock
in 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:RMapAsync
Associates 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:
mergeAsync
in 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
null
if 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:RMapAsync
Computes a new mapping for the specified key and its current mapped value.- Specified by:
computeAsync
in 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
-
compute
-
computeIfAbsentAsync
Description copied from interface:RMapAsync
Computes a mapping for the specified key if it's not mapped before.- Specified by:
computeIfAbsentAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keymappingFunction
- - function to compute a value- Returns:
- current or new computed value associated with
the specified key, or
null
if the computed value is null
-
computeIfAbsent
- Specified by:
computeIfAbsent
in interfaceConcurrentMap<K,
V> - Specified by:
computeIfAbsent
in interfaceMap<K,
V>
-
computeIfPresentAsync
public RFuture<V> computeIfPresentAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsync
Computes a mapping for the specified key only if it's already mapped.- Specified by:
computeIfPresentAsync
in 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:
computeIfPresent
in interfaceConcurrentMap<K,
V> - Specified by:
computeIfPresent
in interfaceMap<K,
V>
-
sizeAsync
Description copied from interface:RMapAsync
Returns size of this map -
valueSize
Description copied from interface:RMap
Returns size of value mapped by specifiedkey
in bytes -
valueSizeAsync
Description copied from interface:RMapAsync
Returns size of value mapped by key in bytes- Specified by:
valueSizeAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map key- Returns:
- size of value
-
checkKey
-
isEmpty
public boolean isEmpty() -
containsKey
Description copied from interface:RMap
Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
- Specified by:
containsKey
in interfaceMap<K,
V> - Specified by:
containsKey
in interfaceRMap<K,
V> - Parameters:
key
- - map key- Returns:
true
if this map contains map entry mapped by specifiedkey
, otherwisefalse
-
containsKeyAsync
Description copied from interface:RMapAsync
Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
- Specified by:
containsKeyAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map key- Returns:
true
if this map contains map entry mapped by specifiedkey
, otherwisefalse
-
containsKeyOperationAsync
-
containsKeyAsync
-
containsValue
Description copied from interface:RMap
Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
- Specified by:
containsValue
in interfaceMap<K,
V> - Specified by:
containsValue
in interfaceRMap<K,
V> - Parameters:
value
- - map value- Returns:
true
if this map contains any map entry with specifiedvalue
, otherwisefalse
-
containsValueAsync
Description copied from interface:RMapAsync
Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
- Specified by:
containsValueAsync
in interfaceRMapAsync<K,
V> - Parameters:
value
- - map value- Returns:
true
if this map contains any map entry with specifiedvalue
, otherwisefalse
-
getAll
Description copied from interface:RMap
Returns map slice contained the mappings with definedkeys
.If map doesn't contain value/values for specified key/keys and
MapLoader
is 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:RMap
Returns random keys from this map limited bycount
- Specified by:
randomKeys
in interfaceRMap<K,
V> - Parameters:
count
- - keys amount to return- Returns:
- random keys
-
randomEntries
Description copied from interface:RMap
Returns random map entries from this map limited bycount
- Specified by:
randomEntries
in interfaceRMap<K,
V> - Parameters:
count
- - entries amount to return- Returns:
- random entries
-
randomKeysAsync
Description copied from interface:RMapAsync
Returns random keys from this map limited bycount
- Specified by:
randomKeysAsync
in interfaceRMapAsync<K,
V> - Parameters:
count
- - keys amount to return- Returns:
- random keys
-
randomEntriesAsync
Description copied from interface:RMapAsync
Returns random map entries from this map limited bycount
- Specified by:
randomEntriesAsync
in interfaceRMapAsync<K,
V> - Parameters:
count
- - entries amount to return- Returns:
- random entries
-
getAllAsync
Description copied from interface:RMapAsync
Returns map slice contained the mappings with definedkeys
.If map doesn't contain value/values for specified key/keys and
MapLoader
is defined then value/values will be loaded in read-through mode.The returned map is NOT backed by the original map.
- Specified by:
getAllAsync
in interfaceRMapAsync<K,
V> - Parameters:
keys
- - map keys- Returns:
- Map slice
-
hasNoLoader
protected boolean hasNoLoader() -
getAllOperationAsync
-
get
Description copied from interface:RMap
Returns the value mapped by definedkey
ornull
if value is absent.If map doesn't contain value for specified key and
MapLoader
is defined then value will be loaded in read-through mode. -
put
Description copied from interface:RMap
Stores the specifiedvalue
mapped by specifiedkey
. Returns previous value if map entry with specifiedkey
already existed.If
MapWriter
is defined then map entry is stored in write-through mode. -
remove
Description copied from interface:RMap
Removes map entry by specifiedkey
and returns value.If
MapWriter
is defined thenkey
is deleted in write-through mode. -
putAll
Description copied from interface:RMap
Stores map entries specified inmap
object in batch mode.If
MapWriter
is defined then map entries will be stored in write-through mode. -
putAll
Description copied from interface:RMap
Stores map entries specified inmap
object in batch mode. Batch inserted by chunks limited bybatchSize
value to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriter
is defined then map entries are stored in write-through mode. -
putAllAsync
Description copied from interface:RMapAsync
Stores map entries specified inmap
object in batch mode. Batch inserted by chunks limited bybatchSize
value to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriter
is defined then map entries are stored in write-through mode.- Specified by:
putAllAsync
in interfaceRMapAsync<K,
V> - Parameters:
map
- mappings to be stored in this mapbatchSize
- - size of map entries batch- Returns:
- void
-
putAllAsync
Description copied from interface:RMapAsync
Stores map entries specified inmap
object in batch mode.If
MapWriter
is defined then map entries will be stored in write-through mode.- Specified by:
putAllAsync
in 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:RMap
Returns key set of this map. Keys are loaded in batch. Batch size is10
. -
keySet
Description copied from interface:RMap
Returns key set of this map. Ifpattern
is not null then only keys match this pattern are loaded.Use
org.redisson.client.codec.StringCodec
for 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:RMap
Returns key set of this map. Ifpattern
is not null then only keys match this pattern are loaded. Keys are loaded in batch. Batch size is defined bycount
param.Use
org.redisson.client.codec.StringCodec
for 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:RMap
Returns key set of this map. Keys are loaded in batch. Batch size is defined bycount
param. -
values
Description copied from interface:RMap
Returns values collection of this map. Values are loaded in batch. Batch size is10
. -
values
Description copied from interface:RMap
Returns values collection of this map. Values are loaded in batch. Batch size is defined bycount
param. IfkeyPattern
is not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodec
for 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
-
values
Description copied from interface:RMap
Returns values collection of this map. Values are loaded in batch. Batch size is10
. IfkeyPattern
is not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodec
for 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
-
values
Description copied from interface:RMap
Returns values collection of this map. Values are loaded in batch. Batch size is defined bycount
param. -
entrySet
Description copied from interface:RMap
Returns map entries collection. Map entries are loaded in batch. Batch size is10
. -
entrySet
Description copied from interface:RMap
Returns map entries collection. Map entries are loaded in batch. Batch size is10
. IfkeyPattern
is not null then only entries mapped by matched keys of this pattern are loaded. 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:RMap
Returns map entries collection. Map entries are loaded in batch. Batch size is defined bycount
param. IfkeyPattern
is not null then only entries mapped by matched keys of this pattern are loaded. 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:RMap
Returns map entries collection. Map entries are loaded in batch. Batch size is defined bycount
param. -
readAllKeySet
Description copied from interface:RMap
Read all keys at once- Specified by:
readAllKeySet
in interfaceRMap<K,
V> - Returns:
- keys
-
readAllKeySetAsync
Description copied from interface:RMapAsync
Read all keys at once- Specified by:
readAllKeySetAsync
in interfaceRMapAsync<K,
V> - Returns:
- keys
-
readAllValues
Description copied from interface:RMap
Read all values at once- Specified by:
readAllValues
in interfaceRMap<K,
V> - Returns:
- values
-
readAllValuesAsync
Description copied from interface:RMapAsync
Read all values at once- Specified by:
readAllValuesAsync
in interfaceRMapAsync<K,
V> - Returns:
- values
-
readAllEntrySet
Description copied from interface:RMap
Read all map entries at once- Specified by:
readAllEntrySet
in interfaceRMap<K,
V> - Returns:
- entries
-
readAllEntrySetAsync
Description copied from interface:RMapAsync
Read all map entries at once- Specified by:
readAllEntrySetAsync
in interfaceRMapAsync<K,
V> - Returns:
- entries
-
readAllMap
Description copied from interface:RMap
Read all map as local instance at once- Specified by:
readAllMap
in interfaceRMap<K,
V> - Returns:
- map
-
readAllMapAsync
Description copied from interface:RMapAsync
Read all map as local instance at once- Specified by:
readAllMapAsync
in interfaceRMapAsync<K,
V> - Returns:
- map
-
putIfExists
Description copied from interface:RMap
Stores the specifiedvalue
mapped bykey
only if mapping already exists.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
putIfExists
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
null
if 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:RMapAsync
Stores the specifiedvalue
mapped bykey
only if mapping already exists.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
null
if 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:RMap
Stores the specifiedvalue
mapped bykey
only if there is no value with specifiedkey
stored before.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsent
in interfaceConcurrentMap<K,
V> - Specified by:
putIfAbsent
in interfaceMap<K,
V> - Specified by:
putIfAbsent
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
null
if 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:RMapAsync
Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
null
if 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:RMap
Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.Returns
true
if key is a new one in the hash and value was set orfalse
if 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)
key
If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsent
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key is a new one in the hash and value was set.false
if key already exists in the hash and change hasn't been made.
-
fastPutIfAbsentAsync
Description copied from interface:RMapAsync
Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.Returns
true
if key is a new one in the hash and value was set orfalse
if 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)
key
If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key is a new one in the hash and value was set.false
if key already exists in the hash and change hasn't been made.
-
fastPutIfAbsentOperationAsync
-
fastPutIfExists
Description copied from interface:RMap
Stores the specifiedvalue
mapped bykey
only if mapping already exists.Returns
true
if key is a new one in the hash and value was set orfalse
if 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)
key
If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExists
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key already exists in the hash and new value has been stored.false
if key doesn't exist in the hash and value hasn't been set.
-
fastPutIfExistsAsync
Description copied from interface:RMapAsync
Stores the specifiedvalue
mapped bykey
only if mapping already exists.Returns
true
if key is a new one in the hash and value was set orfalse
if 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)
key
If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key already exists in the hash and new value has been stored.false
if key doesn't exist in the hash and value hasn't been set.
-
fastPutIfExistsOperationAsync
-
remove
Description copied from interface:RMap
Removes map entry only if it exists with specifiedkey
andvalue
.If
MapWriter
is defined thenkey
is deleted in write-through mode. -
removeAsync
Description copied from interface:RMapAsync
Removes map entry only if it exists with specifiedkey
andvalue
.If
MapWriter
is defined thenkey
is deleted in write-through mode.- Specified by:
removeAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if map entry has been removed otherwisefalse
.
-
removeOperationAsync
-
checkValue
-
encodeMapKeys
-
replace
Description copied from interface:RMap
Replaces previousoldValue
with anewValue
mapped by specifiedkey
. Returnsfalse
if previous value doesn't exist or equal tooldValue
.If
MapWriter
is defined thennewValue
is written in write-through mode. -
replaceAsync
Description copied from interface:RMapAsync
Replaces previousoldValue
with anewValue
mapped by specifiedkey
. Returnsfalse
if previous value doesn't exist or equal tooldValue
.If
MapWriter
is defined thennewValue
is written in write-through mode.- Specified by:
replaceAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyoldValue
- - map old valuenewValue
- - map new value- Returns:
true
if value has been replaced otherwisefalse
.
-
replaceOperationAsync
-
replace
Description copied from interface:RMap
Replaces previous value with a newvalue
mapped by specifiedkey
. Returnsnull
if there is no map entry stored before and doesn't store new map entry.If
MapWriter
is defined then newvalue
is written in write-through mode.- Specified by:
replace
in interfaceConcurrentMap<K,
V> - Specified by:
replace
in interfaceMap<K,
V> - Specified by:
replace
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
- previous associated value
or
null
if there is no map entry stored before and doesn't store new map entry
-
replaceAsync
Description copied from interface:RMapAsync
Replaces previous value with a newvalue
mapped by specifiedkey
. Returnsnull
if there is no map entry stored before and doesn't store new map entry.If
MapWriter
is defined then newvalue
is written in write-through mode.- Specified by:
replaceAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
- previous associated value
or
null
if there is no map entry stored before and doesn't store new map entry
-
replaceOperationAsync
-
fastReplace
Description copied from interface:RMap
Replaces previous value with a newvalue
mapped by specifiedkey
.Works faster than
but not returning the previous value.RMap.replace(Object, Object)
Returns
true
if key exists and value was updated orfalse
if key doesn't exists and value wasn't updated.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastReplace
in interfaceRMap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key exists and value was updated.false
if key doesn't exists and value wasn't updated.
-
fastReplaceAsync
Description copied from interface:RMapAsync
Replaces previous value with a newvalue
mapped by specifiedkey
.Works faster than
but not returning the previous value.RMapAsync.replaceAsync(Object, Object)
Returns
true
if key exists and value was updated orfalse
if key doesn't exists and value wasn't updated.If
MapWriter
is defined then new map entry is stored in write-through mode.- Specified by:
fastReplaceAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key exists and value was updated.false
if key doesn't exists and value wasn't updated.
-
fastReplaceOperationAsync
-
getOperationAsync
-
getAsync
Description copied from interface:RMapAsync
Returns the value mapped by definedkey
ornull
if value is absent.If map doesn't contain value for specified key and
MapLoader
is defined then value will be loaded in read-through mode. -
getAsync
-
loadAll
public void loadAll(boolean replaceExistingValues, int parallelism) Description copied from interface:RMap
Loads all map entries to this Redis map usingMapLoader
. -
loadAllAsync
Description copied from interface:RMapAsync
Loads all map entries to this Redis map usingMapLoader
.- Specified by:
loadAllAsync
in interfaceRMapAsync<K,
V> - Parameters:
replaceExistingValues
- -true
if existed values should be replaced,false
otherwise.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) -
loadAll
Description copied from interface:RMap
Loads map entries usingMapLoader
whose keys are listed in definedkeys
parameter. -
loadAllAsync
public RFuture<Void> loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism) Description copied from interface:RMapAsync
Loads map entries usingMapLoader
whose keys are listed in definedkeys
parameter.- Specified by:
loadAllAsync
in interfaceRMapAsync<K,
V> - Parameters:
keys
- - map keysreplaceExistingValues
- -true
if existed values should be replaced,false
otherwise.parallelism
- - parallelism level, used to increase speed of process execution- Returns:
- void
-
putAsync
Description copied from interface:RMapAsync
Stores the specifiedvalue
mapped by specifiedkey
. Returns previous value if map entry with specifiedkey
already existed.If
MapWriter
is defined then map entry is stored in write-through mode. -
putOperationAsync
-
removeAsync
Description copied from interface:RMapAsync
Removes map entry by specifiedkey
and returns value.If
MapWriter
is defined thenkey
is deleted in write-through mode.- Specified by:
removeAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map key- Returns:
- deleted value,
null
if map entry doesn't exist
-
removeOperationAsync
-
fastPutAsync
Description copied from interface:RMapAsync
Stores the specifiedvalue
mapped by specifiedkey
.Works faster than
but not returning previous value.RMapAsync.putAsync(Object, Object)
Returns
true
if key is a new key in the hash and value was set orfalse
if key already exists in the hash and the value was updated.If
MapWriter
is defined then map entry is stored in write-through mode.- Specified by:
fastPutAsync
in interfaceRMapAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash and the value was updated.
-
fastPutOperationAsync
-
fastPut
Description copied from interface:RMap
Stores the specifiedvalue
mapped by specifiedkey
.Works faster than
but not returning previous value.RMap.put(Object, Object)
Returns
true
if key is a new key in the hash and value was set orfalse
if key already exists in the hash and the value was updated.If
MapWriter
is defined then map entry is stored in write-through mode. -
fastRemoveAsync
Description copied from interface:RMapAsync
Removes map entries mapped by specifiedkeys
.Works faster than
but not returning the value.RMapAsync.removeAsync(Object)
If
MapWriter
is defined thenkeys
are deleted in write-through mode.- Specified by:
fastRemoveAsync
in 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:RMap
Removes map entries mapped by specifiedkeys
.Works faster than
but not returning the value.RMap.remove(Object)
If
MapWriter
is defined thenkeys
are deleted in write-through mode.- Specified by:
fastRemove
in 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:RMap
Adds the givendelta
to the current value by mappedkey
.Works only with codecs below
-
addAndGetAsync
Description copied from interface:RMapAsync
Adds the givendelta
to the current value by mappedkey
.Works only with codecs below
- Specified by:
addAndGetAsync
in 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:RMapAsync
Clears map without removing options data used during map creation.- Specified by:
clearAsync
in interfaceRMapAsync<K,
V> - Returns:
true
if map was clearedfalse
if not
-
destroy
public void destroy()Description copied from interface:RDestroyable
Destroys object when it's not necessary anymore.- Specified by:
destroy
in interfaceRDestroyable
-
addListener
Description copied from interface:RObject
Adds object event listener- Specified by:
addListener
in interfaceRMap<K,
V> - Specified by:
addListener
in interfaceRObject
- Overrides:
addListener
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
addListenerAsync
Description copied from interface:RObjectAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRMapAsync<K,
V> - Specified by:
addListenerAsync
in interfaceRObjectAsync
- Overrides:
addListenerAsync
in classRedissonObject
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObject
Removes object event listener- Specified by:
removeListener
in interfaceRObject
- Overrides:
removeListener
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsync
Removes object event listener- Specified by:
removeListenerAsync
in interfaceRObjectAsync
- Overrides:
removeListenerAsync
in classRedissonObject
- Parameters:
listenerId
- - listener id
-
expire
Description copied from interface:RExpirable
UseRExpirable.expire(Duration)
instead- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Duration)
instead- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets 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:
expireIfSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets 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:
expireIfNotSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets 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:
expireIfGreater
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets 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:
expireIfLess
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets 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:
expireIfSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets 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:
expireIfNotSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets 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:
expireIfGreater
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets 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:
expireIfLess
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets 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:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in 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:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in 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:RExpirable
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTime
in interfaceRExpirable
- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsync
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsync
in interfaceRExpirableAsync
- Returns:
- expiration time
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-