de.zib.scalaris.executor
Class ScalarisChangeListOp1

java.lang.Object
  extended by de.zib.scalaris.executor.ScalarisChangeListOp1
All Implemented Interfaces:
ScalarisOp
Direct Known Subclasses:
ScalarisListAppendRemoveOp1

public abstract class ScalarisChangeListOp1
extends Object
implements ScalarisOp

Implements a list change operation using the read and write operations of Scalaris. Supports an (optional) list counter key which is updated accordingly.

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

Constructor Summary
ScalarisChangeListOp1(String key, String countKey)
          Creates a new list change operation.
 
Method Summary
 int doPhase(int phase, int firstOp, ResultList results, RequestList requests)
          Executes the given phase.
 int workPhases()
          Gets the number of work phases needed by this operation (not including the final result verification phase).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.zib.scalaris.executor.ScalarisOp
toString
 

Constructor Detail

ScalarisChangeListOp1

public ScalarisChangeListOp1(String key,
                             String countKey)
Creates a new list change operation.

Parameters:
key - the key to change the list at
countKey - the key for the counter of the entries in the list (may be null)
Method Detail

workPhases

public int workPhases()
Description copied from interface: ScalarisOp
Gets the number of work phases needed by this operation (not including the final result verification phase).

Specified by:
workPhases in interface ScalarisOp
Returns:
number of required phases

doPhase

public final int doPhase(int phase,
                         int firstOp,
                         ResultList results,
                         RequestList requests)
                  throws OtpErlangException,
                         UnknownException,
                         IllegalArgumentException
Description copied from interface: ScalarisOp
Executes the given phase.

Specified by:
doPhase in interface ScalarisOp
Parameters:
phase - the number of the current phase
firstOp - the current operation's index in the result list
results - the results from the previous operations (may be null if there was none)
requests - the requests for the next operations (may be null if there are none, i.e. in the verification phase)
Returns:
the number of processed operations from the results list
Throws:
OtpErlangException - if an error occured verifying a result from previous operations
UnknownException - if an error occured verifying a result from previous operations
IllegalArgumentException - if the given work phase is not supported
See Also:
ScalarisOp.workPhases()