K
- keyV
- valuepublic class RedissonMapReactive<K,V> extends Object implements RMapReactive<K,V>
ConcurrentMap
and Map
Constructor and Description |
---|
RedissonMapReactive(Codec codec,
CommandReactiveExecutor commandExecutor,
String name,
MapOptions<K,V> options) |
RedissonMapReactive(Codec codec,
CommandReactiveExecutor commandExecutor,
String name,
MapOptions<K,V> options,
RMapAsync<K,V> instance) |
RedissonMapReactive(CommandReactiveExecutor commandExecutor,
String name,
MapOptions<K,V> options) |
RedissonMapReactive(CommandReactiveExecutor commandExecutor,
String name,
MapOptions<K,V> options,
RMapAsync<K,V> instance) |
Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<V> |
addAndGet(K key,
Number value) |
org.reactivestreams.Publisher<Boolean> |
clearExpire()
Clear an expire timeout or expire date for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
containsKey(Object key) |
org.reactivestreams.Publisher<Boolean> |
containsValue(Object value) |
org.reactivestreams.Publisher<Boolean> |
delete()
Delete object in mode
|
protected void |
encode(Collection<Object> params,
Collection<?> values) |
protected io.netty.buffer.ByteBuf |
encode(Object value) |
protected io.netty.buffer.ByteBuf |
encodeMapKey(Object value) |
protected io.netty.buffer.ByteBuf |
encodeMapValue(Object value) |
org.reactivestreams.Publisher<Map.Entry<K,V>> |
entryIterator()
Returns iterator over map entries collection.
|
org.reactivestreams.Publisher<Map.Entry<K,V>> |
entryIterator(int count)
Returns iterator over map entries collection.
|
org.reactivestreams.Publisher<Map.Entry<K,V>> |
entryIterator(String pattern)
Returns iterator over map entries collection.
|
org.reactivestreams.Publisher<Map.Entry<K,V>> |
entryIterator(String pattern,
int count)
Returns iterator over map entries collection.
|
boolean |
equals(Object o) |
org.reactivestreams.Publisher<Boolean> |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
expireAt(Date timestamp)
Set an expire date for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
expireAt(long timestamp)
Set an expire date for object in mode.
|
org.reactivestreams.Publisher<Boolean> |
fastPut(K key,
V value)
Associates the specified
value with the specified key
in async manner. |
org.reactivestreams.Publisher<Boolean> |
fastPutIfAbsent(K key,
V value)
Associates the specified
value with the specified key
only if there is no any association with specifiedkey . |
org.reactivestreams.Publisher<Long> |
fastRemove(K... keys)
Removes
keys from map by one operation in async manner. |
org.reactivestreams.Publisher<V> |
get(K key)
Returns the value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
org.reactivestreams.Publisher<Map<K,V>> |
getAll(Set<K> keys)
Gets a map slice contained the mappings with defined
keys
by one operation. |
Codec |
getCodec() |
String |
getName() |
int |
hashCode() |
org.reactivestreams.Publisher<Boolean> |
isExists()
Check object existence
|
org.reactivestreams.Publisher<K> |
keyIterator()
Returns iterator over key set of this map.
|
org.reactivestreams.Publisher<K> |
keyIterator(int count)
Returns iterator over key set of this map.
|
org.reactivestreams.Publisher<K> |
keyIterator(String pattern)
Returns iterator over key set of this map.
|
org.reactivestreams.Publisher<K> |
keyIterator(String pattern,
int count)
Returns iterator over key set of this map.
|
org.reactivestreams.Publisher<Void> |
loadAll(boolean replaceExistingValues,
int parallelism)
Loads all map entries to this Redis map using
MapLoader . |
org.reactivestreams.Publisher<Void> |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
int parallelism)
Loads map entries using
MapLoader whose keys are listed in defined keys parameter. |
org.reactivestreams.Publisher<Void> |
migrate(String host,
int port,
int database,
long timeout)
Transfer a object from a source Redis instance to a destination Redis instance
in mode
|
org.reactivestreams.Publisher<Boolean> |
move(int database)
Move object to another database in mode
|
protected <V> reactor.core.publisher.Mono<V> |
newSucceeded(V result) |
org.reactivestreams.Publisher<V> |
put(K key,
V value)
Associates the specified
value with the specified key
in async manner. |
org.reactivestreams.Publisher<Void> |
putAll(Map<? extends K,? extends V> map)
Associates the specified
value with the specified key
in batch. |
org.reactivestreams.Publisher<V> |
putIfAbsent(K key,
V value)
Associates the specified
value with the specified key
only if there is no any association with specifiedkey . |
<R> org.reactivestreams.Publisher<R> |
reactive(Supplier<RFuture<R>> supplier) |
org.reactivestreams.Publisher<Set<Map.Entry<K,V>>> |
readAllEntrySet()
Read all map entries at once
|
org.reactivestreams.Publisher<Set<K>> |
readAllKeySet()
Read all keys at once
|
org.reactivestreams.Publisher<Map<K,V>> |
readAllMap()
Read all map as local instance at once
|
org.reactivestreams.Publisher<Collection<V>> |
readAllValues()
Read all values at once
|
org.reactivestreams.Publisher<Long> |
remainTimeToLive()
Get remaining time to live of object in milliseconds.
|
org.reactivestreams.Publisher<V> |
remove(K key)
Removes
key from map and returns associated value in async manner. |
org.reactivestreams.Publisher<Boolean> |
remove(Object key,
Object value)
Removes
key from map only if it associated with value . |
org.reactivestreams.Publisher<Void> |
rename(String newName)
Rename current object key to
newName
in mode |
org.reactivestreams.Publisher<Boolean> |
renamenx(String newName)
Rename current object key to
newName
in mode only if new key is not exists |
org.reactivestreams.Publisher<V> |
replace(K key,
V value)
Replaces previous value with a new
value associated with the key . |
org.reactivestreams.Publisher<Boolean> |
replace(K key,
V oldValue,
V newValue)
Replaces previous
oldValue with a newValue associated with the key . |
org.reactivestreams.Publisher<MapScanResult<Object,Object>> |
scanIteratorReactive(RedisClient client,
long startPos,
String pattern,
int count) |
org.reactivestreams.Publisher<Integer> |
size() |
org.reactivestreams.Publisher<V> |
valueIterator()
Returns iterator over values collection of this map.
|
org.reactivestreams.Publisher<V> |
valueIterator(int count)
Returns iterator over values collection of this map.
|
org.reactivestreams.Publisher<V> |
valueIterator(String pattern)
Returns iterator over values collection of this map.
|
org.reactivestreams.Publisher<V> |
valueIterator(String pattern,
int count)
Returns iterator over values collection of this map.
|
org.reactivestreams.Publisher<Integer> |
valueSize(K key)
Returns size of value mapped by key in bytes
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
clearExpire, expire, expireAt, expireAt, remainTimeToLive
public RedissonMapReactive(CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options)
public RedissonMapReactive(CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options, RMapAsync<K,V> instance)
public RedissonMapReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options)
public RedissonMapReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options, RMapAsync<K,V> instance)
public org.reactivestreams.Publisher<Void> loadAll(boolean replaceExistingValues, int parallelism)
RMapReactive
MapLoader
.loadAll
in interface RMapReactive<K,V>
replaceExistingValues
- - true
if existed values should be replaced, false
otherwise.parallelism
- - parallelism level, used to increase speed of process executionpublic org.reactivestreams.Publisher<Void> loadAll(Set<? extends K> keys, boolean replaceExistingValues, int parallelism)
RMapReactive
MapLoader
whose keys are listed in defined keys
parameter.loadAll
in interface RMapReactive<K,V>
keys
- - map keysreplaceExistingValues
- - true
if existed values should be replaced, false
otherwise.parallelism
- - parallelism level, used to increase speed of process executionpublic org.reactivestreams.Publisher<Boolean> fastPutIfAbsent(K key, V value)
RMapReactive
value
with the specified key
only if there is no any association with specifiedkey
.
Works faster than
but not returning
the previous value associated with RMapReactive.putIfAbsent(Object, Object)
key
If MapWriter
is defined then new map entry is stored in write-through mode.
fastPutIfAbsent
in interface RMapReactive<K,V>
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.public org.reactivestreams.Publisher<Set<K>> readAllKeySet()
RMapReactive
readAllKeySet
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Collection<V>> readAllValues()
RMapReactive
readAllValues
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Set<Map.Entry<K,V>>> readAllEntrySet()
RMapReactive
readAllEntrySet
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Map<K,V>> readAllMap()
RMapReactive
readAllMap
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Integer> valueSize(K key)
RMapReactive
valueSize
in interface RMapReactive<K,V>
key
- - map keypublic org.reactivestreams.Publisher<Integer> size()
size
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Boolean> containsKey(Object key)
containsKey
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Boolean> containsValue(Object value)
containsValue
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Map<K,V>> getAll(Set<K> keys)
RMapReactive
keys
by one operation.
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.
getAll
in interface RMapReactive<K,V>
keys
- - map keyspublic org.reactivestreams.Publisher<Void> putAll(Map<? extends K,? extends V> map)
RMapReactive
value
with the specified key
in batch.
If MapWriter
is defined then new map entries are stored in write-through mode.
putAll
in interface RMapReactive<K,V>
map
- mappings to be stored in this mappublic org.reactivestreams.Publisher<V> putIfAbsent(K key, V value)
RMapReactive
value
with the specified key
only if there is no any association with specifiedkey
.
If MapWriter
is defined then new map entry is stored in write-through mode.
putIfAbsent
in interface RMapReactive<K,V>
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.public org.reactivestreams.Publisher<Boolean> remove(Object key, Object value)
RMapReactive
key
from map only if it associated with value
.
If MapWriter
is defined then key
is deleted in write-through mode.
remove
in interface RMapReactive<K,V>
key
- - map keyvalue
- - map valuetrue
if map entry has been replaced otherwise false
.public org.reactivestreams.Publisher<Boolean> replace(K key, V oldValue, V newValue)
RMapReactive
oldValue
with a newValue
associated with the key
.
If previous value doesn't exist or equal to oldValue
then method returns false
.
If MapWriter
is defined then newValue
is written in write-through mode.
replace
in interface RMapReactive<K,V>
key
- - map keyoldValue
- - map old valuenewValue
- - map new valuetrue
if value has been replaced otherwise false
.public org.reactivestreams.Publisher<V> replace(K key, V value)
RMapReactive
value
associated with the key
.
If there wasn't any association before then method returns null
.
If MapWriter
is defined then new value
is written in write-through mode.
replace
in interface RMapReactive<K,V>
key
- - map keyvalue
- - map valuenull
if there wasn't any association and change hasn't been madepublic org.reactivestreams.Publisher<V> get(K key)
RMapReactive
null
if this map contains no mapping for the key.
If map doesn't contain value for specified key and MapLoader
is defined
then value will be loaded in read-through mode.
get
in interface RMapReactive<K,V>
key
- the key whose associated value is to be returnednull
if this map contains no mapping for the keypublic org.reactivestreams.Publisher<V> put(K key, V value)
RMapReactive
value
with the specified key
in async manner.
If MapWriter
is defined then new map entry is stored in write-through mode.
put
in interface RMapReactive<K,V>
key
- - map keyvalue
- - map valuepublic org.reactivestreams.Publisher<V> remove(K key)
RMapReactive
key
from map and returns associated value in async manner.
If MapWriter
is defined then key
is deleted in write-through mode.
remove
in interface RMapReactive<K,V>
key
- - map keynull
if there wasn't any associationpublic org.reactivestreams.Publisher<Boolean> fastPut(K key, V value)
RMapReactive
value
with the specified key
in async manner.
Works faster than
but not returning
the previous value associated with RMapReactive.put(Object, Object)
key
If MapWriter
is defined then new map entry is stored in write-through mode.
fastPut
in interface RMapReactive<K,V>
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 the value was updated.public org.reactivestreams.Publisher<Long> fastRemove(K... keys)
RMapReactive
keys
from map by one operation in async manner.
Works faster than
but doesn't return
the value associated with RMapReactive.remove(Object, Object)
key
.
If MapWriter
is defined then keys
are deleted in write-through mode.
fastRemove
in interface RMapReactive<K,V>
keys
- - map keyspublic org.reactivestreams.Publisher<MapScanResult<Object,Object>> scanIteratorReactive(RedisClient client, long startPos, String pattern, int count)
public org.reactivestreams.Publisher<Map.Entry<K,V>> entryIterator()
RMapReactive
10
.entryIterator
in interface RMapReactive<K,V>
RMapReactive.readAllEntrySet()
public org.reactivestreams.Publisher<Map.Entry<K,V>> entryIterator(int count)
RMapReactive
count
param.entryIterator
in interface RMapReactive<K,V>
count
- - size of entries batchRMapReactive.readAllEntrySet()
public org.reactivestreams.Publisher<Map.Entry<K,V>> entryIterator(String pattern)
RMapReactive
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
entryIterator
in interface RMapReactive<K,V>
pattern
- - key patternRMapReactive.readAllEntrySet()
public org.reactivestreams.Publisher<Map.Entry<K,V>> entryIterator(String pattern, int count)
RMapReactive
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
entryIterator
in interface RMapReactive<K,V>
pattern
- - key patterncount
- - size of entries batchRMapReactive.readAllEntrySet()
public org.reactivestreams.Publisher<V> valueIterator()
RMapReactive
10
.valueIterator
in interface RMapReactive<K,V>
RMapReactive.readAllValues()
public org.reactivestreams.Publisher<V> valueIterator(String pattern)
RMapReactive
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
valueIterator
in interface RMapReactive<K,V>
pattern
- - key patternRMapReactive.readAllValues()
public org.reactivestreams.Publisher<V> valueIterator(int count)
RMapReactive
count
param.valueIterator
in interface RMapReactive<K,V>
count
- - size of values batchRMapReactive.readAllValues()
public org.reactivestreams.Publisher<V> valueIterator(String pattern, int count)
RMapReactive
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
valueIterator
in interface RMapReactive<K,V>
pattern
- - key patterncount
- - size of values batchRMapReactive.readAllValues()
public org.reactivestreams.Publisher<K> keyIterator()
RMapReactive
10
.keyIterator
in interface RMapReactive<K,V>
RMapReactive.readAllKeySet()
public org.reactivestreams.Publisher<K> keyIterator(String pattern)
RMapReactive
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
keyIterator
in interface RMapReactive<K,V>
pattern
- - key patternRMapReactive.readAllKeySet()
public org.reactivestreams.Publisher<K> keyIterator(int count)
RMapReactive
count
param.keyIterator
in interface RMapReactive<K,V>
count
- - size of keys batchRMapReactive.readAllKeySet()
public org.reactivestreams.Publisher<K> keyIterator(String pattern, int count)
RMapReactive
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
keyIterator
in interface RMapReactive<K,V>
pattern
- - key patterncount
- - size of keys batchRMapReactive.readAllKeySet()
public org.reactivestreams.Publisher<V> addAndGet(K key, Number value)
addAndGet
in interface RMapReactive<K,V>
public org.reactivestreams.Publisher<Boolean> expire(long timeToLive, TimeUnit timeUnit)
RExpirableReactive
expire
in interface RExpirableReactive
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> expireAt(long timestamp)
RExpirableReactive
expireAt
in interface RExpirableReactive
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> expireAt(Date timestamp)
RExpirableReactive
expireAt
in interface RExpirableReactive
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> clearExpire()
RExpirableReactive
clearExpire
in interface RExpirableReactive
true
if the timeout was cleared and false
if notpublic org.reactivestreams.Publisher<Long> remainTimeToLive()
RExpirableReactive
remainTimeToLive
in interface RExpirableReactive
protected <V> reactor.core.publisher.Mono<V> newSucceeded(V result)
public String getName()
getName
in interface RObjectReactive
public Codec getCodec()
getCodec
in interface RObjectReactive
protected void encode(Collection<Object> params, Collection<?> values)
protected io.netty.buffer.ByteBuf encode(Object value)
protected io.netty.buffer.ByteBuf encodeMapKey(Object value)
protected io.netty.buffer.ByteBuf encodeMapValue(Object value)
public org.reactivestreams.Publisher<Void> rename(String newName)
RObjectReactive
newName
in moderename
in interface RObjectReactive
newName
- - new name of objectpublic org.reactivestreams.Publisher<Void> migrate(String host, int port, int database, long timeout)
RObjectReactive
migrate
in interface RObjectReactive
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic org.reactivestreams.Publisher<Boolean> move(int database)
RObjectReactive
move
in interface RObjectReactive
database
- - number of Redis databasetrue
if key was moved false
if notpublic org.reactivestreams.Publisher<Boolean> renamenx(String newName)
RObjectReactive
newName
in mode only if new key is not existsrenamenx
in interface RObjectReactive
newName
- - new name of objecttrue
if object has been renamed successfully and false
otherwisepublic org.reactivestreams.Publisher<Boolean> delete()
RObjectReactive
delete
in interface RObjectReactive
true
if object was deleted false
if notpublic org.reactivestreams.Publisher<Boolean> isExists()
RObjectReactive
isExists
in interface RObjectReactive
true
if object exists and false
otherwiseCopyright © 2014–2018 The Redisson Project. All rights reserved.