public abstract class Trigger.TriggerContext extends Object
Trigger.| Constructor and Description |
|---|
TriggerContext() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
areAllSubtriggersFinished()
Returns true if all the sub-triggers of the current trigger are marked finished.
|
abstract org.joda.time.Instant |
currentProcessingTime()
Returns the current processing time.
|
abstract void |
deleteTimer(com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain)
Removes the timer set in this trigger context for the given
window and
timeDomain. |
abstract com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
firstUnfinishedSubTrigger()
Returns the first unfinished sub-trigger.
|
abstract Trigger.TriggerContext |
forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
Create a
TriggerContext for executing the given trigger. |
abstract boolean |
isFinished()
Returns true if the current trigger is marked finished.
|
abstract <T> Map<W,T> |
lookup(CodedTupleTag<T> tag,
Iterable<W> windows)
Lookup the value stored for a given
tag in a bunch of windows. |
abstract <T> T |
lookup(CodedTupleTag<T> tag,
W window)
Lookup the value stored for the given
tag and window. |
abstract <T> void |
remove(CodedTupleTag<T> tag,
W window)
Removes the keyed state associated with the given
tag and window. |
abstract void |
resetTree()
Clears all keyed state for triggers in the current sub-tree and unsets all the associated
finished bits.
|
abstract void |
setFinished(boolean finished)
Sets the finished bit for the current trigger.
|
abstract void |
setTimer(org.joda.time.Instant timestamp,
com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain)
Sets a timer to fire when the watermark or processing time is beyond the given timestamp.
|
abstract <T> void |
store(CodedTupleTag<T> tag,
W window,
T value)
Updates the value stored in keyed state for the given
tag and window. |
abstract com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
subTrigger(int subtriggerIndex)
Access the executable version of the specified sub-trigger.
|
abstract Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> |
subTriggers()
Access the executable versions of the sub-triggers of the current trigger.
|
abstract Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> |
unfinishedSubTriggers()
Returns an iterable over the unfinished sub-triggers of the current trigger.
|
abstract W |
window()
The window that the current context is executing in.
|
public abstract void setTimer(org.joda.time.Instant timestamp,
com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain)
throws IOException
Each trigger can have a single timer in per timeDomain and window. If the
trigger has already set a timer for a given domain and window, then setting overwrites it.
timestamp - the time at which the trigger’s Trigger.onTimer(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.OnTimerContext) callback should
executetimeDomain - the domain that the timestamp applies toIOExceptionpublic abstract void deleteTimer(com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain)
throws IOException
window and
timeDomain.IOExceptionpublic abstract org.joda.time.Instant currentProcessingTime()
public abstract <T> void store(CodedTupleTag<T> tag, W window, T value) throws IOException
tag and window.IOExceptionpublic abstract <T> void remove(CodedTupleTag<T> tag, W window) throws IOException
tag and window.IOExceptionpublic abstract <T> T lookup(CodedTupleTag<T> tag, W window) throws IOException
tag and window.IOExceptionpublic abstract <T> Map<W,T> lookup(CodedTupleTag<T> tag, Iterable<W> windows) throws IOException
tag in a bunch of windows.IOExceptionpublic abstract Trigger.TriggerContext forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
TriggerContext for executing the given trigger.public abstract Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> subTriggers()
public abstract com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> subTrigger(int subtriggerIndex)
public abstract boolean isFinished()
public abstract boolean areAllSubtriggersFinished()
public abstract Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> unfinishedSubTriggers()
public abstract com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> firstUnfinishedSubTrigger()
public abstract void resetTree()
throws Exception
Exceptionpublic abstract void setFinished(boolean finished)
public abstract W window()