ostore.read
Class HandleStoreReadReq

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

public class HandleStoreReadReq
extends ReadReq

Events sent from the ReplicaStage to the ReadStage requesting the latter to read a portion of a DataObject and return the bytes read.

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

Field Summary
protected  SortedMap spare_blocks
          A VID->block map containing blocks that the ReadStage may use in addition to those found in the memory cache, or null if none.
 
Fields inherited from class ostore.read.ReadReq
digest, FAIL, fault_mode, FETCH_ALL, PARTIAL, sel, target, tree_id
 
Constructor Summary
HandleStoreReadReq(InputBuffer buffer)
          Constructs a HandleStoreReadReq from its serialized form.
HandleStoreReadReq(VID target, SecureHash tree_id, Selection sel, byte fault_mode, Map spare_blocks)
          Constructs a new HandleStoreReadReq.
 
Method Summary
 Map get_spares()
          Returns the VID->block map that contains extra blocks that the ReadStage may use in addition to those found in the memory cache.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 
Methods inherited from class ostore.read.ReadReq
get_digest, get_fault_mode, get_selection, get_seq_num, get_target, get_tree_id, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

spare_blocks

protected SortedMap spare_blocks
A VID->block map containing blocks that the ReadStage may use in addition to those found in the memory cache, or null if none.

Presumably these blocks were returned with a SliceReadResp from a remote node. The ReadStage should verify any blocks used and insert them into the memory cache.

The hashCode of the request depends on its digest. Therefore we keep this map sorted, to ensure a deterministic serialization.

Constructor Detail

HandleStoreReadReq

public HandleStoreReadReq(VID target,
                          SecureHash tree_id,
                          Selection sel,
                          byte fault_mode,
                          Map spare_blocks)
Constructs a new HandleStoreReadReq.


HandleStoreReadReq

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

Method Detail

get_spares

public Map get_spares()
Returns the VID->block map that contains extra blocks that the ReadStage may use in addition to those found in the memory cache.


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