K - key typeV - value typepublic class RedissonTransactionalMapCache<K,V> extends RedissonMapCache<K,V>
codec, commandExecutor| Constructor and Description |
|---|
RedissonTransactionalMapCache(Codec codec,
CommandAsyncExecutor commandExecutor,
String name,
List<TransactionalOperation> operations,
long timeout,
AtomicBoolean executed) |
RedissonTransactionalMapCache(CommandAsyncExecutor commandExecutor,
String name,
List<TransactionalOperation> operations,
long timeout,
AtomicBoolean executed) |
| 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) |
RFuture<Boolean> |
containsValueAsync(Object value) |
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) |
RLock |
getLock(K key)
Returns
RLock instance associated with key |
RFuture<V> |
getOperationAsync(K key) |
RReadWriteLock |
getReadWriteLock(K key)
Returns
RReadWriteLock 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, fastPut, fastPut, fastPutAsync, fastPutAsync, fastPutIfAbsent, fastPutIfAbsent, fastRemoveOperationBatchAsync, fastReplaceOperationAsync, put, put, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, remainTimeToLive, remainTimeToLiveAsync, removeListener, scanIteratorAsync, setMaxSize, trySetMaxSizeaddAndGetAsync, 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, put, putAll, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, removeAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, size, sizeAsync, valueIterator, values, values, values, values, valueSizeawait, copy, copyAsync, delete, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, migrate, move, prefixName, rename, renameAsync, renamenx, renamenxAsync, suffixName, toSeconds, touch, unlinkclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitentrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastRemove, fastReplace, get, getAll, keySet, keySet, keySet, keySet, loadAll, loadAll, put, putAll, putIfAbsent, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSizecompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllclear, containsKey, containsValue, equals, hashCode, isEmptyclearExpire, expire, expireAt, expireAt, remainTimeToLivecopy, delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlinksizeAsyncaddAndGetAsync, fastPutAsync, fastPutIfAbsentAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, putAllAsync, putAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsynccopyAsync, renameAsync, renamenxAsyncpublic RedissonTransactionalMapCache(CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed)
public RedissonTransactionalMapCache(Codec codec, CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, long timeout, AtomicBoolean executed)
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsyncexpireAsync in interface RExpirableAsyncexpireAsync 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)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsyncexpireAtAsync in class RedissonMapCache<K,V>timestamp - - expire date in seconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsyncclearExpireAsync in class RedissonMapCache<K,V>true if the timeout was cleared and false if notpublic RFuture<Boolean> moveAsync(int database)
RObjectAsyncmoveAsync in interface RObjectAsyncmoveAsync in class RedissonObjectdatabase - - number of Redis databasetrue if key was moved false if notpublic RFuture<Void> migrateAsync(String host, int port, int database, long timeout)
RObjectAsyncmigrateAsync in interface RObjectAsyncmigrateAsync in class RedissonObjecthost - - destination hostport - - destination portdatabase - - destination databasetimeout - - maximum idle time in any moment of the communication with the destination instance in millisecondspublic RFuture<Boolean> touchAsync()
RObjectAsynctouchAsync in interface RObjectAsynctouchAsync in class RedissonObjecttrue if object was touched else falsepublic RFuture<Boolean> isExistsAsync()
RObjectAsyncisExistsAsync in interface RObjectAsyncisExistsAsync in class RedissonObjecttrue if object exists and false otherwisepublic RFuture<Boolean> unlinkAsync()
RObjectAsyncRequires Redis 4.0+
unlinkAsync in interface RObjectAsyncunlinkAsync in class RedissonObjecttrue if it was exist and deleted else falsepublic RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsyncdeleteAsync 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)
RMapCacheAsyncStores 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)
RMapCacheAsyncStores 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()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncpublic RFuture<Void> setMaxSizeAsync(int maxSize)
RMapCacheAsyncsetMaxSizeAsync in interface RMapCacheAsync<K,V>setMaxSizeAsync in class RedissonMapCache<K,V>maxSize - - max sizepublic RFuture<Boolean> trySetMaxSizeAsync(int maxSize)
RMapCacheAsynctrySetMaxSizeAsync 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()
RMapRMapReduce 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)
containsKeyAsync in interface RMapAsync<K,V>containsKeyAsync in class RedissonMapCache<K,V>public RFuture<Boolean> containsValueAsync(Object value)
containsValueAsync in interface RMapAsync<K,V>containsValueAsync in class RedissonMapCache<K,V>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)
RMapAsyncvalueSizeAsync 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()
RMapAsyncreadAllKeySetAsync in interface RMapAsync<K,V>readAllKeySetAsync in class RedissonMapCache<K,V>public RFuture<Set<Map.Entry<K,V>>> readAllEntrySetAsync()
RMapAsyncreadAllEntrySetAsync in interface RMapAsync<K,V>readAllEntrySetAsync in class RedissonMapCache<K,V>public RFuture<Collection<V>> readAllValuesAsync()
RMapAsyncreadAllValuesAsync in interface RMapAsync<K,V>readAllValuesAsync in class RedissonMapCache<K,V>public RFuture<Map<K,V>> readAllMapAsync()
RMapAsyncreadAllMapAsync 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)
RMapAsyncMapLoader.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)
RMapAsyncMapLoader 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 getLock(K key)
RMapRLock instance associated with keypublic RReadWriteLock getReadWriteLock(K key)
RMapRReadWriteLock instance associated with keygetReadWriteLock in interface RMap<K,V>getReadWriteLock in class RedissonMap<K,V>key - - map keypublic boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirableCopyright © 2014–2018 The Redisson Project. All rights reserved.