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/01/10 19:53:53 UTC
[GitHub] [beam] lukecwik commented on a change in pull request #16458: [BEAM-13614, BEAM-13213] Add OnWindowExpiration support to the Java SDK harness and proto translation
lukecwik commented on a change in pull request #16458:
URL: https://github.com/apache/beam/pull/16458#discussion_r781503752
##########
File path: sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -1720,6 +1736,23 @@ public Object restriction() {
doFnInvoker.invokeOnTimer(timerId, timerFamilyId, onTimerContext);
}
+ private <K> void processOnWindowExpiration(Timer<K> timer) {
+ try {
+ currentKey = timer.getUserKey();
+ currentTimer = timer;
+ Iterator<BoundedWindow> windowIterator =
Review comment:
currentWindow is defined outside of the method. I believe for-each loops are limited to defining the variable within the `for (...)` so I can't do `for (currentWindow : timer.getWindows()) { ... }`
##########
File path: sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -1720,6 +1736,23 @@ public Object restriction() {
doFnInvoker.invokeOnTimer(timerId, timerFamilyId, onTimerContext);
}
+ private <K> void processOnWindowExpiration(Timer<K> timer) {
+ try {
+ currentKey = timer.getUserKey();
+ currentTimer = timer;
+ Iterator<BoundedWindow> windowIterator =
Review comment:
`currentWindow` is defined outside of the method. I believe for-each loops are limited to defining the variable within the `for (...)` so I can't do `for (currentWindow : timer.getWindows()) { ... }`
--
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