ostore.read
Class ReplicaReadResp

java.lang.Object
  |
  +--ostore.replica.ReplicaResp
        |
        +--ostore.read.ReplicaReadResp
All Implemented Interfaces:
QueueElementIF, QuickSerializable
Direct Known Subclasses:
ReplicaBytesReadResp, ReplicaMetadataReadResp, ReplicaSliceReadResp, ReplicaVersionQueryResp

public abstract class ReplicaReadResp
extends ReplicaResp

A superclass for events sent from the ReplicaStage to the ClientStage responding to ReplicaReadReq events.

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

Field Summary
protected  Selection missing
          The portion of the Replica that was not successfully read.
protected  Selection read
          The portion of the Replica that was successfully read, or null.
protected  VID version
          The id for the version of the Replica that was read, or null.
 
Fields inherited from class ostore.replica.ReplicaResp
digest, error_code, local, NO_ERROR, NOT_OPEN, OBJECT_NOT_FOUND, READ_ERROR, req_digest, target, VERSION_PREDICATE_NOT_SATISFIED
 
Constructor Summary
protected ReplicaReadResp(InputBuffer buffer)
          Constructs a ReplicaReadResp from its serialized form.
protected ReplicaReadResp(ReplicaReadReq req, int error_code)
          Constructs a new (failed) ReplicaReadResp.
protected ReplicaReadResp(ReplicaReadReq req, VID version, Selection read, Selection missing)
          Constructs a new (successful) ReplicaReadResp.
 
Method Summary
 Selection get_missing()
          Returns the Selection which describes the portion of the Replica that was not successfuly read.
 Selection get_read()
          Returns the Selection which describes the portion of the Replica that was read.
 VID get_version()
          Returns id for the version of the Replica that was read.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Returns a human-readable representation of this ReplicaReadResp.
 
Methods inherited from class ostore.replica.ReplicaResp
get_digest, get_error_code, get_req_digest, get_target, hashCode, is_local, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

version

protected VID version
The id for the version of the Replica that was read, or null.

version != null iff this.successful().


read

protected Selection read
The portion of the Replica that was successfully read, or null.


missing

protected Selection missing
The portion of the Replica that was not successfully read. The union of read and missing should equal the original requested Selection.

Constructor Detail

ReplicaReadResp

protected ReplicaReadResp(ReplicaReadReq req,
                          VID version,
                          Selection read,
                          Selection missing)
Constructs a new (successful) ReplicaReadResp.

This constructor applies for responses which denote partial success.


ReplicaReadResp

protected ReplicaReadResp(ReplicaReadReq req,
                          int error_code)
Constructs a new (failed) ReplicaReadResp.


ReplicaReadResp

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

Method Detail

get_version

public VID get_version()
Returns id for the version of the Replica that was read.


get_read

public Selection get_read()
Returns the Selection which describes the portion of the Replica that was read.


get_missing

public Selection get_missing()
Returns the Selection which describes the portion of the Replica that was not successfuly read.


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 ReplicaResp
Parameters:
buffer - the output buffer to add the object to

toString

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

Overrides:
toString in class ReplicaResp