Package org.apache.beam.sdk.state
Interface Timers
public interface Timers
Interface for interacting with time.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current event time.Returns the current processing time.Returns the current synchronized processing time ornullif unknown.voiddeleteTimer(Instant timestamp, TimeDomain timeDomain) Removes the timer set in this context for thetimestampandtimeDomain.voidsetTimer(Instant timestamp, TimeDomain timeDomain) Sets a timer to fire when the event time watermark, the current processing time, or the synchronized processing time watermark surpasses a given timestamp.voidsetTimer(Instant timestamp, Instant outputTimestamp, TimeDomain timeDomain) Set a timer with outputTimestamp.
-
Method Details
-
setTimer
Sets a timer to fire when the event time watermark, the current processing time, or the synchronized processing time watermark surpasses a given timestamp.See
TimeDomainfor details on the time domains available.Timers are not guaranteed to fire immediately, but will be delivered at some time afterwards.
An implementation of
Timersimplicitly scopes timers that are set - they may be scoped to a key and window, or a key, window, and trigger, etc.- Parameters:
timestamp- the time at which the timer should be deliveredtimeDomain- the domain that thetimestampapplies to
-
setTimer
Set a timer with outputTimestamp. -
deleteTimer
Removes the timer set in this context for thetimestampandtimeDomain. -
currentProcessingTime
Instant currentProcessingTime()Returns the current processing time. -
currentSynchronizedProcessingTime
Returns the current synchronized processing time ornullif unknown. -
currentEventTime
Instant currentEventTime()Returns the current event time.
-