Class RedissonLocalCachedMap<K,V>
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonMap<K,V>
-
- org.redisson.RedissonLocalCachedMap<K,V>
-
- All Implemented Interfaces:
<K,V>
,<K,V>
,RDestroyable
,RExpirable
,RExpirableAsync
,RLocalCachedMap<K,V>
,RMap<K,V>
,RMapAsync<K,V>
,RObject
,RObjectAsync
public class RedissonLocalCachedMap<K,V> extends RedissonMap<K,V> implements RLocalCachedMap<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description static
DISABLED_ACK_SUFFIX
static
DISABLED_KEYS_SUFFIX
static
TOPIC_SUFFIX
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonLocalCachedMap(Codec codec, CommandAsyncExecutor connectionManager, name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
RedissonLocalCachedMap(CommandAsyncExecutor commandExecutor, name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RFuture<V>
addAndGetOperationAsync(K key, value)
<<K,V>>
cachedEntrySet()
Returns all map entries stored in local cache<K>
cachedKeySet()
Returns all keys stored in local cache<V>
cachedValues()
Returns all values stored in local cacheboolean
clearExpire()
Clear an expire timeout or expire date for object.>
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.protected >
... keys)
void
clearLocalCache()
Clears local cache across all instances>
clearLocalCacheAsync()
Clears local cache across all instances>
key)
Returnstrue
if this map contains map entry mapped by specifiedkey
, otherwisefalse
>
value)
Returnstrue
if this map contains any map entry with specifiedvalue
, otherwisefalse
protected io.netty.buffer.ByteBuf
createSyncMessage(io.netty.buffer.ByteBuf mapKey, io.netty.buffer.ByteBuf mapValue, CacheKey cacheKey)
>
deleteAsync()
Delete object in async modevoid
destroy()
Destroys object when it's not necessary anymore.io.netty.buffer.ByteBuf
value)
boolean
expire(long timeToLive, timeUnit)
Set a timeout for object.boolean
instant)
Set an expire date for object.>
expireAsync(long timeToLive, timeUnit)
Set a timeout for object in async mode.protected >
expireAsync(long timeToLive, timeUnit, ... keys)
>
instant)
Set an expire date for object.boolean
expireAt(long timestamp)
UseRExpirable.expire(Instant)
insteadboolean
timestamp)
UseRExpirable.expire(Instant)
instead>
expireAtAsync(long timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadprotected >
expireAtAsync(long timestamp, ... keys)
>
timestamp)
UseRExpirableAsync.expireAsync(Instant)
instead>
fastPutIfAbsentAsync(K key, V value)
Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.>
fastPutIfExistsAsync(K key, V value)
Stores the specifiedvalue
mapped bykey
only if mapping already exists.protected >
fastPutOperationAsync(K key, V value)
protected >
fastRemoveOperationAsync(K... keys)
protected <>>
fastRemoveOperationBatchAsync(K... keys)
>
fastReplaceAsync(K key, V value)
Replaces previous value with a newvalue
mapped by specifiedkey
.protected >
fastReplaceOperationAsync(K key, V value)
protected static byte[]
generateLogEntryId(byte[] keyHash)
<K,V>>
<K> keys)
Returns map slice contained the mappings with definedkeys
.RFuture<V>
key)
Returns the value mapped by definedkey
ornull
if value is absent.<K,V>
getCachedMap()
Returns state of local cacheLocalCacheView<K,V>
getLocalCacheView()
void
preloadCache()
Pre-warm the cached entries.void
preloadCache(int count)
Pre-warm the cached entries.protected >
<? extends K,? extends V> map)
RFuture<V>
putIfAbsentAsync(K key, V value)
Stores the specifiedvalue
mapped by specifiedkey
only if there is no value with specifiedkey
stored before.RFuture<V>
putIfExistsAsync(K key, V value)
Stores the specifiedvalue
mapped bykey
only if mapping already exists.protected RFuture<V>
putOperationAsync(K key, V value)
<<K,V>>>
readAllEntrySetAsync()
Read all map entries at once<K,V>>
readAllMapAsync()
Read all map as local instance at once<V>>
readAllValuesAsync()
Read all values at oncelong
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout>
key, value)
Removes map entry only if it exists with specifiedkey
andvalue
.protected >
key, value)
protected RFuture<V>
removeOperationAsync(K key)
RFuture<V>
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
.protected RFuture<V>
replaceOperationAsync(K key, V value)
protected >
replaceOperationAsync(K key, V oldValue, V newValue)
>
sizeAsync()
Returns size of this map>
sizeInMemoryAsync()
Returns bytes amount used by object in Redis memory.-
Methods inherited from class org.redisson.RedissonMap
addAndGet, addAndGetAsync, checkKey, checkValue, clear, compute, computeAsync, computeIfAbsent, computeIfAbsentAsync, computeIfPresent, computeIfPresentAsync, containsKey, containsKeyAsync, containsValue, entryIterator, entrySet, entrySet, entrySet, entrySet, equals, fastPut, fastPutAsync, fastPutIfAbsent, fastPutIfAbsentOperationAsync, fastPutIfExists, fastPutIfExistsOperationAsync, fastRemove, fastRemoveAsync, fastReplace, get, getAll, getAllOperationAsync, getCountDownLatch, getFairLock, getLock, getOperationAsync, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, hashCode, hasNoLoader, hasNoWriter, isEmpty, keyIterator, keySet, keySet, keySet, keySet, loadAll, loadAll, loadAllAsync, loadAllAsync, loadAllAsync, loadValue, mapReduce, mapWriterFuture, mapWriterFuture, merge, mergeAsync, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putIfAbsent, putIfAbsentOperationAsync, putIfExists, putIfExistsOperationAsync, randomEntries, randomEntriesAsync, randomKeys, randomKeysAsync, readAllEntrySet, readAllKeySet, readAllKeySetAsync, readAllMap, readAllValues, remove, remove, removeAsync, replace, replace, scanIterator, scanIteratorAsync, size, valueIterator, values, values, values, values, valueSize, valueSizeAsync
-
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RMap
addAndGet, containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, fastReplace, get, getAll, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, keySet, keySet, keySet, keySet, loadAll, loadAll, mapReduce, put, putAll, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSize
-
Methods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, fastPutAsync, fastRemoveAsync, loadAllAsync, loadAllAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, randomEntriesAsync, randomKeysAsync, readAllKeySetAsync, removeAsync, valueSizeAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
-
-
-
Field Detail
-
TOPIC_SUFFIX
public static final TOPIC_SUFFIX
- See Also:
- Constant Field Values
-
DISABLED_KEYS_SUFFIX
public static final DISABLED_KEYS_SUFFIX
- See Also:
- Constant Field Values
-
DISABLED_ACK_SUFFIX
public static final DISABLED_ACK_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RedissonLocalCachedMap
public RedissonLocalCachedMap(CommandAsyncExecutor commandExecutor, name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
-
RedissonLocalCachedMap
public RedissonLocalCachedMap(Codec codec, CommandAsyncExecutor connectionManager, name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
-
-
Method Detail
-
getLocalCacheView
public LocalCacheView<K,V> getLocalCacheView()
-
sizeAsync
public > sizeAsync()
Description copied from interface:RMapAsync
Returns size of this map
-
containsKeyAsync
public > containsKeyAsync( key)
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
public > containsValueAsync( value)
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 classRedissonMap<K,V>
- Parameters:
value
- - map value- Returns:
true
if this map contains any map entry with specifiedvalue
, otherwisefalse
-
getAsync
public key)
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.
-
generateLogEntryId
protected static byte[] generateLogEntryId(byte[] keyHash)
-
putOperationAsync
protected RFuture<V> putOperationAsync(K key, V value)
- Overrides:
putOperationAsync
in classRedissonMap<K,V>
-
createSyncMessage
protected io.netty.buffer.ByteBuf createSyncMessage(io.netty.buffer.ByteBuf mapKey, io.netty.buffer.ByteBuf mapValue, CacheKey cacheKey)
-
fastPutOperationAsync
protected > fastPutOperationAsync(K key, V value)
- Overrides:
fastPutOperationAsync
in classRedissonMap<K,V>
-
destroy
public void destroy()
Description copied from interface:RDestroyable
Destroys object when it's not necessary anymore.- Specified by:
destroy
in interfaceRDestroyable
-
removeOperationAsync
protected RFuture<V> removeOperationAsync(K key)
- Overrides:
removeOperationAsync
in classRedissonMap<K,V>
-
fastRemoveOperationBatchAsync
protected <>> fastRemoveOperationBatchAsync(K... keys)
- Overrides:
fastRemoveOperationBatchAsync
in classRedissonMap<K,V>
-
fastRemoveOperationAsync
protected > fastRemoveOperationAsync(K... keys)
- Overrides:
fastRemoveOperationAsync
in classRedissonMap<K,V>
-
sizeInMemoryAsync
public > sizeInMemoryAsync()
Description copied from interface:RObjectAsync
Returns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsync
in interfaceRObjectAsync
- Overrides:
sizeInMemoryAsync
in classRedissonObject
- Returns:
- size in bytes
-
deleteAsync
public > deleteAsync()
Description copied from interface:RObjectAsync
Delete object in async mode- Specified by:
deleteAsync
in interfaceRObjectAsync
- Overrides:
deleteAsync
in classRedissonObject
- Returns:
true
if object was deletedfalse
if not
-
getAllAsync
public <<K> keys)
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>
- Overrides:
getAllAsync
in classRedissonMap<K,V>
- Parameters:
keys
- - map keys- Returns:
- Map slice
-
putAllOperationAsync
protected > putAllOperationAsync(<? extends K,? extends V> map)
- Overrides:
putAllOperationAsync
in classRedissonMap<K,V>
-
addAndGetOperationAsync
protected RFuture<V> addAndGetOperationAsync(K key, value)
- Overrides:
addAndGetOperationAsync
in classRedissonMap<K,V>
-
fastPutIfAbsentAsync
public > fastPutIfAbsentAsync(K key, V value)
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>
- Overrides:
fastPutIfAbsentAsync
in classRedissonMap<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.
-
fastPutIfExistsAsync
public > fastPutIfExistsAsync(K key, V value)
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>
- Overrides:
fastPutIfExistsAsync
in classRedissonMap<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.
-
readAllValuesAsync
public <V>> readAllValuesAsync()
Description copied from interface:RMapAsync
Read all values at once- Specified by:
readAllValuesAsync
in interfaceRMapAsync<K,V>
- Overrides:
readAllValuesAsync
in classRedissonMap<K,V>
- Returns:
- values
-
readAllMapAsync
public <K,V>> readAllMapAsync()
Description copied from interface:RMapAsync
Read all map as local instance at once- Specified by:
readAllMapAsync
in interfaceRMapAsync<K,V>
- Overrides:
readAllMapAsync
in classRedissonMap<K,V>
- Returns:
- map
-
preloadCache
public void preloadCache()
Description copied from interface:RLocalCachedMap
Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity). Entries are loaded in a batch with size of 10 elements.- Specified by:
preloadCache
in interfaceRLocalCachedMap<K,V>
-
preloadCache
public void preloadCache(int count)
Description copied from interface:RLocalCachedMap
Pre-warm the cached entries. Not guaranteed to load ALL values, but statistically will preload approximately all (all if no concurrent mutating activity) Entries are loaded in a batch. Batch size is defined bycount
param.- Specified by:
preloadCache
in interfaceRLocalCachedMap<K,V>
- Parameters:
count
- - size of batch
-
clearLocalCache
public void clearLocalCache()
Description copied from interface:RLocalCachedMap
Clears local cache across all instances- Specified by:
clearLocalCache
in interfaceRLocalCachedMap<K,V>
-
clearLocalCacheAsync
public > clearLocalCacheAsync()
Description copied from interface:RLocalCachedMap
Clears local cache across all instances- Specified by:
clearLocalCacheAsync
in interfaceRLocalCachedMap<K,V>
- Returns:
- void
-
readAllEntrySetAsync
public <<K,V>>> readAllEntrySetAsync()
Description copied from interface:RMapAsync
Read all map entries at once- Specified by:
readAllEntrySetAsync
in interfaceRMapAsync<K,V>
- Overrides:
readAllEntrySetAsync
in classRedissonMap<K,V>
- Returns:
- entries
-
fastReplaceAsync
public > fastReplaceAsync(K key, V value)
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>
- Overrides:
fastReplaceAsync
in classRedissonMap<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
protected > fastReplaceOperationAsync(K key, V value)
- Overrides:
fastReplaceOperationAsync
in classRedissonMap<K,V>
-
replaceOperationAsync
protected RFuture<V> replaceOperationAsync(K key, V value)
- Overrides:
replaceOperationAsync
in classRedissonMap<K,V>
-
replaceAsync
public RFuture<V> replaceAsync(K key, V value)
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>
- Overrides:
replaceAsync
in classRedissonMap<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
protected > replaceOperationAsync(K key, V oldValue, V newValue)
- Overrides:
replaceOperationAsync
in classRedissonMap<K,V>
-
replaceAsync
public > replaceAsync(K key, V oldValue, V newValue)
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>
- Overrides:
replaceAsync
in classRedissonMap<K,V>
- Parameters:
key
- - map keyoldValue
- - map old valuenewValue
- - map new value- Returns:
true
if value has been replaced otherwisefalse
.
-
removeOperationAsync
protected > removeOperationAsync( key, value)
- Overrides:
removeOperationAsync
in classRedissonMap<K,V>
-
removeAsync
public > removeAsync( key, value)
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>
- Overrides:
removeAsync
in classRedissonMap<K,V>
- Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if map entry has been removed otherwisefalse
.
-
putIfExistsAsync
public RFuture<V> putIfExistsAsync(K key, V value)
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>
- Overrides:
putIfExistsAsync
in classRedissonMap<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.
-
putIfAbsentAsync
public RFuture<V> putIfAbsentAsync(K key, V value)
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>
- Overrides:
putIfAbsentAsync
in classRedissonMap<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.
-
encode
public io.netty.buffer.ByteBuf encode( value)
- Overrides:
encode
in classRedissonObject
-
cachedKeySet
public <K> cachedKeySet()
Description copied from interface:RLocalCachedMap
Returns all keys stored in local cache- Specified by:
cachedKeySet
in interfaceRLocalCachedMap<K,V>
- Returns:
- keys
-
cachedValues
public <V> cachedValues()
Description copied from interface:RLocalCachedMap
Returns all values stored in local cache- Specified by:
cachedValues
in interfaceRLocalCachedMap<K,V>
- Returns:
- values
-
cachedEntrySet
public <<K,V>> cachedEntrySet()
Description copied from interface:RLocalCachedMap
Returns all map entries stored in local cache- Specified by:
cachedEntrySet
in interfaceRLocalCachedMap<K,V>
- Returns:
- entries
-
getCachedMap
public <K,V> getCachedMap()
Description copied from interface:RLocalCachedMap
Returns state of local cache- Specified by:
getCachedMap
in interfaceRLocalCachedMap<K,V>
- Returns:
- map
-
expire
public boolean expire(long timeToLive, timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- 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
public > expireAsync(long timeToLive, timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- 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
public > expireAtAsync(long timestamp)
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
public boolean expire( instant)
Description copied from interface:RExpirable
Set an expire date for 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
-
expireAsync
public > expireAsync( instant)
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
-
expireAt
public boolean expireAt( timestamp)
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
public > expireAtAsync( timestamp)
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
-
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
public > 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
public > 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.
-
expireAsync
protected > expireAsync(long timeToLive, timeUnit, ... keys)
-
expireAtAsync
protected > expireAtAsync(long timestamp, ... keys)
-
clearExpireAsync
protected > clearExpireAsync(... keys)
-
-