bamboo.dmgr
Class FetchMerkleTreeNodeResp
java.lang.Object
ostore.network.NetworkMessage
bamboo.dmgr.FetchMerkleTreeNodeResp
- All Implemented Interfaces:
- Cloneable, ostore.util.QuickSerializable, QueueElementIF
public class FetchMerkleTreeNodeResp
- extends ostore.network.NetworkMessage
FetchMerkleTreeNodeResp.
Wire format:
| Bytes | Data |
| 0-19 | IP header |
| 20-27 | UdpCC ACK |
| 28-35 | UdpCC SEQ |
| 36-55 | hash |
| 56 | leaf |
| 57-64 | seq |
| 65-68 | number 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 |
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.
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
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