W - BoundedWindow subclass used to represent the windows used@Experimental(value=TRIGGER) public class AfterProcessingTime<W extends BoundedWindow> extends TimeTrigger<W,AfterProcessingTime<W>>
AfterProcessingTime triggers fire based on the current processing time. They operate in
the real-time domain.Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementEvent<W>, Trigger.OnMergeEvent<W>, Trigger.OnTimerEvent<W extends BoundedWindow>, Trigger.TimeDomain, Trigger.TriggerContext<W extends BoundedWindow>, Trigger.TriggerId<W extends BoundedWindow>, Trigger.TriggerResult, Trigger.WindowStatusIDENTITY| Modifier and Type | Method and Description |
|---|---|
void |
clear(Trigger.TriggerContext<W> c,
W window)
Clear any state associated with this trigger in the given window.
|
Instant |
getWatermarkCutoff(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.
|
protected AfterProcessingTime<W> |
newWith(com.google.common.collect.ImmutableList<SerializableFunction<Instant,Instant>> transforms)
Method to create an updated version of this
TimeTrigger modified to use the specified
transform. |
Trigger.TriggerResult |
onElement(Trigger.TriggerContext<W> c,
Trigger.OnElementEvent<W> e)
Called immediately after an element is first incorporated into a window.
|
Trigger.TriggerResult |
onMerge(Trigger.TriggerContext<W> c,
Trigger.OnMergeEvent<W> e)
Called immediately after windows have been merged.
|
Trigger.TriggerResult |
onTimer(Trigger.TriggerContext<W> c,
Trigger.OnTimerEvent<W> e)
Called when a timer has fired for the trigger or one of it’s sub-triggers.
|
static <W extends BoundedWindow> |
pastFirstElementInPane()
Creates a trigger that fires when the current processing time passes the processing time
at which this trigger saw the first element in a pane.
|
boolean |
willNeverFinish()
Return true if the trigger is guaranteed to never finish.
|
alignedTo, alignedTo, computeTargetTimestamp, isCompatible, mappedTo, plusDelayOfpublic static <W extends BoundedWindow> AfterProcessingTime<W> pastFirstElementInPane()
protected AfterProcessingTime<W> newWith(com.google.common.collect.ImmutableList<SerializableFunction<Instant,Instant>> transforms)
TimeTriggerTimeTrigger modified to use the specified
transform.newWith in class TimeTrigger<W extends BoundedWindow,AfterProcessingTime<W extends BoundedWindow>>transforms - The new transform to apply to target times.TimeTrigger.public Trigger.TriggerResult onElement(Trigger.TriggerContext<W> c, Trigger.OnElementEvent<W> e) throws java.lang.Exception
TriggeronElement in class Trigger<W extends BoundedWindow>c - the context to interact withe - an event describing the cause of this callback being executedjava.lang.Exceptionpublic Trigger.TriggerResult onMerge(Trigger.TriggerContext<W> c, Trigger.OnMergeEvent<W> e) throws java.lang.Exception
TriggerThis will only be called if the trigger hasn't finished in any of the oldWindows.
If it had finished, we assume that it is also finished in the resulting window.
The implementation does not need to clear out any state associated with the old windows. That will automatically be done by the trigger execution layer.
onMerge in class Trigger<W extends BoundedWindow>c - the context to interact withe - an event describnig the cause of this callback being executedjava.lang.Exceptionpublic Trigger.TriggerResult onTimer(Trigger.TriggerContext<W> c, Trigger.OnTimerEvent<W> e) throws java.lang.Exception
TriggeronTimer in class Trigger<W extends BoundedWindow>c - the context to interact withe - identifier for the trigger that the timer is for.java.lang.Exceptionpublic void clear(Trigger.TriggerContext<W> c, W window) throws java.lang.Exception
TriggerThis is called after a trigger has indicated it will never fire again. The trigger system keeps enough information to know that the trigger is finished, so this trigger should clear all of its state.
clear in class Trigger<W extends BoundedWindow>c - the context to interact withwindow - the window that is being clearedjava.lang.Exceptionpublic boolean willNeverFinish()
TriggerwillNeverFinish in class Trigger<W extends BoundedWindow>public Instant getWatermarkCutoff(W window)
Trigger For triggers that do not fire based on the watermark advancing, returns
BoundedWindow.TIMESTAMP_MAX_VALUE.
getWatermarkCutoff in class Trigger<W extends BoundedWindow>