Class TransactionalIdsGenerator

java.lang.Object
org.apache.flink.streaming.connectors.kafka.internals.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 Summary

    Constructors
    Constructor
    Description
    TransactionalIdsGenerator(String prefix, int subtaskIndex, int totalNumberOfSubtasks, int poolSize, int safeScaleDownFactor)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TransactionalIdsGenerator

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

    • 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.