Class RedissonLocalCachedMap<K,V>
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonMap<K,V>
-
- org.redisson.RedissonLocalCachedMap<K,V>
-
- All Implemented Interfaces:
ConcurrentMap<K,V>,Map<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 StringDISABLED_ACK_SUFFIXstatic StringDISABLED_KEYS_SUFFIXstatic StringTOPIC_SUFFIX-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonLocalCachedMap(Codec codec, CommandAsyncExecutor connectionManager, String name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)RedissonLocalCachedMap(CommandAsyncExecutor commandExecutor, String 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, Number value)Set<Map.Entry<K,V>>cachedEntrySet()Returns all map entries stored in local cacheSet<K>cachedKeySet()Returns all keys stored in local cacheCollection<V>cachedValues()Returns all values stored in local cachebooleanclearExpire()Clear an expire timeout or expire date for object.RFuture<Boolean>clearExpireAsync()Clear an expire timeout or expire date for object in async mode.protected RFuture<Boolean>clearExpireAsync(String... keys)voidclearLocalCache()Clears local cache across all instancesRFuture<Void>clearLocalCacheAsync()Clears local cache across all instancesRFuture<Boolean>containsKeyAsync(Object key)Returnstrueif this map contains map entry mapped by specifiedkey, otherwisefalseRFuture<Boolean>containsValueAsync(Object value)Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalseprotected io.netty.buffer.ByteBufcreateSyncMessage(io.netty.buffer.ByteBuf mapKey, io.netty.buffer.ByteBuf mapValue, CacheKey cacheKey)RFuture<Boolean>deleteAsync()Delete object in async modevoiddestroy()Destroys object when it's not necessary anymore.io.netty.buffer.ByteBufencode(Object value)booleanexpire(long timeToLive, TimeUnit timeUnit)Set a timeout for object.booleanexpire(Instant instant)Set an expire date for object.RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit)Set a timeout for object in async mode.protected RFuture<Boolean>expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)RFuture<Boolean>expireAsync(Instant instant)Set an expire date for object.booleanexpireAt(long timestamp)UseRExpirable.expire(Instant)insteadbooleanexpireAt(Date timestamp)UseRExpirable.expire(Instant)insteadRFuture<Boolean>expireAtAsync(long timestamp)UseRExpirableAsync.expireAsync(Instant)insteadprotected RFuture<Boolean>expireAtAsync(long timestamp, String... keys)RFuture<Boolean>expireAtAsync(Date timestamp)UseRExpirableAsync.expireAsync(Instant)insteadRFuture<Boolean>fastPutIfAbsentAsync(K key, V value)Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.RFuture<Boolean>fastPutIfExistsAsync(K key, V value)Stores the specifiedvaluemapped bykeyonly if mapping already exists.protected RFuture<Boolean>fastPutOperationAsync(K key, V value)protected RFuture<Long>fastRemoveOperationAsync(K... keys)protected RFuture<List<Long>>fastRemoveOperationBatchAsync(K... keys)RFuture<Boolean>fastReplaceAsync(K key, V value)Replaces previous value with a newvaluemapped by specifiedkey.protected RFuture<Boolean>fastReplaceOperationAsync(K key, V value)protected static byte[]generateLogEntryId(byte[] keyHash)RFuture<Map<K,V>>getAllAsync(Set<K> keys)Returns map slice contained the mappings with definedkeys.RFuture<V>getAsync(Object key)Returns the value mapped by definedkeyornullif value is absent.Map<K,V>getCachedMap()Returns state of local cacheLocalCacheView<K,V>getLocalCacheView()voidpreloadCache()Pre-warm the cached entries.voidpreloadCache(int count)Pre-warm the cached entries.protected RFuture<Void>putAllOperationAsync(Map<? extends K,? extends V> map)RFuture<V>putIfAbsentAsync(K key, V value)Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.RFuture<V>putIfExistsAsync(K key, V value)Stores the specifiedvaluemapped bykeyonly if mapping already exists.protected RFuture<V>putOperationAsync(K key, V value)RFuture<Set<Map.Entry<K,V>>>readAllEntrySetAsync()Read all map entries at onceRFuture<Map<K,V>>readAllMapAsync()Read all map as local instance at onceRFuture<Collection<V>>readAllValuesAsync()Read all values at oncelongremainTimeToLive()Remaining time to live of Redisson object that has a timeoutRFuture<Long>remainTimeToLiveAsync()Remaining time to live of Redisson object that has a timeoutRFuture<Boolean>removeAsync(Object key, Object value)Removes map entry only if it exists with specifiedkeyandvalue.protected RFuture<Boolean>removeOperationAsync(Object key, Object value)protected RFuture<V>removeOperationAsync(K key)RFuture<V>replaceAsync(K key, V value)Replaces previous value with a newvaluemapped by specifiedkey.RFuture<Boolean>replaceAsync(K key, V oldValue, V newValue)Replaces previousoldValuewith anewValuemapped by specifiedkey.protected RFuture<V>replaceOperationAsync(K key, V value)protected RFuture<Boolean>replaceOperationAsync(K key, V oldValue, V newValue)RFuture<Integer>sizeAsync()Returns size of this mapRFuture<Long>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 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, 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 String TOPIC_SUFFIX
- See Also:
- Constant Field Values
-
DISABLED_KEYS_SUFFIX
public static final String DISABLED_KEYS_SUFFIX
- See Also:
- Constant Field Values
-
DISABLED_ACK_SUFFIX
public static final String DISABLED_ACK_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RedissonLocalCachedMap
public RedissonLocalCachedMap(CommandAsyncExecutor commandExecutor, String name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
-
RedissonLocalCachedMap
public RedissonLocalCachedMap(Codec codec, CommandAsyncExecutor connectionManager, String name, LocalCachedMapOptions<K,V> options, EvictionScheduler evictionScheduler, RedissonClient redisson, WriteBehindService writeBehindService)
-
-
Method Detail
-
getLocalCacheView
public LocalCacheView<K,V> getLocalCacheView()
-
sizeAsync
public RFuture<Integer> sizeAsync()
Description copied from interface:RMapAsyncReturns size of this map
-
containsKeyAsync
public RFuture<Boolean> containsKeyAsync(Object key)
Description copied from interface:RMapAsyncReturnstrueif this map contains map entry mapped by specifiedkey, otherwisefalse- Specified by:
containsKeyAsyncin interfaceRMapAsync<K,V>- Overrides:
containsKeyAsyncin classRedissonMap<K,V>- Parameters:
key- - map key- Returns:
trueif this map contains map entry mapped by specifiedkey, otherwisefalse
-
containsValueAsync
public RFuture<Boolean> containsValueAsync(Object value)
Description copied from interface:RMapAsyncReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValueAsyncin interfaceRMapAsync<K,V>- Overrides:
containsValueAsyncin classRedissonMap<K,V>- Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
getAsync
public RFuture<V> getAsync(Object key)
Description copied from interface:RMapAsyncReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode.
-
generateLogEntryId
protected static byte[] generateLogEntryId(byte[] keyHash)
-
putOperationAsync
protected RFuture<V> putOperationAsync(K key, V value)
- Overrides:
putOperationAsyncin classRedissonMap<K,V>
-
createSyncMessage
protected io.netty.buffer.ByteBuf createSyncMessage(io.netty.buffer.ByteBuf mapKey, io.netty.buffer.ByteBuf mapValue, CacheKey cacheKey)
-
fastPutOperationAsync
protected RFuture<Boolean> fastPutOperationAsync(K key, V value)
- Overrides:
fastPutOperationAsyncin classRedissonMap<K,V>
-
destroy
public void destroy()
Description copied from interface:RDestroyableDestroys object when it's not necessary anymore.- Specified by:
destroyin interfaceRDestroyable
-
removeOperationAsync
protected RFuture<V> removeOperationAsync(K key)
- Overrides:
removeOperationAsyncin classRedissonMap<K,V>
-
fastRemoveOperationBatchAsync
protected RFuture<List<Long>> fastRemoveOperationBatchAsync(K... keys)
- Overrides:
fastRemoveOperationBatchAsyncin classRedissonMap<K,V>
-
fastRemoveOperationAsync
protected RFuture<Long> fastRemoveOperationAsync(K... keys)
- Overrides:
fastRemoveOperationAsyncin classRedissonMap<K,V>
-
sizeInMemoryAsync
public RFuture<Long> sizeInMemoryAsync()
Description copied from interface:RObjectAsyncReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsyncin interfaceRObjectAsync- Overrides:
sizeInMemoryAsyncin classRedissonObject- Returns:
- size in bytes
-
deleteAsync
public RFuture<Boolean> deleteAsync()
Description copied from interface:RObjectAsyncDelete object in async mode- Specified by:
deleteAsyncin interfaceRObjectAsync- Overrides:
deleteAsyncin classRedissonObject- Returns:
trueif object was deletedfalseif not
-
getAllAsync
public RFuture<Map<K,V>> getAllAsync(Set<K> keys)
Description copied from interface:RMapAsyncReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.The returned map is NOT backed by the original map.
- Specified by:
getAllAsyncin interfaceRMapAsync<K,V>- Overrides:
getAllAsyncin classRedissonMap<K,V>- Parameters:
keys- - map keys- Returns:
- Map slice
-
putAllOperationAsync
protected RFuture<Void> putAllOperationAsync(Map<? extends K,? extends V> map)
- Overrides:
putAllOperationAsyncin classRedissonMap<K,V>
-
addAndGetOperationAsync
protected RFuture<V> addAndGetOperationAsync(K key, Number value)
- Overrides:
addAndGetOperationAsyncin classRedissonMap<K,V>
-
fastPutIfAbsentAsync
public RFuture<Boolean> fastPutIfAbsentAsync(K key, V value)
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but not returning the previous value associated withRMapAsync.putIfAbsentAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentAsyncin interfaceRMapAsync<K,V>- Overrides:
fastPutIfAbsentAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
trueif key is a new one in the hash and value was set.falseif key already exists in the hash and change hasn't been made.
-
fastPutIfExistsAsync
public RFuture<Boolean> fastPutIfExistsAsync(K key, V value)
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but doesn't return previous value associated withRMapAsync.putIfExistsAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsAsyncin interfaceRMapAsync<K,V>- Overrides:
fastPutIfExistsAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
trueif key already exists in the hash and new value has been stored.falseif key doesn't exist in the hash and value hasn't been set.
-
readAllValuesAsync
public RFuture<Collection<V>> readAllValuesAsync()
Description copied from interface:RMapAsyncRead all values at once- Specified by:
readAllValuesAsyncin interfaceRMapAsync<K,V>- Overrides:
readAllValuesAsyncin classRedissonMap<K,V>- Returns:
- values
-
readAllMapAsync
public RFuture<Map<K,V>> readAllMapAsync()
Description copied from interface:RMapAsyncRead all map as local instance at once- Specified by:
readAllMapAsyncin interfaceRMapAsync<K,V>- Overrides:
readAllMapAsyncin classRedissonMap<K,V>- Returns:
- map
-
preloadCache
public void preloadCache()
Description copied from interface:RLocalCachedMapPre-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:
preloadCachein interfaceRLocalCachedMap<K,V>
-
preloadCache
public void preloadCache(int count)
Description copied from interface:RLocalCachedMapPre-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 bycountparam.- Specified by:
preloadCachein interfaceRLocalCachedMap<K,V>- Parameters:
count- - size of batch
-
clearLocalCache
public void clearLocalCache()
Description copied from interface:RLocalCachedMapClears local cache across all instances- Specified by:
clearLocalCachein interfaceRLocalCachedMap<K,V>
-
clearLocalCacheAsync
public RFuture<Void> clearLocalCacheAsync()
Description copied from interface:RLocalCachedMapClears local cache across all instances- Specified by:
clearLocalCacheAsyncin interfaceRLocalCachedMap<K,V>- Returns:
- void
-
readAllEntrySetAsync
public RFuture<Set<Map.Entry<K,V>>> readAllEntrySetAsync()
Description copied from interface:RMapAsyncRead all map entries at once- Specified by:
readAllEntrySetAsyncin interfaceRMapAsync<K,V>- Overrides:
readAllEntrySetAsyncin classRedissonMap<K,V>- Returns:
- entries
-
fastReplaceAsync
public RFuture<Boolean> fastReplaceAsync(K key, V value)
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey.Works faster than
but not returning the previous value.RMapAsync.replaceAsync(Object, Object)Returns
trueif key exists and value was updated orfalseif key doesn't exists and value wasn't updated.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastReplaceAsyncin interfaceRMapAsync<K,V>- Overrides:
fastReplaceAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
trueif key exists and value was updated.falseif key doesn't exists and value wasn't updated.
-
fastReplaceOperationAsync
protected RFuture<Boolean> fastReplaceOperationAsync(K key, V value)
- Overrides:
fastReplaceOperationAsyncin classRedissonMap<K,V>
-
replaceOperationAsync
protected RFuture<V> replaceOperationAsync(K key, V value)
- Overrides:
replaceOperationAsyncin classRedissonMap<K,V>
-
replaceAsync
public RFuture<V> replaceAsync(K key, V value)
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey. Returnsnullif there is no map entry stored before and doesn't store new map entry.If
MapWriteris defined then newvalueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V>- Overrides:
replaceAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
- previous associated value
or
nullif there is no map entry stored before and doesn't store new map entry
-
replaceOperationAsync
protected RFuture<Boolean> replaceOperationAsync(K key, V oldValue, V newValue)
- Overrides:
replaceOperationAsyncin classRedissonMap<K,V>
-
replaceAsync
public RFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
Description copied from interface:RMapAsyncReplaces previousoldValuewith anewValuemapped by specifiedkey. Returnsfalseif previous value doesn't exist or equal tooldValue.If
MapWriteris defined thennewValueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V>- Overrides:
replaceAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyoldValue- - map old valuenewValue- - map new value- Returns:
trueif value has been replaced otherwisefalse.
-
removeOperationAsync
protected RFuture<Boolean> removeOperationAsync(Object key, Object value)
- Overrides:
removeOperationAsyncin classRedissonMap<K,V>
-
removeAsync
public RFuture<Boolean> removeAsync(Object key, Object value)
Description copied from interface:RMapAsyncRemoves map entry only if it exists with specifiedkeyandvalue.If
MapWriteris defined thenkeyis deleted in write-through mode.- Specified by:
removeAsyncin interfaceRMapAsync<K,V>- Overrides:
removeAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
trueif map entry has been removed otherwisefalse.
-
putIfExistsAsync
public RFuture<V> putIfExistsAsync(K key, V value)
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsAsyncin interfaceRMapAsync<K,V>- Overrides:
putIfExistsAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is doesn't exists in the hash and value hasn't been set. Previous value if key already exists in the hash and new value has been stored.
-
putIfAbsentAsync
public RFuture<V> putIfAbsentAsync(K key, V value)
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentAsyncin interfaceRMapAsync<K,V>- Overrides:
putIfAbsentAsyncin classRedissonMap<K,V>- Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
-
encode
public io.netty.buffer.ByteBuf encode(Object value)
- Overrides:
encodein classRedissonObject
-
cachedKeySet
public Set<K> cachedKeySet()
Description copied from interface:RLocalCachedMapReturns all keys stored in local cache- Specified by:
cachedKeySetin interfaceRLocalCachedMap<K,V>- Returns:
- keys
-
cachedValues
public Collection<V> cachedValues()
Description copied from interface:RLocalCachedMapReturns all values stored in local cache- Specified by:
cachedValuesin interfaceRLocalCachedMap<K,V>- Returns:
- values
-
cachedEntrySet
public Set<Map.Entry<K,V>> cachedEntrySet()
Description copied from interface:RLocalCachedMapReturns all map entries stored in local cache- Specified by:
cachedEntrySetin interfaceRLocalCachedMap<K,V>- Returns:
- entries
-
getCachedMap
public Map<K,V> getCachedMap()
Description copied from interface:RLocalCachedMapReturns state of local cache- Specified by:
getCachedMapin interfaceRLocalCachedMap<K,V>- Returns:
- map
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)Description copied from interface:RExpirableSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsyncSet a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirableSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
-
-