com.streambase.sb.monitor

## Class StatsUtil.StatEncoder

- java.lang.Object
- - com.streambase.sb.monitor.StatsUtil.StatEncoder

- Enclosing class:
    StatsUtil

      public static class StatsUtil.StatEncoder
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `StatsUtil.StatEncoder.KeyType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected KeyRegistry` | `keys`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatEncoder(StatsUtil.What what, KeyRegistry keys)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Tuple` | `marshal(Tuple t, StatTuplev3 data)` Put data in StatBuffer into the tuple; after marshaling, the stat buffer is recycled.
    `StatTuplev3` | `newStatTuple()` Get a tuple from cache.
    `StatTuplev3` | `newStatTuple(int cycle, long time)`
    `void` | `recycle(StatTuplev3 data)`
    `StatTuplev3` | `unmarshal(Tuple t)` Retrieve data from tuple and returns a StatBuffer

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### keys

          protected KeyRegistry keys

  - ### Constructor Detail

    - #### StatEncoder

          public StatEncoder(StatsUtil.What what,
                             KeyRegistry keys)

  - ### Method Detail

    - #### marshal

          public Tuple marshal(Tuple t,
                               StatTuplev3 data)

      Put data in StatBuffer into the tuple; after marshaling, the stat buffer is recycled.
      Parameters:
        `t` - is the destination
        `data` - is the source
      Returns:
        the destination tuple

    - #### unmarshal

          public StatTuplev3 unmarshal(Tuple t)
                                throws NullValueException,
                                       TupleException

      Retrieve data from tuple and returns a StatBuffer
      Parameters:
        `t` -
      Returns:
        a statistics tuple
      Throws:
        `TupleException`
        `NullValueException`

    - #### newStatTuple

          public StatTuplev3 newStatTuple(int cycle,
                                          long time)

    - #### newStatTuple

          public StatTuplev3 newStatTuple()

      Get a tuple from cache. It should be thread-safe
      Returns:
        a statistics tuple

    - #### recycle

          public void recycle(StatTuplev3 data)

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.