Class Trigger<T,W extends Window>

java.lang.Object
org.apache.flink.streaming.api.windowing.triggers.Trigger<T,W>
Type Parameters:
T - The type of elements on which this Trigger works.
W - The type of Windows on which this Trigger can operate.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CountTrigger, EventTimeTrigger, GlobalWindows.EndOfStreamTrigger, GlobalWindows.NeverTrigger, ProcessingTimeTrigger, PurgingTrigger

@PublicEvolving public abstract class Trigger<T,W extends Window> extends Object implements Serializable
A Trigger determines when a pane of a window should be evaluated to emit the results for that part of the window.

A pane is the bucket of elements that have the same key (assigned by the KeySelector) and same Window. An element can be in multiple panes if it was assigned to multiple windows by the WindowAssigner. These panes all have their own instance of the Trigger.

Triggers must not maintain state internally since they can be re-created or reused for different keys. All necessary state should be persisted using the state abstraction available on the Trigger.TriggerContext.

When used with a MergingWindowAssigner the Trigger must return true from canMerge() and onMerge(Window, OnMergeContext) most be properly implemented.

See Also:
  • Constructor Details

    • Trigger

      public Trigger()
  • Method Details