Class ZeebeTransaction

java.lang.Object
io.camunda.zeebe.db.impl.rocksdb.transaction.ZeebeTransaction
All Implemented Interfaces:
ZeebeDbTransaction, AutoCloseable

public class ZeebeTransaction extends Object implements ZeebeDbTransaction, AutoCloseable
  • Constructor Summary

    Constructors
    Constructor
    Description
    ZeebeTransaction(org.rocksdb.Transaction transaction, TransactionRenovator transactionRenovator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    Commits the transaction and writes the data into the database.
    void
    delete(long columnFamilyHandle, byte[] key, int keyLength)
     
    byte[]
    get(long columnFamilyHandle, long readOptionsHandle, byte[] key, int keyLength)
     
    org.rocksdb.RocksIterator
    newIterator(org.rocksdb.ReadOptions options, org.rocksdb.ColumnFamilyHandle handle)
     
    void
    put(long columnFamilyHandle, byte[] key, int keyLength, byte[] value, int valueLength)
     
    void
    Rolls the transaction back to the latest commit, discards all changes in between.
    void
    Runs the commands like delete, put etc.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ZeebeTransaction

      public ZeebeTransaction(org.rocksdb.Transaction transaction, TransactionRenovator transactionRenovator)
  • Method Details

    • put

      public void put(long columnFamilyHandle, byte[] key, int keyLength, byte[] value, int valueLength) throws Exception
      Throws:
      Exception
    • get

      public byte[] get(long columnFamilyHandle, long readOptionsHandle, byte[] key, int keyLength) throws Exception
      Throws:
      Exception
    • delete

      public void delete(long columnFamilyHandle, byte[] key, int keyLength) throws Exception
      Throws:
      Exception
    • newIterator

      public org.rocksdb.RocksIterator newIterator(org.rocksdb.ReadOptions options, org.rocksdb.ColumnFamilyHandle handle)
    • run

      public void run(TransactionOperation operations) throws Exception
      Description copied from interface: ZeebeDbTransaction
      Runs the commands like delete, put etc. in the current transaction. Access of different column families inside this transaction are possible.

      Reading key-value pairs via get or an iterator is also possible and will reflect changes, which are made during the transaction.

      Specified by:
      run in interface ZeebeDbTransaction
      Parameters:
      operations - the operations
      Throws:
      ZeebeDbException - is thrown on an unexpected error in the database layer
      RuntimeException - is thrown on an unexpected error in executing the operations
      Exception
    • commit

      public void commit() throws org.rocksdb.RocksDBException
      Description copied from interface: ZeebeDbTransaction
      Commits the transaction and writes the data into the database.
      Specified by:
      commit in interface ZeebeDbTransaction
      Throws:
      org.rocksdb.RocksDBException
    • rollback

      public void rollback() throws org.rocksdb.RocksDBException
      Description copied from interface: ZeebeDbTransaction
      Rolls the transaction back to the latest commit, discards all changes in between.
      Specified by:
      rollback in interface ZeebeDbTransaction
      Throws:
      org.rocksdb.RocksDBException
    • close

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