Class ZeebeTransaction
java.lang.Object
io.camunda.zeebe.db.impl.rocksdb.transaction.ZeebeTransaction
- All Implemented Interfaces:
ZeebeDbTransaction,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionZeebeTransaction(org.rocksdb.Transaction transaction, TransactionRenovator transactionRenovator) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcommit()Commits the transaction and writes the data into the database.voiddelete(long columnFamilyHandle, byte[] key, int keyLength) byte[]get(long columnFamilyHandle, long readOptionsHandle, byte[] key, int keyLength) org.rocksdb.RocksIteratornewIterator(org.rocksdb.ReadOptions options, org.rocksdb.ColumnFamilyHandle handle) voidput(long columnFamilyHandle, byte[] key, int keyLength, byte[] value, int valueLength) voidrollback()Rolls the transaction back to the latest commit, discards all changes in between.voidrun(TransactionOperation operations) Runs the commands like delete, put etc.
-
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
- Throws:
Exception
-
newIterator
public org.rocksdb.RocksIterator newIterator(org.rocksdb.ReadOptions options, org.rocksdb.ColumnFamilyHandle handle) -
run
Description copied from interface:ZeebeDbTransactionRuns 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:
runin interfaceZeebeDbTransaction- Parameters:
operations- the operations- Throws:
ZeebeDbException- is thrown on an unexpected error in the database layerRuntimeException- is thrown on an unexpected error in executing the operationsException
-
commit
public void commit() throws org.rocksdb.RocksDBExceptionDescription copied from interface:ZeebeDbTransactionCommits the transaction and writes the data into the database.- Specified by:
commitin interfaceZeebeDbTransaction- Throws:
org.rocksdb.RocksDBException
-
rollback
public void rollback() throws org.rocksdb.RocksDBExceptionDescription copied from interface:ZeebeDbTransactionRolls the transaction back to the latest commit, discards all changes in between.- Specified by:
rollbackin interfaceZeebeDbTransaction- Throws:
org.rocksdb.RocksDBException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-