ostore.read
Class BytesReadReq

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

public class BytesReadReq
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: BytesReadReq.java,v 1.23 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
BytesReadReq(InputBuffer buffer)
          Constructs a BytesReadReq from its serialized form.
BytesReadReq(VID target, SecureHash tree_id, Selection sel, byte fault_mode, Map spare_blocks)
          Constructs a new BytesReadReq.
 
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

BytesReadReq

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


BytesReadReq

public BytesReadReq(InputBuffer buffer)
             throws QSException
Constructs a BytesReadReq 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