You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/04/05 07:54:27 UTC
[GitHub] [beam] je-ik commented on a diff in pull request #17262: [BEAM-14244] Use the supplied output timestamp for processing time timers rather than the input watermark
je-ik commented on code in PR #17262:
URL: https://github.com/apache/beam/pull/17262#discussion_r842480719
##########
runners/core-java/src/main/java/org/apache/beam/runners/core/SimpleDoFnRunner.java:
##########
@@ -209,7 +209,12 @@ public void processElement(WindowedValue<InputT> compressedElem) {
break;
case PROCESSING_TIME:
case SYNCHRONIZED_PROCESSING_TIME:
- effectiveTimestamp = stepContext.timerInternals().currentInputWatermarkTime();
+ Instant outputWatermark = stepContext.timerInternals().currentOutputWatermarkTime();
+ Instant inputWatermark = stepContext.timerInternals().currentInputWatermarkTime();
+ effectiveTimestamp =
+ outputTimestamp != null
+ ? outputTimestamp
+ : outputWatermark != null ? outputWatermark : inputWatermark;
Review Comment:
I'm confused. There is a comment in the mentioned `setAndVerifyOutputTimestamp`, that states:
```java
* <ul>
* Ensures that:
* <li>Users can't set {@code outputTimestamp} for processing time timers.
* <li>Event time timers' {@code outputTimestamp} is set before window expiration.
* </ul>
```
The method does not check the first part apparently. If this is correct we might want to fix the comment.
--
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.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org