Interface TableOperationFactory
-
public interface TableOperationFactory
A factory to create operations that can be batched for execution byTableAPI.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 theput
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 inTableOperationResult
.- Since:
- 3.0
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TableOperation
createDelete(PrimaryKey key, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to theexecute
method.TableOperation
createDeleteIfVersion(PrimaryKey key, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to theexecute
method.TableOperation
createPut(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecute
method.TableOperation
createPutIfAbsent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecute
method.TableOperation
createPutIfPresent(Row row, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecute
method.TableOperation
createPutIfVersion(Row row, Version versionMatch, ReturnRow.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecute
method.
-
-
-
Method Detail
-
createPut
TableOperation createPut(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 theput
method.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anTableOperationResult
.
-
createPutIfAbsent
TableOperation createPutIfAbsent(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 theputIfAbsent
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 theput
method returns null.- Returns:
- the created Put operation
- See Also:
putIfAbsent
,execute
-
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
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when theput
method returns null.- Returns:
- the created Put operation
- See Also:
putIfPresent
,execute
-
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
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when theput
method returns null.- Returns:
- the created Put operation
- See Also:
putIfVersion
,execute
-
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:
deleteIfVersion
,execute
-
-