W - BoundedWindow subclass used to represent the windows used by this
Trigger.TriggerContext.public static interface Trigger.TriggerContext<W extends BoundedWindow>
Trigger.| Modifier and Type | Method and Description |
|---|---|
boolean |
areAllSubtriggersFinished()
Returns true if all the sub-triggers of the current trigger are marked finished.
|
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
current()
Access the executable version of the trigger currently being executed.
|
org.joda.time.Instant |
currentProcessingTime()
Returns the current processing time.
|
void |
deleteTimer(W window,
com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain)
Removes the timer set in this trigger context for the given
window and
timeDomain. |
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
firstUnfinishedSubTrigger()
Returns the first unfinished sub-trigger.
|
Trigger.TriggerContext<W> |
forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
Create a
TriggerContext for executing the given trigger. |
boolean |
isCurrentTrigger(int triggerIndex)
Returns true if the given trigger index corresponds to the current trigger.
|
boolean |
isFinished()
Returns true if the current trigger is marked finished.
|
<T> Map<W,T> |
lookup(CodedTupleTag<T> tag,
Iterable<W> windows)
Lookup the value stored for a given
tag in a bunch of windows. |
<T> T |
lookup(CodedTupleTag<T> tag,
W window)
Lookup the value stored for the given
tag and window. |
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
nextStepTowards(int destinationIndex)
Returns the sub-trigger of the current trigger that is the next step towards the destination.
|
<T> void |
remove(CodedTupleTag<T> tag,
W window)
Removes the keyed state associated with the given
tag and window. |
void |
resetTree(W window)
Clears all keyed state for triggers in the current sub-tree and unsets all the associated
finished bits.
|
void |
setFinished(boolean finished)
Sets the finished bit for the current trigger.
|
void |
setTimer(W window,
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.
|
<T> void |
store(CodedTupleTag<T> tag,
W window,
T value)
Updates the value stored in keyed state for the given
tag and window. |
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> |
subTrigger(int subtriggerIndex)
Access the executable version of the specified sub-trigger.
|
Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> |
subTriggers()
Access the executable versions of the sub-triggers of the current trigger.
|
Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> |
unfinishedSubTriggers()
Returns an iterable over the unfinished sub-triggers of the current trigger.
|
void setTimer(W window, 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.
window - the window the timer is being set for.timestamp - the time at which the trigger’s Trigger.onTimer(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.TriggerContext<W>, com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.OnTimerEvent<W>) callback should
executetimeDomain - the domain that the timestamp applies toIOExceptionvoid deleteTimer(W window, com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain timeDomain) throws IOException
window and
timeDomain.IOExceptionorg.joda.time.Instant currentProcessingTime()
<T> void store(CodedTupleTag<T> tag, W window, T value) throws IOException
tag and window.IOException<T> void remove(CodedTupleTag<T> tag, W window) throws IOException
tag and window.IOException<T> T lookup(CodedTupleTag<T> tag, W window) throws IOException
tag and window.IOException<T> Map<W,T> lookup(CodedTupleTag<T> tag, Iterable<W> windows) throws IOException
tag in a bunch of windows.IOExceptionTrigger.TriggerContext<W> forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)
TriggerContext for executing the given trigger.com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> current()
Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> subTriggers()
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> subTrigger(int subtriggerIndex)
boolean isCurrentTrigger(int triggerIndex)
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> nextStepTowards(int destinationIndex)
boolean isFinished()
boolean areAllSubtriggersFinished()
Iterable<com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W>> unfinishedSubTriggers()
com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> firstUnfinishedSubTrigger()
void resetTree(W window) throws Exception
Exceptionvoid setFinished(boolean finished)