Class DbKeyGenerator

    • Constructor Detail

      • DbKeyGenerator

        public DbKeyGenerator​(int partitionId,
                              ZeebeDb zeebeDb,
                              TransactionContext transactionContext)
        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 Detail

      • 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 interface KeyGenerator
        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 interface KeyGeneratorControls
        Parameters:
        key - the new key