Package org.apache.storm.metricstore.rocksdb

## Class RocksDbKey

- java.lang.Object
- - org.apache.storm.metricstore.rocksdb.RocksDbKey

- All Implemented Interfaces:
    `Comparable<RocksDbKey>`

      public class RocksDbKey
      extends Object
      implements Comparable<RocksDbKey>

  Class representing the data used as a Key in RocksDB. Keys can be used either for metadata or metrics.

  Keys are 38 bytes in size. The fields for a key are:

      <
       Field             Size         Offset

       Type                 1              0      The type maps to the KeyType enum, specifying a metric or various types of metadata
       Aggregation Level    1              1      The aggregation level for a metric (see AggLevel enum).  0 for metadata.
       TopologyId           4              2      The metadata string Id representing a topologyId for a metric, or the unique
                                                         string Id for a metadata string
       Timestamp            8              6      The timestamp for a metric, unused for metadata
       MetricId             4             14      The metadata string Id for the metric name
       ComponentId          4             18      The metadata string Id for the component Id
       ExecutorId           4             22      The metadata string Id for the executor Id
       HostId               4             26      The metadata string Id for the host Id
       Port                 4             30      The port number
       StreamId             4             34      The metadata string Id for the stream Id

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `compareTo​(RocksDbKey o)` | compares to keys on a byte by byte basis.
    `String` | `toString()` |

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

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

- - ### Method Detail

    - #### compareTo

          public int compareTo​(RocksDbKey o)

      compares to keys on a byte by byte basis.
      Specified by:
        `compareTo` in interface `Comparable<RocksDbKey>`
      Returns:
        comparison of key byte values

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`