je-ik commented on a change in pull request #13571:
URL: https://github.com/apache/beam/pull/13571#discussion_r545114926
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/DoFnOperator.java
##########
@@ -992,7 +997,23 @@ public void onProcessingTime(InternalTimer<ByteBuffer,
TimerData> timer) {
// allow overriding this in ExecutableStageDoFnOperator to set the key
context
protected void fireTimerInternal(ByteBuffer key, TimerData timerData) {
+ long oldHold = keyCoder != null ? keyedStateInternals.minWatermarkHoldMs()
: -1L;
fireTimer(timerData);
+ emitWatermarkIfHoldChanged(oldHold);
+ }
+
+ void emitWatermarkIfHoldChanged(long currentWatermarkHold) {
+ if (keyCoder != null) {
+ long newWatermarkHold = keyedStateInternals.minWatermarkHoldMs();
+ if (newWatermarkHold > currentWatermarkHold) {
+ try {
+ processInputWatermark(false);
+ } catch (Exception ex) {
+ // should not happen
Review comment:
Isn't `IllegalStateException` meat to be used for an illegal state,
which is a state that should not happen? :)
----------------------------------------------------------------
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:
[email protected]