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.MergeResult, Trigger.OnceTrigger<W extends BoundedWindow>, Trigger.OnElementEvent<W extends BoundedWindow>, Trigger.OnMergeEvent<W extends BoundedWindow>, Trigger.OnTimerEvent<W extends BoundedWindow>, Trigger.TriggerContext<W extends BoundedWindow>, Trigger.TriggerId<W extends BoundedWindow>, Trigger.TriggerResult, Trigger.WindowStatusIDENTITYsubTriggers| 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.
|
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.
|
protected AfterProcessingTime<W> |
newWith(List<SerializableFunction<org.joda.time.Instant,org.joda.time.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.MergeResult |
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 its 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.
|
alignedTo, alignedTo, computeTargetTimestamp, isCompatible, mappedTo, plusDelayOforFinally, subTriggers, toStringpublic static <W extends BoundedWindow> AfterProcessingTime<W> pastFirstElementInPane()
protected AfterProcessingTime<W> newWith(List<SerializableFunction<org.joda.time.Instant,org.joda.time.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 Exception
TriggeronElement in class Trigger<W extends BoundedWindow>c - the context to interact withe - an event describing the cause of this callback being executedExceptionpublic Trigger.MergeResult onMerge(Trigger.TriggerContext<W> c, Trigger.OnMergeEvent<W> e) throws Exception
Trigger Leaf 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.TriggerContext<W>, com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnMergeEvent<W>) 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>c - the context to interact withe - an event describnig the cause of this callback being executedExceptionpublic Trigger.TriggerResult onTimer(Trigger.TriggerContext<W> c, Trigger.OnTimerEvent<W> e) throws Exception
TriggeronTimer in class Trigger<W extends BoundedWindow>c - the context to interact withe - identifier for the trigger that the timer is for.Exceptionpublic void clear(Trigger.TriggerContext<W> c, W window) throws 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 clearedExceptionpublic org.joda.time.Instant getWatermarkThatGuaranteesFiring(W window)
Trigger For 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>