public static interface Trigger.TriggerContext
Trigger methods to allow them to register timer
callbacks and deal with state.| Modifier and Type | Method and Description |
|---|---|
void |
deleteEventTimeTimer(long time)
Delete the event-time trigger for the given time.
|
void |
deleteProcessingTimeTimer(long time)
Delete the processing time trigger for the given time.
|
long |
getCurrentProcessingTime()
Returns the current processing time.
|
long |
getCurrentWatermark()
Returns the current watermark time.
|
org.apache.flink.metrics.MetricGroup |
getMetricGroup()
Returns the metric group for this
Trigger. |
<S extends org.apache.flink.api.common.state.State> |
getPartitionedState(org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor)
Retrieves a
State object that can be used to interact with fault-tolerant state
that is scoped to the window and key of the current trigger invocation. |
ZoneId |
getShiftTimeZone()
Returns the shifted timezone.
|
void |
registerEventTimeTimer(long time)
Register an event-time callback.
|
void |
registerProcessingTimeTimer(long time)
Register a system time callback.
|
long getCurrentProcessingTime()
org.apache.flink.metrics.MetricGroup getMetricGroup()
Trigger. This is the same metric group that
would be returned from RuntimeContext.getMetricGroup() in a user function.
You must not call methods that create metric objects (such as MetricGroup.counter(int) multiple times but instead call once and store the metric
object in a field.
long getCurrentWatermark()
void registerProcessingTimeTimer(long time)
Trigger.onProcessingTime(long, Window) is called with the time specified here.time - The time at which to invoke Trigger.onProcessingTime(long, Window)void registerEventTimeTimer(long time)
Trigger.onEventTime(long, Window) is called with the time specified here.time - The watermark at which to invoke Trigger.onEventTime(long, Window)Watermarkvoid deleteProcessingTimeTimer(long time)
void deleteEventTimeTimer(long time)
ZoneId getShiftTimeZone()
<S extends org.apache.flink.api.common.state.State> S getPartitionedState(org.apache.flink.api.common.state.StateDescriptor<S,?> stateDescriptor)
State object that can be used to interact with fault-tolerant state
that is scoped to the window and key of the current trigger invocation.S - The type of the state.stateDescriptor - The StateDescriptor that contains the name and type of the state
that is being accessed.UnsupportedOperationException - Thrown, if no partitioned state is available for
the function (function is not part os a KeyedStream).Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.