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

use work processing context in work processing #31148

Closed
wants to merge 2 commits into from

Conversation

m-trieu
Copy link
Contributor

@m-trieu m-trieu commented May 1, 2024

Add work processing context

R: @scwhittle


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.

Copy link
Contributor

github-actions bot commented May 1, 2024

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@m-trieu
Copy link
Contributor Author

m-trieu commented May 2, 2024

assign set of reviewers

Copy link
Contributor

github-actions bot commented May 2, 2024

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @johnjcasey added as fallback since no labels match configuration

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

.setInputDataWatermark(inputDataWatermark)
.setSynchronizedProcessingTime(synchronizedProcessingTime)
.setWorkItem(workItem)
.build();
Work scheduledWork =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have WorkItem, WorkProcessingContext, and Work classes.
Does the ProcessingContext benefit from being separate from Work?
If they are valuable distinctions can we think of better names to explain them?
Or perhaps we can have different interfaces and a single class implementing them?

It's odd that process() is a Work member instead of WorkProcessingContext which has commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated
added Watermarks and ProcessingContext as subclasses of Work and all interactions for work processing goes through Work.java

@@ -1061,7 +1064,8 @@ private void process(
if (workItem.getSourceState().getOnlyFinalize()) {
outputBuilder.setSourceStateUpdates(Windmill.SourceState.newBuilder().setOnlyFinalize(true));
work.setState(State.COMMIT_QUEUED);
workCommitter.commit(Commit.create(outputBuilder.build(), computationState, work));
workProcessingContext.queueCommit(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example if work/workprocessingcontext were combined we could have a single
work.queueCommit(...) which would internally update it's state

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@m-trieu m-trieu force-pushed the mt-work-processing-context branch 3 times, most recently from a2084d6 to 6fadee3 Compare May 14, 2024 22:00
@github-actions github-actions bot added core and removed core labels May 14, 2024
@m-trieu m-trieu force-pushed the mt-work-processing-context branch 3 times, most recently from 97644a2 to 2109108 Compare May 15, 2024 00:10
@m-trieu
Copy link
Contributor Author

m-trieu commented May 15, 2024

ready for another look @scwhittle

I went with the sort of a SteppedBuilder https://github.com/google/auto/blob/main/value/userguide/builders-howto.md#-create-a-step-builder approach for passing the ProcessingContext out of GrpcDirectGetWorkStream. The receiver just has to setProcessWorkFn and then build.

@m-trieu m-trieu force-pushed the mt-work-processing-context branch from 2109108 to 3c0702a Compare May 15, 2024 19:57
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.42%. Comparing base (bcac88b) to head (2109108).
Report is 73 commits behind head on master.

Current head 2109108 differs from pull request most recent head 3c0702a

Please upload reports for the commit 3c0702a to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #31148   +/-   ##
=========================================
  Coverage     71.42%   71.42%           
  Complexity     1474     1474           
=========================================
  Files           909      909           
  Lines        113707   113707           
  Branches       1076     1076           
=========================================
  Hits          81217    81217           
  Misses        30471    30471           
  Partials       2019     2019           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Reminder, please take a look at this pr: @johnjcasey

Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @johnjcasey added as fallback since no labels match configuration

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

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.

None yet

2 participants