ostore.network.patchwork
Class ProbeMsg
java.lang.Object
|
+--ostore.network.NetworkMessage
|
+--ostore.network.patchwork.ProbeMsg
- All Implemented Interfaces:
- Cloneable, PatchMsg, QueueElementIF, QuickSerializable
- public final class ProbeMsg
- extends NetworkMessage
- implements QuickSerializable, PatchMsg
This is a probing message sent out by Patchwork
in order to measure statistics of other nodes.
NOTE: This class cannot be extended, because the structure of the
serialized message (the extra filler) doesn't allow for it.
- Version:
- $Id: ProbeMsg.java,v 1.3 2003/03/24 00:13:13 geels Exp $
- Author:
- Jeremy Stribling
Field Summary |
int |
data
Type-specific data |
boolean |
do_respond
Should the receiver respond? |
static int |
MINIMUM_SIZE
The smallest size a ProbeMsg can be, given all its fields |
boolean |
quick_stat
Is this a quick stat probe? |
boolean |
response
Is this a response to another probe? |
int |
seq_no
The current sequence number of this probe. |
byte |
type
The type of measurement being probed. |
Constructor Summary |
ProbeMsg(InputBuffer buffer)
|
ProbeMsg(NodeId peer,
int totalSize,
byte type,
int seqNo,
boolean response)
|
ProbeMsg(NodeId peer,
int totalSize,
byte type,
int seqNo,
boolean response,
boolean quickStat)
Constucts a probing message of a certain type, with a given
approximate size. |
MINIMUM_SIZE
public static final int MINIMUM_SIZE
- The smallest size a
ProbeMsg
can be, given all its fields
type
public byte type
- The type of measurement being probed. See
Patch
.
seq_no
public int seq_no
- The current sequence number of this probe.
response
public boolean response
- Is this a response to another probe?
do_respond
public boolean do_respond
- Should the receiver respond?
quick_stat
public boolean quick_stat
- Is this a quick stat probe?
data
public int data
- Type-specific data
ProbeMsg
public ProbeMsg(NodeId peer,
int totalSize,
byte type,
int seqNo,
boolean response)
ProbeMsg
public ProbeMsg(NodeId peer,
int totalSize,
byte type,
int seqNo,
boolean response,
boolean quickStat)
- Constucts a probing message of a certain type, with a given
approximate size. The size needs to be at least
MINIMUM_SIZE
, and if difference between it and
MINIMUM_SIZE
is not divisible by 4 it will be
rounded down to a number that is.
- Parameters:
peer
- the node to probetotalSize
- how big the message should betype
- the type of the messageseqNo
- the sequence number of this probe in the current stream
of probes to peer
response
- whether this is a responsequickStat
- whether this probe should be treated as "quick"
ProbeMsg
public ProbeMsg(InputBuffer buffer)
throws QSException
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 NetworkMessage
- Following copied from interface:
ostore.util.QuickSerializable
- Parameters:
buffer
- the output buffer to add the object to
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone
in class NetworkMessage
getType
public byte getType()
- Specified by:
getType
in interface PatchMsg
toString
public String toString()
- Overrides:
toString
in class NetworkMessage