Adds triggerring configuration to KafkaIO eos.#37648
Adds triggerring configuration to KafkaIO eos.#37648stankiewicz wants to merge 4 commits intoapache:masterfrom
Conversation
…of sink. EOS sink is slow when sending transactions with single element, to speed up, it's needed to trigger together multiple messages.
Summary of ChangesHello @stankiewicz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the KafkaIO Exactly-Once Semantics (EOS) sink by introducing configurable triggering mechanisms. The primary goal is to optimize performance by allowing the sink to batch multiple messages or wait for a specified duration before committing transactions, addressing the inefficiency of single-element transactions. This change provides users with greater control over the trade-off between latency and throughput for their Kafka writes. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| abstract Builder<K, V> setEOS(boolean eosEnabled); | ||
|
|
||
| abstract Builder<K, V> setNumElements(int numElements); | ||
|
|
There was a problem hiding this comment.
I would name these more narrowly. Theres lots of potential numElements and timeouts in the scope of KafkaIO
8811436 to
c6ab2f5
Compare
| ParDo.of(new Reshard<>(numShards))) | ||
| .apply("Persist sharding", GroupByKey.create()) | ||
| .apply("Assign sequential ids", ParDo.of(new Sequencer<>())) | ||
| .apply( |
There was a problem hiding this comment.
is this needed or is the the windowing inherited from above?
There was a problem hiding this comment.
It didn't work without repeating triggering definition
There was a problem hiding this comment.
we discussed, it looks like this is because the continuation trigger changes it to aftercount(1)
can you add a comment here
// Reapply the windowing configuration as the continuation trigger doesn't maintain the desired batching.
| .apply( | ||
| Window.<ProducerRecord<K, V>>into(new GlobalWindows()) // Everything into global window. | ||
| .triggering(Repeatedly.forever(AfterPane.elementCountAtLeast(1))) | ||
| .triggering( |
There was a problem hiding this comment.
this is going to break update compatability, I think that either:
- have the defaults result in the same windowing
- or add support for the compatabilityversion option to be used to ignore the options and use the old windowing
There was a problem hiding this comment.
Ack, will keep the default behaviour and introduce new triggering when options are set.
|
Assigning reviewers: R: @chamikaramj for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
8466da6 to
168cbd0
Compare
scwhittle
left a comment
There was a problem hiding this comment.
Would be good to double-check the update compatability by running it, I think that specifying the second windowing should be fine because it is equivalent to the continuation triggering.
| ParDo.of(new Reshard<>(numShards))) | ||
| .apply("Persist sharding", GroupByKey.create()) | ||
| .apply("Assign sequential ids", ParDo.of(new Sequencer<>())) | ||
| .apply( |
There was a problem hiding this comment.
we discussed, it looks like this is because the continuation trigger changes it to aftercount(1)
can you add a comment here
// Reapply the windowing configuration as the continuation trigger doesn't maintain the desired batching.
d8e2d5e to
62a3be7
Compare
spotless ds
62a3be7 to
7ac991f
Compare
Adds triggerring configuration to KafkaIO eos sink. EOS sink is slow when sending transactions with single element, to speed up, it's needed to trigger together multiple messages.
Scope of the change:
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.