Class AsyncWindowOperator.Context
java.lang.Object
org.apache.flink.runtime.asyncprocessing.operators.windowing.AsyncWindowOperator.Context
- All Implemented Interfaces:
AsyncTrigger.OnMergeContext,AsyncTrigger.TriggerContext
Context is a utility for handling AsyncTrigger invocations. It can be reused
by setting the key and window fields. No internal state must be kept in the
Context-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.api.common.state.v2.StateFuture<Void>clear()voiddeleteEventTimeTimer(long time) Delete the event-time trigger for the given time.voiddeleteProcessingTimeTimer(long time) Delete the processing time trigger for the given time.longReturns the current processing time.longReturns the current watermark time.org.apache.flink.metrics.MetricGroupReturns the metric group for thisAsyncTrigger.<T,S extends org.apache.flink.api.common.state.v2.State>
SgetPartitionedState(org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor) Retrieves aState(v2) object that can be used to interact with fault-tolerant state that is scoped to the window and key of the current trigger invocation.<T> voidmergePartitionedState(org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor) org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onElement(StreamRecord<IN> element) org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onEventTime(long time) voidonMerge(Collection<W> mergedWindows) org.apache.flink.api.common.state.v2.StateFuture<TriggerResult>onProcessingTime(long time) voidregisterEventTimeTimer(long time) Register an event-time callback.voidregisterProcessingTimeTimer(long time) Register a system time callback.toString()
-
Field Details
-
window
-
-
Constructor Details
-
Context
-
-
Method Details
-
getMetricGroup
public org.apache.flink.metrics.MetricGroup getMetricGroup()Description copied from interface:AsyncTrigger.TriggerContextReturns the metric group for thisAsyncTrigger. This is the same metric group that would be returned fromRuntimeContext.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.- Specified by:
getMetricGroupin interfaceAsyncTrigger.TriggerContext
-
getCurrentWatermark
public long getCurrentWatermark()Description copied from interface:AsyncTrigger.TriggerContextReturns the current watermark time.- Specified by:
getCurrentWatermarkin interfaceAsyncTrigger.TriggerContext
-
getPartitionedState
public <T,S extends org.apache.flink.api.common.state.v2.State> S getPartitionedState(org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor) Description copied from interface:AsyncTrigger.TriggerContextRetrieves aState(v2) object that can be used to interact with fault-tolerant state that is scoped to the window and key of the current trigger invocation.- Specified by:
getPartitionedStatein interfaceAsyncTrigger.TriggerContext- Type Parameters:
T- The store element of the state.- Parameters:
stateDescriptor- The StateDescriptor that contains the name and type of the state that is being accessed.- Returns:
- The partitioned state object.
-
mergePartitionedState
public <T> void mergePartitionedState(org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor) - Specified by:
mergePartitionedStatein interfaceAsyncTrigger.OnMergeContext
-
getCurrentProcessingTime
public long getCurrentProcessingTime()Description copied from interface:AsyncTrigger.TriggerContextReturns the current processing time.- Specified by:
getCurrentProcessingTimein interfaceAsyncTrigger.TriggerContext
-
registerProcessingTimeTimer
public void registerProcessingTimeTimer(long time) Description copied from interface:AsyncTrigger.TriggerContextRegister a system time callback. When the current system time passes the specified timeAsyncTrigger.onProcessingTime(long, Window, TriggerContext)is called with the time specified here.- Specified by:
registerProcessingTimeTimerin interfaceAsyncTrigger.TriggerContext- Parameters:
time- The time at which to invokeAsyncTrigger.onProcessingTime(long, Window, TriggerContext)
-
registerEventTimeTimer
public void registerEventTimeTimer(long time) Description copied from interface:AsyncTrigger.TriggerContextRegister an event-time callback. When the current watermark passes the specified timeAsyncTrigger.onEventTime(long, Window, TriggerContext)is called with the time specified here.- Specified by:
registerEventTimeTimerin interfaceAsyncTrigger.TriggerContext- Parameters:
time- The watermark at which to invokeAsyncTrigger.onEventTime(long, Window, AsyncTrigger.TriggerContext)- See Also:
-
deleteProcessingTimeTimer
public void deleteProcessingTimeTimer(long time) Description copied from interface:AsyncTrigger.TriggerContextDelete the processing time trigger for the given time.- Specified by:
deleteProcessingTimeTimerin interfaceAsyncTrigger.TriggerContext
-
deleteEventTimeTimer
public void deleteEventTimeTimer(long time) Description copied from interface:AsyncTrigger.TriggerContextDelete the event-time trigger for the given time.- Specified by:
deleteEventTimeTimerin interfaceAsyncTrigger.TriggerContext
-
onElement
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onElement(StreamRecord<IN> element) throws Exception - Throws:
Exception
-
onProcessingTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onProcessingTime(long time) throws Exception - Throws:
Exception
-
onEventTime
public org.apache.flink.api.common.state.v2.StateFuture<TriggerResult> onEventTime(long time) throws Exception - Throws:
Exception
-
onMerge
- Throws:
Exception
-
clear
- Throws:
Exception
-
toString
-