Interface RMapCacheNativeRx<K,V>
- Type Parameters:
K
- keyV
- value
- All Superinterfaces:
RDestroyable
,RExpirableRx
,RMapRx<K,
,V> RObjectRx
Requires Redis 7.4.0 and higher.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single
<Integer> addListener
(ObjectListener listener) Adds object event listenerclearExpire
(Set<K> keys) Clears an expiration timeout or date of specified entries by keys.io.reactivex.rxjava3.core.Maybe
<Boolean> clearExpire
(K key) Clears an expiration timeout or date of specified entry by key.io.reactivex.rxjava3.core.Single
<Integer> expireEntries
(Set<K> keys, Duration ttl) Updates time to live of specified entries by keys.io.reactivex.rxjava3.core.Single
<Integer> expireEntriesIfGreater
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's greater than timeout set before.io.reactivex.rxjava3.core.Single
<Integer> expireEntriesIfLess
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's less than timeout set before.io.reactivex.rxjava3.core.Single
<Integer> expireEntriesIfNotSet
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys.io.reactivex.rxjava3.core.Single
<Boolean> expireEntry
(K key, Duration ttl) Updates time to live of specified entry by key.io.reactivex.rxjava3.core.Single
<Boolean> expireEntryIfGreater
(K key, Duration ttl) Sets time to live of specified entry by key only if it's greater than timeout set before.io.reactivex.rxjava3.core.Single
<Boolean> expireEntryIfLess
(K key, Duration ttl) Sets time to live of specified entry by key only if it's less than timeout set before.io.reactivex.rxjava3.core.Single
<Boolean> expireEntryIfNotSet
(K key, Duration ttl) Sets time to live of specified entry by key.io.reactivex.rxjava3.core.Single
<Boolean> Stores value mapped by key with specified time to live.io.reactivex.rxjava3.core.Single
<Boolean> fastPutIfAbsent
(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.io.reactivex.rxjava3.core.Maybe
<V> Stores value mapped by key with specified time to live.io.reactivex.rxjava3.core.Completable
Associates the specifiedvalue
with the specifiedkey
in batch.io.reactivex.rxjava3.core.Maybe
<V> 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
.io.reactivex.rxjava3.core.Single
<Long> remainTimeToLive
(K key) Remaining time to live of map entry associated with akey
.Methods inherited from interface org.redisson.api.RDestroyable
destroy
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RMapRx
addAndGet, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entryIterator, entryIterator, entryIterator, entryIterator, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, get, getAll, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, keyIterator, keyIterator, keyIterator, keyIterator, loadAll, loadAll, merge, put, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, size, valueIterator, valueIterator, valueIterator, valueIterator, valueSize
Methods inherited from interface org.redisson.api.RObjectRx
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
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. If0
then 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. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if 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. If0
then 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. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if 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 specifiedvalue
with the specifiedkey
in batch.If
MapWriter
is 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. If0
then stores infinitely.
-
clearExpire
Clears an expiration timeout or date of specified entry by key.- Parameters:
key
- map key- Returns:
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if 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.
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if entry does not exist
-
expireEntry
Updates time to live of specified entry by key. Entry expires when specified time to live was reached.Returns
false
if entry already expired or doesn't exist, otherwise returnstrue
.- Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if 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
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if 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
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if 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
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if 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. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then 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. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then 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. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then 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. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
addListener
Adds object event listener- Specified by:
addListener
in interfaceRMapRx<K,
V> - Specified by:
addListener
in interfaceRObjectRx
- Parameters:
listener
- object event listener- Returns:
- listener id
- See Also:
-