public interface DistributedTransaction
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts a transaction.
|
void |
commit()
Commits a transaction.
|
void |
delete(Delete delete)
Deletes an entry from the storage through a transaction with the specified
Delete
command. |
void |
delete(java.util.List<Delete> deletes)
Deletes entries from the storage through a transaction with the specified list of
Delete commands. |
java.util.Optional<Result> |
get(Get get)
Retrieves a result from the storage through a transaction with the specified
Get
command with a primary key and returns the result. |
java.lang.String |
getId()
Returns the ID of a transaction.
|
java.util.Optional<java.lang.String> |
getNamespace()
Returns the namespace
|
java.util.Optional<java.lang.String> |
getTable()
Returns the table name
|
void |
mutate(java.util.List<? extends Mutation> mutations)
Mutates entries of the storage through a transaction with the specified list of
Mutation commands. |
void |
put(java.util.List<Put> puts)
Inserts/Updates multiple entries to the storage through a transaction with the specified list
of
Put commands. |
void |
put(Put put)
Inserts/Updates an entry to the storage through a transaction with the specified
Put
command. |
java.util.List<Result> |
scan(Scan scan)
|
void |
with(java.lang.String namespace,
java.lang.String tableName)
Sets the specified namespace and the table name as default values in the instance
|
void |
withNamespace(java.lang.String namespace)
Sets the specified namespace as a default value in the instance
|
void |
withTable(java.lang.String tableName)
Sets the specified table name as a default value in the instance
|
java.lang.String getId()
void with(java.lang.String namespace, java.lang.String tableName)
namespace
- default namespace to operate fortableName
- default table name to operate forvoid withNamespace(java.lang.String namespace)
namespace
- default namespace to operate forjava.util.Optional<java.lang.String> getNamespace()
Optional
with the namespacevoid withTable(java.lang.String tableName)
tableName
- default table name to operate forjava.util.Optional<java.lang.String> getTable()
Optional
with the table namejava.util.Optional<Result> get(Get get) throws CrudException
Get
command with a primary key and returns the result.get
- a Get
commandOptional
with the returned resultCrudException
- if the operation failedjava.util.List<Result> scan(Scan scan) throws CrudException
Scan
command with a partition key and returns a list of Result
. Results can be filtered by
specifying a range of clustering keys.scan
- a Scan
commandResult
CrudException
- if the operation failedvoid put(Put put) throws CrudException
Put
command. Note that the conditions set in Put will be ignored. Please program such conditions in
a transaction if you want to implement conditional mutation.put
- a Put
commandCrudException
- if the operation failedvoid put(java.util.List<Put> puts) throws CrudException
Put
commands. Note that the conditions set in Put will be ignored. Please program
such conditions in a transaction if you want to implement conditional mutation.puts
- a list of Put
commandsCrudException
- if the operation failedvoid delete(Delete delete) throws CrudException
Delete
command. Note that the conditions set in Delete will be ignored. Please program such conditions
in a transaction if you want to implement conditional mutation.delete
- a Delete
commandCrudException
- if the operation failedvoid delete(java.util.List<Delete> deletes) throws CrudException
Delete
commands. Note that the conditions set in Delete will be ignored. Please program such
conditions in a transaction if you want to implement conditional mutation.deletes
- a list of Delete
commandsCrudException
- if the operation failedvoid mutate(java.util.List<? extends Mutation> mutations) throws CrudException
Mutation
commands.mutations
- a list of Mutation
commandsCrudException
- if the operation failedvoid commit() throws CommitException, UnknownTransactionStatusException
CommitException
- if the operation failsUnknownTransactionStatusException
- if the status of the commit is unknownvoid abort() throws AbortException
AbortException
- if the operation fails