Package io.camunda.zeebe.db
Interface ZeebeDb<ColumnFamilyType extends Enum<ColumnFamilyType>>
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ZeebeTransactionDb
The zeebe database, to store key value pairs in different column families. The column families
are defined via the specified
ZeebeDb enum.
To access and store key-value pairs in a specific column family the user needs to create a
ColumnFamily instance via createColumnFamily(Enum, TransactionContext, DbKey, DbValue).
If the column family instances are created they are type save, which makes it possible that only
the defined key and value types are stored in the column family.
-
Method Summary
Modifier and TypeMethodDescription<KeyType extends DbKey,ValueType extends DbValue>
ColumnFamily<KeyType,ValueType> createColumnFamily(ColumnFamilyType 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.getProperty(String propertyName) booleanisEmpty(ColumnFamilyType column, TransactionContext context) Checks the database if the given column is empty.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
createColumnFamily
<KeyType extends DbKey,ValueType extends DbValue> ColumnFamily<KeyType,ValueType> createColumnFamily(ColumnFamilyType 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. 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.
- 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
Creates a snapshot of the current database in the given directory.- Parameters:
snapshotDir- the directory where the snapshot should be stored
-
getProperty
-
createContext
TransactionContext createContext() -
isEmpty
Checks the database if the given column is empty.- Parameters:
column- the enum of the column to checkcontext- the context that is used to access the database- Returns:
trueif the column is empty, otherwisefalse
-