Class ZeebeTransactionDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>

java.lang.Object
io.camunda.zeebe.db.impl.rocksdb.transaction.ZeebeTransactionDb<ColumnFamilyNames>
All Implemented Interfaces:
TransactionRenovator, ZeebeDb<ColumnFamilyNames>, AutoCloseable

public class ZeebeTransactionDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>> extends Object implements ZeebeDb<ColumnFamilyNames>, TransactionRenovator
  • Constructor Details

  • Method Details

    • openTransactionalDb

      public static <ColumnFamilyNames extends Enum<ColumnFamilyNames>> ZeebeTransactionDb<ColumnFamilyNames> openTransactionalDb(org.rocksdb.Options options, String path, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings) throws org.rocksdb.RocksDBException
      Throws:
      org.rocksdb.RocksDBException
    • getPrefixReadOptions

      protected org.rocksdb.ReadOptions getPrefixReadOptions()
    • getDefaultHandle

      protected org.rocksdb.ColumnFamilyHandle getDefaultHandle()
    • getReadOptionsNativeHandle

      protected long getReadOptionsNativeHandle()
    • getDefaultNativeHandle

      protected long getDefaultNativeHandle()
    • createColumnFamily

      public <KeyType extends DbKey, ValueType extends DbValue> ColumnFamily<KeyType,ValueType> createColumnFamily(ColumnFamilyNames columnFamily, TransactionContext context, KeyType keyInstance, ValueType valueInstance)
      Description copied from interface: ZeebeDb
      Creates an instance of a specific column family to access and store key-value pairs in that column family. The key and value instances are used to ensure type safety.

      If the column family instance is created only the defined key and value types can be stored in the column family.

      Specified by:
      createColumnFamily in interface ZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
      Type Parameters:
      KeyType - the key type of the column family
      ValueType - the value type of the column family
      Parameters:
      columnFamily - the enum instance of the column family
      keyInstance - this instance defines the type of the column family key type
      valueInstance - this instance defines the type of the column family value type
      Returns:
      the created column family instance
    • createSnapshot

      public void createSnapshot(File snapshotDir)
      Description copied from interface: ZeebeDb
      Creates a snapshot of the current database in the given directory.
      Specified by:
      createSnapshot in interface ZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
      Parameters:
      snapshotDir - the directory where the snapshot should be stored
    • getProperty

      public Optional<String> getProperty(String propertyName)
      Specified by:
      getProperty in interface ZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
    • createContext

      public TransactionContext createContext()
      Specified by:
      createContext in interface ZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
    • isEmpty

      public boolean isEmpty(ColumnFamilyNames columnFamilyName, TransactionContext context)
      Description copied from interface: ZeebeDb
      Checks the database if the given column is empty.
      Specified by:
      isEmpty in interface ZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
      Parameters:
      columnFamilyName - the enum of the column to check
      context - the context that is used to access the database
      Returns:
      true if the column is empty, otherwise false
    • renewTransaction

      public org.rocksdb.Transaction renewTransaction(org.rocksdb.Transaction oldTransaction)
      Description copied from interface: TransactionRenovator
      Renews the given oldTransaction such that it can reused.
      Specified by:
      renewTransaction in interface TransactionRenovator
      Parameters:
      oldTransaction - the old transaction which becomes new
      Returns:
      the renewed transaction
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable