bamboo.dmgr
Class FetchMerkleTreeNodeResp

java.lang.Object
  extended by ostore.network.NetworkMessage
      extended by bamboo.dmgr.FetchMerkleTreeNodeResp
All Implemented Interfaces:
Cloneable, ostore.util.QuickSerializable, QueueElementIF

public class FetchMerkleTreeNodeResp
extends ostore.network.NetworkMessage

FetchMerkleTreeNodeResp.

Wire format:

BytesData
0-19 IP header
20-27UdpCC ACK
28-35UdpCC SEQ
36-55hash
56 leaf
57-64seq
65-68number of child hashes
69- child hashes, 20 bytes apiece

As such, the first 69 bytes of the message are header. Assuming an MTU of 500 bytes, we can thus pack (500-69)/20 = 21 child pointers into a single packet response. Assuming an MTU of 1500 bytes, we can pack 71 in. So a "good" expansion factor for the tree would be 2^6=64.

Version:
$Id: FetchMerkleTreeNodeResp.java,v 1.5 2004/02/10 21:24:04 srhea Exp $
Author:
Sean C. Rhea

Field Summary
 LinkedList children
          The children of the node, if the hashes didn't match and the node was not a leaf.
 byte[] hash
          Our hash for this node.
 boolean leaf
          Whether this node was a leaf.
 long seq
          To pair it up with its request.
 
Fields inherited from class ostore.network.NetworkMessage
comp_q, est_rtt_ms, inbound, peer, sender, timeout_sec, user_data, wait_ms
 
Constructor Summary
FetchMerkleTreeNodeResp(ostore.util.InputBuffer buffer)
           
FetchMerkleTreeNodeResp(ostore.util.NodeId dest, byte[] h, boolean l, LinkedList c, long s)
           
 
Method Summary
 Object clone()
           
 void serialize(ostore.util.OutputBuffer buffer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hash

public byte[] hash
Our hash for this node.


leaf

public boolean leaf
Whether this node was a leaf.


children

public LinkedList children
The children of the node, if the hashes didn't match and the node was not a leaf. These are always hashes of the same length as hash, and there are always 2^expansion of them in left-to-right, smallest-to-largest order.


seq

public long seq
To pair it up with its request.

Constructor Detail

FetchMerkleTreeNodeResp

public FetchMerkleTreeNodeResp(ostore.util.NodeId dest,
                               byte[] h,
                               boolean l,
                               LinkedList c,
                               long s)

FetchMerkleTreeNodeResp

public FetchMerkleTreeNodeResp(ostore.util.InputBuffer buffer)
                        throws ostore.util.QSException
Throws:
ostore.util.QSException
Method Detail

serialize

public void serialize(ostore.util.OutputBuffer buffer)
Specified by:
serialize in interface ostore.util.QuickSerializable
Overrides:
serialize in class ostore.network.NetworkMessage

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class ostore.network.NetworkMessage
Throws:
CloneNotSupportedException

toString

public String toString()
Overrides:
toString in class ostore.network.NetworkMessage