K - key typeV - value typepublic class CachingAsyncConsistentMap<K,V> extends DelegatingAsyncConsistentMap<K,V>
AsyncConsistentMap that caches entries on read.
The cache entries are automatically invalidated when updates are detected either locally or remotely.
This implementation only attempts to serve cached entries for get
calls. All other calls skip the cache and directly go the backing map.
| Constructor and Description |
|---|
CachingAsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap<K,V> backingMap)
Default constructor.
|
CachingAsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap<K,V> backingMap,
int cacheSize)
Constructor to configure cache size.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
clear() |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
computeIf(K key,
Predicate<? super V> condition,
BiFunction<? super K,? super V,? extends V> remappingFunction) |
CompletableFuture<Void> |
destroy() |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
get(K key) |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
put(K key,
V value) |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
putAndGet(K key,
V value) |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
remove(K key) |
CompletableFuture<Boolean> |
remove(K key,
long version) |
CompletableFuture<Boolean> |
remove(K key,
V value) |
CompletableFuture<Boolean> |
replace(K key,
long oldVersion,
V newValue) |
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
replace(K key,
V value) |
CompletableFuture<Boolean> |
replace(K key,
V oldValue,
V newValue) |
addListener, addStatusChangeListener, applicationId, commit, containsKey, containsValue, entrySet, equals, hashCode, keySet, name, prepare, prepareAndCommit, putIfAbsent, removeListener, removeStatusChangeListener, rollback, size, statusChangeListeners, toString, valuespublic CachingAsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap<K,V> backingMap)
backingMap - a distributed, strongly consistent map for backingpublic CompletableFuture<Void> destroy()
public CompletableFuture<org.onosproject.store.service.Versioned<V>> get(K key)
public CompletableFuture<org.onosproject.store.service.Versioned<V>> computeIf(K key, Predicate<? super V> condition, BiFunction<? super K,? super V,? extends V> remappingFunction)
public CompletableFuture<org.onosproject.store.service.Versioned<V>> put(K key, V value)
public CompletableFuture<org.onosproject.store.service.Versioned<V>> putAndGet(K key, V value)
public CompletableFuture<org.onosproject.store.service.Versioned<V>> remove(K key)
public CompletableFuture<Void> clear()
public CompletableFuture<Boolean> remove(K key, V value)
public CompletableFuture<Boolean> remove(K key, long version)
public CompletableFuture<org.onosproject.store.service.Versioned<V>> replace(K key, V value)
public CompletableFuture<Boolean> replace(K key, V oldValue, V newValue)
public CompletableFuture<Boolean> replace(K key, long oldVersion, V newValue)
Copyright © 2016. All rights reserved.