java.lang.Object
io.camunda.zeebe.db.impl.rocksdb.transaction.ZeebeTransactionDb<ColumnFamilyNames>
- All Implemented Interfaces:
TransactionRenovator,ZeebeDb<ColumnFamilyNames>,AutoCloseable
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedZeebeTransactionDb(org.rocksdb.ColumnFamilyHandle defaultHandle, org.rocksdb.OptimisticTransactionDB optimisticTransactionDB, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings, AccessMetricsConfiguration accessMetricsConfiguration) -
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<? extends EnumValue> & EnumValue>
ZeebeTransactionDb<ColumnFamilyNames> openTransactionalDb(RocksDbOptions options, String path, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings, AccessMetricsConfiguration metrics) 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, AccessMetricsConfiguration accessMetricsConfiguration)
-
-
Method Details
-
openTransactionalDb
public static <ColumnFamilyNames extends Enum<? extends EnumValue> & EnumValue> ZeebeTransactionDb<ColumnFamilyNames> openTransactionalDb(RocksDbOptions options, String path, List<AutoCloseable> closables, RocksDbConfiguration rocksDbConfiguration, ConsistencyChecksSettings consistencyChecksSettings, AccessMetricsConfiguration metrics) 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<? extends EnumValue> & EnumValue>- 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<? extends EnumValue> & EnumValue>- Parameters:
snapshotDir- the directory where the snapshot should be stored
-
getProperty
- Specified by:
getPropertyin interfaceZeebeDb<ColumnFamilyNames extends Enum<? extends EnumValue> & EnumValue>
-
createContext
- Specified by:
createContextin interfaceZeebeDb<ColumnFamilyNames extends Enum<? extends EnumValue> & EnumValue>
-
isEmpty
Description copied from interface:ZeebeDbChecks the database if the given column is empty. -
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
-