de.zib.scalaris.executor
Class ScalarisReadOp

java.lang.Object
  extended by de.zib.scalaris.executor.ScalarisReadOp
All Implemented Interfaces:
ScalarisOp

public class ScalarisReadOp
extends Object
implements ScalarisOp

Implements a read operation (tolerates "not found" and in this case contains null).

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

Constructor Summary
ScalarisReadOp(String key)
          Creates a read operation.
 
Method Summary
 int doPhase(int phase, int firstOp, ResultList results, RequestList requests)
          Executes the given phase.
 String getKey()
          Gets the key to read from.
 ErlangValue getValue()
          Gets the value from the read.
 String toString()
           
 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, wait, wait, wait
 

Constructor Detail

ScalarisReadOp

public ScalarisReadOp(String key)
Creates a read operation.

Parameters:
key - the key to read from
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()

toString

public String toString()
Specified by:
toString in interface ScalarisOp
Overrides:
toString in class Object

getKey

public String getKey()
Gets the key to read from.

Returns:
the key

getValue

public ErlangValue getValue()
Gets the value from the read.

Returns:
the value that has been read (may be null