akshay-aggarwal opened a new pull request #11968:
URL: https://github.com/apache/flink/pull/11968
## What is the purpose of the change
This change enables event time alignment for FlinkKafkaConsumer.
## Brief change log
- Takes 2 new configurations eventTimeAlignmentIntervalMillis (the interval
in which sync should occur) and eventTimeAlignmentThresholdMillis (the
threshold value for unalignment beyond which the partition will be paused)
- When periodic watermarks are used, and above parameters are set it will
start a new thread to check the alignment in KafkaFetcher
- We keep track of the watermark timestamp at a partition level and then
compute the global mininum using GlobalAggregateManager, and the list of
partitions to pause
- Since KafkaFetcher and KafkaConsumerThread are 2 threads, we make use of a
EventTimeAlignmentHandover to pass the partitions to the consumer
- In KafkaConsumerThread run loop, we check if there are any updates in the
EventTimeAlignmentHandover pausedPartitions and apply the changes to the
KafkaConsumer
## Verifying this change
This change added tests and can be verified as follows:
- Manually verfied the change by running a local Flink job with
parallelism 2, and which listens to 2 kafka topics.
- Will add more tests once I get some feedback, total rework might be
required so holding it off
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? not documented
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]