Interface TableOperationFactory
TableAPI.execute
.
Each operation created here operates on a single row and matches the
corresponding operation defined in TableAPI. For example, the Operation
generated by the createPut
method corresponds to the
put
method. The argument pattern for creating the
operation is similar. It differs in the following respects:
-
The writeOptions argument is not passed, since that argument applies to the
execution of the entire batch of operations and is passed in to the
execute
method. -
ReturnRow.Choice
is passed instead ofReturnRow
. -
An additional argument,
abortIfUnsuccessful
is passed.
The return values associated with operations similarly match the
descriptions for the corresponding methods described in in TableAPI
.
They are, however, retrieved differently: the status, return value, previous
value and version are packaged together in TableOperationResult
.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateDelete
(PrimaryKey key, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method.createDeleteIfVersion
(PrimaryKey key, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method.createPut
(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfAbsent
(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfPresent
(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfVersion
(Row row, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.
-
Method Details
-
createPut
Create a Put operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of theput
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
. -
createPutIfAbsent
Create a Put operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of theputIfAbsent
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
. -
createPutIfPresent
TableOperation createPutIfPresent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of theputIfPresent
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
. -
createPutIfVersion
TableOperation createPutIfVersion(Row row, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of theputIfVersion
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
. -
createDelete
TableOperation createDelete(PrimaryKey key, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of thedelete
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
. -
createDeleteIfVersion
TableOperation createDeleteIfVersion(PrimaryKey key, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method. The semantics of the returned operation are identical to that of thedeleteIfVersion
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when thedeleteIfVersion
method returns null.- Returns:
- the created Delete operation
- See Also:
-