ostore.network
Class NetworkMessage

java.lang.Object
  |
  +--ostore.network.NetworkMessage
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable
Direct Known Subclasses:
AuthenticationMsg, CloseConnectionMsg, IdentityMessage, LatTest.Msg, Network.NatHackMsg, NonceAckMsg, QTreeCloseMsg, QTreeCloseMsgAck, QTreeDownMsg, QTreeDownMsgAck, QTreeGroupMsg, QTreeGroupMsgAck, QTreeRepairMsg, QTreeStateMsg, QTreeUpMsg, QTreeUpMsgAck, SimpleTest.Msg, StreamMicroBenchmarkMessage, TagMicroBenchmarkMessage, TputMicroBenchmarkMessage, TputTest.Msg

public abstract class NetworkMessage
extends Object
implements QueueElementIF, QuickSerializable, Cloneable


Field Summary
 SinkIF comp_q
          A completion queue to enqueue a success or failure on after this message is successfully acknowledged or times out tries times, respectively; the enqueued object will be of type NetworkMessageResult; if this field is null, no event will be enqueued.
 long est_rtt_ms
          The sending node's estimate of the round trip time between it and the receiving node, or -1 if this information is not available.
 boolean inbound
           
 NodeId peer
          If inbound=true then peer is the NodeId of the node where this message came from; otherwise, it's the NodeId of the node where this message should be sent.
 NodeId sender
          DO NOT TOUCH THIS FIELD.
 int tries
          For outbound messages, the number of times to attempt sending the message before giving up; for inbound messages, the number of times the sender sent the message, including this one, or -1 if this information is unknown.
 Object user_data
          A value to place in the NetworkMessageResult so that the calling stage can associate the result with this request.
 long wait_ms
          The time in milliseconds that this message spent in the sending node's outbound queue waiting for the transport channel to be available.
 
Constructor Summary
NetworkMessage(InputBuffer buffer)
           
NetworkMessage(NodeId peer, boolean inbound)
           
 
Method Summary
 Object clone()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

peer

public NodeId peer
If inbound=true then peer is the NodeId of the node where this message came from; otherwise, it's the NodeId of the node where this message should be sent.


inbound

public boolean inbound

sender

public NodeId sender
DO NOT TOUCH THIS FIELD. That said, one of you will ignore me; if you are that person, you had better understand ostore.dispatch.Classifier and ostore.network.MultiplexedNetwork.


tries

public int tries
For outbound messages, the number of times to attempt sending the message before giving up; for inbound messages, the number of times the sender sent the message, including this one, or -1 if this information is unknown. To get the number of times the message was dropped by the network before being received (if tries != -1), use tries-1. Depending on the underlying network layer, this field may be ignored (for outbound messages).


wait_ms

public long wait_ms
The time in milliseconds that this message spent in the sending node's outbound queue waiting for the transport channel to be available.


est_rtt_ms

public long est_rtt_ms
The sending node's estimate of the round trip time between it and the receiving node, or -1 if this information is not available.


comp_q

public SinkIF comp_q
A completion queue to enqueue a success or failure on after this message is successfully acknowledged or times out tries times, respectively; the enqueued object will be of type NetworkMessageResult; if this field is null, no event will be enqueued. Depending on the underlying network layer, this field may be ignored.


user_data

public Object user_data
A value to place in the NetworkMessageResult so that the calling stage can associate the result with this request. Depending on the underlying network layer, this field may be ignored.

Constructor Detail

NetworkMessage

public NetworkMessage(NodeId peer,
                      boolean inbound)

NetworkMessage

public NetworkMessage(InputBuffer buffer)
               throws QSException
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
CloneNotSupportedException

toString

public String toString()
Overrides:
toString in class Object