Package io.camunda.zeebe.db
Interface ColumnFamily<KeyType extends DbKey,ValueType extends DbValue>
- Type Parameters:
KeyType- the type of the keysValueType- the type of the values
Represents an column family, where it is possible to store keys of type
ColumnFamily and
corresponding values of type ColumnFamily.-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the key-value pair with the given key from the column family.booleanChecks for key existence in the column family.voidforEach(BiConsumer<KeyType, ValueType> consumer) Visits the key-value pairs, which are stored in the column family.voidVisits the values, which are stored in the column family.The corresponding stored value in the column family to the given key.booleanisEmpty()Checks if the column family has any entry.voidStores the key-value pair into the column family.voidwhileEqualPrefix(DbKey keyPrefix, KeyValuePairVisitor<KeyType, ValueType> visitor) Visits the key-value pairs, which are stored in the column family and which have the same common prefix.voidwhileEqualPrefix(DbKey keyPrefix, BiConsumer<KeyType, ValueType> visitor) Visits the key-value pairs, which are stored in the column family and which have the same common prefix.voidwhileTrue(KeyValuePairVisitor<KeyType, ValueType> visitor) Visits the key-value pairs, which are stored in the column family.
-
Method Details
-
put
Stores the key-value pair into the column family.- Parameters:
key- the keyvalue- the value
-
get
The corresponding stored value in the column family to the given key.- Parameters:
key- the key- Returns:
- if the key was found in the column family then the value, otherwise null
-
forEach
Visits the values, which are stored in the column family. The ordering depends on the key.The given consumer accepts the values. Be aware that the given DbValue wraps the stored value and reflects the current iteration step. The DbValue should not be stored, since it will change his internal value during iteration.
- Parameters:
consumer- the consumer which accepts the value
-
forEach
Visits the key-value pairs, which are stored in the column family. The ordering depends on the key.Similar to
forEach(BiConsumer).- Parameters:
consumer- the consumer which accepts the key-value pairs
-
whileTrue
Visits the key-value pairs, which are stored in the column family. The ordering depends on the key. The visitor can indicate via the return value, whether the iteration should continue or not. This means if the visitor returns false the iteration will stop.Similar to
forEach(BiConsumer).- Parameters:
visitor- the visitor which visits the key-value pairs
-
whileEqualPrefix
Visits the key-value pairs, which are stored in the column family and which have the same common prefix. The ordering depends on the key.Similar to
forEach(BiConsumer).- Parameters:
keyPrefix- the prefix which should have the keys in commonvisitor- the visitor which visits the key-value pairs
-
whileEqualPrefix
Visits the key-value pairs, which are stored in the column family and which have the same common prefix. The ordering depends on the key. The visitor can indicate via the return value, whether the iteration should continue or * not. This means if the visitor returns false the iteration will stop.Similar to
and #whileTrue(KeyValuePairVisitor).- Parameters:
keyPrefix- the prefix which should have the keys in commonvisitor- the visitor which visits the key-value pairs
-
delete
Deletes the key-value pair with the given key from the column family.- Parameters:
key- the key which identifies the pair
-
exists
Checks for key existence in the column family.- Parameters:
key- the key to look for- Returns:
- true if the key exist in this column family, false otherwise
-
isEmpty
boolean isEmpty()Checks if the column family has any entry.- Returns:
trueif the column family has no entry
-