Interface OperationFactory
KVStore.execute.
Each operation created here operates on a single key and matches the
corresponding operation defined in KVStore. 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 durability argument is not passed, since that argument applies to the
execution of the entire batch of operations and is passed in to the
executemethod. -
ReturnValueVersion.Choiceis passed instead ofReturnValueVersion. -
An additional argument,
abortIfUnsuccessfulis passed.
The return values associated with operations similarly match the
descriptions for the corresponding methods described in in KVStore.
They are, however, retrieved differently: the status, return value, previous
value and version are packaged together in OperationResult.
-
Method Summary
Modifier and TypeMethodDescriptioncreateDelete(Key key) Create a Delete operation suitable for use as an argument to theexecutemethod.createDelete(Key key, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecutemethod.createDeleteIfVersion(Key key, Version version) Create a Delete operation suitable for use as an argument to theexecutemethod.createDeleteIfVersion(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecutemethod.Create a Put operation suitable for use as an argument to theexecutemethod.createPut(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfAbsent(Key key, Value value) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfAbsent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfPresent(Key key, Value value) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfPresent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfVersion(Key key, Value value, Version version) Create a Put operation suitable for use as an argument to theexecutemethod.createPutIfVersion(Key key, Value value, Version version, ReturnValueVersion.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 previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. -
createPut
Operation createPut(Key key, Value value, ReturnValueVersion.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 theputmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. -
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 previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
- the created Put operation
- See Also:
-
createPutIfAbsent
Operation createPutIfAbsent(Key key, Value value, ReturnValueVersion.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 theputIfAbsentmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfAbsentmethod returns null.- Returns:
- the created Put operation
- See Also:
-
createPutIfPresent
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 previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
- the created Put operation
- See Also:
-
createPutIfPresent
Operation createPutIfPresent(Key key, Value value, ReturnValueVersion.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 anOperationResult.- Parameters:
abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfPresentmethod returns null.- Returns:
- the created Put operation
- See Also:
-
createPutIfVersion
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 previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
- the created Put operation
- See Also:
-
createPutIfVersion
Operation createPutIfVersion(Key key, Value value, Version version, ReturnValueVersion.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 anOperationResult.- Parameters:
abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfVersionmethod returns null.- Returns:
- the created Put operation
- See Also:
-
createDelete
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeletemethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. -
createDelete
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeletemethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. -
createDeleteIfVersion
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeleteIfVersionmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
- the created Delete operation
- See Also:
-
createDeleteIfVersion
Operation createDeleteIfVersion(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeleteIfVersionmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when thedeleteIfVersionmethod returns false.- Returns:
- the created Delete operation
- See Also:
-