ostore.read
Class ReplicaSliceReadResp

java.lang.Object
  |
  +--ostore.replica.ReplicaResp
        |
        +--ostore.read.ReplicaReadResp
              |
              +--ostore.read.ReplicaSliceReadResp
All Implemented Interfaces:
QueueElementIF, QuickSerializable

public class ReplicaSliceReadResp
extends ReplicaReadResp

Events sent from the ReplicaStage to the ClientStage responding to ReplicaSliceReadReq events.

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

Field Summary
protected  SortedMap blocks
          A VID->VerifiableBlock map containing the blocks that make up the slice read, or null.
 
Fields inherited from class ostore.read.ReplicaReadResp
missing, read, version
 
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
ReplicaSliceReadResp(InputBuffer buffer)
          Constructs a ReplicaSliceReadResp from its serialized form.
ReplicaSliceReadResp(ReplicaReadReq req, int error_code)
          Constructs a new (failed) ReplicaSliceReadResp.
ReplicaSliceReadResp(ReplicaReadReq req, VID version, Selection read, Selection missing, Map blocks)
          Constructs a new (successful) ReplicaSliceReadResp.
 
Method Summary
 Map get_blocks()
          Returns the VID->VerifiableBlock map containing the blocks make up the slice that was read.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 
Methods inherited from class ostore.read.ReplicaReadResp
get_missing, get_read, get_version, toString
 
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

blocks

protected SortedMap blocks
A VID->VerifiableBlock map containing the blocks that make up the slice read, or null.

blocks != null iff this.successful().

The hashCode of responses depend on their digest. Therefore we keep this map sorted, to ensure a deterministic serialization.

Constructor Detail

ReplicaSliceReadResp

public ReplicaSliceReadResp(ReplicaReadReq req,
                            VID version,
                            Selection read,
                            Selection missing,
                            Map blocks)
Constructs a new (successful) ReplicaSliceReadResp.

If blocks is not already a SortedMap, it is copied into one.


ReplicaSliceReadResp

public ReplicaSliceReadResp(ReplicaReadReq req,
                            int error_code)
Constructs a new (failed) ReplicaSliceReadResp.


ReplicaSliceReadResp

public ReplicaSliceReadResp(InputBuffer buffer)
                     throws QSException
Constructs a ReplicaSliceReadResp from its serialized form.

Method Detail

get_blocks

public Map get_blocks()
Returns the VID->VerifiableBlock map containing the blocks make up the slice that was 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 ReplicaReadResp
Parameters:
buffer - the output buffer to add the object to