-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[Spark runner] Support for ProcessingTime Timer for Spark Runner #35316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spark runner] Support for ProcessingTime Timer for Spark Runner #35316
Conversation
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
ac8f7a6 to
d23948a
Compare
50d800d to
86c67ab
Compare
|
assign set of reviewers |
|
Assigning reviewers: R: @damccorm 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). |
damccorm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together
...rk/src/main/java/org/apache/beam/runners/spark/translation/streaming/ParDoStateUpdateFn.java
Outdated
Show resolved
Hide resolved
| .isBefore(sparkTimerInternals.currentInputWatermarkTime())) | ||
| .isBefore( | ||
| timer.getDomain().equals(TimeDomain.PROCESSING_TIME) | ||
| ? sparkTimerInternals.currentProcessingTime() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this safe to do? I'd expect us to try to fire processing time timers (if unfired) before clearing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right! I've added TimerUtils.triggerExpiredTimers to fire expired processing time timers before clearing them. This ensures we don't lose any timer callbacks that should have been executed.
Please take a look at the implementation.
|
@damccorm Thanks for the feedback! |
|
Reminder, please take a look at this pr: @damccorm |
|
waiting on author |
|
@damccorm |
|
Reminder, please take a look at this pr: @damccorm |
damccorm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please add a meaningful description for your change here
fixes #33633
Problem Statement
The Spark Runner did not support timers due to the following technical challenges:
Timer Triggering Difficulties:
UnboundedInOutIteratorobjects are periodically created and destroyed at each Spark Streaming batch interval, rendering the internalwhile (true)loop ineffective for timer management.Sparse Key Issue: As a consequence of the above limitation, sparse keys lose their timer triggering capability once their corresponding
UnboundedInOutIteratorobjects are destroyed, leaving no mechanism to fire pending timers.This PR resolves the above issues to enable Processing Time Timer functionality.
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.