Package org.yamcs.yarch.rocksdb
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 Summary
Constructors Constructor Description RdbSequence(String name, YRDB rdb, org.rocksdb.ColumnFamilyHandle cfMetadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longget()Return the current sequence valuestatic byte[]getDbKey(String name)static StringgetName(byte[] dbkey)static longgetValue(byte[] value)longnext()voidreset(long value)
-
-
-
Constructor Detail
-
RdbSequence
public RdbSequence(String name, YRDB rdb, org.rocksdb.ColumnFamilyHandle cfMetadata) throws org.rocksdb.RocksDBException, YarchException
- Throws:
org.rocksdb.RocksDBExceptionYarchException
-
-
Method Detail
-
next
public long next() throws YarchException- Specified by:
nextin interfaceSequence- Throws:
YarchException
-
close
public void close() throws YarchException- Throws:
YarchException
-
get
public long get()
Return the current sequence value- Returns:
-
getName
public static String getName(byte[] dbkey)
-
getDbKey
public static byte[] getDbKey(String name)
-
getValue
public static long getValue(byte[] value)
-
-