public class ReadRandomFromListOp extends PartialReadOp
Modifier and Type | Class and Description |
---|---|
static class |
ReadRandomFromListOp.Result
Result type of random_from_list operations.
|
Constructor and Description |
---|
ReadRandomFromListOp(OtpErlangString key)
Constructor
|
ReadRandomFromListOp(String key)
Constructor
|
Modifier and Type | Method and Description |
---|---|
OtpErlangObject |
getErlang(boolean compressed)
Gets the erlang representation of the operation.
|
ReadRandomFromListOp.Result |
processResult()
Processes the result set by
Operation.setResult(OtpErlangObject, boolean) . |
ReadRandomFromListOp.Result |
processResultSingle()
Processes the result set by
Operation.setResult(OtpErlangObject, boolean)
assuming that operation was committed. |
String |
toString() |
getKey, getResult, getResultCompressed, setResult
public ReadRandomFromListOp(OtpErlangString key)
key
- the key to readpublic ReadRandomFromListOp(String key)
key
- the key to readpublic OtpErlangObject getErlang(boolean compressed)
Operation
compressed
- whether the value part in the term should be encoded, i.e.
compressed into an Erlang binary, or notpublic ReadRandomFromListOp.Result processResult() throws NotFoundException, EmptyListException, NotAListException, UnknownException
Operation
Operation.setResult(OtpErlangObject, boolean)
.
Note: the created value is not cached!NotFoundException
- if the requested key does not existEmptyListException
- if the stored value is an empty list but the op requires a
non-empty listNotAListException
- if the previously stored value was no listUnknownException
- if any other error occurspublic ReadRandomFromListOp.Result processResultSingle() throws NotFoundException, EmptyListException, NotAListException, UnknownException
TransactionSingleOpOperation
Operation.setResult(OtpErlangObject, boolean)
assuming that operation was committed.
In contrast to Operation.processResult()
operations like WriteOp
will throw a proper AbortException
for their commit part instead
of an UnknownException
.
Note: the created value is not cached!NotFoundException
- if the requested key does not existEmptyListException
- if the stored value is an empty list but the op requires a
non-empty listNotAListException
- if the previously stored value was no listUnknownException
- if any other error occurs