public abstract class Timer<K>
extends java.lang.Object
Note that this is an implementation helper specifically intended for use during execution by
runners and the Java SDK harness. The API for pipeline authors is Timer
.
Modifier and Type | Class and Description |
---|---|
static class |
Timer.Coder<K>
A
Coder for timers. |
Constructor and Description |
---|
Timer() |
Modifier and Type | Method and Description |
---|---|
static <K> Timer<K> |
cleared(K userKey,
java.lang.String dynamicTimerTag,
java.util.Collection<? extends BoundedWindow> windows)
Returns a cleared timer for the given
userKey , dynamicTimerTag and windows . |
boolean |
equals(@Nullable java.lang.Object other) |
abstract boolean |
getClearBit()
Returns whether the timer is going to be cleared.
|
abstract java.lang.String |
getDynamicTimerTag()
Returns the tag that the timer is set on.
|
abstract @Nullable org.joda.time.Instant |
getFireTimestamp()
Returns the timestamp of when the timer is scheduled to fire.
|
abstract @Nullable org.joda.time.Instant |
getHoldTimestamp()
Returns the watermark that the timer is supposed to be held.
|
abstract @Nullable PaneInfo |
getPane()
Returns the
PaneInfo that is related to the timer. |
abstract K |
getUserKey()
Returns the key that the timer is set on.
|
abstract java.util.Collection<? extends BoundedWindow> |
getWindows()
Returns the windows which are associated with the timer.
|
int |
hashCode() |
static <K> Timer<K> |
of(K userKey,
java.lang.String dynamicTimerTag,
java.util.Collection<? extends BoundedWindow> windows,
org.joda.time.Instant fireTimestamp,
org.joda.time.Instant holdTimestamp,
PaneInfo pane)
Returns a non-cleared timer for the given
userKey , dynamicTimerTag , fireTimestamp , holdTimestamp , windows and pane . |
public static <K> Timer<K> of(K userKey, java.lang.String dynamicTimerTag, java.util.Collection<? extends BoundedWindow> windows, org.joda.time.Instant fireTimestamp, org.joda.time.Instant holdTimestamp, PaneInfo pane)
userKey
, dynamicTimerTag
, fireTimestamp
, holdTimestamp
, windows
and pane
.public static <K> Timer<K> cleared(K userKey, java.lang.String dynamicTimerTag, java.util.Collection<? extends BoundedWindow> windows)
userKey
, dynamicTimerTag
and windows
.public abstract K getUserKey()
public abstract java.lang.String getDynamicTimerTag()
""
when the timer is for a TimerSpec
.public abstract java.util.Collection<? extends BoundedWindow> getWindows()
public abstract boolean getClearBit()
public abstract @Nullable org.joda.time.Instant getFireTimestamp()
The time is absolute to the time domain defined in the RunnerApi.TimerFamilySpec
that is associated with this
timer.
public abstract @Nullable org.joda.time.Instant getHoldTimestamp()
public abstract @Nullable PaneInfo getPane()
PaneInfo
that is related to the timer. This field is nullable only when the
timer is being cleared.public final boolean equals(@Nullable java.lang.Object other)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object