Construct AfterEachStateMachine from list of subtriggers

Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/f46ce0db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/f46ce0db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/f46ce0db

Branch: refs/heads/master
Commit: f46ce0db372ffb66915eda22092bd760e474b9c0
Parents: 8afb80e
Author: Kenneth Knowles <k...@google.com>
Authored: Thu Oct 13 20:56:54 2016 -0700
Committer: Kenneth Knowles <k...@google.com>
Committed: Mon Oct 17 19:56:35 2016 -0700

----------------------------------------------------------------------
 .../beam/runners/core/triggers/AfterEachStateMachine.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/f46ce0db/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
----------------------------------------------------------------------
diff --git 
a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
 
b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
index 140ac75..38357d4 100644
--- 
a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
+++ 
b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterEachStateMachine.java
@@ -20,6 +20,7 @@ package org.apache.beam.runners.core.triggers;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -54,6 +55,10 @@ public class AfterEachStateMachine extends 
TriggerStateMachine {
     return new 
AfterEachStateMachine(Arrays.<TriggerStateMachine>asList(triggers));
   }
 
+  public static TriggerStateMachine inOrder(Iterable<? extends 
TriggerStateMachine> triggers) {
+    return new AfterEachStateMachine(ImmutableList.copyOf(triggers));
+  }
+
   @Override
   public void onElement(OnElementContext c) throws Exception {
     if (!c.trigger().isMerging()) {

Reply via email to