public 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:
execute method.
ReturnValueVersion.Choice is passed instead of ReturnValueVersion.
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.
| Modifier and Type | Method and Description |
|---|---|
Operation |
createDelete(Key key)
Create a Delete operation suitable for use as an argument to the
execute method. |
Operation |
createDelete(Key key,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to the
execute method. |
Operation |
createDeleteIfVersion(Key key,
Version version)
Create a Delete operation suitable for use as an argument to the
execute method. |
Operation |
createDeleteIfVersion(Key key,
Version version,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to the
execute method. |
Operation |
createPut(Key key,
Value value)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPut(Key key,
Value value,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfAbsent(Key key,
Value value)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfAbsent(Key key,
Value value,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfPresent(Key key,
Value value)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfPresent(Key key,
Value value,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfVersion(Key key,
Value value,
Version version)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation |
createPutIfVersion(Key key,
Value value,
Version version,
ReturnValueVersion.Choice prevReturn,
boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to the
execute method. |
Operation createPut(Key key, Value value)
execute method. The semantics of the returned operation
are identical to that of the put 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 an
OperationResult.
Operation createPut(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
are identical to that of the put method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
Operation createPutIfAbsent(Key key, Value value)
execute method. The semantics of the returned operation
are identical to that of the putIfAbsent
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 an
OperationResult.
putIfAbsent,
executeOperation createPutIfAbsent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
are identical to that of the putIfAbsent
method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
abortIfUnsuccessful - is true if this operation should cause the
execute transaction to abort when the operation
fails, where failure is the condition when the putIfAbsent method returns null.putIfAbsent,
executeOperation createPutIfPresent(Key key, Value value)
execute method. The semantics of the returned operation
are identical to that of the putIfPresent
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 an
OperationResult.
putIfPresent,
executeOperation createPutIfPresent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
are identical to that of the putIfPresent
method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
abortIfUnsuccessful - is true if this operation should cause the
execute transaction to abort when the operation
fails, where failure is the condition when the putIfPresent method returns null.putIfPresent,
executeOperation createPutIfVersion(Key key, Value value, Version version)
execute method. The semantics of the returned operation
are identical to that of the putIfVersion
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 an
OperationResult.
putIfVersion,
executeOperation createPutIfVersion(Key key, Value value, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
are identical to that of the putIfVersion
method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
abortIfUnsuccessful - is true if this operation should cause the
execute transaction to abort when the operation
fails, where failure is the condition when the putIfVersion method returns null.putIfVersion,
executeOperation createDelete(Key key)
execute method. The semantics of the returned operation
when executed are identical to that of the delete
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 an
OperationResult.
Operation createDelete(Key key, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
when executed are identical to that of the delete
method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
Operation createDeleteIfVersion(Key key, Version version)
execute method. The semantics of the returned operation
when executed are identical to that of the deleteIfVersion 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 an
OperationResult.
deleteIfVersion,
executeOperation createDeleteIfVersion(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
execute method. The semantics of the returned operation
when executed are identical to that of the deleteIfVersion method.
The result of evaluating the operation, or the resulting exception,
after the call to execute is available as an
OperationResult.
abortIfUnsuccessful - is true if this operation should cause the
execute transaction to abort when the operation
fails, where failure is the condition when the deleteIfVersion method returns false.deleteIfVersion,
executeCopyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.