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 2020/06/26 23:13:45 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #12093: [BEAM-10303] Add support for the non-window observing optimization to DoFn execution in portable Beam Java

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



##########
File path: sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -637,6 +737,28 @@ private void processElementForParDo(WindowedValue<InputT> elem) {
   }
 
   private void processElementForPairWithRestriction(WindowedValue<InputT> elem) {
+    currentElement = elem;
+    try {
+      currentRestriction = doFnInvoker.invokeGetInitialRestriction(processContext);
+      outputTo(
+          mainOutputConsumers,
+          (WindowedValue)
+              elem.withValue(
+                  KV.of(
+                      elem.getValue(),
+                      KV.of(
+                          currentRestriction,
+                          doFnInvoker.invokeGetInitialWatermarkEstimatorState(processContext)))));
+    } finally {
+      currentElement = null;
+      currentRestriction = null;

Review comment:
       It is never set/utilized in these methods and just remains null. All output is produced using the entire set of windows for the current element instead.
   
   The window observing versions of these methods do set it and clear it.




----------------------------------------------------------------
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