K
- key typeV
- value typepublic class RedissonTransactionalMapCache<K,V> extends RedissonMapCache<K,V>
codec, commandExecutor, name
Constructor and Description |
---|
RedissonTransactionalMapCache(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) |
Modifier and Type | Method and Description |
---|---|
protected RFuture<V> |
addAndGetOperationAsync(K key,
Number value) |
protected void |
checkState() |
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
RFuture<Boolean> |
containsKeyAsync(Object key)
Returns
true if this map contains map entry
mapped by specified key , otherwise false |
RFuture<Boolean> |
containsValueAsync(Object value)
Returns
true if this map contains any map entry
with specified value , otherwise false |
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
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.
|
protected RFuture<Boolean> |
fastPutIfAbsentOperationAsync(K key,
V value) |
protected RFuture<Boolean> |
fastPutOperationAsync(K key,
V value) |
RFuture<Boolean> |
fastPutOperationAsync(K key,
V value,
long ttl,
TimeUnit ttlUnit,
long maxIdleTime,
TimeUnit maxIdleUnit) |
protected RFuture<Long> |
fastRemoveOperationAsync(K... keys) |
RFuture<Map<K,V>> |
getAllOperationAsync(Set<K> keys) |
RCountDownLatch |
getCountDownLatch(K key)
Returns
RCountDownLatch instance associated with key |
RLock |
getFairLock(K key)
Returns
RLock instance associated with key |
RLock |
getLock(K key)
Returns
RLock instance associated with key |
RFuture<V> |
getOperationAsync(K key) |
RPermitExpirableSemaphore |
getPermitExpirableSemaphore(K key)
Returns
RPermitExpirableSemaphore instance associated with key |
RReadWriteLock |
getReadWriteLock(K key)
Returns
RReadWriteLock instance associated with key |
RSemaphore |
getSemaphore(K key)
Returns
RSemaphore instance associated with key |
RFuture<Boolean> |
isExistsAsync()
Check object existence in async mode.
|
RFuture<Void> |
loadAllAsync(boolean replaceExistingValues,
int parallelism)
Loads all map entries to this Redis map using
MapLoader . |
RFuture<Void> |
loadAllAsync(Set<? extends K> keys,
boolean replaceExistingValues,
int parallelism)
Loads map entries using
MapLoader whose keys are listed in defined keys parameter. |
<KOut,VOut> |
mapReduce()
Returns
RMapReduce object associated with this map |
RFuture<Void> |
migrateAsync(String host,
int port,
int database,
long timeout)
Transfer object from source Redis instance to destination Redis instance
in async mode
|
RFuture<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
protected RFuture<Void> |
putAllOperationAsync(Map<? extends K,? extends V> entries) |
RFuture<V> |
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.
|
protected RFuture<V> |
putIfAbsentOperationAsync(K key,
V value) |
protected RFuture<V> |
putOperationAsync(K key,
V value) |
RFuture<V> |
putOperationAsync(K key,
V value,
long ttlTimeout,
long maxIdleTimeout,
long maxIdleDelta) |
RFuture<Set<Map.Entry<K,V>>> |
readAllEntrySetAsync()
Read all map entries at once
|
RFuture<Set<K>> |
readAllKeySetAsync()
Read all keys at once
|
RFuture<Map<K,V>> |
readAllMapAsync()
Read all map as local instance at once
|
RFuture<Collection<V>> |
readAllValuesAsync()
Read all values at once
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
protected RFuture<V> |
removeOperationAsync(K key) |
protected RFuture<Boolean> |
removeOperationAsync(Object key,
Object value) |
protected RFuture<V> |
replaceOperationAsync(K key,
V value) |
protected RFuture<Boolean> |
replaceOperationAsync(K key,
V oldValue,
V newValue) |
MapScanResult<Object,Object> |
scanIterator(String name,
RedisClient client,
long startPos,
String pattern,
int count) |
RFuture<Void> |
setMaxSizeAsync(int maxSize)
Sets max size of the map.
|
RFuture<Boolean> |
touchAsync()
Update the last access time of an object in async mode.
|
RFuture<Boolean> |
trySetMaxSizeAsync(int maxSize)
Tries to set max size of the map.
|
RFuture<Boolean> |
unlinkAsync()
Delete the objects.
|
RFuture<Integer> |
valueSizeAsync(K key)
Returns size of value mapped by key in bytes
|
addAndGet, addListener, destroy, fastPut, fastPut, fastPutAsync, fastPutAsync, fastPutIfAbsent, fastPutIfAbsent, fastRemoveOperationBatchAsync, fastReplaceOperationAsync, put, put, putAll, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, remainTimeToLive, remainTimeToLiveAsync, removeListener, scanIteratorAsync, setMaxSize, sizeInMemoryAsync, trySetMaxSize
addAndGetAsync, checkKey, checkValue, clear, containsKey, containsValue, entryIterator, entrySet, entrySet, entrySet, entrySet, equals, fastPut, fastPutAsync, fastPutIfAbsent, fastPutIfAbsentAsync, fastRemove, fastRemoveAsync, fastReplace, fastReplaceAsync, get, getAll, getAllAsync, getAsync, hashCode, hasNoLoader, hasNoWriter, isEmpty, keyIterator, keySet, keySet, keySet, keySet, loadAll, loadAll, mapWriterFuture, mapWriterFuture, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, removeAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, size, sizeAsync, valueIterator, values, values, values, values, valueSize
addListener, addListenerAsync, copy, copyAsync, delete, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getLockByMapKey, getLockByValue, getName, getName, isExists, migrate, move, prefixName, removeListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, unlink
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastRemove, fastReplace, get, getAll, keySet, keySet, keySet, keySet, loadAll, loadAll, put, putAll, putAll, putIfAbsent, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSize
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
sizeAsync
addAndGetAsync, fastPutAsync, fastPutIfAbsentAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsync
addListenerAsync, copyAsync, dumpAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync
public RedissonTransactionalMapCache(CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId)
public RedissonTransactionalMapCache(Codec codec, CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed, String transactionId)
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
expireAsync
in class RedissonMapCache<K,V>
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
expireAtAsync
in class RedissonMapCache<K,V>
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
clearExpireAsync
in class RedissonMapCache<K,V>
true
if the timeout was cleared and false
if notpublic RFuture<Boolean> moveAsync(int database)
RObjectAsync
moveAsync
in interface RObjectAsync
moveAsync
in class RedissonObject
database
- - number of Redis databasetrue
if key was moved false
if notpublic RFuture<Void> migrateAsync(String host, int port, int database, long timeout)
RObjectAsync
migrateAsync
in interface RObjectAsync
migrateAsync
in class RedissonObject
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic RFuture<Boolean> touchAsync()
RObjectAsync
touchAsync
in interface RObjectAsync
touchAsync
in class RedissonObject
true
if object was touched else false
public RFuture<Boolean> isExistsAsync()
RObjectAsync
isExistsAsync
in interface RObjectAsync
isExistsAsync
in class RedissonObject
true
if object exists and false
otherwisepublic RFuture<Boolean> unlinkAsync()
RObjectAsync
Requires Redis 4.0+
unlinkAsync
in interface RObjectAsync
unlinkAsync
in class RedissonObject
true
if it was exist and deleted else false
public RFuture<Boolean> deleteAsync()
RObjectAsync
deleteAsync
in interface RObjectAsync
deleteAsync
in class RedissonMapCache<K,V>
true
if object was deleted false
if notpublic RFuture<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
RMapCacheAsync
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.
putIfAbsentAsync
in interface RMapCacheAsync<K,V>
putIfAbsentAsync
in class RedissonMapCache<K,V>
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry.
If 0
then time to live doesn't affect entry expiration.ttlUnit
- - time unitmaxIdleTime
- - max idle time for key\value entry.
If 0
then max idle time doesn't affect entry expiration.maxIdleUnit
- - time unit
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.
public RFuture<Boolean> fastPutOperationAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
fastPutOperationAsync
in class RedissonMapCache<K,V>
public RFuture<V> putOperationAsync(K key, V value, long ttlTimeout, long maxIdleTimeout, long maxIdleDelta)
putOperationAsync
in class RedissonMapCache<K,V>
public RFuture<Boolean> fastPutIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit)
RMapCacheAsync
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.
fastPutIfAbsentAsync
in interface RMapCacheAsync<K,V>
fastPutIfAbsentAsync
in class RedissonMapCache<K,V>
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry.
If 0
then time to live doesn't affect entry expiration.ttlUnit
- - time unitmaxIdleTime
- - max idle time for key\value entry.
If 0
then max idle time doesn't affect entry expiration.maxIdleUnit
- - time unit
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.
true
if key is a new key in the hash and value was set.
false
if key already exists in the hashpublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
public RFuture<Void> setMaxSizeAsync(int maxSize)
RMapCacheAsync
setMaxSizeAsync
in interface RMapCacheAsync<K,V>
setMaxSizeAsync
in class RedissonMapCache<K,V>
maxSize
- - max sizepublic RFuture<Boolean> trySetMaxSizeAsync(int maxSize)
RMapCacheAsync
trySetMaxSizeAsync
in interface RMapCacheAsync<K,V>
trySetMaxSizeAsync
in class RedissonMapCache<K,V>
maxSize
- - max sizetrue
if max size has been successfully set, otherwise false
.public <KOut,VOut> RMapReduce<K,V,KOut,VOut> mapReduce()
RMap
RMapReduce
object associated with this mappublic MapScanResult<Object,Object> scanIterator(String name, RedisClient client, long startPos, String pattern, int count)
scanIterator
in class RedissonMapCache<K,V>
public RFuture<Boolean> containsKeyAsync(Object key)
RMapAsync
true
if this map contains map entry
mapped by specified key
, otherwise false
containsKeyAsync
in interface RMapAsync<K,V>
containsKeyAsync
in class RedissonMapCache<K,V>
key
- - map keytrue
if this map contains map entry
mapped by specified key
, otherwise false
public RFuture<Boolean> containsValueAsync(Object value)
RMapAsync
true
if this map contains any map entry
with specified value
, otherwise false
containsValueAsync
in interface RMapAsync<K,V>
containsValueAsync
in class RedissonMapCache<K,V>
value
- - map valuetrue
if this map contains any map entry
with specified value
, otherwise false
protected RFuture<V> addAndGetOperationAsync(K key, Number value)
addAndGetOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<V> putIfAbsentOperationAsync(K key, V value)
putIfAbsentOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<V> putOperationAsync(K key, V value)
putOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Boolean> fastPutIfAbsentOperationAsync(K key, V value)
fastPutIfAbsentOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Boolean> fastPutOperationAsync(K key, V value)
fastPutOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Long> fastRemoveOperationAsync(K... keys)
fastRemoveOperationAsync
in class RedissonMapCache<K,V>
public RFuture<Integer> valueSizeAsync(K key)
RMapAsync
valueSizeAsync
in interface RMapAsync<K,V>
valueSizeAsync
in class RedissonMap<K,V>
key
- - map keypublic RFuture<V> getOperationAsync(K key)
getOperationAsync
in class RedissonMapCache<K,V>
public RFuture<Set<K>> readAllKeySetAsync()
RMapAsync
readAllKeySetAsync
in interface RMapAsync<K,V>
readAllKeySetAsync
in class RedissonMapCache<K,V>
public RFuture<Set<Map.Entry<K,V>>> readAllEntrySetAsync()
RMapAsync
readAllEntrySetAsync
in interface RMapAsync<K,V>
readAllEntrySetAsync
in class RedissonMapCache<K,V>
public RFuture<Collection<V>> readAllValuesAsync()
RMapAsync
readAllValuesAsync
in interface RMapAsync<K,V>
readAllValuesAsync
in class RedissonMapCache<K,V>
public RFuture<Map<K,V>> readAllMapAsync()
RMapAsync
readAllMapAsync
in interface RMapAsync<K,V>
readAllMapAsync
in class RedissonMapCache<K,V>
public RFuture<Map<K,V>> getAllOperationAsync(Set<K> keys)
getAllOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<V> removeOperationAsync(K key)
removeOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Boolean> removeOperationAsync(Object key, Object value)
removeOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Void> putAllOperationAsync(Map<? extends K,? extends V> entries)
putAllOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<Boolean> replaceOperationAsync(K key, V oldValue, V newValue)
replaceOperationAsync
in class RedissonMapCache<K,V>
protected RFuture<V> replaceOperationAsync(K key, V value)
replaceOperationAsync
in class RedissonMapCache<K,V>
protected void checkState()
public RFuture<Void> loadAllAsync(boolean replaceExistingValues, int parallelism)
RMapAsync
MapLoader
.loadAllAsync
in interface RMapAsync<K,V>
loadAllAsync
in class RedissonMap<K,V>
replaceExistingValues
- - true
if existed values should be replaced, false
otherwise.parallelism
- - parallelism level, used to increase speed of process executionpublic RFuture<Void> loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism)
RMapAsync
MapLoader
whose keys are listed in defined keys
parameter.loadAllAsync
in interface RMapAsync<K,V>
loadAllAsync
in class RedissonMap<K,V>
keys
- - map keysreplaceExistingValues
- - true
if existed values should be replaced, false
otherwise.parallelism
- - parallelism level, used to increase speed of process executionpublic RLock getFairLock(K key)
RMap
RLock
instance associated with keygetFairLock
in interface RMap<K,V>
getFairLock
in class RedissonMap<K,V>
key
- - map keypublic RCountDownLatch getCountDownLatch(K key)
RMap
RCountDownLatch
instance associated with keygetCountDownLatch
in interface RMap<K,V>
getCountDownLatch
in class RedissonMap<K,V>
key
- - map keypublic RPermitExpirableSemaphore getPermitExpirableSemaphore(K key)
RMap
RPermitExpirableSemaphore
instance associated with keygetPermitExpirableSemaphore
in interface RMap<K,V>
getPermitExpirableSemaphore
in class RedissonMap<K,V>
key
- - map keypublic RSemaphore getSemaphore(K key)
RMap
RSemaphore
instance associated with keygetSemaphore
in interface RMap<K,V>
getSemaphore
in class RedissonMap<K,V>
key
- - map keypublic RLock getLock(K key)
RMap
RLock
instance associated with keypublic RReadWriteLock getReadWriteLock(K key)
RMap
RReadWriteLock
instance associated with keygetReadWriteLock
in interface RMap<K,V>
getReadWriteLock
in class RedissonMap<K,V>
key
- - map keypublic boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
Copyright © 2014–2020 Redisson. All rights reserved.