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.
|
MetricGroup |
getMetricGroup()
Returns the metric group for this
Trigger . |
<S extends State> |
getPartitionedState(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. |
java.time.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()
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)
Watermark
void deleteProcessingTimeTimer(long time)
void deleteEventTimeTimer(long time)
java.time.ZoneId getShiftTimeZone()
<S extends State> S getPartitionedState(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–2024 The Apache Software Foundation. All rights reserved.