Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.transforms.windowing
Class Trigger.OnElementContext
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.TriggerContext
-
- com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnElementContext
-
- Enclosing class:
- Trigger<W extends BoundedWindow>
public abstract class Trigger.OnElementContext extends Trigger.TriggerContext
ExtendedTrigger.TriggerContext
containing information accessible to theTrigger.onElement(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnElementContext)
operational hook.
-
-
Constructor Summary
Constructors Constructor and Description OnElementContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract Instant
eventTimestamp()
The event timestamp of the element currently being processed.abstract Trigger.OnElementContext
forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
Create anOnElementContext
for executing the given trigger.abstract void
setTimer(Instant timestamp, com.google.cloud.dataflow.sdk.util.TimeDomain domain)
Sets a timer to fire when the watermark or processing time is beyond the given timestamp.-
Methods inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.TriggerContext
currentEventTime, currentProcessingTime, currentSynchronizedProcessingTime, deleteTimer, state, trigger, window
-
-
-
-
Method Detail
-
eventTimestamp
public abstract Instant eventTimestamp()
The event timestamp of the element currently being processed.
-
setTimer
public abstract void setTimer(Instant timestamp, com.google.cloud.dataflow.sdk.util.TimeDomain domain)
Sets a timer to fire when the watermark or processing time is beyond the given timestamp. Timers are not guaranteed to fire immediately, but will be delivered at some time afterwards.As with
Trigger.TriggerContext.state()
, timers are implicitly scoped to the current window. All timer firings for a window will be received, but the implementation should choose to ignore those that are not applicable.- Parameters:
timestamp
- the time at which the trigger should be re-evaluateddomain
- the domain that thetimestamp
applies to
-
forTrigger
public abstract Trigger.OnElementContext forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
Create anOnElementContext
for executing the given trigger.- Specified by:
forTrigger
in classTrigger.TriggerContext
-
-