public class DefaultDatabaseState extends Object implements DatabaseState<String,byte[]>
| Constructor and Description |
|---|
DefaultDatabaseState() |
| Modifier and Type | Method and Description |
|---|---|
Result<Void> |
clear(String tableName) |
boolean |
commit(org.onosproject.store.service.Transaction transaction) |
boolean |
containsKey(String tableName,
String key) |
boolean |
containsValue(String tableName,
byte[] value) |
Long |
counterAddAndGet(String counterName,
long delta) |
Long |
counterGet(String counterName) |
Long |
counterGetAndAdd(String counterName,
long delta) |
Map<String,Long> |
counters() |
Set<Map.Entry<String,org.onosproject.store.service.Versioned<byte[]>>> |
entrySet(String tableName) |
org.onosproject.store.service.Versioned<byte[]> |
get(String tableName,
String key) |
void |
init(net.kuujo.copycat.state.StateContext<DatabaseState<String,byte[]>> context)
Initializes the database state.
|
boolean |
isEmpty(String tableName) |
Set<String> |
keySet(String tableName) |
boolean |
prepare(org.onosproject.store.service.Transaction transaction) |
boolean |
prepareAndCommit(org.onosproject.store.service.Transaction transaction) |
Result<org.onosproject.store.service.Versioned<byte[]>> |
put(String tableName,
String key,
byte[] value) |
Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> |
putAndGet(String tableName,
String key,
byte[] value) |
Result<org.onosproject.store.service.Versioned<byte[]>> |
putIfAbsent(String tableName,
String key,
byte[] value) |
Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> |
putIfAbsentAndGet(String tableName,
String key,
byte[] value) |
Result<org.onosproject.store.service.Versioned<byte[]>> |
remove(String tableName,
String key) |
Result<Boolean> |
remove(String tableName,
String key,
byte[] value) |
Result<Boolean> |
remove(String tableName,
String key,
long version) |
Result<Boolean> |
replace(String tableName,
String key,
byte[] oldValue,
byte[] newValue) |
Result<Boolean> |
replace(String tableName,
String key,
long oldVersion,
byte[] newValue) |
Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> |
replaceAndGet(String tableName,
String key,
long oldVersion,
byte[] newValue) |
boolean |
rollback(org.onosproject.store.service.Transaction transaction) |
int |
size(String tableName) |
Set<String> |
tableNames() |
Collection<org.onosproject.store.service.Versioned<byte[]>> |
values(String tableName) |
public void init(net.kuujo.copycat.state.StateContext<DatabaseState<String,byte[]>> context)
DatabaseStateinit in interface DatabaseState<String,byte[]>context - The map state context.public Set<String> tableNames()
tableNames in interface DatabaseState<String,byte[]>public Map<String,Long> counters()
counters in interface DatabaseState<String,byte[]>public int size(String tableName)
size in interface DatabaseState<String,byte[]>public boolean isEmpty(String tableName)
isEmpty in interface DatabaseState<String,byte[]>public boolean containsKey(String tableName, String key)
containsKey in interface DatabaseState<String,byte[]>public boolean containsValue(String tableName, byte[] value)
containsValue in interface DatabaseState<String,byte[]>public org.onosproject.store.service.Versioned<byte[]> get(String tableName, String key)
get in interface DatabaseState<String,byte[]>public Result<org.onosproject.store.service.Versioned<byte[]>> put(String tableName, String key, byte[] value)
put in interface DatabaseState<String,byte[]>public Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> putAndGet(String tableName, String key, byte[] value)
putAndGet in interface DatabaseState<String,byte[]>public Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> putIfAbsentAndGet(String tableName, String key, byte[] value)
putIfAbsentAndGet in interface DatabaseState<String,byte[]>public Result<org.onosproject.store.service.Versioned<byte[]>> remove(String tableName, String key)
remove in interface DatabaseState<String,byte[]>public Result<Void> clear(String tableName)
clear in interface DatabaseState<String,byte[]>public Set<String> keySet(String tableName)
keySet in interface DatabaseState<String,byte[]>public Collection<org.onosproject.store.service.Versioned<byte[]>> values(String tableName)
values in interface DatabaseState<String,byte[]>public Set<Map.Entry<String,org.onosproject.store.service.Versioned<byte[]>>> entrySet(String tableName)
entrySet in interface DatabaseState<String,byte[]>public Result<org.onosproject.store.service.Versioned<byte[]>> putIfAbsent(String tableName, String key, byte[] value)
putIfAbsent in interface DatabaseState<String,byte[]>public Result<Boolean> remove(String tableName, String key, byte[] value)
remove in interface DatabaseState<String,byte[]>public Result<Boolean> remove(String tableName, String key, long version)
remove in interface DatabaseState<String,byte[]>public Result<Boolean> replace(String tableName, String key, byte[] oldValue, byte[] newValue)
replace in interface DatabaseState<String,byte[]>public Result<Boolean> replace(String tableName, String key, long oldVersion, byte[] newValue)
replace in interface DatabaseState<String,byte[]>public Result<UpdateResult<org.onosproject.store.service.Versioned<byte[]>>> replaceAndGet(String tableName, String key, long oldVersion, byte[] newValue)
replaceAndGet in interface DatabaseState<String,byte[]>public Long counterAddAndGet(String counterName, long delta)
counterAddAndGet in interface DatabaseState<String,byte[]>public Long counterGetAndAdd(String counterName, long delta)
counterGetAndAdd in interface DatabaseState<String,byte[]>public Long counterGet(String counterName)
counterGet in interface DatabaseState<String,byte[]>public boolean prepareAndCommit(org.onosproject.store.service.Transaction transaction)
prepareAndCommit in interface DatabaseState<String,byte[]>public boolean prepare(org.onosproject.store.service.Transaction transaction)
prepare in interface DatabaseState<String,byte[]>public boolean commit(org.onosproject.store.service.Transaction transaction)
commit in interface DatabaseState<String,byte[]>public boolean rollback(org.onosproject.store.service.Transaction transaction)
rollback in interface DatabaseState<String,byte[]>Copyright © 2015. All rights reserved.