ostore.read
Class SliceReadResp

java.lang.Object
  |
  +--ostore.read.ReadResp
        |
        +--ostore.read.SliceReadResp
All Implemented Interfaces:
QueueElementIF, QuickSerializable

public class SliceReadResp
extends ReadResp

Events sent from the ReadStage to the ReplicaStage responding to SliceReadReq events.

Version:
$Id: SliceReadResp.java,v 1.19 2002/07/29 18:48:54 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.ReadResp
digest, error_code, missing, NO_ERROR, read, READ_ERROR, req_digest
 
Constructor Summary
SliceReadResp(InputBuffer buffer)
          Constructs a SliceReadResp from its serialized form.
SliceReadResp(ReadReq req, int error_code)
          Constructs a new (failed) SliceReadResp.
SliceReadResp(ReadReq req, Selection read, Selection missing, Map blocks)
          Constructs a new (successful) SliceReadResp.
 
Method Summary
 Map get_blocks()
          Returns the VID->block map containing the blocks that make up the slice read.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 
Methods inherited from class ostore.read.ReadResp
get_digest, get_error_code, get_missing, get_read, get_req_digest, get_req_seq_num, hashCode, successful, toString
 
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

SliceReadResp

public SliceReadResp(ReadReq req,
                     Selection read,
                     Selection missing,
                     Map blocks)
Constructs a new (successful) SliceReadResp.

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


SliceReadResp

public SliceReadResp(ReadReq req,
                     int error_code)
Constructs a new (failed) SliceReadResp.


SliceReadResp

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

Method Detail

get_blocks

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