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 Summary
ConstructorsModifierConstructorDescriptionprotectedZeebeTransactionDb(org.rocksdb.ColumnFamilyHandle defaultHandle, org.rocksdb.OptimisticTransactionDB optimisticTransactionDB, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<KeyType extends DbKey,ValueType extends DbValue>
ColumnFamily<KeyType,ValueType> createColumnFamily(ColumnFamilyNames columnFamily, TransactionContext context, KeyType keyInstance, ValueType valueInstance) Creates an instance of a specific column family to access and store key-value pairs in that column family.voidcreateSnapshot(File snapshotDir) Creates a snapshot of the current database in the given directory.protected org.rocksdb.ColumnFamilyHandleprotected longprotected org.rocksdb.ReadOptionsgetProperty(String propertyName) protected longbooleanisEmpty(ColumnFamilyNames columnFamilyName, TransactionContext context) Checks the database if the given column is empty.static <ColumnFamilyNames extends Enum<ColumnFamilyNames>>
ZeebeTransactionDb<ColumnFamilyNames>openTransactionalDb(org.rocksdb.Options options, String path, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings) org.rocksdb.TransactionrenewTransaction(org.rocksdb.Transaction oldTransaction) Renews the given oldTransaction such that it can reused.
-
Constructor Details
-
ZeebeTransactionDb
protected ZeebeTransactionDb(org.rocksdb.ColumnFamilyHandle defaultHandle, org.rocksdb.OptimisticTransactionDB optimisticTransactionDB, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings)
-
-
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:ZeebeDbCreates 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:
createColumnFamilyin interfaceZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>- Type Parameters:
KeyType- the key type of the column familyValueType- the value type of the column family- Parameters:
columnFamily- the enum instance of the column familykeyInstance- this instance defines the type of the column family key typevalueInstance- this instance defines the type of the column family value type- Returns:
- the created column family instance
-
createSnapshot
Description copied from interface:ZeebeDbCreates a snapshot of the current database in the given directory.- Specified by:
createSnapshotin interfaceZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>- Parameters:
snapshotDir- the directory where the snapshot should be stored
-
getProperty
- Specified by:
getPropertyin interfaceZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
-
createContext
- Specified by:
createContextin interfaceZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>
-
isEmpty
Description copied from interface:ZeebeDbChecks the database if the given column is empty.- Specified by:
isEmptyin interfaceZeebeDb<ColumnFamilyNames extends Enum<ColumnFamilyNames>>- Parameters:
columnFamilyName- the enum of the column to checkcontext- the context that is used to access the database- Returns:
trueif the column is empty, otherwisefalse
-
renewTransaction
public org.rocksdb.Transaction renewTransaction(org.rocksdb.Transaction oldTransaction) Description copied from interface:TransactionRenovatorRenews the given oldTransaction such that it can reused.- Specified by:
renewTransactionin interfaceTransactionRenovator- Parameters:
oldTransaction- the old transaction which becomes new- Returns:
- the renewed transaction
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-