Class MapCacheNativeWrapper<K,V>
- All Implemented Interfaces:
ConcurrentMap<K,,V> Supplier<RMap<K,,V>> Map<K,,V> RDestroyable,RExpirable,RExpirableAsync,RMap<K,,V> RMapAsync<K,,V> RMapCache<K,,V> RMapCacheAsync<K,,V> RObject,RObjectAsync
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the givendeltato the current value by mappedkey.addAndGetAsync(K key, Number delta) Adds the givendeltato the current value by mappedkey.intaddListener(MapEntryListener listener) Adds map entry listenerintaddListener(ObjectListener listener) Adds object event listeneraddListenerAsync(MapEntryListener listener) Adds map entry listeneraddListenerAsync(ObjectListener listener) Adds object event listenervoidclear()Clears map without removing options data used during map creation.booleanClear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.Computes a new mapping for the specified key and its current mapped value.computeAsync(K key, Duration ttl, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Computes a new mapping for the specified key and its current mapped value.computeAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Computes a new mapping for the specified key and its current mapped value.If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .computeIfAbsentAsync(K key, Function<? super K, ? extends V> mappingFunction) Computes a mapping for the specified key if it's not mapped before.computeIfPresentAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Computes a mapping for the specified key only if it's already mapped.booleancontainsKey(Object key) Returnstrueif this map contains map entry mapped by specifiedkey, otherwisefalsecontainsKeyAsync(Object key) Returnstrueif this map contains map entry mapped by specifiedkey, otherwisefalsebooleancontainsValue(Object value) Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalsecontainsValueAsync(Object value) Returnstrueif this map contains any map entry with specifiedvalue, otherwisefalsebooleanCopy this object instance to the new instance with a defined name.booleanCopy this object instance to the new instance with a defined name and database.voidCopy object from source Redis instance to destination Redis instancebooleancopyAndReplace(String destination) Copy this object instance to the new instance with a defined name, and replace it if it already exists.booleancopyAndReplace(String destination, int database) Copy this object instance to the new instance with a defined name and database, and replace it if it already exists.copyAndReplaceAsync(String destination) Copy this object instance to the new instance with a defined name, and replace it if it already exists.copyAndReplaceAsync(String destination, int database) Copy this object instance to the new instance with a defined name and database, and replace it if it already exists.Copy this object instance to the new instance with a defined name.Copy this object instance to the new instance with a defined name and database.Copy object from source Redis instance to destination Redis instance in async modebooleandelete()Deletes the objectDelete object in async modevoiddestroy()Destroys object when it's not necessary anymore.byte[]dump()Returns dump of objectRFuture<byte[]> Returns dump of objectentrySet()Returns map entries collection.entrySet(int count) Returns map entries collection.Returns map entries collection.Returns map entries collection.Returns map entries using iterable.entrySetAsync(int count) Returns map entries using iterable.entrySetAsync(String keyPattern) Returns map entries using iterable.entrySetAsync(String keyPattern, int count) Returns map entries using iterable.booleanUseRExpirable.expire(Duration)insteadbooleanSets a timeout for this object.booleanSets an expiration date for this object.expireAsync(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)insteadexpireAsync(Duration duration) Set a timeout for object.expireAsync(Instant time) Set an expire date for object.booleanexpireAt(long timestamp) UseRExpirable.expire(Instant)insteadbooleanUseRExpirable.expire(Instant)insteadexpireAtAsync(long timestamp) UseRExpirableAsync.expireAsync(Instant)insteadexpireAtAsync(Date timestamp) UseRExpirableAsync.expireAsync(Instant)insteadintexpireEntries(Set<K> keys, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entries by keys.expireEntriesAsync(Set<K> keys, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entries by keys.intexpireEntriesIfNotSet(Set<K> keys, Duration ttl, Duration maxIdleTime) Sets time to live and max idle time of specified entries by keys.booleanexpireEntry(K key, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entry by key.expireEntryAsync(K key, Duration ttl, Duration maxIdleTime) Updates time to live and max idle time of specified entry by key.booleanexpireEntryIfNotSet(K key, Duration ttl, Duration maxIdleTime) Sets time to live and max idle time of specified entry by key.booleanexpireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.booleanexpireIfGreater(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.booleanexpireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.booleanexpireIfLess(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.booleanexpireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.booleanexpireIfNotSet(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync(Instant time) Sets an expiration date for this object only if it hasn't been set before.booleanexpireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.booleanexpireIfSet(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync(Instant time) Sets an expiration date for this object only if it has been already set.booleanStores the specifiedvaluemapped by specifiedkey.booleanStores value mapped by key with specified time to live.booleanStores value mapped by key with specified time to live and max idle time.fastPutAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkey.fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit) Stores value mapped by key with specified time to live.fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Stores value mapped by key with specified time to live and max idle time.booleanfastPutIfAbsent(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.booleanfastPutIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.booleanfastPutIfAbsent(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.fastPutIfAbsentAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.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.booleanfastPutIfExists(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.fastPutIfExistsAsync(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.longfastRemove(K... keys) Removes map entries mapped by specifiedkeys.fastRemoveAsync(K... keys) Removes map entries mapped by specifiedkeys.booleanfastReplace(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.fastReplaceAsync(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.get()Returns the value mapped by definedkeyornullif value is absent.intReturns the logarithmic access frequency counter over this object.Returns the logarithmic access frequency counter over this object.Returns map slice contained the mappings with definedkeys.getAllAsync(Set<K> keys) Returns map slice contained the mappings with definedkeys.getAllWithTTLOnly(Set<K> keys) Returns map slice contained the mappings with definedkeys.getAllWithTTLOnlyAsync(Set<K> keys) Returns map slice contained the mappings with definedkeys.Returns the value mapped by definedkeyornullif value is absent.getCodec()Returns the underlying Codec used by this RObjectgetCountDownLatch(K key) ReturnsRCountDownLatchinstance associated with keylongReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.getFairLock(K key) ReturnsRLockinstance associated with keyReturns number of seconds spent since last write or read operation over this object.Returns number of seconds spent since last write or read operation over this object.Returns the internal encoding for the Redis objectReturns the internal encoding for the Redis objectReturnsRLockinstance associated with keygetName()Returns name of objectReturnsRPermitExpirableSemaphoreinstance associated with keygetReadWriteLock(K key) ReturnsRReadWriteLockinstance associated with keyintReturns count of references over this object.Returns count of references over this object.getSemaphore(K key) ReturnsRSemaphoreinstance associated with keygetWithTTLOnly(K key) Returns the value mapped by definedkeyornullif value is absent.getWithTTLOnlyAsync(K key) Returns the value mapped by definedkeyornullif value is absent.booleanisEmpty()booleanisExists()Check object existenceCheck object existence in async mode.keySet()Returns key set of this map.keySet(int count) Returns key set of this map.Returns key set of this map.Returns key set of this map.voidloadAll(boolean replaceExistingValues, int parallelism) Loads all map entries to this Redis map usingMapLoader.voidLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.loadAllAsync(boolean replaceExistingValues, int parallelism) Loads all map entries to this Redis map usingMapLoader.loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism) Loads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.<KOut,VOut>
RMapReduce<K, V, KOut, VOut> ReturnsRMapReduceobject associated with this mapmergeAsync(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Associates specified key with the given value if key isn't already associated with a value.voidCopy object from source Redis instance to destination Redis instancemigrateAsync(String host, int port, int database, long timeout) Transfer object from source Redis instance to destination Redis instance in async modebooleanmove(int database) Move object to another databasemoveAsync(int database) Move object to another database in async modeStores the specifiedvaluemapped by specifiedkey.Stores value mapped by key with specified time to live.Stores value mapped by key with specified time to live and max idle time.voidStores map entries specified inmapobject in batch mode.voidStores map entries specified inmapobject in batch mode.voidAssociates the specifiedvaluewith the specifiedkeyin batch.putAllAsync(Map<? extends K, ? extends V> map) Stores map entries specified inmapobject in batch mode.putAllAsync(Map<? extends K, ? extends V> map, int batchSize) Stores map entries specified inmapobject in batch mode.putAllAsync(Map<? extends K, ? extends V> map, long ttl, TimeUnit ttlUnit) Associates the specifiedvaluewith the specifiedkeyin batch.Stores the specifiedvaluemapped by specifiedkey.Stores value mapped by key with specified time to live.Stores value mapped by key with specified time to live and max idle time.putIfAbsent(K key, V value) Stores the specifiedvaluemapped bykeyonly if there is no value with specifiedkeystored before.putIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.putIfAbsent(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.putIfAbsentAsync(K key, V value) Stores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit) If the specified key is not already associated with a value, associate it with the given value.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.putIfExists(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.putIfExistsAsync(K key, V value) Stores the specifiedvaluemapped bykeyonly if mapping already exists.randomEntries(int count) Returns random map entries from this map limited bycountrandomEntriesAsync(int count) Returns random map entries from this map limited bycountrandomKeys(int count) Returns random keys from this map limited bycountrandomKeysAsync(int count) Returns random keys from this map limited bycountRead all map entries at onceRead all map entries at oncereadAllEntrySetAsync(String keyPattern) Read all entries mapped by matched keys of this pattern at onceRead all keys at onceRead all keys at oncereadAllKeySetAsync(String keyPattern) Read all keys mapped by matched keys of this pattern at onceRead all map as local instance at onceRead all map as local instance at onceRead all values at onceRead all values at oncereadAllValuesAsync(String keyPattern) Read all values mapped by matched keys of this pattern at oncelongReturns remaining time of the object in milliseconds.longremainTimeToLive(K key) Remaining time to live of map entry associated with akey.Returns remaining time of the object in milliseconds.remainTimeToLiveAsync(K key) Remaining time to live of map entry associated with akey.Removes map entry by specifiedkeyand returns value.booleanRemoves map entry only if it exists with specifiedkeyandvalue.removeAsync(Object key) Removes map entry by specifiedkeyand returns value.removeAsync(Object key, Object value) Removes map entry only if it exists with specifiedkeyandvalue.voidremoveListener(int listenerId) Removes map entry listenerremoveListenerAsync(int listenerId) Removes object event listenervoidRename current object key tonewNamerenameAsync(String newName) Rename current object key tonewNamein async modebooleanRename current object key tonewNameonly if new key doesn't exist.renamenxAsync(String newName) Rename current object key tonewNamein async mode only if new key is not existsReplaces previous value with a newvaluemapped by specifiedkey.booleanReplaces previousoldValuewith anewValuemapped by specifiedkey.replaceAsync(K key, V value) Replaces previous value with a newvaluemapped by specifiedkey.replaceAsync(K key, V oldValue, V newValue) Replaces previousoldValuewith anewValuemapped by specifiedkey.voidrestore(byte[] state) Restores object using its state returned byRObject.dump()method.voidRestores object using its state returned byRObject.dump()method and set time to live for it.voidrestoreAndReplace(byte[] state) Restores and replaces object if it already exists.voidrestoreAndReplace(byte[] state, long timeToLive, TimeUnit timeUnit) Restores and replaces object if it already exists and set time to live for it.restoreAndReplaceAsync(byte[] state) Restores and replaces object if it already exists.restoreAndReplaceAsync(byte[] state, long timeToLive, TimeUnit timeUnit) Restores and replaces object if it already exists and set time to live for it.restoreAsync(byte[] state) Restores object using its state returned byRObjectAsync.dumpAsync()method.restoreAsync(byte[] state, long timeToLive, TimeUnit timeUnit) Restores object using its state returned byRObjectAsync.dumpAsync()method and set time to live for it.voidsetMaxSize(int maxSize) Sets max size of the map and overrides current value.voidsetMaxSize(int maxSize, EvictionMode mode) Sets max size of the map and overrides current value.setMaxSizeAsync(int maxSize) Sets max size of the map and overrides current value.setMaxSizeAsync(int maxSize, EvictionMode mode) Sets max size of the map and overrides current value.intsize()Returns the number of entries in cache.Returns size of this maplongReturns bytes amount used by object in Redis memory.Returns bytes amount used by object in Redis memory.booleantouch()Update the last access time of an object.Update the last access time of an object in async mode.booleantrySetMaxSize(int maxSize) Tries to set max size of the map.booleantrySetMaxSize(int maxSize, EvictionMode mode) Tries to set max size of the map.trySetMaxSizeAsync(int maxSize) Tries to set max size of the map.trySetMaxSizeAsync(int maxSize, EvictionMode mode) Tries to set max size of the map.booleanunlink()Delete the objects.Delete the objects.booleanupdateEntryExpiration(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) UseRMapCache.expireEntry(Object, Duration, Duration)instead.updateEntryExpirationAsync(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) values()Returns values collection of this map.values(int count) Returns values collection of this map.Returns values collection of this map.Returns values collection of this map.Returns values of this map using iterable.valuesAsync(int count) Returns values of this map using iterable.valuesAsync(String keyPattern) Returns values of this map using iterable.valuesAsync(String keyPattern, int count) Returns values of this map using iterable.intReturns size of value mapped by specifiedkeyin bytesvalueSizeAsync(K key) Returns size of value mapped by key in bytesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
Constructor Details
-
MapCacheNativeWrapper
-
-
Method Details
-
get
-
setMaxSize
public void setMaxSize(int maxSize) Description copied from interface:RMapCacheSets max size of the map and overrides current value. Superfluous elements are evicted using LRU algorithm.- Specified by:
setMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max size If0the cache is unbounded (default).
-
setMaxSize
Description copied from interface:RMapCacheSets max size of the map and overrides current value. Superfluous elements are evicted using defined algorithm.- Specified by:
setMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode
-
trySetMaxSize
public boolean trySetMaxSize(int maxSize) Description copied from interface:RMapCacheTries to set max size of the map. Superfluous elements are evicted using LRU algorithm.- Specified by:
trySetMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max size- Returns:
trueif max size has been successfully set, otherwisefalse. If0the cache is unbounded (default).
-
trySetMaxSize
Description copied from interface:RMapCacheTries to set max size of the map. Superfluous elements are evicted using defined algorithm.- Specified by:
trySetMaxSizein interfaceRMapCache<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
trueif max size has been successfully set, otherwisefalse.
-
computeIfAbsent
Description copied from interface:RMapCacheIf the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
computeIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then stores infinitely.mappingFunction- the mapping function to compute a value- Returns:
- current associated value
-
compute
public V compute(K key, Duration ttl, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapCacheComputes a new mapping for the specified key and its current mapped value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
-
getWithTTLOnly
Description copied from interface:RMapCacheReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getWithTTLOnlyin interfaceRMapCache<K,V> - Parameters:
key- the key- Returns:
- the value mapped by defined
keyornullif value is absent
-
getAllWithTTLOnly
Description copied from interface:RMapCacheReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getAllWithTTLOnlyin interfaceRMapCache<K,V> - Parameters:
keys- map keys- Returns:
- Map slice
-
fastPut
public boolean fastPut(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheStores 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.
Works faster than usual
RMapCache.put(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry 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
public V putIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheIf 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 and max idle time. Entry expires when specified time to live or max idle time has expired.
- Specified by:
putIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- current associated value
-
containsKey
Description copied from interface:RMapReturnstrueif this map contains map entry mapped by specifiedkey, otherwisefalse- Specified by:
containsKeyin interfaceMap<K,V> - Specified by:
containsKeyin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
trueif this map contains map entry mapped by specifiedkey, otherwisefalse
-
clear
public void clear() -
fastRemove
Description copied from interface:RMapRemoves map entries mapped by specifiedkeys.Works faster than
but not returning the value.RMap.remove(Object)If
MapWriteris defined thenkeysare deleted in write-through mode.- Specified by:
fastRemovein interfaceRMap<K,V> - Parameters:
keys- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
destroy
public void destroy()Description copied from interface:RDestroyableDestroys object when it's not necessary anymore.- Specified by:
destroyin interfaceRDestroyable
-
put
Description copied from interface:RMapCacheStores 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.
-
put
Description copied from interface:RMapCacheStores 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.
- Specified by:
putin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
fastPut
Description copied from interface:RMapCacheStores 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
RMapCache.put(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- 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
Description copied from interface:RMapCacheIf 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.
- Specified by:
putIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- current associated value
-
fastPutIfAbsent
Description copied from interface:RMapCacheIf 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
RMapCache.putIfAbsent(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash
-
fastPutIfAbsent
public boolean fastPutIfAbsent(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheIf 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 and max idle time. Entry expires when specified time to live or max idle time has expired.
Works faster than usual
RMapCache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutIfAbsentin interfaceRMapCache<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash.
-
putAll
Description copied from interface:RMapCacheAssociates the specifiedvaluewith the specifiedkeyin batch.If
MapWriteris defined then new map entries will be stored in write-through mode. -
updateEntryExpiration
public boolean updateEntryExpiration(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheUseRMapCache.expireEntry(Object, Duration, Duration)instead.- Specified by:
updateEntryExpirationin interfaceRMapCache<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntry
Description copied from interface:RMapCacheUpdates time to live and max idle time of specified entry by key. Entry expires when specified time to live or max idle time was reached.Returns
falseif entry already expired or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryin interfaceRMapCache<K,V> - Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time 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.
-
expireEntries
Description copied from interface:RMapCacheUpdates time to live and max idle time of specified entries by keys. Entries expires when specified time to live or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesin interfaceRMapCache<K,V> - Parameters:
keys- map keysttl- time to live for key\value entries. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entries. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entries are stored infinitely.- Returns:
- amount of updated entries.
-
expireEntryIfNotSet
Description copied from interface:RMapCacheSets 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 or max idle time was reached.Returns
falseif entry already has expiration time or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryIfNotSetin interfaceRMapCache<K,V> - Parameters:
key- map keyttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time 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.
-
expireEntriesIfNotSet
Description copied from interface:RMapCacheSets 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 or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfNotSetin interfaceRMapCache<K,V> - Parameters:
keys- map keysttl- time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- amount of updated entries.
-
addListener
Description copied from interface:RMapAdds object event listener- Specified by:
addListenerin interfaceRMap<K,V> - Specified by:
addListenerin interfaceRObject- Parameters:
listener- object event listener- Returns:
- listener id
- See Also:
-
putAsync
Description copied from interface:RMapCacheAsyncStores 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.- Specified by:
putAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- previous associated value
-
putAsync
public RFuture<V> putAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface: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.
- Specified by:
putAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
fastPutAsync
Description copied from interface:RMapCacheAsyncStores 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
RMapCacheAsync.putAsync(Object, Object, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- 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.
-
fastPutAsync
public RFuture<Boolean> fastPutAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface: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.
Works faster than usual
RMapCacheAsync.putAsync(Object, Object, long, TimeUnit, long, TimeUnit)as it not returns previous value.- Specified by:
fastPutAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry 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.
-
setMaxSizeAsync
Description copied from interface:RMapCacheAsyncSets max size of the map and overrides current value. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
setMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max size- Returns:
- void
-
setMaxSizeAsync
Description copied from interface:RMapCacheAsyncSets max size of the map and overrides current value. Superfluous elements are evicted using defined algorithm.- Specified by:
setMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
- void
-
trySetMaxSizeAsync
Description copied from interface:RMapCacheAsyncTries to set max size of the map. Superfluous elements are evicted using LRU algorithm by default.- Specified by:
trySetMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max size- Returns:
trueif max size has been successfully set, otherwisefalse.
-
trySetMaxSizeAsync
Description copied from interface:RMapCacheAsyncTries to set max size of the map. Superfluous elements are evicted using defined algorithm.- Specified by:
trySetMaxSizeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
maxSize- - max sizemode- - eviction mode- Returns:
trueif max size has been successfully set, otherwisefalse.
-
putIfAbsentAsync
Description copied from interface:RMapCacheAsyncIf 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. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then stores infinitely.ttlUnit- - time unit- Returns:
- previous associated value
-
putIfAbsentAsync
public RFuture<V> putIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncIf 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 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.
- Specified by:
putIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- previous associated value
-
fastPutIfAbsentAsync
public RFuture<Boolean> fastPutIfAbsentAsync(K key, V value, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsyncIf 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 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.- Specified by:
fastPutIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyvalue- - map valuettl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
trueif key is a new key in the hash and value was set.falseif key already exists in the hash
-
computeIfAbsentAsync
public RFuture<V> computeIfAbsentAsync(K key, Duration ttl, Function<? super K, ? extends V> mappingFunction) Description copied from interface:RMapCacheAsyncIf the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map .Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
computeIfAbsentAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then stores infinitely.mappingFunction- the mapping function to compute a value- Returns:
- current associated value
-
computeAsync
public RFuture<V> computeAsync(K key, Duration ttl, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapCacheAsyncComputes a new mapping for the specified key and its current mapped value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
computeAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then stores infinitely.remappingFunction- - function to compute a value- Returns:
- the new value associated with the specified key, or
nullif none
-
updateEntryExpirationAsync
public RFuture<Boolean> updateEntryExpirationAsync(K key, long ttl, TimeUnit ttlUnit, long maxIdleTime, TimeUnit maxIdleUnit) Description copied from interface:RMapCacheAsync- Specified by:
updateEntryExpirationAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.ttlUnit- - time unitmaxIdleTime- - max idle time for key\value entry. If0then max idle time doesn't affect entry expiration.maxIdleUnit- - time unitif
maxIdleTimeandttlparams are equal to0then entry stores infinitely.- Returns:
- returns
falseif entry already expired or doesn't exist, otherwise returnstrue.
-
expireEntryAsync
Description copied from interface:RMapCacheAsyncUpdates time to live and max idle time of specified entry by key. Entry expires when specified time to live or max idle time was reached.Returns
falseif entry already expired or doesn't exist, otherwise returnstrue.- Specified by:
expireEntryAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- - map keyttl- - time to live for key\value entry. If0then time to live doesn't affect entry expiration.maxIdleTime- - max idle time for key\value entry. If0then max idle time 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.
-
expireEntriesAsync
Description copied from interface:RMapCacheAsyncUpdates time to live and max idle time of specified entries by keys. Entries expires when specified time to live or max idle time was reached.Returns amount of updated entries.
- Specified by:
expireEntriesAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
keys- map keysttl- time to live for key\value entries. If0then time to live doesn't affect entry expiration.maxIdleTime- max idle time for key\value entries. If0then max idle time doesn't affect entry expiration.if
maxIdleTimeandttlparams are equal to0then entries are stored infinitely.- Returns:
- amount of updated entries.
-
getWithTTLOnlyAsync
Description copied from interface:RMapCacheAsyncReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getWithTTLOnlyAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
key- the key- Returns:
- the value mapped by defined
keyornullif value is absent
-
getAllWithTTLOnlyAsync
Description copied from interface:RMapCacheAsyncReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.NOTE: Idle time of entry is not taken into account. Entry last access time isn't modified if map limited by size.
- Specified by:
getAllWithTTLOnlyAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
keys- map keys- Returns:
- Map slice
-
putAllAsync
Description copied from interface:RMapCacheAsyncAssociates the specifiedvaluewith the specifiedkeyin batch.If
MapWriteris defined then new map entries are stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
map- - mappings to be stored in this mapttl- - time to live for all key\value entries. If0then stores infinitely.ttlUnit- - time unit- Returns:
- void
-
loadAll
public void loadAll(boolean replaceExistingValues, int parallelism) Description copied from interface:RMapLoads all map entries to this Redis map usingMapLoader. -
loadAll
Description copied from interface:RMapLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter. -
get
Description copied from interface:RMapReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode. -
put
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkey. Returns previous value if map entry with specifiedkeyalready existed.If
MapWriteris defined then map entry is stored in write-through mode. -
remove
Description copied from interface:RMapRemoves map entry by specifiedkeyand returns value.If
MapWriteris defined thenkeyis deleted in write-through mode. -
putAll
Description copied from interface:RMapStores map entries specified inmapobject in batch mode.If
MapWriteris defined then map entries will be stored in write-through mode. -
putAll
Description copied from interface:RMapStores map entries specified inmapobject in batch mode. Batch inserted by chunks limited bybatchSizevalue to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriteris defined then map entries are stored in write-through mode. -
keySet
Description copied from interface:RMapReturns key set of this map. Keys are loaded in batch. Batch size is10. -
keySet
Description copied from interface:RMapReturns key set of this map. Keys are loaded in batch. Batch size is defined bycountparam. -
keySet
Description copied from interface:RMapReturns key set of this map. Ifpatternis not null then only keys match this pattern are loaded. Keys are loaded in batch. Batch size is defined bycountparam.Use
org.redisson.client.codec.StringCodecfor Map keys.Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillo
-
keySet
Description copied from interface:RMapReturns key set of this map. Ifpatternis not null then only keys match this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillo
-
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is10. -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is10. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is defined bycountparam. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
values
Description copied from interface:RMapReturns values collection of this map. Values are loaded in batch. Batch size is defined bycountparam. -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is10. -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is10. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is defined bycountparam. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo -
entrySet
Description copied from interface:RMapReturns map entries collection. Map entries are loaded in batch. Batch size is defined bycountparam. -
fastPut
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkey.Works faster than
but not returning previous value.RMap.put(Object, Object)Returns
trueif key is a new key in the hash and value was set orfalseif key already exists in the hash and the value was updated.If
MapWriteris defined then map entry is stored in write-through mode. -
fastReplace
Description copied from interface:RMapReplaces previous value with a newvaluemapped by specifiedkey.Works faster than
but not returning the previous value.RMap.replace(Object, Object)Returns
trueif key exists and value was updated orfalseif key doesn't exists and value wasn't updated.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastReplacein interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key exists and value was updated.falseif key doesn't exists and value wasn't updated.
-
putIfAbsent
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if there is no value with specifiedkeystored before.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V> - Specified by:
putIfAbsentin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
-
putIfExists
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if mapping already exists.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key doesn't exist in the hash and value hasn't been set. Previous value if key already exists in the hash and new value has been stored.
-
randomKeys
Description copied from interface:RMapReturns random keys from this map limited bycount- Specified by:
randomKeysin interfaceRMap<K,V> - Parameters:
count- - keys amount to return- Returns:
- random keys
-
randomEntries
Description copied from interface:RMapReturns random map entries from this map limited bycount- Specified by:
randomEntriesin interfaceRMap<K,V> - Parameters:
count- - entries amount to return- Returns:
- random entries
-
mapReduce
Description copied from interface:RMapReturnsRMapReduceobject associated with this map -
getCountDownLatch
Description copied from interface:RMapReturnsRCountDownLatchinstance associated with key- Specified by:
getCountDownLatchin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- countdownlatch
-
getPermitExpirableSemaphore
Description copied from interface:RMapReturnsRPermitExpirableSemaphoreinstance associated with key- Specified by:
getPermitExpirableSemaphorein interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- permitExpirableSemaphore
-
getSemaphore
Description copied from interface:RMapReturnsRSemaphoreinstance associated with key- Specified by:
getSemaphorein interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- semaphore
-
getFairLock
Description copied from interface:RMapReturnsRLockinstance associated with key- Specified by:
getFairLockin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- fairlock
-
getReadWriteLock
Description copied from interface:RMapReturnsRReadWriteLockinstance associated with key- Specified by:
getReadWriteLockin interfaceRMap<K,V> - Parameters:
key- - map key- Returns:
- readWriteLock
-
getLock
Description copied from interface:RMapReturnsRLockinstance associated with key -
valueSize
Description copied from interface:RMapReturns size of value mapped by specifiedkeyin bytes -
addAndGet
Description copied from interface:RMapAdds the givendeltato the current value by mappedkey.Works only with codecs below
-
fastPutIfAbsent
Description copied from interface:RMapStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but not returning the previous value associated withRMap.putIfAbsent(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key is a new one in the hash and value was set.falseif key already exists in the hash and change hasn't been made.
-
fastPutIfExists
Description copied from interface:RMapStores the specifiedvaluemapped bykeyonly if mapping already exists.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but doesn't return previous value associated withRMap.putIfExists(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsin interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key already exists in the hash and new value has been stored.falseif key doesn't exist in the hash and value hasn't been set.
-
readAllKeySet
Description copied from interface:RMapRead all keys at once- Specified by:
readAllKeySetin interfaceRMap<K,V> - Returns:
- keys
-
readAllValues
Description copied from interface:RMapRead all values at once- Specified by:
readAllValuesin interfaceRMap<K,V> - Returns:
- values
-
readAllEntrySet
Description copied from interface:RMapRead all map entries at once- Specified by:
readAllEntrySetin interfaceRMap<K,V> - Returns:
- entries
-
readAllMap
Description copied from interface:RMapRead all map as local instance at once- Specified by:
readAllMapin interfaceRMap<K,V> - Returns:
- map
-
remove
Description copied from interface:RMapRemoves map entry only if it exists with specifiedkeyandvalue.If
MapWriteris defined thenkeyis deleted in write-through mode. -
replace
Description copied from interface:RMapReplaces previousoldValuewith anewValuemapped by specifiedkey. Returnsfalseif previous value doesn't exist or equal tooldValue.If
MapWriteris defined thennewValueis written in write-through mode. -
replace
Description copied from interface:RMapReplaces previous value with a newvaluemapped by specifiedkey. Returnsnullif there is no map entry stored before and doesn't store new map entry.If
MapWriteris defined then newvalueis written in write-through mode.- Specified by:
replacein interfaceConcurrentMap<K,V> - Specified by:
replacein interfaceMap<K,V> - Specified by:
replacein interfaceRMap<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
- previous associated value
or
nullif there is no map entry stored before and doesn't store new map entry
-
getAsync
Description copied from interface:RMapAsyncReturns the value mapped by definedkeyornullif value is absent.If map doesn't contain value for specified key and
MapLoaderis defined then value will be loaded in read-through mode. -
putAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkey. Returns previous value if map entry with specifiedkeyalready existed.If
MapWriteris defined then map entry is stored in write-through mode. -
removeAsync
Description copied from interface:RMapAsyncRemoves map entry by specifiedkeyand returns value.If
MapWriteris defined thenkeyis deleted in write-through mode.- Specified by:
removeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
- deleted value,
nullif map entry doesn't exist
-
fastPutAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkey.Works faster than
but not returning previous value.RMapAsync.putAsync(Object, Object)Returns
trueif key is a new key in the hash and value was set orfalseif key already exists in the hash and the value was updated.If
MapWriteris defined then map entry is stored in write-through mode.- Specified by:
fastPutAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- 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.
-
fastReplaceAsync
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey.Works faster than
but not returning the previous value.RMapAsync.replaceAsync(Object, Object)Returns
trueif key exists and value was updated orfalseif key doesn't exists and value wasn't updated.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastReplaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key exists and value was updated.falseif key doesn't exists and value wasn't updated.
-
putIfAbsentAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
-
putIfExistsAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.If
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
putIfExistsAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
nullif key is doesn't exists in the hash and value hasn't been set. Previous value if key already exists in the hash and new value has been stored.
-
fastPutIfAbsentAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped by specifiedkeyonly if there is no value with specifiedkeystored before.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but not returning the previous value associated withRMapAsync.putIfAbsentAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key is a new one in the hash and value was set.falseif key already exists in the hash and change hasn't been made.
-
fastPutIfExistsAsync
Description copied from interface:RMapAsyncStores the specifiedvaluemapped bykeyonly if mapping already exists.Returns
trueif key is a new one in the hash and value was set orfalseif key already exists in the hash and change hasn't been made.Works faster than
but doesn't return previous value associated withRMapAsync.putIfExistsAsync(Object, Object)keyIf
MapWriteris defined then new map entry is stored in write-through mode.- Specified by:
fastPutIfExistsAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif key already exists in the hash and new value has been stored.falseif key doesn't exist in the hash and value hasn't been set.
-
readAllKeySetAsync
Description copied from interface:RMapAsyncRead all keys at once- Specified by:
readAllKeySetAsyncin interfaceRMapAsync<K,V> - Returns:
- keys
-
readAllValuesAsync
Description copied from interface:RMapAsyncRead all values at once- Specified by:
readAllValuesAsyncin interfaceRMapAsync<K,V> - Returns:
- values
-
readAllEntrySetAsync
Description copied from interface:RMapAsyncRead all map entries at once- Specified by:
readAllEntrySetAsyncin interfaceRMapAsync<K,V> - Returns:
- entries
-
readAllKeySetAsync
Description copied from interface:RMapAsyncRead all keys mapped by matched keys of this pattern at once- Specified by:
readAllKeySetAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- - key Pattern- Returns:
- keys
-
readAllValuesAsync
Description copied from interface:RMapAsyncRead all values mapped by matched keys of this pattern at once- Specified by:
readAllValuesAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- - key Pattern- Returns:
- values
-
readAllEntrySetAsync
Description copied from interface:RMapAsyncRead all entries mapped by matched keys of this pattern at once- Specified by:
readAllEntrySetAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- - key Pattern- Returns:
- entries
-
readAllMapAsync
Description copied from interface:RMapAsyncRead all map as local instance at once- Specified by:
readAllMapAsyncin interfaceRMapAsync<K,V> - Returns:
- map
-
removeAsync
Description copied from interface:RMapAsyncRemoves map entry only if it exists with specifiedkeyandvalue.If
MapWriteris defined thenkeyis deleted in write-through mode.- Specified by:
removeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
trueif map entry has been removed otherwisefalse.
-
replaceAsync
Description copied from interface:RMapAsyncReplaces previousoldValuewith anewValuemapped by specifiedkey. Returnsfalseif previous value doesn't exist or equal tooldValue.If
MapWriteris defined thennewValueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyoldValue- - map old valuenewValue- - map new value- Returns:
trueif value has been replaced otherwisefalse.
-
replaceAsync
Description copied from interface:RMapAsyncReplaces previous value with a newvaluemapped by specifiedkey. Returnsnullif there is no map entry stored before and doesn't store new map entry.If
MapWriteris defined then newvalueis written in write-through mode.- Specified by:
replaceAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - map value- Returns:
- previous associated value
or
nullif there is no map entry stored before and doesn't store new map entry
-
expire
Description copied from interface:RExpirableUseRExpirable.expire(Duration)instead- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirableReturns remaining time of the object in milliseconds.- Specified by:
remainTimeToLivein interfaceRExpirable- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirableReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTimein interfaceRExpirable- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
expireAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Duration)instead- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
time- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpireAsync
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsyncReturns remaining time of the object in milliseconds.- Specified by:
remainTimeToLiveAsyncin interfaceRExpirableAsync- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTimeAsync
Description copied from interface:RExpirableAsyncReturns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsyncin interfaceRExpirableAsync- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
getName
Description copied from interface:RObjectReturns name of object -
rename
Description copied from interface:RObjectRename current object key tonewName -
renamenx
Description copied from interface:RObjectRename current object key tonewNameonly if new key doesn't exist. -
isExists
public boolean isExists()Description copied from interface:RObjectCheck object existence -
getCodec
Description copied from interface:RObjectReturns the underlying Codec used by this RObject -
getIdleTime
Description copied from interface:RObjectReturns number of seconds spent since last write or read operation over this object.- Specified by:
getIdleTimein interfaceRObject- Returns:
- number of seconds
-
getReferenceCount
public int getReferenceCount()Description copied from interface:RObjectReturns count of references over this object.- Specified by:
getReferenceCountin interfaceRObject- Returns:
- count of reference
-
getAccessFrequency
public int getAccessFrequency()Description copied from interface:RObjectReturns the logarithmic access frequency counter over this object.- Specified by:
getAccessFrequencyin interfaceRObject- Returns:
- frequency counter
-
getInternalEncoding
Description copied from interface:RObjectReturns the internal encoding for the Redis object- Specified by:
getInternalEncodingin interfaceRObject- Returns:
- internal encoding
-
sizeInMemory
public long sizeInMemory()Description copied from interface:RObjectReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryin interfaceRObject- Returns:
- size in bytes
-
restore
public void restore(byte[] state) Description copied from interface:RObjectRestores object using its state returned byRObject.dump()method. -
restore
Description copied from interface:RObjectRestores object using its state returned byRObject.dump()method and set time to live for it. -
restoreAndReplace
public void restoreAndReplace(byte[] state) Description copied from interface:RObjectRestores and replaces object if it already exists.- Specified by:
restoreAndReplacein interfaceRObject- Parameters:
state- - state of the object
-
restoreAndReplace
Description copied from interface:RObjectRestores and replaces object if it already exists and set time to live for it.- Specified by:
restoreAndReplacein interfaceRObject- Parameters:
state- - state of the objecttimeToLive- - time to live of the objecttimeUnit- - time unit
-
dump
public byte[] dump()Description copied from interface:RObjectReturns dump of object -
touch
public boolean touch()Description copied from interface:RObjectUpdate the last access time of an object. -
migrate
Description copied from interface:RObjectCopy object from source Redis instance to destination Redis instance -
copy
Description copied from interface:RObjectCopy object from source Redis instance to destination Redis instance -
copy
Description copied from interface:RObjectCopy this object instance to the new instance with a defined name. -
copy
Description copied from interface:RObjectCopy this object instance to the new instance with a defined name and database. -
copyAndReplace
Description copied from interface:RObjectCopy this object instance to the new instance with a defined name, and replace it if it already exists.- Specified by:
copyAndReplacein interfaceRObject- Parameters:
destination- name of the destination instance- Returns:
trueif this object instance was copied elsefalse
-
copyAndReplace
Description copied from interface:RObjectCopy this object instance to the new instance with a defined name and database, and replace it if it already exists.- Specified by:
copyAndReplacein interfaceRObject- Parameters:
destination- name of the destination instancedatabase- database number- Returns:
trueif this object instance was copied elsefalse
-
move
public boolean move(int database) Description copied from interface:RObjectMove object to another database -
delete
public boolean delete()Description copied from interface:RObjectDeletes the object -
unlink
public boolean unlink()Description copied from interface:RObjectDelete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
-
size
public int size()Description copied from interface:RMapCacheReturns the number of entries in cache. This number can reflects expired entries too due to non realtime cleanup process. -
addListener
Description copied from interface:RMapCacheAdds map entry listener- Specified by:
addListenerin interfaceRMapCache<K,V> - Parameters:
listener- - entry listener- Returns:
- listener id
- See Also:
-
isEmpty
public boolean isEmpty() -
containsValue
Description copied from interface:RMapReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValuein interfaceMap<K,V> - Specified by:
containsValuein interfaceRMap<K,V> - Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
getAll
Description copied from interface:RMapReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.The returned map is NOT backed by the original map.
-
renameAsync
Description copied from interface:RObjectAsyncRename current object key tonewNamein async mode- Specified by:
renameAsyncin interfaceRObjectAsync- Parameters:
newName- - new name of object- Returns:
- void
-
renamenxAsync
Description copied from interface:RObjectAsyncRename current object key tonewNamein async mode only if new key is not exists- Specified by:
renamenxAsyncin interfaceRObjectAsync- Parameters:
newName- - new name of object- Returns:
trueif object has been renamed successfully andfalseotherwise
-
isExistsAsync
Description copied from interface:RObjectAsyncCheck object existence in async mode.- Specified by:
isExistsAsyncin interfaceRObjectAsync- Returns:
trueif object exists andfalseotherwise
-
addListenerAsync
Description copied from interface:RObjectAsyncAdds object event listener- Specified by:
addListenerAsyncin interfaceRMapAsync<K,V> - Specified by:
addListenerAsyncin interfaceRObjectAsync- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
removeListenerAsync
Description copied from interface:RObjectAsyncRemoves object event listener- Specified by:
removeListenerAsyncin interfaceRObjectAsync- Parameters:
listenerId- - listener id
-
getIdleTimeAsync
Description copied from interface:RObjectAsyncReturns number of seconds spent since last write or read operation over this object.- Specified by:
getIdleTimeAsyncin interfaceRObjectAsync- Returns:
- number of seconds
-
getReferenceCountAsync
Description copied from interface:RObjectAsyncReturns count of references over this object.- Specified by:
getReferenceCountAsyncin interfaceRObjectAsync- Returns:
- count of reference
-
getAccessFrequencyAsync
Description copied from interface:RObjectAsyncReturns the logarithmic access frequency counter over this object.- Specified by:
getAccessFrequencyAsyncin interfaceRObjectAsync- Returns:
- frequency counter
-
getInternalEncodingAsync
Description copied from interface:RObjectAsyncReturns the internal encoding for the Redis object- Specified by:
getInternalEncodingAsyncin interfaceRObjectAsync- Returns:
- internal encoding
-
sizeInMemoryAsync
Description copied from interface:RObjectAsyncReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsyncin interfaceRObjectAsync- Returns:
- size in bytes
-
restoreAsync
Description copied from interface:RObjectAsyncRestores object using its state returned byRObjectAsync.dumpAsync()method.- Specified by:
restoreAsyncin interfaceRObjectAsync- Parameters:
state- - state of object- Returns:
- void
-
restoreAsync
Description copied from interface:RObjectAsyncRestores object using its state returned byRObjectAsync.dumpAsync()method and set time to live for it.- Specified by:
restoreAsyncin interfaceRObjectAsync- Parameters:
state- - state of objecttimeToLive- - time to live of the objecttimeUnit- - time unit- Returns:
- void
-
restoreAndReplaceAsync
Description copied from interface:RObjectAsyncRestores and replaces object if it already exists.- Specified by:
restoreAndReplaceAsyncin interfaceRObjectAsync- Parameters:
state- - state of the object- Returns:
- void
-
restoreAndReplaceAsync
Description copied from interface:RObjectAsyncRestores and replaces object if it already exists and set time to live for it.- Specified by:
restoreAndReplaceAsyncin interfaceRObjectAsync- Parameters:
state- - state of the objecttimeToLive- - time to live of the objecttimeUnit- - time unit- Returns:
- void
-
dumpAsync
Description copied from interface:RObjectAsyncReturns dump of object- Specified by:
dumpAsyncin interfaceRObjectAsync- Returns:
- dump
-
touchAsync
Description copied from interface:RObjectAsyncUpdate the last access time of an object in async mode.- Specified by:
touchAsyncin interfaceRObjectAsync- Returns:
trueif object was touched elsefalse
-
migrateAsync
Description copied from interface:RObjectAsyncTransfer object from source Redis instance to destination Redis instance in async mode- Specified by:
migrateAsyncin interfaceRObjectAsync- Parameters:
host- - destination hostport- - destination portdatabase- - destination databasetimeout- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
copyAsync
Description copied from interface:RObjectAsyncCopy object from source Redis instance to destination Redis instance in async mode- Specified by:
copyAsyncin interfaceRObjectAsync- Parameters:
host- - destination hostport- - destination portdatabase- - destination databasetimeout- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
copyAsync
Description copied from interface:RObjectAsyncCopy this object instance to the new instance with a defined name.- Specified by:
copyAsyncin interfaceRObjectAsync- Parameters:
destination- name of the destination instance- Returns:
trueif this object instance was copied elsefalse
-
copyAsync
Description copied from interface:RObjectAsyncCopy this object instance to the new instance with a defined name and database.- Specified by:
copyAsyncin interfaceRObjectAsync- Parameters:
destination- name of the destination instancedatabase- database number- Returns:
trueif this object instance was copied elsefalse
-
copyAndReplaceAsync
Description copied from interface:RObjectAsyncCopy this object instance to the new instance with a defined name, and replace it if it already exists.- Specified by:
copyAndReplaceAsyncin interfaceRObjectAsync- Parameters:
destination- name of the destination instance- Returns:
trueif this object instance was copied elsefalse
-
copyAndReplaceAsync
Description copied from interface:RObjectAsyncCopy this object instance to the new instance with a defined name and database, and replace it if it already exists.- Specified by:
copyAndReplaceAsyncin interfaceRObjectAsync- Parameters:
destination- name of the destination instancedatabase- database number- Returns:
trueif this object instance was copied elsefalse
-
moveAsync
Description copied from interface:RObjectAsyncMove object to another database in async mode- Specified by:
moveAsyncin interfaceRObjectAsync- Parameters:
database- - number of Redis database- Returns:
trueif key was movedfalseif not
-
deleteAsync
Description copied from interface:RObjectAsyncDelete object in async mode- Specified by:
deleteAsyncin interfaceRObjectAsync- Returns:
trueif object was deletedfalseif not
-
unlinkAsync
Description copied from interface:RObjectAsyncDelete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Specified by:
unlinkAsyncin interfaceRObjectAsync- Returns:
trueif it was exist and deleted elsefalse
-
sizeAsync
Description copied from interface:RMapAsyncReturns size of this map -
valuesAsync
Description copied from interface:RMapAsyncReturns values of this map using iterable. Values are loaded in batch. Batch size is10.- Specified by:
valuesAsyncin interfaceRMapAsync<K,V> - Returns:
- Asynchronous Iterable object
-
valuesAsync
Description copied from interface:RMapAsyncReturns values of this map using iterable. Values are loaded in batch. Batch size is10. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo- Specified by:
valuesAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- - key pattern- Returns:
- Asynchronous Iterable object
-
valuesAsync
Description copied from interface:RMapAsyncReturns values of this map using iterable. Values are loaded in batch. Batch size is10. IfkeyPatternis not null then only values mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo- Specified by:
valuesAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- - key patterncount- - size of values batch- Returns:
- Asynchronous Iterable object
-
valuesAsync
Description copied from interface:RMapAsyncReturns values of this map using iterable. Values are loaded in batch. Batch size is defined bycountparam.- Specified by:
valuesAsyncin interfaceRMapAsync<K,V> - Parameters:
count- - size of values batch- Returns:
- Asynchronous Iterable object
-
entrySetAsync
Description copied from interface:RMapAsyncReturns map entries using iterable. Map entries are loaded in batch. Batch size is10.- Specified by:
entrySetAsyncin interfaceRMapAsync<K,V> - Returns:
- Asynchronous Iterable object
-
entrySetAsync
Description copied from interface:RMapAsyncReturns map entries using iterable. Map entries are loaded in batch. Batch size is10. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo- Specified by:
entrySetAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- key pattern- Returns:
- Asynchronous Iterable object
-
entrySetAsync
Description copied from interface:RMapAsyncReturns map entries using iterable. Map entries are loaded in batch. Batch size is defined bycountparam. IfkeyPatternis not null then only entries mapped by matched keys of this pattern are loaded.Use
org.redisson.client.codec.StringCodecfor Map keys.Usage example:
Codec valueCodec = ... RMapinvalid input: '<'String, MyObject> map = redissonClient.getMap("simpleMap", new CompositeCodec(StringCodec.INSTANCE, valueCodec, valueCodec)); // or RMapinvalid input: '<'String, String> map = redissonClient.getMap("simpleMap", StringCodec.INSTANCE);Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo- Specified by:
entrySetAsyncin interfaceRMapAsync<K,V> - Parameters:
keyPattern- key patterncount- size of entries batch- Returns:
- Asynchronous Iterable object
-
entrySetAsync
Description copied from interface:RMapAsyncReturns map entries using iterable. Map entries are loaded in batch. Batch size is defined bycountparam.- Specified by:
entrySetAsyncin interfaceRMapAsync<K,V> - Parameters:
count- - size of entries batch- Returns:
- Asynchronous Iterable object
-
fastRemoveAsync
Description copied from interface:RMapAsyncRemoves map entries mapped by specifiedkeys.Works faster than
but not returning the value.RMapAsync.removeAsync(Object)If
MapWriteris defined thenkeysare deleted in write-through mode.- Specified by:
fastRemoveAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
remainTimeToLiveAsync
Description copied from interface:RMapCacheAsyncRemaining time to live of map entry associated with akey.- Specified by:
remainTimeToLiveAsyncin interfaceRMapCacheAsync<K,V> - 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.
-
addListenerAsync
Description copied from interface:RMapCacheAsyncAdds map entry listener- Specified by:
addListenerAsyncin interfaceRMapCacheAsync<K,V> - Parameters:
listener- - entry listener- Returns:
- listener id
- See Also:
-
mergeAsync
public RFuture<V> mergeAsync(K key, V value, BiFunction<? super V, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncAssociates specified key with the given value if key isn't already associated with a value. Otherwise, replaces the associated value with the results of the given remapping function, or removes if the result isnull.- Specified by:
mergeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyvalue- - value to be merged with the existing value associated with the key or to be associated with the key, if no existing valueremappingFunction- - the function is invoked with the existing value to compute new value- Returns:
- new value associated with the specified key or
nullif no value associated with the key
-
computeAsync
public RFuture<V> computeAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncComputes a new mapping for the specified key and its current mapped value.- Specified by:
computeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyremappingFunction- - function to compute a value- Returns:
- the new value associated with the specified key, or
nullif none
-
computeIfAbsentAsync
Description copied from interface:RMapAsyncComputes a mapping for the specified key if it's not mapped before.- Specified by:
computeIfAbsentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keymappingFunction- - function to compute a value- Returns:
- current or new computed value associated with
the specified key, or
nullif the computed value is null
-
computeIfPresentAsync
public RFuture<V> computeIfPresentAsync(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) Description copied from interface:RMapAsyncComputes a mapping for the specified key only if it's already mapped.- Specified by:
computeIfPresentAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keyremappingFunction- - function to compute a value- Returns:
- the new value associated with the specified key, or null if none
-
loadAllAsync
Description copied from interface:RMapAsyncLoads all map entries to this Redis map usingMapLoader.- Specified by:
loadAllAsyncin interfaceRMapAsync<K,V> - Parameters:
replaceExistingValues- -trueif existed values should be replaced,falseotherwise.parallelism- - parallelism level, used to increase speed of process execution- Returns:
- void
-
loadAllAsync
public RFuture<Void> loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism) Description copied from interface:RMapAsyncLoads map entries usingMapLoaderwhose keys are listed in definedkeysparameter.- Specified by:
loadAllAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keysreplaceExistingValues- -trueif existed values should be replaced,falseotherwise.parallelism- - parallelism level, used to increase speed of process execution- Returns:
- void
-
valueSizeAsync
Description copied from interface:RMapAsyncReturns size of value mapped by key in bytes- Specified by:
valueSizeAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
- size of value
-
getAllAsync
Description copied from interface:RMapAsyncReturns map slice contained the mappings with definedkeys.If map doesn't contain value/values for specified key/keys and
MapLoaderis defined then value/values will be loaded in read-through mode.The returned map is NOT backed by the original map.
- Specified by:
getAllAsyncin interfaceRMapAsync<K,V> - Parameters:
keys- - map keys- Returns:
- Map slice
-
putAllAsync
Description copied from interface:RMapAsyncStores map entries specified inmapobject in batch mode.If
MapWriteris defined then map entries will be stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapAsync<K,V> - Parameters:
map- mappings to be stored in this map- Returns:
- void
-
putAllAsync
Description copied from interface:RMapAsyncStores map entries specified inmapobject in batch mode. Batch inserted by chunks limited bybatchSizevalue to avoid OOM and/or Redis response timeout error for map with big size.If
MapWriteris defined then map entries are stored in write-through mode.- Specified by:
putAllAsyncin interfaceRMapAsync<K,V> - Parameters:
map- mappings to be stored in this mapbatchSize- - size of map entries batch- Returns:
- void
-
randomKeysAsync
Description copied from interface:RMapAsyncReturns random keys from this map limited bycount- Specified by:
randomKeysAsyncin interfaceRMapAsync<K,V> - Parameters:
count- - keys amount to return- Returns:
- random keys
-
randomEntriesAsync
Description copied from interface:RMapAsyncReturns random map entries from this map limited bycount- Specified by:
randomEntriesAsyncin interfaceRMapAsync<K,V> - Parameters:
count- - entries amount to return- Returns:
- random entries
-
addAndGetAsync
Description copied from interface:RMapAsyncAdds the givendeltato the current value by mappedkey.Works only with codecs below
- Specified by:
addAndGetAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map keydelta- the value to add- Returns:
- the updated value
-
clearAsync
Description copied from interface:RMapAsyncClears map without removing options data used during map creation.- Specified by:
clearAsyncin interfaceRMapAsync<K,V> - Returns:
trueif map was clearedfalseif not
-
containsKeyAsync
Description copied from interface:RMapAsyncReturnstrueif this map contains map entry mapped by specifiedkey, otherwisefalse- Specified by:
containsKeyAsyncin interfaceRMapAsync<K,V> - Parameters:
key- - map key- Returns:
trueif this map contains map entry mapped by specifiedkey, otherwisefalse
-
containsValueAsync
Description copied from interface:RMapAsyncReturnstrueif this map contains any map entry with specifiedvalue, otherwisefalse- Specified by:
containsValueAsyncin interfaceRMapAsync<K,V> - Parameters:
value- - map value- Returns:
trueif this map contains any map entry with specifiedvalue, otherwisefalse
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RMapCacheRemoves map entry listener- Specified by:
removeListenerin interfaceRMapCache<K,V> - Specified by:
removeListenerin interfaceRObject- Parameters:
listenerId- - listener id
-
remainTimeToLive
Description copied from interface:RMapCacheRemaining time to live of map entry associated with akey.- Specified by:
remainTimeToLivein interfaceRMapCache<K,V> - 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.
-