Class DbKeyGenerator
java.lang.Object
io.camunda.zeebe.engine.state.processing.DbKeyGenerator
- All Implemented Interfaces:
KeyGenerator
,KeyGeneratorControls
-
Constructor Summary
ConstructorDescriptionDbKeyGenerator
(int partitionId, ZeebeDb zeebeDb, TransactionContext transactionContext) Initializes the key state with the corresponding partition id, so that unique keys are generated over all partitions. -
Method Summary
Modifier and TypeMethodDescriptionlong
nextKey()
Returns the next key of a record and updates the key generator.void
setKeyIfHigher
(long key) Set the given value as the new key if it is higher than the current key.
-
Constructor Details
-
DbKeyGenerator
Initializes the key state with the corresponding partition id, so that unique keys are generated over all partitions.- Parameters:
partitionId
- the partition to determine the key start value
-
-
Method Details
-
nextKey
public long nextKey()Description copied from interface:KeyGenerator
Returns the next key of a record and updates the key generator.- Specified by:
nextKey
in interfaceKeyGenerator
- Returns:
- the next key for a new record
-
setKeyIfHigher
public void setKeyIfHigher(long key) Description copied from interface:KeyGeneratorControls
Set the given value as the new key if it is higher than the current key.- Specified by:
setKeyIfHigher
in interfaceKeyGeneratorControls
- Parameters:
key
- the new key
-