Add direct accessors for the components of OrFinallyTrigger

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

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

----------------------------------------------------------------------
 .../sdk/transforms/windowing/OrFinallyTrigger.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8afb80e1/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/OrFinallyTrigger.java
----------------------------------------------------------------------
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/OrFinallyTrigger.java
 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/OrFinallyTrigger.java
index 25b7b34..1a03450 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/OrFinallyTrigger.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/OrFinallyTrigger.java
@@ -35,6 +35,21 @@ class OrFinallyTrigger extends Trigger {
     super(Arrays.asList(actual, until));
   }
 
+  /**
+   * The main trigger, which will continue firing until the "until" trigger 
fires. See
+   * {@link #getUntilTrigger()}
+   */
+  public Trigger getMainTrigger() {
+    return subTriggers().get(ACTUAL);
+  }
+
+  /**
+   * The trigger that signals termination of this trigger.
+   */
+  public OnceTrigger getUntilTrigger() {
+    return (OnceTrigger) subTriggers().get(UNTIL);
+  }
+
   @Override
   public void onElement(OnElementContext c) throws Exception {
     c.trigger().subTrigger(ACTUAL).invokeOnElement(c);

Reply via email to