K
- keyV
- valuepublic class RedissonMap<K,V> extends Object implements RMap<K,V>
ConcurrentMap
and Map
Modifier | Constructor and Description |
---|---|
protected |
RedissonMap(CommandExecutor commandExecutor,
String name) |
Modifier and Type | Method and Description |
---|---|
V |
addAndGet(K key,
Number value)
Atomically adds the given
delta to the current value
by mapped key . |
io.netty.util.concurrent.Future<V> |
addAndGetAsync(K key,
Number value) |
void |
clear() |
boolean |
clearExpire()
Remove the existing timeout of Redisson object
|
io.netty.util.concurrent.Future<Boolean> |
clearExpireAsync() |
boolean |
containsKey(Object key) |
io.netty.util.concurrent.Future<Boolean> |
containsKeyAsync(Object key) |
boolean |
containsValue(Object value) |
io.netty.util.concurrent.Future<Boolean> |
containsValueAsync(Object value) |
boolean |
delete()
Deletes the object
|
io.netty.util.concurrent.Future<Boolean> |
deleteAsync() |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
boolean |
expire(long timeToLive,
TimeUnit timeUnit) |
io.netty.util.concurrent.Future<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit) |
boolean |
expireAt(Date timestamp) |
boolean |
expireAt(long timestamp) |
io.netty.util.concurrent.Future<Boolean> |
expireAtAsync(Date timestamp) |
io.netty.util.concurrent.Future<Boolean> |
expireAtAsync(long timestamp) |
boolean |
fastPut(K key,
V value)
Associates the specified
value with the specified key . |
io.netty.util.concurrent.Future<Boolean> |
fastPutAsync(K key,
V value)
Associates the specified
value with the specified key
in async manner. |
long |
fastRemove(K... keys)
Removes
keys from map by one operation
Works faster than RMap.remove but not returning
the value associated with key |
io.netty.util.concurrent.Future<Long> |
fastRemoveAsync(K... keys)
Removes
keys from map by one operation in async manner
Works faster than RMap.removeAsync but not returning
the value associated with key |
Map<K,V> |
filterEntries(Predicate<Map.Entry<K,V>> predicate)
Returns a map slice containing the mappings in whose
Map.Entry<K, V> entries
satisfy a predicate. |
Map<K,V> |
filterKeys(Predicate<K> predicate)
Returns a map slice containing the mappings in whose
keys
satisfy a predicate. |
Map<K,V> |
filterValues(Predicate<V> predicate)
Returns a map slice containing the mappings in whose
values
satisfy a predicate. |
protected <V> V |
get(io.netty.util.concurrent.Future<V> future) |
V |
get(Object key) |
Map<K,V> |
getAll(Set<K> keys)
Gets a map slice contains the mappings with defined
keys
by one operation. |
io.netty.util.concurrent.Future<V> |
getAsync(K key) |
String |
getName()
Returns name of object
|
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
io.netty.util.concurrent.Future<Set<K>> |
keySetAsync() |
void |
migrate(String host,
int port,
int database)
Transfer a object from a source Redis instance to a destination Redis instance
|
io.netty.util.concurrent.Future<Void> |
migrateAsync(String host,
int port,
int database)
Transfer a object from a source Redis instance to a destination Redis instance
in async mode
|
boolean |
move(int database)
Move object to another database
|
io.netty.util.concurrent.Future<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
protected <V> io.netty.util.concurrent.Promise<V> |
newPromise() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
io.netty.util.concurrent.Future<V> |
putAsync(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
io.netty.util.concurrent.Future<V> |
putIfAbsentAsync(K key,
V value) |
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
io.netty.util.concurrent.Future<Long> |
remainTimeToLiveAsync() |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
io.netty.util.concurrent.Future<V> |
removeAsync(K key) |
io.netty.util.concurrent.Future<Long> |
removeAsync(Object key,
Object value) |
void |
rename(String newName)
Rename current object key to
newName |
io.netty.util.concurrent.Future<Void> |
renameAsync(String newName)
Rename current object key to
newName
in async mode |
boolean |
renamenx(String newName)
Rename current object key to
newName
only if new key is not exists |
io.netty.util.concurrent.Future<Boolean> |
renamenxAsync(String newName)
Rename current object key to
newName
in async mode only if new key is not exists |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
io.netty.util.concurrent.Future<V> |
replaceAsync(K key,
V value) |
io.netty.util.concurrent.Future<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue) |
int |
size() |
io.netty.util.concurrent.Future<Integer> |
sizeAsync() |
Collection<V> |
values() |
io.netty.util.concurrent.Future<Collection<V>> |
valuesAsync() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
clearExpire, expire, expireAt, expireAt, remainTimeToLive
delete, getName, migrate, move, rename, renamenx
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
deleteAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync
protected RedissonMap(CommandExecutor commandExecutor, String name)
public io.netty.util.concurrent.Future<Integer> sizeAsync()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public io.netty.util.concurrent.Future<Boolean> containsKeyAsync(Object key)
containsKeyAsync
in interface RMapAsync<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public io.netty.util.concurrent.Future<Boolean> containsValueAsync(Object value)
containsValueAsync
in interface RMapAsync<K,V>
public Map<K,V> getAll(Set<K> keys)
RMap
keys
by one operation. This operation NOT traverses all map entries
like any other filter*
method, so works faster.
The returned map is NOT backed by the original map.public io.netty.util.concurrent.Future<Set<K>> keySetAsync()
keySetAsync
in interface RMapAsync<K,V>
public io.netty.util.concurrent.Future<Collection<V>> valuesAsync()
valuesAsync
in interface RMapAsync<K,V>
public V putIfAbsent(K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
public io.netty.util.concurrent.Future<V> putIfAbsentAsync(K key, V value)
putIfAbsentAsync
in interface RMapAsync<K,V>
public boolean remove(Object key, Object value)
remove
in interface ConcurrentMap<K,V>
public io.netty.util.concurrent.Future<Long> removeAsync(Object key, Object value)
removeAsync
in interface RMapAsync<K,V>
public boolean replace(K key, V oldValue, V newValue)
replace
in interface ConcurrentMap<K,V>
public io.netty.util.concurrent.Future<Boolean> replaceAsync(K key, V oldValue, V newValue)
replaceAsync
in interface RMapAsync<K,V>
public io.netty.util.concurrent.Future<V> replaceAsync(K key, V value)
replaceAsync
in interface RMapAsync<K,V>
public io.netty.util.concurrent.Future<V> removeAsync(K key)
removeAsync
in interface RMapAsync<K,V>
public io.netty.util.concurrent.Future<Boolean> fastPutAsync(K key, V value)
RMapAsync
value
with the specified key
in async manner.
Works faster than RMap.putAsync
but not returning
the previous value associated with key
fastPutAsync
in interface RMapAsync<K,V>
true
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.public boolean fastPut(K key, V value)
RMap
value
with the specified key
.
Works faster than RMap.put
but not returning
the previous value associated with key
public io.netty.util.concurrent.Future<Long> fastRemoveAsync(K... keys)
RMapAsync
keys
from map by one operation in async manner
Works faster than RMap.removeAsync
but not returning
the value associated with key
fastRemoveAsync
in interface RMapAsync<K,V>
public long fastRemove(K... keys)
RMap
keys
from map by one operation
Works faster than RMap.remove
but not returning
the value associated with key
fastRemove
in interface RMap<K,V>
public Map<K,V> filterKeys(Predicate<K> predicate)
RMap
keys
satisfy a predicate. Traverses all map entries.
The returned map is NOT backed by the original map.filterKeys
in interface RMap<K,V>
public Map<K,V> filterValues(Predicate<V> predicate)
RMap
values
satisfy a predicate. Traverses all map entries.
The returned map is NOT backed by the original map.filterValues
in interface RMap<K,V>
public Map<K,V> filterEntries(Predicate<Map.Entry<K,V>> predicate)
RMap
Map.Entry<K, V> entries
satisfy a predicate. This operation traverses all map entries.
The returned map is NOT backed by the original map.filterEntries
in interface RMap<K,V>
public V addAndGet(K key, Number value)
RMap
delta
to the current value
by mapped key
.
Works only for numeric values!public io.netty.util.concurrent.Future<V> addAndGetAsync(K key, Number value)
addAndGetAsync
in interface RMapAsync<K,V>
public boolean equals(Object o)
public int hashCode()
public boolean expire(long timeToLive, TimeUnit timeUnit)
expire
in interface RExpirable
public io.netty.util.concurrent.Future<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
expireAsync
in interface RExpirableAsync
public boolean expireAt(long timestamp)
expireAt
in interface RExpirable
public io.netty.util.concurrent.Future<Boolean> expireAtAsync(long timestamp)
expireAtAsync
in interface RExpirableAsync
public boolean expireAt(Date timestamp)
expireAt
in interface RExpirable
public io.netty.util.concurrent.Future<Boolean> expireAtAsync(Date timestamp)
expireAtAsync
in interface RExpirableAsync
public boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic io.netty.util.concurrent.Future<Boolean> clearExpireAsync()
clearExpireAsync
in interface RExpirableAsync
public long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public io.netty.util.concurrent.Future<Long> remainTimeToLiveAsync()
remainTimeToLiveAsync
in interface RExpirableAsync
protected <V> V get(io.netty.util.concurrent.Future<V> future)
protected <V> io.netty.util.concurrent.Promise<V> newPromise()
public void rename(String newName)
RObject
newName
public io.netty.util.concurrent.Future<Void> renameAsync(String newName)
RObjectAsync
newName
in async moderenameAsync
in interface RObjectAsync
public void migrate(String host, int port, int database)
RObject
public io.netty.util.concurrent.Future<Void> migrateAsync(String host, int port, int database)
RObjectAsync
migrateAsync
in interface RObjectAsync
host
- - destination hostport
- - destination portdatabase
- - destination databasepublic boolean move(int database)
RObject
public io.netty.util.concurrent.Future<Boolean> moveAsync(int database)
RObjectAsync
moveAsync
in interface RObjectAsync
true
if key was moved else false
public boolean renamenx(String newName)
RObject
newName
only if new key is not existspublic io.netty.util.concurrent.Future<Boolean> renamenxAsync(String newName)
RObjectAsync
newName
in async mode only if new key is not existsrenamenxAsync
in interface RObjectAsync
public boolean delete()
RObject
public io.netty.util.concurrent.Future<Boolean> deleteAsync()
deleteAsync
in interface RObjectAsync
Copyright © 2014–2015. All rights reserved.