public interface DatabaseProxy<K,V>
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Result<Void>> |
clear(String tableName)
Clears the table.
|
CompletableFuture<Boolean> |
commit(org.onosproject.store.service.Transaction transaction)
Commit the specified transaction.
|
CompletableFuture<Boolean> |
containsKey(String tableName,
K key)
Checks whether the table contains a key.
|
CompletableFuture<Boolean> |
containsValue(String tableName,
V value)
Checks whether the table contains a value.
|
CompletableFuture<Long> |
counterAddAndGet(String counterName,
long delta)
Atomically add the given value to current value of the specified counter.
|
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<Set<Map.Entry<K,org.onosproject.store.service.Versioned<V>>>> |
entrySet(String tableName)
Gets a set of entries in the table.
|
CompletableFuture<org.onosproject.store.service.Versioned<V>> |
get(String tableName,
K key)
Gets a value from the table.
|
CompletableFuture<Boolean> |
isEmpty(String tableName)
Checks whether the table is empty.
|
CompletableFuture<Set<K>> |
keySet(String tableName)
Gets a set of keys in the table.
|
CompletableFuture<Boolean> |
prepare(org.onosproject.store.service.Transaction transaction)
Prepare the specified transaction for commit.
|
CompletableFuture<Boolean> |
prepareAndCommit(org.onosproject.store.service.Transaction transaction)
Prepare and commit the specified transaction.
|
CompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> |
put(String tableName,
K key,
V value)
Puts a value in the table.
|
CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> |
putAndGet(String tableName,
K key,
V value)
Puts a value in the table.
|
CompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> |
putIfAbsent(String tableName,
K key,
V value)
Puts a value in the table if the given key does not exist.
|
CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> |
putIfAbsentAndGet(String tableName,
K key,
V value)
Puts a value in the table.
|
CompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> |
remove(String tableName,
K key)
Removes a value from the table.
|
CompletableFuture<Result<Boolean>> |
remove(String tableName,
K key,
long version)
Removes a key and if the existing version for that key matches the specified version.
|
CompletableFuture<Result<Boolean>> |
remove(String tableName,
K key,
V value)
Removes a key and if the existing value for that key matches the specified value.
|
CompletableFuture<Result<Boolean>> |
replace(String tableName,
K key,
long oldVersion,
V newValue)
Replaces the entry for the specified key only if currently mapped to the specified version.
|
CompletableFuture<Result<Boolean>> |
replace(String tableName,
K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped to the specified value.
|
CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> |
replaceAndGet(String tableName,
K key,
long oldVersion,
V newValue)
Replaces the entry for the specified key only if currently mapped to the specified version.
|
CompletableFuture<Boolean> |
rollback(org.onosproject.store.service.Transaction transaction)
Rollback the specified transaction.
|
CompletableFuture<Integer> |
size(String tableName)
Gets the table size.
|
CompletableFuture<Set<String>> |
tableNames()
Returns a set of all tables names.
|
CompletableFuture<Collection<org.onosproject.store.service.Versioned<V>>> |
values(String tableName)
Gets a collection of values in the table.
|
CompletableFuture<Set<String>> tableNames()
CompletableFuture<Map<String,Long>> counters()
CompletableFuture<Integer> size(String tableName)
tableName - table nameCompletableFuture<Boolean> isEmpty(String tableName)
tableName - table nameCompletableFuture<Boolean> containsKey(String tableName, K key)
tableName - table namekey - The key to check.CompletableFuture<Boolean> containsValue(String tableName, V value)
tableName - table namevalue - The value to check.CompletableFuture<org.onosproject.store.service.Versioned<V>> get(String tableName, K key)
tableName - table namekey - The key to get.CompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> put(String tableName, K key, V value)
tableName - table namekey - The key to set.value - The value to set.CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> putAndGet(String tableName, K key, V value)
tableName - table namekey - The key to set.value - The value to set.CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> putIfAbsentAndGet(String tableName, K key, V value)
tableName - table namekey - The key to set.value - The value to set.CompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> remove(String tableName, K key)
tableName - table namekey - The key to remove.CompletableFuture<Result<Void>> clear(String tableName)
tableName - table nameCompletableFuture<Set<K>> keySet(String tableName)
tableName - table nameCompletableFuture<Collection<org.onosproject.store.service.Versioned<V>>> values(String tableName)
tableName - table nameCompletableFuture<Set<Map.Entry<K,org.onosproject.store.service.Versioned<V>>>> entrySet(String tableName)
tableName - table nameCompletableFuture<Result<org.onosproject.store.service.Versioned<V>>> putIfAbsent(String tableName, K key, V value)
tableName - table namekey - The key to set.value - The value to set if the given key does not exist.CompletableFuture<Result<Boolean>> remove(String tableName, K key, V value)
tableName - table namekey - The key to remove.value - The value to remove.CompletableFuture<Result<Boolean>> remove(String tableName, K key, long version)
tableName - table namekey - The key to remove.version - The expected version.CompletableFuture<Result<Boolean>> replace(String tableName, K key, V oldValue, V newValue)
tableName - table namekey - The key to replace.oldValue - The value to replace.newValue - The value with which to replace the given key and value.CompletableFuture<Result<Boolean>> replace(String tableName, K key, long oldVersion, V newValue)
tableName - table namekey - The key to updateoldVersion - existing version in the map for this replace to succeed.newValue - The value with which to replace the given key and version.CompletableFuture<Result<UpdateResult<org.onosproject.store.service.Versioned<V>>>> replaceAndGet(String tableName, K key, long oldVersion, V newValue)
tableName - table namekey - The key to updateoldVersion - existing version in the map for this replace to succeed.newValue - The value with which to replace the given key and version.CompletableFuture<Long> counterAddAndGet(String counterName, long delta)
counterName - counter namedelta - value to addCompletableFuture<Long> counterGetAndAdd(String counterName, long delta)
counterName - counter namedelta - value to addCompletableFuture<Long> counterGet(String counterName)
counterName - counter nameCompletableFuture<Boolean> prepareAndCommit(org.onosproject.store.service.Transaction transaction)
transaction - transaction to commit (after preparation)CompletableFuture<Boolean> prepare(org.onosproject.store.service.Transaction transaction)
transaction - transaction to prepare (for commit)CompletableFuture<Boolean> commit(org.onosproject.store.service.Transaction transaction)
transaction - transaction to commitCompletableFuture<Boolean> rollback(org.onosproject.store.service.Transaction transaction)
transaction - transaction to rollbackCopyright © 2015. All rights reserved.