Class InternalTimerServiceAsyncImpl<K,N>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.InternalTimerServiceImpl<K,N>
-
- org.apache.flink.streaming.api.operators.InternalTimerServiceAsyncImpl<K,N>
-
- Type Parameters:
K
- Type of timer's key.N
- Type of the namespace to which timers are scoped.
- All Implemented Interfaces:
InternalTimerService<N>
@Internal public class InternalTimerServiceAsyncImpl<K,N> extends InternalTimerServiceImpl<K,N>
An implementation ofInternalTimerService
that is used byorg.apache.flink.streaming.runtime.operators.asyncprocessing.AbstractAsyncStateStreamOperator
. The timer service will setRecordContext
for the timers before invoking action to preserve the execution order between timer firing and records processing.- See Also:
- FLIP-425 timers section.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.api.operators.InternalTimerServiceImpl
cancellationContext, currentWatermark, eventTimeTimersQueue, keyContext, nextTimer, processingTimeService, processingTimeTimersQueue, taskIOMetricGroup, triggerTarget
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advanceWatermark(long time)
Advance one watermark, this will fire some event timers.protected void
foreachTimer(BiConsumerWithException<N,Long,Exception> consumer, KeyGroupedInternalPriorityQueue<TimerHeapInternalTimer<K,N>> queue)
Iterator each timer in the queue, and invoke the consumer.-
Methods inherited from class org.apache.flink.streaming.api.operators.InternalTimerServiceImpl
currentProcessingTime, currentWatermark, deleteEventTimeTimer, deleteProcessingTimeTimer, forEachEventTimeTimer, forEachProcessingTimeTimer, getKeySerializer, getNamespaceSerializer, numEventTimeTimers, numEventTimeTimers, numProcessingTimeTimers, numProcessingTimeTimers, registerEventTimeTimer, registerProcessingTimeTimer, restoreTimersForKeyGroup, snapshotTimersForKeyGroup, startTimerService, tryAdvanceWatermark
-
-
-
-
Method Detail
-
advanceWatermark
public void advanceWatermark(long time) throws Exception
Advance one watermark, this will fire some event timers.- Overrides:
advanceWatermark
in classInternalTimerServiceImpl<K,N>
- Parameters:
time
- the time in watermark.- Throws:
Exception
-
foreachTimer
protected void foreachTimer(BiConsumerWithException<N,Long,Exception> consumer, KeyGroupedInternalPriorityQueue<TimerHeapInternalTimer<K,N>> queue) throws Exception
Iterator each timer in the queue, and invoke the consumer. This function is mainly used by state-processor-API. TODO: Ensure state-processor-API that only uses sync state API.- Overrides:
foreachTimer
in classInternalTimerServiceImpl<K,N>
- Throws:
Exception
-
-