ostore.read
Class ReplicaReadReq

java.lang.Object
  |
  +--ostore.replica.ReplicaReq
        |
        +--ostore.read.ReplicaReadReq
All Implemented Interfaces:
QueueElementIF, QuickSerializable
Direct Known Subclasses:
ReplicaBytesReadReq, ReplicaMetadataReadReq, ReplicaSliceReadReq, ReplicaVersionQueryReq

public abstract class ReplicaReadReq
extends ReplicaReq

Events sent from the ClientStage to the ReplicaStage requesting the latter to read a portion of a Replica.

Version:
$Id: ReplicaReadReq.java,v 1.20 2002/07/29 18:48:53 geels Exp $
Author:
Dennis Geels

Field Summary
static byte FAIL
          A value for fault_mode instructing the ReplicaStage to give up completely.
protected  byte fault_mode
          Specifies what the ReplicaStage should do if any required blocks from the DataObject are missing from the memory cache.
static byte FETCH_ALL
          A value for fault_mode instructing the ReplicaStage to fetch missing blocks through the block manager (memory cache).
static byte INTERIM
          A value for fault_mode instructing the ReplicaStage to return as much data as possible immediately, as with PARTIAL, but continue to read the remainder of the Selection automatically, as with FETCH_ALL.
static byte PARTIAL
          A value for fault_mode instructing the ReplicaStage to read as much as possible and include in its response a Selection describing the portion of the DataObject which it could not find locally.
protected  Selection sel
          The portion of the DataObject to read, or null if none.
protected  VersionPredicate version_pred
          A predicate specifying which version(s) of the Replica (a DataObject) to read.
 
Fields inherited from class ostore.replica.ReplicaReq
digest, local, target
 
Constructor Summary
protected ReplicaReadReq(InputBuffer buffer)
          Constructs a ReplicaReadReq from its serialized form.
protected ReplicaReadReq(SecureHash target, VersionPredicate version_pred, Selection sel, byte fault_mode)
          Constructs a new ReplicaReadReq.
 
Method Summary
 byte get_fault_mode()
          Returns the code for the fault mode.
 VersionPredicate get_predicate()
          Returns the predicate specifying which version(s) of the Replica (a DataObject) to read.
 Selection get_selection()
          Returns the Selection describing the read.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Returns a human-readable representation of this ReplicaReaqReq.
 
Methods inherited from class ostore.replica.ReplicaReq
get_digest, get_seq_num, get_target, hashCode, is_local
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FAIL

public static final byte FAIL
A value for fault_mode instructing the ReplicaStage to give up completely.

See Also:
Constant Field Values

FETCH_ALL

public static final byte FETCH_ALL
A value for fault_mode instructing the ReplicaStage to fetch missing blocks through the block manager (memory cache).

See Also:
Constant Field Values

PARTIAL

public static final byte PARTIAL
A value for fault_mode instructing the ReplicaStage to read as much as possible and include in its response a Selection describing the portion of the DataObject which it could not find locally.

See Also:
Constant Field Values

INTERIM

public static final byte INTERIM
A value for fault_mode instructing the ReplicaStage to return as much data as possible immediately, as with PARTIAL, but continue to read the remainder of the Selection automatically, as with FETCH_ALL. The remainder will be returned in a second ReplicaReadResp.

See Also:
Constant Field Values

version_pred

protected VersionPredicate version_pred
A predicate specifying which version(s) of the Replica (a DataObject) to read.


sel

protected Selection sel
The portion of the DataObject to read, or null if none. Should only be null for ReplicaMetadataReadReqs.


fault_mode

protected byte fault_mode
Specifies what the ReplicaStage should do if any required blocks from the DataObject are missing from the memory cache.

Constructor Detail

ReplicaReadReq

protected ReplicaReadReq(SecureHash target,
                         VersionPredicate version_pred,
                         Selection sel,
                         byte fault_mode)
Constructs a new ReplicaReadReq.


ReplicaReadReq

protected ReplicaReadReq(InputBuffer buffer)
                  throws QSException
Constructs a ReplicaReadReq from its serialized form.

Method Detail

get_predicate

public VersionPredicate get_predicate()
Returns the predicate specifying which version(s) of the Replica (a DataObject) to read.


get_selection

public Selection get_selection()
Returns the Selection describing the read.


get_fault_mode

public byte get_fault_mode()
Returns the code for the fault mode.


serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class ReplicaReq
Parameters:
buffer - the output buffer to add the object to

toString

public String toString()
Returns a human-readable representation of this ReplicaReaqReq.

Overrides:
toString in class ReplicaReq