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
execute
method. -
ReturnValueVersion.Choice
is passed instead ofReturnValueVersion
. -
An additional argument,
abortIfUnsuccessful
is 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 theexecute
method.createDelete
(Key key, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method.createDeleteIfVersion
(Key key, Version version) Create a Delete operation suitable for use as an argument to theexecute
method.createDeleteIfVersion
(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Delete operation suitable for use as an argument to theexecute
method.Create a Put operation suitable for use as an argument to theexecute
method.createPut
(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfAbsent
(Key key, Value value) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfAbsent
(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfPresent
(Key key, Value value) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfPresent
(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfVersion
(Key key, Value value, Version version) Create a Put operation suitable for use as an argument to theexecute
method.createPutIfVersion
(Key key, Value value, Version version, ReturnValueVersion.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 previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is 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 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 anOperationResult
. -
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 previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is 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 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 anOperationResult
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when theputIfAbsent
method returns null.- Returns:
- the created Put operation
- See Also:
-
createPutIfPresent
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 previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is 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 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 anOperationResult
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when theputIfPresent
method returns null.- Returns:
- the created Put operation
- See Also:
-
createPutIfVersion
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 previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is 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 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 anOperationResult
.- Parameters:
abortIfUnsuccessful
- is true if this operation should cause theexecute
transaction to abort when the operation fails, where failure is the condition when theputIfVersion
method returns null.- Returns:
- the created Put operation
- See Also:
-
createDelete
Create a Delete operation suitable for use as an argument to theexecute
method. The semantics of the returned operation when executed are identical to that of thedelete
method.The previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is available as anOperationResult
. -
createDelete
Create a Delete operation suitable for use as an argument to theexecute
method. The semantics of the returned operation when executed 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 anOperationResult
. -
createDeleteIfVersion
Create a Delete operation suitable for use as an argument to theexecute
method. The semantics of the returned operation when executed are identical to that of thedeleteIfVersion
method.The previous value is not returned by this method and the
abortIfUnsuccessful
property is false.The result of evaluating the operation, or the resulting exception, after the call to
execute
is 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 theexecute
method. The semantics of the returned operation when executed 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 anOperationResult
.- 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 false.- Returns:
- the created Delete operation
- See Also:
-