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
executemethod. -
ReturnRow.Choiceis passed instead ofReturnRow. -
An additional argument,
abortIfUnsuccessfulis 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 theexecutemethod.createDeleteIfVersion(PrimaryKey key, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecutemethod.createPut(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfAbsent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfPresent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfVersion(Row row, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.
-
Method Details
-
createPut
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anTableOperationResult. -
createPutIfAbsent
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfAbsentmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anTableOperationResult. -
createPutIfPresent
TableOperation createPutIfPresent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfPresentmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis 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 theexecutemethod. The semantics of the returned operation are identical to that of theputIfVersionmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anTableOperationResult. -
createDelete
TableOperation createDelete(PrimaryKey key, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of thedeletemethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis 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 theexecutemethod. The semantics of the returned operation are identical to that of thedeleteIfVersionmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anTableOperationResult.- Parameters:
abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when thedeleteIfVersionmethod returns null.- Returns:
- the created Delete operation
- See Also:
-