public abstract static class Trigger.OnceTrigger extends Trigger
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, Trigger.OnceTrigger, Trigger.OnElementContext, Trigger.OnMergeContext, Trigger.TriggerContext, Trigger.TriggerInfosubTriggers| Modifier | Constructor and Description |
|---|---|
protected |
OnceTrigger(List<Trigger> subTriggers) |
| Modifier and Type | Method and Description |
|---|---|
Trigger.OnceTrigger |
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(org.apache.beam.sdk.transforms.windowing.Trigger.TriggerContext) when the trigger is fired. |
clear, equals, getContinuationTrigger, getWatermarkThatGuaranteesFiring, hashCode, isCompatible, onElement, onMerge, orFinally, prefetchOnElement, prefetchOnFire, prefetchOnMerge, prefetchShouldFire, shouldFire, subTriggers, toStringpublic final Trigger.OnceTrigger 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 Triggerpublic 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.
protected abstract void onOnlyFiring(Trigger.TriggerContext context) throws Exception
onFire(org.apache.beam.sdk.transforms.windowing.Trigger.TriggerContext) when the trigger is fired. By default,
invokes onFire(org.apache.beam.sdk.transforms.windowing.Trigger.TriggerContext) on all subtriggers for which Trigger.shouldFire(org.apache.beam.sdk.transforms.windowing.Trigger.TriggerContext) is true.Exception