K - keyV - valuepublic interface RMapAsync<K,V> extends RExpirableAsync
ConcurrentMap and Map
This map uses serialized state of key instead of hashCode or equals methods.
This map doesn't allow to store null as key or value.
| Modifier and Type | Method and Description |
|---|---|
RFuture<V> |
addAndGetAsync(K key,
Number delta)
Adds the given
delta to the current value
by mapped key. |
RFuture<V> |
computeAsync(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
Computes a new mapping for the specified key and its current mapped value.
|
RFuture<V> |
computeIfAbsentAsync(K key,
Function<? super K,? extends V> mappingFunction)
Computes a mapping for the specified key if it's not mapped before.
|
RFuture<V> |
computeIfPresentAsync(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
Computes a mapping for the specified key only if it's already mapped.
|
RFuture<Boolean> |
containsKeyAsync(Object key)
Returns
true if this map contains map entry
mapped by specified key, otherwise false |
RFuture<Boolean> |
containsValueAsync(Object value)
Returns
true if this map contains any map entry
with specified value, otherwise false |
RFuture<Boolean> |
fastPutAsync(K key,
V value)
Stores the specified
value mapped by specified key. |
RFuture<Boolean> |
fastPutIfAbsentAsync(K key,
V value)
Stores the specified
value mapped by specified key
only if there is no value with specifiedkey stored before. |
RFuture<Long> |
fastRemoveAsync(K... keys)
Removes map entries mapped by specified
keys. |
RFuture<Boolean> |
fastReplaceAsync(K key,
V value)
Replaces previous value with a new
value mapped by specified key. |
RFuture<Map<K,V>> |
getAllAsync(Set<K> keys)
Returns map slice contained the mappings with defined
keys. |
RFuture<V> |
getAsync(K key)
Returns the value mapped by defined
key or null if value is absent. |
RFuture<Void> |
loadAllAsync(boolean replaceExistingValues,
int parallelism)
Loads all map entries to this Redis map using
MapLoader. |
RFuture<Void> |
loadAllAsync(Set<? extends K> keys,
boolean replaceExistingValues,
int parallelism)
Loads map entries using
MapLoader whose keys are listed in defined keys parameter. |
RFuture<V> |
mergeAsync(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.
|
RFuture<Void> |
putAllAsync(Map<? extends K,? extends V> map)
Stores map entries specified in
map object in batch mode. |
RFuture<Void> |
putAllAsync(Map<? extends K,? extends V> map,
int batchSize)
Stores map entries specified in
map object in batch mode. |
RFuture<V> |
putAsync(K key,
V value)
Stores the specified
value mapped by specified key. |
RFuture<V> |
putIfAbsentAsync(K key,
V value)
Stores the specified
value mapped by specified key
only if there is no value with specifiedkey stored before. |
RFuture<Set<Map.Entry<K,V>>> |
readAllEntrySetAsync()
Read all map entries at once
|
RFuture<Set<K>> |
readAllKeySetAsync()
Read all keys at once
|
RFuture<Map<K,V>> |
readAllMapAsync()
Read all map as local instance at once
|
RFuture<Collection<V>> |
readAllValuesAsync()
Read all values at once
|
RFuture<V> |
removeAsync(K key)
Removes map entry by specified
key and returns value. |
RFuture<Boolean> |
removeAsync(Object key,
Object value)
Removes map entry only if it exists with specified
key and value. |
RFuture<V> |
replaceAsync(K key,
V value)
Replaces previous value with a new
value mapped by specified key. |
RFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue)
Replaces previous
oldValue with a newValue mapped by specified key. |
RFuture<Integer> |
sizeAsync()
Returns size of this map
|
RFuture<Integer> |
valueSizeAsync(K key)
Returns size of value mapped by key in bytes
|
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsyncaddListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncRFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
null.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 valuenull if no value associated with the keyRFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
key - - map keyremappingFunction - - function to compute a valuenull if noneRFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction)
key - - map keymappingFunction - - function to compute a valuenull if the computed value is nullRFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
key - - map keyremappingFunction - - function to compute a valueRFuture<Void> loadAllAsync(boolean replaceExistingValues, int parallelism)
MapLoader.replaceExistingValues - - true if existed values should be replaced, false otherwise.parallelism - - parallelism level, used to increase speed of process executionRFuture<Void> loadAllAsync(Set<? extends K> keys, boolean replaceExistingValues, int parallelism)
MapLoader whose keys are listed in defined keys parameter.keys - - map keysreplaceExistingValues - - true if existed values should be replaced, false otherwise.parallelism - - parallelism level, used to increase speed of process executionRFuture<Integer> valueSizeAsync(K key)
key - - map keyRFuture<Map<K,V>> getAllAsync(Set<K> keys)
keys.
If map doesn't contain value/values for specified key/keys and MapLoader is defined
then value/values will be loaded in read-through mode.
The returned map is NOT backed by the original map.
keys - - map keysRFuture<Void> putAllAsync(Map<? extends K,? extends V> map)
map object in batch mode.
If MapWriter is defined then map entries will be stored in write-through mode.
map - mappings to be stored in this mapRFuture<Void> putAllAsync(Map<? extends K,? extends V> map, int batchSize)
map object in batch mode.
Batch inserted by chunks limited by batchSize value
to avoid OOM and/or Redis response timeout error for map with big size.
If MapWriter is defined then map entries are stored in write-through mode.
map - mappings to be stored in this mapbatchSize - - size of map entries batchRFuture<V> addAndGetAsync(K key, Number delta)
delta to the current value
by mapped key.
Works only for numeric values!key - - map keydelta - the value to addRFuture<Boolean> containsValueAsync(Object value)
true if this map contains any map entry
with specified value, otherwise falsevalue - - map valuetrue if this map contains any map entry
with specified value, otherwise falseRFuture<Boolean> containsKeyAsync(Object key)
true if this map contains map entry
mapped by specified key, otherwise falsekey - - map keytrue if this map contains map entry
mapped by specified key, otherwise falseRFuture<Long> fastRemoveAsync(K... keys)
keys.
Works faster than but not returning
the value.
removeAsync(Object)
If MapWriter is defined then keysare deleted in write-through mode.
keys - - map keysRFuture<Boolean> fastPutAsync(K key, V value)
value mapped by specified key.
Works faster than but not returning
previous value.
putAsync(Object, Object)
Returns true if key is a new key in the hash and value was set or
false if key already exists in the hash and the value was updated.
If MapWriter is defined then map entry is stored in write-through mode.
key - - map keyvalue - - map valuetrue if key is a new key in the hash and value was set.
false if key already exists in the hash and the value was updated.RFuture<Boolean> fastReplaceAsync(K key, V value)
value mapped by specified key.
Works faster than but not returning
the previous value.
replaceAsync(Object, Object)
Returns true if key exists and value was updated or
false if key doesn't exists and value wasn't updated.
If MapWriter is defined then new map entry is stored in write-through mode.
key - - map keyvalue - - map valuetrue if key exists and value was updated.
false if key doesn't exists and value wasn't updated.RFuture<Boolean> fastPutIfAbsentAsync(K key, V value)
value mapped by specified key
only if there is no value with specifiedkey stored before.
Returns true if key is a new one in the hash and value was set or
false if key already exists in the hash and change hasn't been made.
Works faster than but not returning
the previous value associated with putIfAbsentAsync(Object, Object)key
If MapWriter is defined then new map entry is stored in write-through mode.
key - - map keyvalue - - map valuetrue if key is a new one in the hash and value was set.
false if key already exists in the hash and change hasn't been made.RFuture<Collection<V>> readAllValuesAsync()
RFuture<Set<Map.Entry<K,V>>> readAllEntrySetAsync()
RFuture<Map<K,V>> readAllMapAsync()
RFuture<V> getAsync(K key)
key or null if value is absent.
If map doesn't contain value for specified key and MapLoader is defined
then value will be loaded in read-through mode.
key - the keykey or null if value is absentRFuture<V> putAsync(K key, V value)
value mapped by specified key.
Returns previous value if map entry with specified key already existed.
If MapWriter is defined then map entry is stored in write-through mode.
key - - map keyvalue - - map valueRFuture<V> removeAsync(K key)
key and returns value.
If MapWriter is defined then keyis deleted in write-through mode.
key - - map keynull if map entry doesn't existRFuture<V> replaceAsync(K key, V value)
value mapped by specified key.
Returns null if there is no map entry stored before and doesn't store new map entry.
If MapWriter is defined then new valueis written in write-through mode.
key - - map keyvalue - - map valuenull if there is no map entry stored before and doesn't store new map entryRFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
oldValue with a newValue mapped by specified key.
Returns false if previous value doesn't exist or equal to oldValue.
If MapWriter is defined then newValueis written in write-through mode.
key - - map keyoldValue - - map old valuenewValue - - map new valuetrue if value has been replaced otherwise false.RFuture<Boolean> removeAsync(Object key, Object value)
key and value.
If MapWriter is defined then keyis deleted in write-through mode.
key - - map keyvalue - - map valuetrue if map entry has been removed otherwise false.RFuture<V> putIfAbsentAsync(K key, V value)
value mapped by specified key
only if there is no value with specifiedkey stored before.
If MapWriter is defined then new map entry is stored in write-through mode.
key - - map keyvalue - - map valuenull if 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.Copyright © 2014–2020 Redisson. All rights reserved.