W - BoundedWindow subclass used to represent the windows used by this
Trigger@Experimental(value=TRIGGER) public class AfterFirst<W extends BoundedWindow> extends Trigger.OnceTrigger<W>
Trigger that fires once after at least one of its sub-triggers have
fired.Trigger.MergeResult, Trigger.MergingTriggerInfo<W extends BoundedWindow>, Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementContext, Trigger.OnMergeContext, Trigger.OnTimerContext, Trigger.TriggerContext, Trigger.TriggerInfo<W extends BoundedWindow>, Trigger.TriggerResultsubTriggers| Modifier and Type | Method and Description |
|---|---|
Trigger.OnceTrigger<W> |
getContinuationTrigger(List<Trigger<W>> continuationTriggers)
Return the
Trigger.getContinuationTrigger() of this Trigger. |
org.joda.time.Instant |
getWatermarkThatGuaranteesFiring(W window)
Returns a bound in watermark time by which this trigger would have fired at least once
for a given window had there been input data.
|
static <W extends BoundedWindow> |
of(Trigger.OnceTrigger<W>... triggers) |
Trigger.TriggerResult |
onElement(Trigger.OnElementContext c)
Called immediately after an element is first incorporated into a window.
|
Trigger.MergeResult |
onMerge(Trigger.OnMergeContext c)
Called immediately after windows have been merged.
|
Trigger.TriggerResult |
onTimer(Trigger.OnTimerContext c)
Called when a timer has fired for the current window.
|
getContinuationTriggerbuildTrigger, clear, equals, hashCode, isCompatible, orFinally, prefetchOnElement, prefetchOnMerge, prefetchOnTimer, subTriggers, toString@SafeVarargs public static <W extends BoundedWindow> Trigger.OnceTrigger<W> of(Trigger.OnceTrigger<W>... triggers)
public Trigger.TriggerResult onElement(Trigger.OnElementContext c) throws Exception
TriggeronElement in class Trigger<W extends BoundedWindow>Exceptionpublic Trigger.MergeResult onMerge(Trigger.OnMergeContext c) throws Exception
TriggerLeaf triggers should determine their result by inspecting their status and any state
in the merging windows. Composite triggers should determine their result by calling
ExecutableTrigger.invokeMerge(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnMergeContext) on their sub-triggers, and applying appropriate logic.
A trigger can only return Trigger.MergeResult.ALREADY_FINISHED if it is marked as finished
in at least one of the windows being merged.
The implementation does not need to clear out any state associated with the old windows.
onMerge in class Trigger<W extends BoundedWindow>Exceptionpublic Trigger.TriggerResult onTimer(Trigger.OnTimerContext c) throws Exception
TriggeronTimer in class Trigger<W extends BoundedWindow>Exceptionpublic org.joda.time.Instant getWatermarkThatGuaranteesFiring(W window)
TriggerFor triggers that do not fire based on the watermark advancing, returns
BoundedWindow.TIMESTAMP_MAX_VALUE.
This estimate is used to determine that there are no elements in a side-input window, which causes the default value to be used instead.
getWatermarkThatGuaranteesFiring in class Trigger<W extends BoundedWindow>public Trigger.OnceTrigger<W> getContinuationTrigger(List<Trigger<W>> continuationTriggers)
TriggerTrigger.getContinuationTrigger() of this Trigger. For convenience, this
is provided the continuation trigger of each of the sub-triggers.getContinuationTrigger in class Trigger<W extends BoundedWindow>