Class RdbSequence

java.lang.Object
org.yamcs.yarch.rocksdb.RdbSequence
All Implemented Interfaces:
Sequence

public class RdbSequence extends Object implements Sequence
sequence stored in the Rocksdb metadata.

The sequence will "cache" some numbers such that it does not have to update the database after each increment. If the system crashes, the numbers cached will be lost.

  • Constructor Details

    • RdbSequence

      public RdbSequence(String name, YRDB rdb, org.rocksdb.ColumnFamilyHandle cfMetadata) throws org.rocksdb.RocksDBException, YarchException
      Throws:
      org.rocksdb.RocksDBException
      YarchException
  • Method Details

    • next

      public long next() throws YarchException
      Specified by:
      next in interface Sequence
      Throws:
      YarchException
    • close

      public void close() throws YarchException
      Throws:
      YarchException
    • reset

      public void reset(long value)
      Specified by:
      reset in interface Sequence
    • get

      public long get()
      Return the current sequence value
      Specified by:
      get in interface Sequence
      Returns:
    • getName

      public static String getName(byte[] dbkey)
    • getDbKey

      public static byte[] getDbKey(String name)
    • getValue

      public static long getValue(byte[] value)