Class Trigger.OnceTrigger

java.lang.Object
org.apache.beam.sdk.transforms.windowing.Trigger
org.apache.beam.sdk.transforms.windowing.Trigger.OnceTrigger
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AfterAll, AfterFirst, AfterPane, AfterProcessingTime, AfterSynchronizedProcessingTime, AfterWatermark.FromEndOfWindow, Never.NeverTrigger
Enclosing class:
Trigger

@Internal public abstract static class Trigger.OnceTrigger extends Trigger
For internal use only; no backwards-compatibility guarantees.

Triggers that are guaranteed to fire at most once should extend Trigger.OnceTrigger rather than the general Trigger class to indicate that behavior.

See Also:
  • Constructor Details

    • OnceTrigger

      protected OnceTrigger(List<Trigger> subTriggers)
  • Method Details

    • mayFinish

      public final boolean mayFinish()
      Description copied from class: Trigger
      For internal use only; no backwards-compatibility guarantees.

      Indicates whether this trigger may "finish". A top level trigger that finishes can cause data loss, so is rejected by GroupByKey validation.

      Specified by:
      mayFinish in class Trigger
    • getContinuationTrigger

      public final Trigger.OnceTrigger getContinuationTrigger()
      Description copied from class: Trigger
      Return a trigger to use after a GroupByKey to preserve the intention of this trigger. Specifically, triggers that are time based and intended to provide speculative results should continue providing speculative results. Triggers that fire once (or multiple times) should continue firing once (or multiple times).

      If this method is not overridden, its default implementation delegates its behavior to Trigger.getContinuationTrigger(List) which is expected to be implemented by subclasses.

      Overrides:
      getContinuationTrigger in class Trigger