Class RedissonTransactionalMapCache<K,V>
- Type Parameters:
K
- key typeV
- value type
- All Implemented Interfaces:
ConcurrentMap<K,
,V> Map<K,
,V> RDestroyable
,RExpirable
,RExpirableAsync
,RMap<K,
,V> RMapAsync<K,
,V> RMapCache<K,
,V> RMapCacheAsync<K,
,V> RObject
,RObjectAsync
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Constructor Summary
ConstructorDescriptionRedissonTransactionalMapCache
(Codec codec, CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId) RedissonTransactionalMapCache
(CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId) -
Method Summary
Modifier and TypeMethodDescriptionaddAndGetOperationAsync
(K key, Number value) protected void
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) containsKeyAsync
(Object key) Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
containsValueAsync
(Object value) Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
Delete object in async modeboolean
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) expireIfGreaterAsync
(Instant time) 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) expireIfLessAsync
(Instant time) 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) expireIfNotSetAsync
(Instant time) 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) expireIfSetAsync
(Instant time) fastPutIfAbsentAsync
(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) If the specified key is not already associated with a value, associate it with the given value.fastPutIfAbsentOperationAsync
(K key, V value) fastPutIfExistsOperationAsync
(K key, V value) fastPutOperationAsync
(K key, V value) fastPutOperationAsync
(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) fastRemoveOperationAsync
(K... keys) getAllOperationAsync
(Set<K> keys) 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 keyCheck object existence in async mode.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.<KOut,
VOut>
RMapReduce<K,V, KOut, VOut> ReturnsRMapReduce
object associated with this mapmigrateAsync
(String host, int port, int database, long timeout) Transfer object from source Redis instance to destination Redis instance in async modemoveAsync
(int database) Move object to another database in async modeputAllOperationAsync
(Map<? extends K, ? extends V> entries) putIfAbsentAsync
(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) If the specified key is not already associated with a value, associate it with the given value.putIfAbsentOperationAsync
(K key, V value) putIfExistsOperationAsync
(K key, V value) putOperationAsync
(K key, V value) putOperationAsync
(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta, long ttlTimeoutDelta) Read all map entries at onceRead all keys at onceRead all map as local instance 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 timeoutremoveOperationAsync
(Object key, Object value) removeOperationAsync
(K key) replaceOperationAsync
(K key, V value) replaceOperationAsync
(K key, V oldValue, V newValue) scanIterator
(String name, RedisClient client, long startPos, String pattern, int count) setMaxSizeAsync
(int maxSize) Sets max size of the map and overrides current value.Update the last access time of an object in async mode.trySetMaxSizeAsync
(int maxSize) Tries to set max size of the map.Delete the objects.valueSizeAsync
(K key) Returns size of value mapped by key in bytesMethods inherited from class org.redisson.RedissonMapCache
addAndGet, addListener, clear, containsKeyOperationAsync, destroy, fastPut, fastPut, fastPutAsync, fastPutAsync, fastPutIfAbsent, fastPutIfAbsent, fastRemoveOperationBatchAsync, fastReplaceOperationAsync, getWithTTLOnly, getWithTTLOnlyAsync, put, put, putAll, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, randomEntriesAsync, randomKeysAsync, remainTimeToLive, remainTimeToLiveAsync, removeListener, scanIteratorAsync, setMaxSize, setMaxSize, setMaxSizeAsync, sizeInMemoryAsync, trySetMaxSize, trySetMaxSize, trySetMaxSizeAsync, updateEntryExpiration, updateEntryExpirationAsync
Methods inherited from class org.redisson.RedissonMap
addAndGetAsync, checkKey, checkValue, compute, computeAsync, computeIfAbsent, computeIfAbsentAsync, computeIfPresent, computeIfPresentAsync, containsKey, containsKeyAsync, containsValue, entryIterator, entrySet, entrySet, entrySet, entrySet, equals, fastPut, fastPutAsync, fastPutIfAbsent, fastPutIfAbsentAsync, fastPutIfExists, fastPutIfExistsAsync, fastRemove, fastRemoveAsync, fastReplace, fastReplaceAsync, get, getAll, getAllAsync, getAsync, hashCode, hasNoLoader, hasNoWriter, isEmpty, keyIterator, keySet, keySet, keySet, keySet, loadAll, loadAll, loadAllAsync, loadValue, loadValue, mapWriterFuture, mapWriterFuture, merge, mergeAsync, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfExists, putIfExistsAsync, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, removeAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, size, sizeAsync, valueIterator, values, values, values, values, valueSize
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, migrate, move, prefixName, removeListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, unlink
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, 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
expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync
Methods inherited from interface org.redisson.api.RMap
containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, fastReplace, get, getAll, keySet, keySet, keySet, keySet, loadAll, loadAll, put, putAll, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSize
Methods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, fastPutAsync, fastPutIfAbsentAsync, fastPutIfExistsAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, putIfExistsAsync, removeAsync, removeAsync, replaceAsync, replaceAsync
Methods inherited from interface org.redisson.api.RMapCacheAsync
sizeAsync
Methods inherited from interface org.redisson.api.RObject
addListener, 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
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync
-
Constructor Details
-
RedissonTransactionalMapCache
public RedissonTransactionalMapCache(CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId) -
RedissonTransactionalMapCache
public RedissonTransactionalMapCache(Codec codec, CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId)
-
-
Method Details
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String param, String... keys) - Overrides:
expireAsync
in classRedissonMapCache<K,
V>
-
expireAtAsync
- Overrides:
expireAtAsync
in classRedissonMapCache<K,
V>
-
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
- Overrides:
clearExpireAsync
in classRedissonMapCache<K,
V> - Returns:
true
if the timeout was cleared andfalse
if not
-
moveAsync
Description copied from interface:RObjectAsync
Move object to another database in async mode- Specified by:
moveAsync
in interfaceRObjectAsync
- Overrides:
moveAsync
in classRedissonObject
- Parameters:
database
- - number of Redis database- Returns:
true
if key was movedfalse
if not
-
migrateAsync
Description copied from interface:RObjectAsync
Transfer object from source Redis instance to destination Redis instance in async mode- Specified by:
migrateAsync
in interfaceRObjectAsync
- Overrides:
migrateAsync
in classRedissonObject
- Parameters:
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
touchAsync
Description copied from interface:RObjectAsync
Update the last access time of an object in async mode.- Specified by:
touchAsync
in interfaceRObjectAsync
- Overrides:
touchAsync
in classRedissonObject
- Returns:
true
if object was touched elsefalse
-
isExistsAsync
Description copied from interface:RObjectAsync
Check object existence in async mode.- Specified by:
isExistsAsync
in interfaceRObjectAsync
- Overrides:
isExistsAsync
in classRedissonObject
- Returns:
true
if object exists andfalse
otherwise
-
unlinkAsync
Description copied from interface:RObjectAsync
Delete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Specified by:
unlinkAsync
in interfaceRObjectAsync
- Overrides:
unlinkAsync
in classRedissonObject
- Returns:
true
if it was exist and deleted elsefalse
-
deleteAsync
Description copied from interface:RObjectAsync
Delete object in async mode- Specified by:
deleteAsync
in interfaceRObjectAsync
- Overrides:
deleteAsync
in classRedissonMapCache<K,
V> - Returns:
true
if object was deletedfalse
if not
-
putIfAbsentAsync
public RFuture<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsync
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putIfAbsentAsync
in interfaceRMapCacheAsync<K,
V> - Overrides:
putIfAbsentAsync
in classRedissonMapCache<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then time to live doesn't affect entry expiration.ttlUnit
- - time unitmaxIdleTime
- - max idle time for key\value entry. If0
then max idle time doesn't affect entry expiration.maxIdleUnit
- - time unitif
maxIdleTime
andttl
params are equal to0
then entry stores infinitely.- Returns:
- previous associated value
-
fastPutOperationAsync
public RFuture<Boolean> fastPutOperationAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) - Overrides:
fastPutOperationAsync
in classRedissonMapCache<K,
V>
-
putOperationAsync
public RFuture<V> putOperationAsync(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta, long ttlTimeoutDelta) - Overrides:
putOperationAsync
in classRedissonMapCache<K,
V>
-
fastPutIfAbsentAsync
public RFuture<Boolean> fastPutIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsync
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live and max idle time. Entry expires when specified time to live or max idle time has expired.
Works faster than usual
RMapCacheAsync.putIfAbsentAsync(Object, Object, long, TimeUnit, long, TimeUnit)
as it not returns previous value.- Specified by:
fastPutIfAbsentAsync
in interfaceRMapCacheAsync<K,
V> - Overrides:
fastPutIfAbsentAsync
in classRedissonMapCache<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then time to live doesn't affect entry expiration.ttlUnit
- - time unitmaxIdleTime
- - max idle time for key\value entry. If0
then max idle time doesn't affect entry expiration.maxIdleUnit
- - time unitif
maxIdleTime
andttl
params are equal to0
then entry stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash
-
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.
-
setMaxSizeAsync
Description copied from interface:RMapCacheAsync
Sets max size of the map and overrides current value. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
setMaxSizeAsync
in interfaceRMapCacheAsync<K,
V> - Overrides:
setMaxSizeAsync
in classRedissonMapCache<K,
V> - Parameters:
maxSize
- - max size- Returns:
- void
-
trySetMaxSizeAsync
Description copied from interface:RMapCacheAsync
Tries to set max size of the map. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
trySetMaxSizeAsync
in interfaceRMapCacheAsync<K,
V> - Overrides:
trySetMaxSizeAsync
in classRedissonMapCache<K,
V> - Parameters:
maxSize
- - max size- Returns:
true
if max size has been successfully set, otherwisefalse
.
-
mapReduce
Description copied from interface:RMap
ReturnsRMapReduce
object associated with this map -
scanIterator
public ScanResult<Map.Entry<Object,Object>> scanIterator(String name, RedisClient client, long startPos, String pattern, int count) - Overrides:
scanIterator
in classRedissonMapCache<K,
V>
-
containsKeyAsync
Description copied from interface:RMapAsync
Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
- Specified by:
containsKeyAsync
in interfaceRMapAsync<K,
V> - Overrides:
containsKeyAsync
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
true
if this map contains map entry mapped by specifiedkey
, 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> - Overrides:
containsValueAsync
in classRedissonMapCache<K,
V> - Parameters:
value
- - map value- Returns:
true
if this map contains any map entry with specifiedvalue
, otherwisefalse
-
addAndGetOperationAsync
- Overrides:
addAndGetOperationAsync
in classRedissonMapCache<K,
V>
-
fastPutIfExistsOperationAsync
- Overrides:
fastPutIfExistsOperationAsync
in classRedissonMapCache<K,
V>
-
putIfExistsOperationAsync
- Overrides:
putIfExistsOperationAsync
in classRedissonMapCache<K,
V>
-
putIfAbsentOperationAsync
- Overrides:
putIfAbsentOperationAsync
in classRedissonMapCache<K,
V>
-
putOperationAsync
- Overrides:
putOperationAsync
in classRedissonMapCache<K,
V>
-
fastPutIfAbsentOperationAsync
- Overrides:
fastPutIfAbsentOperationAsync
in classRedissonMapCache<K,
V>
-
fastPutOperationAsync
- Overrides:
fastPutOperationAsync
in classRedissonMapCache<K,
V>
-
fastRemoveOperationAsync
- Overrides:
fastRemoveOperationAsync
in classRedissonMapCache<K,
V>
-
valueSizeAsync
Description copied from interface:RMapAsync
Returns size of value mapped by key in bytes- Specified by:
valueSizeAsync
in interfaceRMapAsync<K,
V> - Overrides:
valueSizeAsync
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
- size of value
-
getOperationAsync
- Overrides:
getOperationAsync
in classRedissonMapCache<K,
V>
-
readAllKeySetAsync
Description copied from interface:RMapAsync
Read all keys at once- Specified by:
readAllKeySetAsync
in interfaceRMapAsync<K,
V> - Overrides:
readAllKeySetAsync
in classRedissonMapCache<K,
V> - Returns:
- keys
-
readAllEntrySetAsync
Description copied from interface:RMapAsync
Read all map entries at once- Specified by:
readAllEntrySetAsync
in interfaceRMapAsync<K,
V> - Overrides:
readAllEntrySetAsync
in classRedissonMapCache<K,
V> - Returns:
- entries
-
readAllValuesAsync
Description copied from interface:RMapAsync
Read all values at once- Specified by:
readAllValuesAsync
in interfaceRMapAsync<K,
V> - Overrides:
readAllValuesAsync
in classRedissonMapCache<K,
V> - Returns:
- values
-
readAllMapAsync
Description copied from interface:RMapAsync
Read all map as local instance at once- Specified by:
readAllMapAsync
in interfaceRMapAsync<K,
V> - Overrides:
readAllMapAsync
in classRedissonMapCache<K,
V> - Returns:
- map
-
getAllOperationAsync
- Overrides:
getAllOperationAsync
in classRedissonMapCache<K,
V>
-
removeOperationAsync
- Overrides:
removeOperationAsync
in classRedissonMapCache<K,
V>
-
removeOperationAsync
- Overrides:
removeOperationAsync
in classRedissonMapCache<K,
V>
-
putAllOperationAsync
- Overrides:
putAllOperationAsync
in classRedissonMapCache<K,
V>
-
replaceOperationAsync
- Overrides:
replaceOperationAsync
in classRedissonMapCache<K,
V>
-
replaceOperationAsync
- Overrides:
replaceOperationAsync
in classRedissonMapCache<K,
V>
-
checkState
protected void checkState() -
loadAllAsync
Description copied from interface:RMapAsync
Loads all map entries to this Redis map usingMapLoader
.- Specified by:
loadAllAsync
in interfaceRMapAsync<K,
V> - Overrides:
loadAllAsync
in classRedissonMap<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
-
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> - Overrides:
loadAllAsync
in classRedissonMap<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
-
getFairLock
Description copied from interface:RMap
ReturnsRLock
instance associated with key- Specified by:
getFairLock
in interfaceRMap<K,
V> - Overrides:
getFairLock
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
- fairlock
-
getCountDownLatch
Description copied from interface:RMap
ReturnsRCountDownLatch
instance associated with key- Specified by:
getCountDownLatch
in interfaceRMap<K,
V> - Overrides:
getCountDownLatch
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
- countdownlatch
-
getPermitExpirableSemaphore
Description copied from interface:RMap
ReturnsRPermitExpirableSemaphore
instance associated with key- Specified by:
getPermitExpirableSemaphore
in interfaceRMap<K,
V> - Overrides:
getPermitExpirableSemaphore
in classRedissonMap<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> - Overrides:
getSemaphore
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
- semaphore
-
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> - Overrides:
getReadWriteLock
in classRedissonMap<K,
V> - Parameters:
key
- - map key- Returns:
- readWriteLock
-
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
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
-
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
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
-
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
-
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.
-
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
-
clearExpireAsync
-