[GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points - #38521
[GSoC 2026] Add Kafka Streams runner skeleton module + portable entry points#38521junaiddshaukat wants to merge 2 commits into
Conversation
Summary of ChangesHello, 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 establishes the foundational skeleton for a new Kafka Streams runner in Apache Beam. It sets up the necessary project structure, build configurations, and core portable runner entry points. The implementation currently focuses on plumbing, ensuring that the runner can be registered and invoked, while providing a fail-fast mechanism for pipeline translation until specific transform support is added. Highlights
New Features🧠 You can now enable Memory (public preview) 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. 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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new runners/kafka-streams Gradle module providing a portable job server and runner entry points for Apache Kafka Streams. The implementation includes a job invoker, server driver, and a pipeline translator that currently performs validation and fails fast for unsupported transforms. Feedback focuses on improving the robustness of the KafkaStreamsPipelineResult by ensuring the job server is only stopped upon reaching a terminal state or through a finally block to handle exceptions during cancellation and completion. Additionally, it is suggested to include the job name in the default state directory path to avoid conflicts during parallel execution.
| public State waitUntilFinish(Duration duration) { | ||
| State state = delegate.waitUntilFinish(duration); | ||
| stopJobServer.run(); | ||
| return state; | ||
| } |
There was a problem hiding this comment.
The current implementation stops the job server even if waitUntilFinish(duration) times out and the pipeline is still running. This prevents further interaction with the job. The server should only be stopped if the pipeline has reached a terminal state.
@Override
public State waitUntilFinish(Duration duration) {
State state = delegate.waitUntilFinish(duration);
if (state != null && state.isTerminal()) {
stopJobServer.run();
}
return state;
}| class StateDirDefaultFactory implements DefaultValueFactory<String> { | ||
| @Override | ||
| public String create(PipelineOptions options) { | ||
| return Paths.get(System.getProperty("java.io.tmpdir"), "beam-kafka-streams-state").toString(); |
There was a problem hiding this comment.
Using a fixed path for the Kafka Streams state directory in the system temp directory can cause conflicts and LockException when multiple pipelines (e.g., parallel tests) run on the same host. It is recommended to include the job name to ensure uniqueness.
| return Paths.get(System.getProperty("java.io.tmpdir"), "beam-kafka-streams-state").toString(); | |
| return Paths.get(System.getProperty("java.io.tmpdir"), "beam-kafka-streams-state", options.getJobName()).toString(); |
| public State cancel() throws IOException { | ||
| State state = delegate.cancel(); | ||
| stopJobServer.run(); | ||
| return state; | ||
| } |
There was a problem hiding this comment.
| public State waitUntilFinish() { | ||
| State state = delegate.waitUntilFinish(); | ||
| stopJobServer.run(); | ||
| return state; | ||
| } |
There was a problem hiding this comment.
|
Assigning reviewers: R: @shunping added as fallback since no labels match configuration 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). |
|
@junaiddshaukat I will walk through the PR ASAP, but can you please change the target branch? We don't want this subtask to hit master branck right now. Thanks! |
@je-ik sure, changing it right now |
|
Moving review to fork PR per my mentor (@je-ik) guidance: junaiddshaukat#1 |
Summary
runners/kafka-streamsGradle module and wires it into build/settings.KafkaStreamsRunner, options, registrar, job server driver, job invoker, and translation context.No translator registered for URN ...for unsupported transforms.CHANGES.mdwith the new runner skeleton entry.Validation
./gradlew :runners:kafka-streams:compileJava./gradlew :runners:kafka-streams:checkScope
This PR intentionally provides skeleton plumbing only.
No transform translators, watermark manager, or state implementation are included yet.
Closes #38465
cc @je-ik
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.