[ 
https://issues.apache.org/jira/browse/BEAM-11144?focusedWorklogId=507276&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-507276
 ]

ASF GitHub Bot logged work on BEAM-11144:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Nov/20 19:13
            Start Date: 03/Nov/20 19:13
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on a change in pull request 
#13221:
URL: https://github.com/apache/beam/pull/13221#discussion_r516896813



##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterWatermarkStateMachine.java
##########
@@ -91,6 +91,13 @@ public AfterWatermarkEarlyAndLate 
withLateFirings(TriggerStateMachine lateTrigge
       return new AfterWatermarkEarlyAndLate(earlyTrigger, lateTrigger);
     }
 
+    @Override
+    public void prefetchOnElement(PrefetchContext c) {
+      for (ExecutableTriggerStateMachine subTrigger : 
c.trigger().subTriggers()) {

Review comment:
       This was the other one. Same problem with my thinking.

##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
##########
@@ -48,6 +48,13 @@ private AfterEachStateMachine(List<TriggerStateMachine> 
subTriggers) {
     checkArgument(subTriggers.size() > 1);
   }
 
+  @Override
+  public void prefetchOnElement(PrefetchContext c) {
+    for (ExecutableTriggerStateMachine subTrigger : c.trigger().subTriggers()) 
{

Review comment:
       This was one of the cases where I was thinking it only made sense to 
prefetch the active subtrigger. Of course, I was missing the whole point that 
you can't know which one that is until you do a fetch. So maybe my whole idea 
was foolish.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 507276)
    Time Spent: 50m  (was: 40m)

> TriggerStateMachine.prefetchOnElement and other prefetch methods use 
> incorrect state for subtriggers
> ----------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-11144
>                 URL: https://issues.apache.org/jira/browse/BEAM-11144
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core
>            Reporter: Sam Whittle
>            Assignee: Sam Whittle
>            Priority: P2
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> prefetchOnElement takes a single StateAccessor corresponding to the root 
> trigger.  It uses that state accessor to perform prefetches for the 
> subtrigger state. However that will use the root trigger namespace for the 
> tags in the subtriggers.  This makes prefetching ineffective, introducing 
> possibly an additional round-trip once the data is actually read.
> https://github.com/apache/beam/blob/68d6c8e6243b1d8f392840273f886276e2a8baff/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachine.java#L296



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to