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 ornull
if unknown.void
deleteTimer
(Instant timestamp, TimeDomain timeDomain) Removes the timer set in this context for thetimestamp
andtimeDomain
.void
setTimer
(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.void
setTimer
(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
TimeDomain
for details on the time domains available.Timers are not guaranteed to fire immediately, but will be delivered at some time afterwards.
An implementation of
Timers
implicitly 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 thetimestamp
applies to
-
setTimer
Set a timer with outputTimestamp. -
deleteTimer
Removes the timer set in this context for thetimestamp
andtimeDomain
. -
currentProcessingTime
Instant currentProcessingTime()Returns the current processing time. -
currentSynchronizedProcessingTime
Returns the current synchronized processing time ornull
if unknown. -
currentEventTime
Instant currentEventTime()Returns the current event time.
-