[GitHub] [beam] lukecwik commented on a change in pull request #11591: [BEAM-9801] [cherry-pick] Pass in fire timestamp to timer callback

2020-05-01 Thread GitBox


lukecwik commented on a change in pull request #11591:
URL: https://github.com/apache/beam/pull/11591#discussion_r418756561



##
File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageFunction.java
##
@@ -247,25 +247,27 @@ public void reduce(Iterable> 
iterable, Collector transformAndTimerId, Timer timerValue) -> {
-FnDataReceiver fnTimerReceiver =
-bundle.getTimerReceivers().get(transformAndTimerId);
-Preconditions.checkNotNull(
-fnTimerReceiver, "No FnDataReceiver found for %s", 
transformAndTimerId);
-try {
-  fnTimerReceiver.accept(timerValue);
-} catch (Exception e) {
-  throw new RuntimeException(
-  String.format(Locale.ENGLISH, "Failed to process timer: %s", 
timerValue));
-}
-  },
-  currentTimerKey);
+while (timerInternals.hasPendingTimers()) {

Review comment:
   Doesn't it make sense to make this change in batch as well for 
spark/flink in FlinkExecutableStageFunction and SparkExecutableStageFunction?
   
   Any watermark based timers should continue to be eligible and continue to 
fire while in batch while the processing time timers should be dropped.





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:
us...@infra.apache.org




[GitHub] [beam] lukecwik commented on a change in pull request #11591: [BEAM-9801] [cherry-pick] Pass in fire timestamp to timer callback

2020-05-01 Thread GitBox


lukecwik commented on a change in pull request #11591:
URL: https://github.com/apache/beam/pull/11591#discussion_r418756561



##
File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/functions/FlinkExecutableStageFunction.java
##
@@ -247,25 +247,27 @@ public void reduce(Iterable> 
iterable, Collector transformAndTimerId, Timer timerValue) -> {
-FnDataReceiver fnTimerReceiver =
-bundle.getTimerReceivers().get(transformAndTimerId);
-Preconditions.checkNotNull(
-fnTimerReceiver, "No FnDataReceiver found for %s", 
transformAndTimerId);
-try {
-  fnTimerReceiver.accept(timerValue);
-} catch (Exception e) {
-  throw new RuntimeException(
-  String.format(Locale.ENGLISH, "Failed to process timer: %s", 
timerValue));
-}
-  },
-  currentTimerKey);
+while (timerInternals.hasPendingTimers()) {

Review comment:
   Doesn't it make sense to make this change in batch as well for 
spark/flink in FlinkExecutableStageFunction and SparkExecutableStageFunction





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:
us...@infra.apache.org