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(CommandReactiveExecutor commandExecutor,
String name,
MapOptions<K,V> options) |
| 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 byte[] |
encode(Object value) |
protected byte[] |
encodeMapKey(Object value) |
protected byte[] |
encodeMapValue(Object value) |
org.reactivestreams.Publisher<Map.Entry<K,V>> |
entryIterator() |
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() |
org.reactivestreams.Publisher<Void> |
loadAll(boolean replaceExistingValues,
int parallelism)
Loads all map entries to this Redis map.
|
org.reactivestreams.Publisher<Void> |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
int parallelism)
Loads map entries whose keys are listed in defined
keys parameter. |
org.reactivestreams.Publisher<Void> |
migrate(String host,
int port,
int database)
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.rx.Stream<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(reactor.fn.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<ScanObjectEntry,ScanObjectEntry>> |
scanIteratorReactive(InetSocketAddress client,
long startPos) |
org.reactivestreams.Publisher<Integer> |
size() |
org.reactivestreams.Publisher<V> |
valueIterator() |
org.reactivestreams.Publisher<Integer> |
valueSize(K key)
Returns size of value mapped by key in bytes
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitclearExpire, expire, expireAt, expireAt, remainTimeToLivepublic RedissonMapReactive(CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options)
public RedissonMapReactive(Codec codec, CommandReactiveExecutor commandExecutor, String name, MapOptions<K,V> options)
public org.reactivestreams.Publisher<Void> loadAll(boolean replaceExistingValues, int parallelism)
RMapReactiveloadAll 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)
RMapReactivekeys 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)
RMapReactivevalue 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()
RMapReactivereadAllKeySet in interface RMapReactive<K,V>public org.reactivestreams.Publisher<Collection<V>> readAllValues()
RMapReactivereadAllValues in interface RMapReactive<K,V>public org.reactivestreams.Publisher<Set<Map.Entry<K,V>>> readAllEntrySet()
RMapReactivereadAllEntrySet in interface RMapReactive<K,V>public org.reactivestreams.Publisher<Map<K,V>> readAllMap()
RMapReactivereadAllMap in interface RMapReactive<K,V>public org.reactivestreams.Publisher<Integer> valueSize(K key)
RMapReactivevalueSize 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)
RMapReactivekeys
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)
RMapReactivevalue 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)
RMapReactivevalue 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)
RMapReactivekey from map only if it associated with value.
If MapWriter is defined then keyis 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)
RMapReactiveoldValue 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 newValueis 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)
RMapReactivevalue associated with the key.
If there wasn't any association before then method returns null.
If MapWriter is defined then new valueis 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)
RMapReactivenull 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)
RMapReactivevalue 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)
RMapReactivekey from map and returns associated value in async manner.
If MapWriter is defined then keyis 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)
RMapReactivevalue 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)
RMapReactivekeys 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 keysare deleted in write-through mode.
fastRemove in interface RMapReactive<K,V>keys - - map keyspublic org.reactivestreams.Publisher<MapScanResult<ScanObjectEntry,ScanObjectEntry>> scanIteratorReactive(InetSocketAddress client, long startPos)
public org.reactivestreams.Publisher<Map.Entry<K,V>> entryIterator()
entryIterator in interface RMapReactive<K,V>public org.reactivestreams.Publisher<V> valueIterator()
valueIterator in interface RMapReactive<K,V>public org.reactivestreams.Publisher<K> keyIterator()
keyIterator in interface RMapReactive<K,V>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)
RExpirableReactiveexpire in interface RExpirableReactivetimeToLive - - 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)
RExpirableReactiveexpireAt in interface RExpirableReactivetimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic org.reactivestreams.Publisher<Boolean> expireAt(Date timestamp)
RExpirableReactiveexpireAt in interface RExpirableReactivetimestamp - - expire datetrue if the timeout was set and false if notpublic org.reactivestreams.Publisher<Boolean> clearExpire()
RExpirableReactiveclearExpire in interface RExpirableReactivetrue if the timeout was cleared and false if notpublic org.reactivestreams.Publisher<Long> remainTimeToLive()
RExpirableReactiveremainTimeToLive in interface RExpirableReactivepublic <R> org.reactivestreams.Publisher<R> reactive(reactor.fn.Supplier<RFuture<R>> supplier)
protected <V> reactor.rx.Stream<V> newSucceeded(V result)
public String getName()
getName in interface RObjectReactivepublic Codec getCodec()
getCodec in interface RObjectReactiveprotected byte[] encode(Object value)
protected byte[] encodeMapKey(Object value)
protected byte[] encodeMapValue(Object value)
public org.reactivestreams.Publisher<Void> rename(String newName)
RObjectReactivenewName
in moderename in interface RObjectReactivenewName - - new name of objectpublic org.reactivestreams.Publisher<Void> migrate(String host, int port, int database)
RObjectReactivemigrate in interface RObjectReactivehost - - destination hostport - - destination portdatabase - - destination databasepublic org.reactivestreams.Publisher<Boolean> move(int database)
RObjectReactivemove in interface RObjectReactivedatabase - - number of Redis databasetrue if key was moved false if notpublic org.reactivestreams.Publisher<Boolean> renamenx(String newName)
RObjectReactivenewName
in mode only if new key is not existsrenamenx in interface RObjectReactivenewName - - new name of objecttrue if object has been renamed successfully and false otherwisepublic org.reactivestreams.Publisher<Boolean> delete()
RObjectReactivedelete in interface RObjectReactivetrue if object was deleted false if notpublic org.reactivestreams.Publisher<Boolean> isExists()
RObjectReactiveisExists in interface RObjectReactivetrue if object exists and false otherwiseCopyright © 2014–2017 The Redisson Project. All rights reserved.