public interface DatabaseService
| Modifier and Type | Method and Description |
|---|---|
BatchReadResult |
batchRead(BatchReadRequest batchRequest)
Performs a batch read operation and returns the results.
|
BatchWriteResult |
batchWrite(BatchWriteRequest batchRequest)
Performs a batch write operation and returns the results.
|
VersionedValue |
get(String tableName,
String key)
Reads the specified key.
|
Map<String,VersionedValue> |
getAll(String tableName)
Reads the whole table.
|
VersionedValue |
put(String tableName,
String key,
byte[] value)
Associate the key with a value.
|
boolean |
putIfAbsent(String tableName,
String key,
byte[] value)
If the specified key is not already associated with a value, associate it with the given value.
|
boolean |
putIfValueMatches(String tableName,
String key,
byte[] oldValue,
byte[] newValue)
Replaces the entry for a key only if currently mapped to a given value.
|
boolean |
putIfVersionMatches(String tableName,
String key,
byte[] value,
long version)
Sets the key to the specified value if the version in the database (for that key)
matches the specified version.
|
VersionedValue |
remove(String tableName,
String key)
Removes the key (and associated value).
|
boolean |
removeIfValueMatches(String tableName,
String key,
byte[] value)
Removes the key (and associated value) if the value in the database matches specified value.
|
boolean |
removeIfVersionMatches(String tableName,
String key,
long version)
Removes the key (and associated value) if the version in the database matches specified version.
|
VersionedValue get(String tableName, String key)
tableName - name of the table associated with this operation.key - key to read.Map<String,VersionedValue> getAll(String tableName)
tableName - name of the table associated with this operation.VersionedValue put(String tableName, String key, byte[] value)
tableName - table name in which this key/value resides.key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyboolean putIfAbsent(String tableName, String key, byte[] value)
tableName - table name in which this key/value resides.key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyboolean putIfVersionMatches(String tableName, String key, byte[] value, long version)
tableName - name of table associated with this operation.key - keyvalue - valueversion - version that should present in the database for the put to be successful.boolean putIfValueMatches(String tableName, String key, byte[] oldValue, byte[] newValue)
tableName - name of table associated with this operation.key - with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified keyVersionedValue remove(String tableName, String key)
tableName - name of table associated with this operation.key - key to removeboolean removeIfVersionMatches(String tableName, String key, long version)
tableName - name of table associated with this operation.key - key to removeversion - version that should present in the database for the remove to be successful.boolean removeIfValueMatches(String tableName, String key, byte[] value)
tableName - name of table associated with this operation.key - key to removevalue - value that should present in the database for the remove to be successful.BatchReadResult batchRead(BatchReadRequest batchRequest)
batchRequest - batch request.BatchWriteResult batchWrite(BatchWriteRequest batchRequest)
batchRequest - batch request.Copyright © 2015. All rights reserved.