ostore.oil.patchwork
Class PatchworkModel.Observation

java.lang.Object
  |
  +--ostore.oil.patchwork.PatchworkModel.Observation
All Implemented Interfaces:
QuickSerializable
Enclosing class:
PatchworkModel

public static class PatchworkModel.Observation
extends Object
implements QuickSerializable

A Patchwork.Observation object contains an observation recorded by the patchwork stage.

Version:
$Id: PatchworkModel.java,v 1.2 2001/12/04 19:43:17 strib Exp $
Author:
Jeremy Stribling

Constructor Summary
PatchworkModel.Observation(byte[] data, int[] offset)
          Construct a Patchwork.Observation from its QuickSerializable form.
PatchworkModel.Observation(NodeId observed_peer, double value, int type)
          Record the observed double value of type type for the specified node id peer.
 
Method Summary
 void to_bytes(byte[] data, int[] offset)
          Specified by ostore.util.QuickSerializable
 String toString()
          Returns a string representation of this Observation
 int type_code()
          Specified by ostore.util.QuickSerializable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatchworkModel.Observation

public PatchworkModel.Observation(byte[] data,
                                  int[] offset)
                           throws QSException
Construct a Patchwork.Observation from its QuickSerializable form. See to_bytes(byte[], int[]).

PatchworkModel.Observation

public PatchworkModel.Observation(NodeId observed_peer,
                                  double value,
                                  int type)
Record the observed double value of type type for the specified node id peer.
Parameters:
observed_peer - the node to which the statistic belongs
value - the value of the observed statistic
type - the type of statistic (i.e. LATENCY, etc)
Method Detail

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
Specified by ostore.util.QuickSerializable
Specified by:
to_bytes in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Parameters:
data - The byte array to store into, or null.
offset - A single element array whose first element is the index in data to begin writing at on function entry, and which on function exit has been incremented by the number of bytes written.

type_code

public int type_code()
Specified by ostore.util.QuickSerializable
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class

toString

public String toString()
Returns a string representation of this Observation
Overrides:
toString in class Object