Interface RMapCacheNativeAsync<K,V>
- Type Parameters:
K- keyV- value
- All Superinterfaces:
RExpirableAsync,RMapAsync<K,,V> RObjectAsync
- All Known Subinterfaces:
RMapCacheNative<K,V>
- All Known Implementing Classes:
RedissonMapCacheNative
Requires Redis 7.4.0 and higher.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync(ObjectListener listener) Adds object event listenerclearExpireAsync(Set<K> keys) Clears an expiration timeout or date of specified entries by keys.clearExpireAsync(K key) Clears an expiration timeout or date of specified entry by key.expireEntriesAsync(Set<K> keys, Duration ttl) Updates time to live and max idle time of specified entries by keys.expireEntriesIfGreaterAsync(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's greater than timeout set before.expireEntriesIfLessAsync(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's less than timeout set before.expireEntriesIfNotSetAsync(Set<K> keys, Duration ttl) Sets time to live and max idle time of specified entries by keys.expireEntryAsync(K key, Duration ttl) Updates time to live and max idle time of specified entry by key.expireEntryIfGreaterAsync(K key, Duration ttl) Sets time to live of specified entry by key only if it's greater than timeout set before.expireEntryIfLessAsync(K key, Duration ttl) Sets time to live of specified entry by key only if it's less than timeout set before.expireEntryIfNotSetAsync(K key, Duration ttl) Sets time to live and max idle time of specified entry by key.fastPutAsync(K key, V value, Duration ttl) Stores value mapped by key with specified time to live.fastPutIfAbsentAsync(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.putAllAsync(Map<? extends K, ? extends V> map, Duration ttl) Associates the specifiedvaluewith the specifiedkeyin batch.Stores value mapped by key with specified time to live.putIfAbsentAsync(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.remainTimeToLiveAsync(Set<K> keys) remainTimeToLiveAsync(K key) Remaining time to live of map entry associated with akey.Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, clearAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, containsKeyAsync, containsValueAsync, fastPutAsync, fastPutIfAbsentAsync, fastPutIfExistsAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, loadAllAsync, loadAllAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, putIfExistsAsync, randomEntriesAsync, randomKeysAsync, readAllEntrySetAsync, readAllKeySetAsync, readAllMapAsync, readAllValuesAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, sizeAsync, valueSizeAsyncMethods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
putAsync
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.- Returns:
- previous associated value
-
fastPutAsync
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
putAsync(Object, Object, Duration)as it not returns previous value.- Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash and the value was updated.
-
putIfAbsentAsync
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. Entry expires after specified time to live.
- Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.- Returns:
- current associated value
-
fastPutIfAbsentAsync
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. Entry expires after specified time to live.
Works faster than usual
putIfAbsentAsync(Object, Object, Duration)as it not returns previous value.- Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash
-
remainTimeToLiveAsync
Remaining time to live of map entry associated with akey.- Parameters:
key- - map key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
-
putAllAsync
Associates the specifiedvaluewith the specifiedkeyin batch.If
MapWriteris defined then new map entries will be stored in write-through mode.- Parameters:
map- - mappings to be stored in this mapttl- - time to live for all key\value entries. If0then stores infinitely.
-
clearExpireAsync
Clears an expiration timeout or date of specified entry by key.- Parameters:
key- map key- Returns:
trueif timeout was removedfalseif entry does not have an associated timeoutnullif entry does not exist
-
clearExpireAsync
Clears an expiration timeout or date of specified entries by keys.- Parameters:
keys- map keys- Returns:
- Boolean mapped by key.
trueif timeout was removedfalseif entry does not have an associated timeoutnullif entry does not exist
-
expireEntryAsync
Updates time to live and max idle time of specified entry by key. Entry expires when specified time to live was reached.Returns
falseif entry already expired or doesn't exist, otherwise returnstrue.- Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntryIfNotSetAsync
Sets time to live and max idle time of specified entry by key. If these parameters weren't set before. Entry expires when specified time to live was reached.Returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.- Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.
-
expireEntryIfGreaterAsync
Sets time to live of specified entry by key only if it's greater than timeout set before. Entry expires when specified time to live was reached.Returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.- Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.
-
expireEntryIfLessAsync
Sets time to live of specified entry by key only if it's less than timeout set before. Entry expires when specified time to live was reached.Returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.- Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.
-
expireEntriesAsync
Updates time to live and max idle time of specified entries by keys. Entries expires when specified time to live was reached.Returns amount of updated entries.
- Parameters:
keys- map keysttl- time to live for key\value entries. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entries are stored infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfNotSetAsync
Sets time to live and max idle time of specified entries by keys. If these parameters weren't set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Parameters:
keys- map keysttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfGreaterAsync
Sets time to live of specified entries by keys only if it's greater than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Parameters:
keys- map keysttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfLessAsync
Sets time to live of specified entries by keys only if it's less than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Parameters:
keys- map keysttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.if
ttlparams are equal to0then entry stores infinitely.- Returns:
- amount of updated entries.
-
addListenerAsync
Adds object event listener- Specified by:
addListenerAsyncin interfaceRMapAsync<K,V> - Specified by:
addListenerAsyncin interfaceRObjectAsync- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-