W - BoundedWindow subclass used to represent the windows used by this
AtMostOnceTriggerpublic abstract static class Trigger.OnceTrigger<W extends BoundedWindow> extends Trigger<W>
Triggers that are guaranteed to fire at most once should extend from this, rather
than the general Trigger class to indicate that behavior.Trigger.MergingTriggerInfo<W extends BoundedWindow>, Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementContext, Trigger.OnMergeContext, Trigger.TriggerContext, Trigger.TriggerInfo<W extends BoundedWindow>subTriggers| Modifier | Constructor and Description |
|---|---|
protected |
OnceTrigger(List<Trigger<W>> subTriggers) |
| Modifier and Type | Method and Description |
|---|---|
Trigger.OnceTrigger<W> |
getContinuationTrigger()
Return a trigger to use after a
GroupByKey to preserve the
intention of this trigger. |
void |
onFire(Trigger.TriggerContext context)
Adjusts the state of the trigger to be ready for the next pane.
|
protected abstract void |
onOnlyFiring(Trigger.TriggerContext context)
Called exactly once by
onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext) when the trigger is fired. |
buildTrigger, clear, equals, getContinuationTrigger, getWatermarkThatGuaranteesFiring, hashCode, isCompatible, onElement, onMerge, orFinally, prefetchOnElement, prefetchOnFire, prefetchOnMerge, prefetchShouldFire, shouldFire, subTriggers, toStringpublic final Trigger.OnceTrigger<W> getContinuationTrigger()
TriggerGroupByKey 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).getContinuationTrigger in class Trigger<W extends BoundedWindow>public final void onFire(Trigger.TriggerContext context) throws Exception
Repeatedly trigger will reset its inner trigger, since it has fired.
If the trigger is finished, it is the responsibility of the trigger itself to
record that fact via the context.
onFire in class Trigger<W extends BoundedWindow>Exceptionprotected abstract void onOnlyFiring(Trigger.TriggerContext context) throws Exception
onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext) when the trigger is fired. By default,
invokes onFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext) on all subtriggers for which Trigger.shouldFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext) is true.Exception