-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Prism] Support BundleFinalization DoFn parameter #32425
base: master
Are you sure you want to change the base?
Conversation
R: @lostluck |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, 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.
General comments since I know you have other plans for that remaining test right now.
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.
Minor changes and refactoring suggestions!
Please feel free to merge after you've made them, if you don't want another look.
"sync/atomic" | ||
"time" |
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.
Please put the standard library imports in a separate group at the top of the imports. For some reason the break was dropped, and the grouping changed.
|
||
// ParDoProcessElementBundleFinalizer creates a beam.Pipeline with a beam.ParDo0 that processes a DoFn with a | ||
// beam.BundleFinalization in its ProcessElement method. | ||
func ParDoProcessElementBundleFinalizer() *beam.Pipeline { |
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.
Consider instead having the scope passed into this function instead of returning a Pipeline.
eg.
func ParDoProcessElementBundleFinalizer(s beam.Scope) {
imp := beam.Impulse(s)
beam.ParDo0(s, &processElemBundleFinalizer{}, imp)
}
This cuts the boiler plate.
That makes it easier to integrated with the Prism Test suites, and thus ensure we get explicit code coverage over the prism you've written code.
eg. That's how we do the (increasingly mis-named) unimplemented_test.go file.
So you could add the "Finalization" tests to the TestImplemented suite.
DO NOT refactor that test file to fix it, that's an orthogonal change that should be made separately.
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.
Naturally, the same for the other test cases in this file.
This PR closes #31912 by adding support for bundle finalization via the
beam.BundleFinalization
DoFn parameter.With Prism running, to validate Java tests against Prism runner:
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.md
with 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.