You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by GitBox <gi...@apache.org> on 2020/02/27 21:04:03 UTC
[GitHub] [beam] lukecwik opened a new pull request #10992: [WIP][BEAM-2939]
Add support for reporting the watermark in SplittableDoFns.
lukecwik opened a new pull request #10992: [WIP][BEAM-2939] Add support for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992
This exposes 3 methods using new DoFn style semantics:
`GetInitialWatermarkEstimatorState`
`NewWatermarkEstimator`
`GetWatermarkEstimatorStateCoder`
and one new parameter:
`WatermarkEstimatorState`
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) 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](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
Java | [](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/) | --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python35_VR_Flink/lastCompletedBuild/) | --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/)
XLang | --- | --- | --- | [](https://builds.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/) | --- | --- | [](https://builds.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/)
Pre-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
--- |Java | Python | Go | Website
--- | --- | --- | --- | ---
Non-portable | [](https://builds.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [](https://builds.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/)
Portable | --- | [](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | ---
See [.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md) for trigger phrase, status and link of all Jenkins jobs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] mxm commented on a change in pull request #10992:
[BEAM-2939] Provide user facing API for reporting the watermark in
SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
mxm commented on a change in pull request #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#discussion_r392275988
##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java
##########
@@ -1070,6 +1091,120 @@ public Duration getAllowedTimestampSkew() {
@Experimental(Kind.SPLITTABLE_DO_FN)
public @interface NewTracker {}
+ /**
+ * Annotation for the method that maps an element and restriction to initial watermark estimator
+ * state for a <a href="https://s.apache.org/splittable-do-fn">splittable</a> {@link DoFn}.
+ *
+ * <p>Signature: {@code WatermarkEstimatorStateT getInitialWatermarkState(<arguments>);}
+ *
+ * <p>This method must satisfy the following constraints:
+ *
+ * <ul>
+ * <li>The return type {@code WatermarkEstimatorStateT} defines the watermark state type used
+ * within this splittable DoFn. All other methods that use a {@link
+ * WatermarkEstimatorState @WatermarkEstimatorState} parameter must use the same type that
+ * is used here. It is suggested to use as narrow of a return type definition as possible
+ * (for example prefer to use a square type over a shape type as a square is a type of a
+ * shape).
+ * <li>If one of its arguments is tagged with the {@link Element} annotation, then it will be
+ * passed the current element being processed; the argument must be of type {@code InputT}.
+ * Note that automatic conversion of {@link Row}s and {@link FieldAccess} parameters are
+ * currently unsupported.
+ * <li>If one of its arguments is tagged with the {@link Restriction} annotation, then it will
+ * be passed the current restriction being processed; the argument must be of type {@code
+ * RestrictionT}.
+ * <li>If one of its arguments is tagged with the {@link Timestamp} annotation, then it will be
+ * passed the timestamp of the current element being processed; the argument must be of type
+ * {@link Instant}.
+ * <li>If one of its arguments is a subtype of {@link BoundedWindow}, then it will be passed the
+ * window of the current element. When applied by {@link ParDo} the subtype of {@link
+ * BoundedWindow} must match the type of windows on the input {@link PCollection}. If the
+ * window is not accessed a runner may perform additional optimizations.
+ * <li>If one of its arguments is of type {@link PaneInfo}, then it will be passed information
+ * about the current triggering pane.
+ * <li>If one of the parameters is of type {@link PipelineOptions}, then it will be passed the
+ * options for the current pipeline.
+ * </ul>
+ */
+ @Documented
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ @Experimental(Kind.SPLITTABLE_DO_FN)
+ public @interface GetInitialWatermarkEstimatorState {}
Review comment:
Note that this terminology deviates from the current `getCheckpointMark()`. I like it though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik merged pull request #10992: [BEAM-2939] Provide
user facing API for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik merged pull request #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik commented on issue #10992: [WIP][BEAM-2939] Add
support for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik commented on issue #10992: [WIP][BEAM-2939] Add support for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#issuecomment-592224753
CC: @boyuanzz @robertwb @mxm
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik edited a comment on issue #10992: [BEAM-2939]
Provide user facing API for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik edited a comment on issue #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#issuecomment-598529191
R: @mxm
This is ready for review.
Max, if your really busy at the moment I can try to find other reviewers.
I finished the API specification, DoFnSignature validation and DoFnInvoker changes to be able to start using them. The next change is BEAM-9430 where we get rid of updateWatermark in favor of the WatermarkEstimator and update existing argument providers to source their watermark information from them.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik commented on issue #10992: [BEAM-2939] Provide user
facing API for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik commented on issue #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#issuecomment-598529191
R: @mxm Do you want to take a look at this?
I finished the API specification, DoFnSignature validation and DoFnInvoker changes to be able to start using them. The next change is BEAM-9430 where we get rid of updateWatermark in favor of the WatermarkEstimator and update existing argument providers to source their watermark information from them.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik commented on issue #10992: [BEAM-2939] Provide user
facing API for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik commented on issue #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#issuecomment-598797984
Run Java PreCommit
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [beam] lukecwik edited a comment on issue #10992: [BEAM-2939]
Provide user facing API for reporting the watermark in SplittableDoFns.
Posted by GitBox <gi...@apache.org>.
lukecwik edited a comment on issue #10992: [BEAM-2939] Provide user facing API for reporting the watermark in SplittableDoFns.
URL: https://github.com/apache/beam/pull/10992#issuecomment-598529191
R: @mxm
This is ready for review.
I finished the API specification, DoFnSignature validation and DoFnInvoker changes to be able to start using them. The next change is BEAM-9430 where we get rid of updateWatermark in favor of the WatermarkEstimator and update existing argument providers to source their watermark information from them.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services