K
- keyV
- valuepublic interface RMapRx<K,V> extends RExpirableRx
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 |
---|---|
io.reactivex.Single<V> |
addAndGet(K key,
Number delta)
Adds the given
delta to the current value
by mapped key . |
io.reactivex.Single<Boolean> |
containsKey(Object key)
Returns
true if this map contains map entry
mapped by specified key , otherwise false |
io.reactivex.Single<Boolean> |
containsValue(Object value)
Returns
true if this map contains any map entry
with specified value , otherwise false |
io.reactivex.Flowable<Map.Entry<K,V>> |
entryIterator()
Returns iterator over map entries collection.
|
io.reactivex.Flowable<Map.Entry<K,V>> |
entryIterator(int count)
Returns iterator over map entries collection.
|
io.reactivex.Flowable<Map.Entry<K,V>> |
entryIterator(String pattern)
Returns iterator over map entries collection.
|
io.reactivex.Flowable<Map.Entry<K,V>> |
entryIterator(String pattern,
int count)
Returns iterator over map entries collection.
|
io.reactivex.Single<Boolean> |
fastPut(K key,
V value)
Stores the specified
value mapped by specified key . |
io.reactivex.Single<Boolean> |
fastPutIfAbsent(K key,
V value)
Stores the specified
value mapped by specified key
only if there is no value with specifiedkey stored before. |
io.reactivex.Single<Long> |
fastRemove(K... keys)
Removes map entries mapped by specified
keys . |
io.reactivex.Maybe<V> |
get(K key)
Returns the value mapped by defined
key or null if value is absent. |
io.reactivex.Single<Map<K,V>> |
getAll(Set<K> keys)
Returns map slice contained the mappings with defined
keys . |
RLockRx |
getFairLock(K key)
Returns
RLock instance associated with key |
RLockRx |
getLock(K key)
Returns
RLock instance associated with key |
RPermitExpirableSemaphoreRx |
getPermitExpirableSemaphore(K key)
Returns
RPermitExpirableSemaphore instance associated with key |
RReadWriteLockRx |
getReadWriteLock(K key)
Returns
RReadWriteLock instance associated with key |
RSemaphoreRx |
getSemaphore(K key)
Returns
RSemaphore instance associated with key |
io.reactivex.Flowable<K> |
keyIterator()
Returns iterator over key set of this map.
|
io.reactivex.Flowable<K> |
keyIterator(int count)
Returns iterator over key set of this map.
|
io.reactivex.Flowable<K> |
keyIterator(String pattern)
Returns iterator over key set of this map.
|
io.reactivex.Flowable<K> |
keyIterator(String pattern,
int count)
Returns iterator over key set of this map.
|
io.reactivex.Completable |
loadAll(boolean replaceExistingValues,
int parallelism)
Loads all map entries to this Redis map using
MapLoader . |
io.reactivex.Completable |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
int parallelism)
Loads map entries using
MapLoader whose keys are listed in defined keys parameter. |
io.reactivex.Maybe<V> |
put(K key,
V value)
Stores the specified
value mapped by specified key . |
io.reactivex.Completable |
putAll(Map<? extends K,? extends V> map)
Stores map entries specified in
map object in batch mode. |
io.reactivex.Maybe<V> |
putIfAbsent(K key,
V value)
Stores the specified
value mapped by specified key
only if there is no value with specifiedkey stored before. |
io.reactivex.Single<Set<Map.Entry<K,V>>> |
readAllEntrySet()
Read all map entries at once
|
io.reactivex.Single<Set<K>> |
readAllKeySet()
Read all keys at once
|
io.reactivex.Single<Map<K,V>> |
readAllMap()
Read all map as local instance at once
|
io.reactivex.Single<Collection<V>> |
readAllValues()
Read all values at once
|
io.reactivex.Maybe<V> |
remove(K key)
Removes map entry by specified
key and returns value. |
io.reactivex.Single<Boolean> |
remove(Object key,
Object value)
Removes map entry only if it exists with specified
key and value . |
io.reactivex.Maybe<V> |
replace(K key,
V value)
Replaces previous value with a new
value mapped by specified key . |
io.reactivex.Single<Boolean> |
replace(K key,
V oldValue,
V newValue)
Replaces previous
oldValue with a newValue mapped by specified key . |
io.reactivex.Single<Integer> |
size()
Returns size of this map
|
io.reactivex.Flowable<V> |
valueIterator()
Returns iterator over values collection of this map.
|
io.reactivex.Flowable<V> |
valueIterator(int count)
Returns iterator over values collection of this map.
|
io.reactivex.Flowable<V> |
valueIterator(String pattern)
Returns iterator over values collection of this map.
|
io.reactivex.Flowable<V> |
valueIterator(String pattern,
int count)
Returns iterator over values collection of this map.
|
io.reactivex.Single<Integer> |
valueSize(K key)
Returns size of value mapped by key in bytes
|
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
io.reactivex.Completable loadAll(boolean replaceExistingValues, int parallelism)
MapLoader
.replaceExistingValues
- - true
if existed values should be replaced, false
otherwise.parallelism
- - parallelism level, used to increase speed of process executionio.reactivex.Completable loadAll(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 executionio.reactivex.Single<Integer> valueSize(K key)
key
- - map keyio.reactivex.Single<Map<K,V>> getAll(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 keysio.reactivex.Completable putAll(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 mapio.reactivex.Single<V> addAndGet(K key, Number delta)
delta
to the current value
by mapped key
.
Works only for numeric values!key
- - map keydelta
- the value to addio.reactivex.Single<Boolean> containsValue(Object value)
true
if this map contains any map entry
with specified value
, otherwise false
value
- - map valuetrue
if this map contains any map entry
with specified value
, otherwise false
io.reactivex.Single<Boolean> containsKey(Object key)
true
if this map contains map entry
mapped by specified key
, otherwise false
key
- - map keytrue
if this map contains map entry
mapped by specified key
, otherwise false
io.reactivex.Single<Integer> size()
io.reactivex.Single<Long> fastRemove(K... keys)
keys
.
Works faster than
but not returning
the value.
remove(Object)
If MapWriter
is defined then keys
are deleted in write-through mode.
keys
- - map keysio.reactivex.Single<Boolean> fastPut(K key, V value)
value
mapped by specified key
.
Works faster than
but not returning
previous value.
put(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.io.reactivex.Single<Boolean> fastPutIfAbsent(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 putIfAbsent(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.io.reactivex.Single<Collection<V>> readAllValues()
io.reactivex.Single<Set<Map.Entry<K,V>>> readAllEntrySet()
io.reactivex.Single<Map<K,V>> readAllMap()
io.reactivex.Maybe<V> get(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 absentio.reactivex.Maybe<V> put(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 valueio.reactivex.Maybe<V> remove(K key)
key
and returns value.
If MapWriter
is defined then key
is deleted in write-through mode.
key
- - map keynull
if map entry doesn't existio.reactivex.Maybe<V> replace(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 value
is written in write-through mode.
key
- - map keyvalue
- - map valuenull
if there is no map entry stored before and doesn't store new map entryio.reactivex.Single<Boolean> replace(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 newValue
is written in write-through mode.
key
- - map keyoldValue
- - map old valuenewValue
- - map new valuetrue
if value has been replaced otherwise false
.io.reactivex.Single<Boolean> remove(Object key, Object value)
key
and value
.
If MapWriter
is defined then key
is deleted in write-through mode.
key
- - map keyvalue
- - map valuetrue
if map entry has been removed otherwise false
.io.reactivex.Maybe<V> putIfAbsent(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.io.reactivex.Flowable<Map.Entry<K,V>> entryIterator()
10
.readAllEntrySet()
io.reactivex.Flowable<Map.Entry<K,V>> entryIterator(int count)
count
param.count
- - size of entries batchreadAllEntrySet()
io.reactivex.Flowable<Map.Entry<K,V>> entryIterator(String pattern)
10
.
If keyPattern
is not null then only entries mapped by matched keys of this pattern are loaded.
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
pattern
- - key patternreadAllEntrySet()
io.reactivex.Flowable<Map.Entry<K,V>> entryIterator(String pattern, int count)
count
param.
If keyPattern
is not null then only entries mapped by matched keys of this pattern are loaded.
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
pattern
- - key patterncount
- - size of entries batchreadAllEntrySet()
io.reactivex.Flowable<V> valueIterator()
10
.readAllValues()
io.reactivex.Flowable<V> valueIterator(int count)
count
param.count
- - size of values batchreadAllValues()
io.reactivex.Flowable<V> valueIterator(String pattern)
10
.
If keyPattern
is not null then only values mapped by matched keys of this pattern are loaded.
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
pattern
- - key patternreadAllValues()
io.reactivex.Flowable<V> valueIterator(String pattern, int count)
count
param.
If keyPattern
is not null then only values mapped by matched keys of this pattern are loaded.
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
pattern
- - key patterncount
- - size of values batchreadAllValues()
io.reactivex.Flowable<K> keyIterator()
10
.readAllKeySet()
io.reactivex.Flowable<K> keyIterator(int count)
count
param.count
- - size of keys batchreadAllKeySet()
io.reactivex.Flowable<K> keyIterator(String pattern)
pattern
is not null then only keys match this pattern are loaded.
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
pattern
- - key patternreadAllKeySet()
io.reactivex.Flowable<K> keyIterator(String pattern, int count)
pattern
is not null then only keys match this pattern are loaded.
Keys are loaded in batch. Batch size is defined by count
param.
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
pattern
- - key patterncount
- - size of keys batchreadAllKeySet()
RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(K key)
RPermitExpirableSemaphore
instance associated with keykey
- - map keyRSemaphoreRx getSemaphore(K key)
RSemaphore
instance associated with keykey
- - map keyRLockRx getFairLock(K key)
RLock
instance associated with keykey
- - map keyRReadWriteLockRx getReadWriteLock(K key)
RReadWriteLock
instance associated with keykey
- - map keyCopyright © 2014–2020 Redisson. All rights reserved.