ostore.read
Class HandleStoreReadResp

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

public class HandleStoreReadResp
extends ReadResp

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

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

Field Summary
protected  HandleStore _handleStore
          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
HandleStoreReadResp(InputBuffer buffer)
          Constructs a HandleStoreReadResp from its serialized form.
HandleStoreReadResp(ReadReq req, int error_code)
          Constructs a new (failed) HandleStoreReadResp.
HandleStoreReadResp(ReadReq req, Selection read, Selection missing, HandleStore handleStore)
          Constructs a new (successful) HandleStoreReadResp.
 
Method Summary
 HandleStore getHandleStore()
          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

_handleStore

protected HandleStore _handleStore
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

HandleStoreReadResp

public HandleStoreReadResp(ReadReq req,
                           Selection read,
                           Selection missing,
                           HandleStore handleStore)
Constructs a new (successful) HandleStoreReadResp.

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


HandleStoreReadResp

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


HandleStoreReadResp

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

Method Detail

getHandleStore

public HandleStore getHandleStore()
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