Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

damondouglas
Copy link
Contributor

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:

TEST=org.apache.beam.sdk.transforms.SplittableDoFnTest
./gradlew :runners:portability:java:ulrLoopbackValidatesRunnerTests -PjobEndpoint=localhost:8073 --tests="$TEST"

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@damondouglas
Copy link
Contributor Author

R: @lostluck

@damondouglas damondouglas marked this pull request as ready for review September 11, 2024 01:32
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@damondouglas damondouglas marked this pull request as draft September 11, 2024 17:58
Copy link
Contributor

@lostluck lostluck left a 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.

@damondouglas damondouglas marked this pull request as ready for review September 19, 2024 19:21
Copy link
Contributor

@lostluck lostluck left a 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.

Comment on lines +24 to +25
"sync/atomic"
"time"
Copy link
Contributor

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 {
Copy link
Contributor

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.

https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/runners/prism/internal/unimplemented_test.go#L74

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Prism] Support Bundle Finalization
2 participants