scwhittle commented on a change in pull request #13221:
URL: https://github.com/apache/beam/pull/13221#discussion_r516913548



##########
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:
       Yeah when I embarked on this I was thinking also it might be possible to 
do better but it didn't pan out.
   
   One idea I had was adding a isCached() method on the state objects that 
would indicate if the value was local (cached, in-memory, etc) and didn't 
require a fetch.  In such cases we could trim the trigger state to prefetch by 
looking at the closed triggers.  However if everything we actually needed was 
local, we've only called readLater on something we never actually read and thus 
never issue a fetch anyway.  And if we do have to issue a fetch for anything, 
fetching an additional unused tag to it is likely not much more overhead.




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


Reply via email to