Class TransactionalIdsGenerator


  • @Internal
    @Deprecated
    public class TransactionalIdsGenerator
    extends Object
    Deprecated.
    Class responsible for generating transactional ids to use when communicating with Kafka.

    It guarantees that:

    • generated ids to use will never clash with ids to use from different subtasks
    • generated ids to abort will never clash with ids to abort from different subtasks
    • generated ids to use will never clash with ids to abort from different subtasks

    In other words, any particular generated id will always be assigned to one and only one subtask.

    • Constructor Detail

      • TransactionalIdsGenerator

        public TransactionalIdsGenerator​(String prefix,
                                         int subtaskIndex,
                                         int totalNumberOfSubtasks,
                                         int poolSize,
                                         int safeScaleDownFactor)
        Deprecated.
    • Method Detail

      • generateIdsToUse

        public Set<String> generateIdsToUse​(long nextFreeTransactionalId)
        Deprecated.
        Range of available transactional ids to use is: [nextFreeTransactionalId, nextFreeTransactionalId + parallelism * kafkaProducersPoolSize) loop below picks in a deterministic way a subrange of those available transactional ids based on index of this subtask.
      • generateIdsToAbort

        public Set<String> generateIdsToAbort()
        Deprecated.
        If we have to abort previous transactional id in case of restart after a failure BEFORE first checkpoint completed, we don't know what was the parallelism used in previous attempt. In that case we must guess the ids range to abort based on current configured pool size, current parallelism and safeScaleDownFactor.