Interface AsyncMap<K,V>
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clear all entries in the mapentries()Get the entries of the map, asynchronously.Get a value from the map, asynchronously.keys()Get the keys of the map, asynchronously.Put a value in the map, asynchronously.Likeput(K, V)but specifying a time to live for the entry.putIfAbsent(K k, V v) Put the entry only if there is no entry with the key already present.putIfAbsent(K k, V v, long ttl) LinkputIfAbsent(K, V)but specifying a time to live for the entry.Remove a value from the map, asynchronously.removeIfPresent(K k, V v) Remove a value from the map, only if entry already exists with same value.Replace the entry only if it is currently mapped to some valueReplace the entry only if it is currently mapped to some valuereplaceIfPresent(K k, V oldValue, V newValue) Replace the entry only if it is currently mapped to a specific valuereplaceIfPresent(K k, V oldValue, V newValue, long ttl) Replace the entry only if it is currently mapped to a specific valuesize()Provide the number of entries in the mapvalues()Get the values of the map, asynchronously.
-
Method Details
-
get
-
put
-
put
-
putIfAbsent
Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.- Parameters:
k- the keyv- the value- Returns:
- a future notified some time later with the async result.
-
putIfAbsent
LinkputIfAbsent(K, V)but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.- Parameters:
k- the keyv- the valuettl- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
remove
-
removeIfPresent
-
replace
-
replace
-
replaceIfPresent
-
replaceIfPresent
Replace the entry only if it is currently mapped to a specific value- Parameters:
k- the keyoldValue- the existing valuenewValue- the new valuettl- The time to live (in ms) for the entry- Returns:
- a future notified some time later with the async result.
-
clear
-
size
-
keys
Get the keys of the map, asynchronously.Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError.- Returns:
- a future notified some time later with the async result.
-
values
Get the values of the map, asynchronously.Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError.- Returns:
- a future notified some time later with the async result.
-
entries
Get the entries of the map, asynchronously.Use this method with care as the map may contain a large number of entries, which may not fit entirely in memory of a single node. In this case, the invocation will result in an
OutOfMemoryError.- Returns:
- a future notified some time later with the async result.
-