public interface DatabaseProxy<K,V>
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<CommitResponse> |
commit(Transaction transaction)
Commit the specified transaction.
|
CompletableFuture<Long> |
counterAddAndGet(String counterName,
long delta)
Atomically add the given value to current value of the specified counter.
|
CompletableFuture<Boolean> |
counterCompareAndSet(String counterName,
long expectedValue,
long update)
Atomically sets the given counter to the specified update value if and only if the current value is equal to the
expected value.
|
CompletableFuture<Long> |
counterGet(String counterName)
Returns the current value of the specified atomic counter.
|
CompletableFuture<Long> |
counterGetAndAdd(String counterName,
long delta)
Atomically add the given value to current value of the specified counter.
|
CompletableFuture<Map<String,Long>> |
counters()
Returns a mapping from counter name to next value.
|
CompletableFuture<Void> |
counterSet(String counterName,
long value)
Atomically sets the given value to current value of the specified counter.
|
CompletableFuture<Result<Void>> |
mapClear(String mapName)
Clears the map.
|
CompletableFuture<Boolean> |
mapContainsKey(String mapName,
K key)
Checks whether the map contains a key.
|
CompletableFuture<Boolean> |
mapContainsValue(String mapName,
V value)
Checks whether the map contains a value.
|
CompletableFuture<Set<Map.Entry<K,org.onosproject.store.service.Versioned<V>>>> |
mapEntrySet(String mapName)
Gets a set of entries in the map.
|
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
mapGet(String mapName,
K key)
Gets a value from the map.
|
CompletableFuture<Boolean> |
mapIsEmpty(String mapName)
Checks whether the map is empty.
|
CompletableFuture<Set<K>> |
mapKeySet(String mapName)
Gets a set of keys in the map.
|
CompletableFuture<Set<String>> |
maps()
Returns a set of all map names.
|
CompletableFuture<Integer> |
mapSize(String mapName)
Returns the number of entries in map.
|
CompletableFuture<Result<UpdateResult<K,V>>> |
mapUpdate(String mapName,
K key,
org.onlab.util.Match<V> valueMatch,
org.onlab.util.Match<Long> versionMatch,
V value)
Updates the map.
|
CompletableFuture<Collection<org.onosproject.store.service.Versioned<V>>> |
mapValues(String mapName)
Gets a collection of values in the map.
|
CompletableFuture<Boolean> |
prepare(Transaction transaction)
Prepare the specified transaction for commit.
|
CompletableFuture<CommitResponse> |
prepareAndCommit(Transaction transaction)
Prepare and commit the specified transaction.
|
CompletableFuture<byte[]> |
queuePeek(String queueName)
Returns but does not remove an entry from the queue.
|
CompletableFuture<byte[]> |
queuePop(String queueName)
Removes an entry from the queue if the queue is non-empty.
|
CompletableFuture<Void> |
queuePush(String queueName,
byte[] entry)
Inserts an entry into the queue.
|
CompletableFuture<Long> |
queueSize(String queueName)
Returns the size of queue.
|
CompletableFuture<Boolean> |
rollback(Transaction transaction)
Rollback the specified transaction.
|
CompletableFuture<Set<String>> maps()
CompletableFuture<Map<String,Long>> counters()
CompletableFuture<Integer> mapSize(String mapName)
mapName - map nameCompletableFuture<Boolean> mapIsEmpty(String mapName)
mapName - map nameCompletableFuture<Boolean> mapContainsKey(String mapName, K key)
mapName - map namekey - key to check.CompletableFuture<Boolean> mapContainsValue(String mapName, V value)
mapName - map namevalue - The value to check.CompletableFuture<org.onosproject.store.service.Versioned<V>> mapGet(String mapName, K key)
mapName - map namekey - The key to get.CompletableFuture<Result<UpdateResult<K,V>>> mapUpdate(String mapName, K key, org.onlab.util.Match<V> valueMatch, org.onlab.util.Match<Long> versionMatch, V value)
mapName - map namekey - The key to setvalueMatch - match for checking existing valueversionMatch - match for checking existing versionvalue - new valueCompletableFuture<Result<Void>> mapClear(String mapName)
mapName - map nameCompletableFuture<Set<K>> mapKeySet(String mapName)
mapName - map nameCompletableFuture<Collection<org.onosproject.store.service.Versioned<V>>> mapValues(String mapName)
mapName - map nameCompletableFuture<Set<Map.Entry<K,org.onosproject.store.service.Versioned<V>>>> mapEntrySet(String mapName)
mapName - map nameCompletableFuture<Long> counterAddAndGet(String counterName, long delta)
counterName - counter namedelta - value to addCompletableFuture<Long> counterGetAndAdd(String counterName, long delta)
counterName - counter namedelta - value to addCompletableFuture<Void> counterSet(String counterName, long value)
counterName - counter namevalue - value to setCompletableFuture<Boolean> counterCompareAndSet(String counterName, long expectedValue, long update)
counterName - counter nameexpectedValue - value to use for equivalence checkupdate - value to set if expected value is current valueCompletableFuture<Long> counterGet(String counterName)
counterName - counter nameCompletableFuture<Long> queueSize(String queueName)
queueName - queue nameCompletableFuture<Void> queuePush(String queueName, byte[] entry)
queueName - queue nameentry - queue entryCompletableFuture<byte[]> queuePop(String queueName)
queueName - queue nameCompletableFuture<byte[]> queuePeek(String queueName)
queueName - queue nameCompletableFuture<CommitResponse> prepareAndCommit(Transaction transaction)
transaction - transaction to commit (after preparation)CompletableFuture<Boolean> prepare(Transaction transaction)
transaction - transaction to prepare (for commit)CompletableFuture<CommitResponse> commit(Transaction transaction)
transaction - transaction to commitCompletableFuture<Boolean> rollback(Transaction transaction)
transaction - transaction to rollbackCopyright © 2016. All rights reserved.