de.zib.scalaris.executor
Class ScalarisChangeListOp2
java.lang.Object
de.zib.scalaris.executor.ScalarisChangeListOp2
- All Implemented Interfaces:
- ScalarisOp
- Direct Known Subclasses:
- ScalarisListAppendRemoveOp2
public abstract class ScalarisChangeListOp2
- extends Object
- implements ScalarisOp
Implements a list change operation using the append operation of Scalaris.
Supports an (optional) list counter key which is updated accordingly.
Sub-classes need to override changeList(RequestList)
to perform the
changes and issue a single AddOnNrOp
operation and
(optionally) a second AddOnNrOp
for a list counter key!
- Since:
- 3.18
- Version:
- 3.18
- Author:
- Nico Kruber, kruber@zib.de
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). |
ScalarisChangeListOp2
public ScalarisChangeListOp2(String key,
String countKey)
- Creates a new list change operation.
- Parameters:
key
- the key to change the list atcountKey
- the key for the counter of the entries in the list
(may be null)
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 phasefirstOp
- the current operation's index in the result listresults
- 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()