eu.reservoir.monitoring.distribution
Class MeasurementDecoder

java.lang.Object
  extended by eu.reservoir.monitoring.distribution.MeasurementDecoder
Direct Known Subclasses:
MeasurementDecoderWithNames

public class MeasurementDecoder
extends java.lang.Object

Convert to a byte array to a measurement.


Constructor Summary
MeasurementDecoder()
          Construct a MeasurementDecoder.
 
Method Summary
 Measurement decode(java.io.DataInput in)
          Decode the Measurement from a DataOutput object.
protected  ProbeAttributeType decodeType()
          Decode a type
protected  java.lang.Object decodeValue(ProbeAttributeType type)
          Decode a value
protected  int readInt()
          Read an Integer from the input.
protected  MList readList()
          Read a list from the input.
protected  Table readTable()
          Read a table from the input.
protected  java.lang.String readUTF()
          Read a UTF strinh from the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementDecoder

public MeasurementDecoder()
Construct a MeasurementDecoder.

Method Detail

decode

public Measurement decode(java.io.DataInput in)
                   throws java.io.IOException,
                          TypeException
Decode the Measurement from a DataOutput object. The message is encoded and it's structure is:
 +------------------------------------------------------------------------+
 | seq no (long) | options (byte) [bit 0 : 0 = no names / 1 = with names] |
 +------------------------------------------------------------------------+
 |  probe id (long) | type (utf string)  | timestamp (long)               |
 +------------------------------------------------------------------------+
 | time delta (long) | service id (long) | group id (long) | attr count   |
 +------------------------------------------------------------------------+
 | attr0 field no (int) | attr0 type (byte) | attr0 value (depends)       |
 +------------------------------------------------------------------------+
 | ....                                                                   |
 +------------------------------------------------------------------------+
 | attrN field no (int) | attrN type (byte) | attrN value (depends)       |
 +------------------------------------------------------------------------+
 

Throws:
java.io.IOException
TypeException

decodeType

protected ProbeAttributeType decodeType()
                                 throws java.io.IOException,
                                        TypeException
Decode a type

Throws:
java.io.IOException
TypeException

decodeValue

protected java.lang.Object decodeValue(ProbeAttributeType type)
                                throws java.io.IOException,
                                       TypeException
Decode a value

Throws:
java.io.IOException
TypeException

readInt

protected int readInt()
               throws java.io.IOException
Read an Integer from the input.

Throws:
java.io.IOException

readUTF

protected java.lang.String readUTF()
                            throws java.io.IOException
Read a UTF strinh from the input.

Throws:
java.io.IOException

readTable

protected Table readTable()
                   throws java.io.IOException,
                          TypeException
Read a table from the input.

Throws:
java.io.IOException
TypeException

readList

protected MList readList()
                  throws java.io.IOException,
                         TypeException
Read a list from the input.

Throws:
java.io.IOException
TypeException


RESERVOIR Monitoring 0.6.4