Interface RMapCacheNative<K,V>
- Type Parameters:
K- keyV- value
- All Superinterfaces:
ConcurrentMap<K,,V> Map<K,,V> RDestroyable,RExpirable,RExpirableAsync,RMap<K,,V> RMapAsync<K,,V> RMapCacheNativeAsync<K,,V> RObject,RObjectAsync
- All Known Implementing Classes:
RedissonMapCacheNative
Requires Redis 7.4.0 and higher.
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionintaddListener(ObjectListener listener) Adds object event listenerclearExpire(Set<K> keys) Clears an expiration timeout or date of specified entries by keys.clearExpire(K key) Clears an expiration timeout or date of specified entry by key.intexpireEntries(Set<K> keys, Duration ttl) Updates time to live of specified entries by keys.intexpireEntriesIfGreater(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's greater than timeout set before.intexpireEntriesIfLess(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's less than timeout set before.intexpireEntriesIfNotSet(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys.booleanexpireEntry(K key, Duration ttl) Updates time to live of specified entry by key.booleanexpireEntryIfGreater(K key, Duration ttl) Sets time to live of specified entry by key only if it's greater than timeout set before.booleanexpireEntryIfLess(K key, Duration ttl) Sets time to live of specified entry by key only if it's less than timeout set before.booleanexpireEntryIfNotSet(K key, Duration ttl) Sets time to live of specified entry by key.booleanStores value mapped by key with specified time to live.booleanfastPutIfAbsent(K key, V value, Duration ttl) 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.voidAssociates the specifiedvaluewith the specifiedkeyin batch.putIfAbsent(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.remainTimeToLive(Set<K> keys) Remaining time to live of map entries associated withkeys.longremainTimeToLive(K key) Remaining time to live of map entry associated with akey.Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAllMethods inherited from interface org.redisson.api.RDestroyable
destroyMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods 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.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, valueSizeMethods 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.RMapCacheNativeAsync
addListenerAsync, clearExpireAsync, clearExpireAsync, expireEntriesAsync, expireEntriesIfGreaterAsync, expireEntriesIfLessAsync, expireEntriesIfNotSetAsync, expireEntryAsync, expireEntryIfGreaterAsync, expireEntryIfLessAsync, expireEntryIfNotSetAsync, fastPutAsync, fastPutIfAbsentAsync, putAllAsync, putAsync, putIfAbsentAsync, remainTimeToLiveAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
put
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
-
fastPut
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
put(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.
-
putIfAbsent
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
-
fastPutIfAbsent
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
putIfAbsent(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
-
remainTimeToLive
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.
-
remainTimeToLive
Remaining time to live of map entries associated withkeys.- Parameters:
keys- map keys- Returns:
- Time to live mapped by key. Time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
putAll
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.
-
clearExpire
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
-
clearExpire
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
-
expireEntry
Updates time to live 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
ttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntryIfNotSet
Sets time to live 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
ttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.
-
expireEntryIfGreater
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.
-
expireEntryIfLess
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.
-
expireEntries
Updates time to live 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.
-
expireEntriesIfGreater
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.
-
expireEntriesIfLess
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.
-
expireEntriesIfNotSet
Sets time to live 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.
-
addListener
Adds object event listener- Specified by:
addListenerin interfaceRMap<K,V> - Specified by:
addListenerin interfaceRObject- Parameters:
listener- object event listener- Returns:
- listener id
- See Also:
-