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

[BEAM-1819] Key should be available in @OnTimer methods #11154

Merged
merged 55 commits into from Apr 27, 2020

Conversation

rehmanmuradali
Copy link
Contributor

@rehmanmuradali rehmanmuradali commented Mar 18, 2020


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

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • 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.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@mxm
Copy link
Contributor

mxm commented Mar 18, 2020

retest this please

@mxm
Copy link
Contributor

mxm commented Mar 18, 2020

retest this please

@rehmanmuradali
Copy link
Contributor Author

rehmanmuradali commented Apr 22, 2020

R: @mxm
CC: @reuvenlax

@aaltay
Copy link
Member

aaltay commented Apr 22, 2020

retest this please

Copy link
Contributor

@mxm mxm left a comment

Choose a reason for hiding this comment

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

Awesome @rehmanmuradali. The changes look good to me. I'd just change the signature of fireTimerInternal now that we have adapted the tests.

@@ -837,11 +837,15 @@ public void onProcessingTime(InternalTimer<ByteBuffer, TimerData> timer) {

// allow overriding this in ExecutableStageDoFnOperator to set the key context
protected void fireTimerInternal(Object key, TimerData timerData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to ByteBuffer now? Same in ExecutableStageDoFnOperator where it is overridden.

@rehmanmuradali
Copy link
Contributor Author

Awesome @rehmanmuradali. The changes look good to me. I'd just change the signature of fireTimerInternal now that we have adapted the tests.

@mxm done

@reuvenlax
Copy link
Contributor

retest this please

@reuvenlax
Copy link
Contributor

run dataflow validatesrunner

@reuvenlax
Copy link
Contributor

run flink validatesrunner

@reuvenlax
Copy link
Contributor

retest this please

@reuvenlax
Copy link
Contributor

run dataflow validatesrunner

@reuvenlax
Copy link
Contributor

run flink validatesrunner

1 similar comment
@reuvenlax
Copy link
Contributor

run flink validatesrunner

@reuvenlax
Copy link
Contributor

Run Java PreCommit

@reuvenlax
Copy link
Contributor

run flink validatesrunner

@reuvenlax
Copy link
Contributor

Run Java PreCommit

@reuvenlax
Copy link
Contributor

@mxm do you see any obvious reason why the SDF test is failing on Flink, with just one element missing in the output?

@mxm
Copy link
Contributor

mxm commented Apr 27, 2020

@reuvenlax The test became flaky recently with the latest SDF changes. It's a Flink Runner bug fixed here: #11533

@reuvenlax
Copy link
Contributor

Run Java PreCommit

@reuvenlax
Copy link
Contributor

@mxm so unrelated to this PR then

@mxm
Copy link
Contributor

mxm commented Apr 27, 2020

@mxm so unrelated to this PR then

Yes. The tests should be passing now.

@mxm
Copy link
Contributor

mxm commented Apr 27, 2020

Run Flink ValidatesRunner

@reuvenlax reuvenlax merged commit 591de34 into apache:master Apr 27, 2020
@mxm
Copy link
Contributor

mxm commented Apr 27, 2020

Good job @rehmanmuradali! Also thank you @reuvenlax for mentoring the PR!

@@ -560,7 +560,6 @@ public Instant timestamp(DoFn<InputT, OutputT> doFn) {
throw new IllegalStateException(
String.format("Unknown URN %s", pTransform.getSpec().getUrn()));
}
this.onTimerContext = new OnTimerContext();
Copy link
Member

Choose a reason for hiding this comment

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

The intent of these context objects was to not create a new one when processing each element/timer and instead to reference a member variable as can be seen in:


It would have made more sense to have OnTimerContext just return currentTimer.getUserKey()

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 Let's fix these in a follow-up.

Copy link
Member

Choose a reason for hiding this comment

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

And document the intent.

Copy link
Contributor

Choose a reason for hiding this comment

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

And document the intent.

! :)

@rehmanmuradali Do you have time to look into this?

Copy link
Member

Choose a reason for hiding this comment

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

+1 worth to create a JIRA to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mxm I am currently working on BEAM-1589, BEAM-8543. I will get back to it after that. The Jira is filed here: https://issues.apache.org/jira/browse/BEAM-9839

@iemejia
Copy link
Member

iemejia commented Apr 28, 2020

Starting with this PR merge the Spark ValidatesRunner tests are broken can you please take a look @rehmanmuradali
https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/7352/

This can be reproduced locally by running /gradlew :runners:spark:validatesRunnerBatch --tests "*ParDoTest\$KeyTests*" --scan

CC @ibzib who reported the issue first https://issues.apache.org/jira/browse/BEAM-9836

@rehmanmuradali
Copy link
Contributor Author

Starting with this PR merge the Spark ValidatesRunner tests are broken can you please take a look @rehmanmuradali
https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/7352/

This can be reproduced locally by running /gradlew :runners:spark:validatesRunnerBatch --tests "*ParDoTest\$KeyTests*" --scan

CC @ibzib who reported the issue first https://issues.apache.org/jira/browse/BEAM-9836

On it

yirutang pushed a commit to yirutang/beam that referenced this pull request Jul 23, 2020
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