de.zib.scalaris.operations
Class CommitOp

java.lang.Object
  extended by de.zib.scalaris.operations.CommitOp
All Implemented Interfaces:
Operation, TransactionOperation

public class CommitOp
extends Object
implements TransactionOperation

An operation committing a transaction.

Since:
3.18
Version:
3.18
Author:
Nico Kruber, kruber@zib.de

Constructor Summary
CommitOp()
          Constructor
 
Method Summary
 OtpErlangObject getErlang(boolean compressed)
          Gets the erlang representation of the operation.
 OtpErlangString getKey()
          Gets the key the operation is working on (if available)
 OtpErlangObject getResult()
          Gets the (raw Erlang) result set via Operation.setResult(OtpErlangObject, boolean).
 boolean getResultCompressed()
          Determines if the result set via Operation.setResult(OtpErlangObject, boolean) is compressed or not.
static void processResult_commit(OtpErlangObject received_raw, boolean compressed)
          Processes the received_raw term from erlang interpreting it as a result from a commit operation.
 Object processResult()
          Processes the result set by Operation.setResult(OtpErlangObject, boolean).
 void setResult(OtpErlangObject resultRaw, boolean compressed)
          Sets the raw erlang result value.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommitOp

public CommitOp()
Constructor

Method Detail

getErlang

public OtpErlangObject getErlang(boolean compressed)
Description copied from interface: Operation
Gets the erlang representation of the operation.

Specified by:
getErlang in interface Operation
Parameters:
compressed - whether the value part in the term should be encoded, i.e. compressed into an Erlang binary, or not
Returns:
erlang representation for api_tx:req_list

getKey

public OtpErlangString getKey()
Description copied from interface: Operation
Gets the key the operation is working on (if available)

Specified by:
getKey in interface Operation
Returns:
the key or null

setResult

public void setResult(OtpErlangObject resultRaw,
                      boolean compressed)
Description copied from interface: Operation
Sets the raw erlang result value. It can be processed using Operation.processResult().

Specified by:
setResult in interface Operation
Parameters:
resultRaw - the result
compressed - whether the value inside the result is compressed or not

getResult

public OtpErlangObject getResult()
Description copied from interface: Operation
Gets the (raw Erlang) result set via Operation.setResult(OtpErlangObject, boolean).

Specified by:
getResult in interface Operation
Returns:
the result object or null if not set

getResultCompressed

public boolean getResultCompressed()
Description copied from interface: Operation
Determines if the result set via Operation.setResult(OtpErlangObject, boolean) is compressed or not.

Specified by:
getResultCompressed in interface Operation
Returns:
true if compressed, false otherwise, undefined if no result was set

processResult

public Object processResult()
                     throws AbortException,
                            UnknownException
Description copied from interface: Operation
Processes the result set by Operation.setResult(OtpErlangObject, boolean). Note: the created value is not cached!

Specified by:
processResult in interface Operation
Returns:
a (potentially) read value (may be null)
Throws:
AbortException - if a commit failed
UnknownException - if any other error occurs

toString

public String toString()
Overrides:
toString in class Object

processResult_commit

public static final void processResult_commit(OtpErlangObject received_raw,
                                              boolean compressed)
                                       throws AbortException,
                                              UnknownException
Processes the received_raw term from erlang interpreting it as a result from a commit operation. NOTE: this method should not be called manually by an application and may change without prior notice!

Parameters:
received_raw - the object to process
compressed - whether the transfer of values is compressed or not
Throws:
AbortException - if the commit of the commit failed
UnknownException - if any other error occurs