Class SyncStateWindowRankProcessor
java.lang.Object
org.apache.flink.table.runtime.operators.rank.window.processors.SyncStateWindowRankProcessor
- All Implemented Interfaces:
Serializable,SyncStateWindowProcessor<Long>,WindowProcessor<Long,,SyncStateWindowProcessor.SyncStateContext<Long>> SlicingSyncStateWindowProcessor<Long>
public final class SyncStateWindowRankProcessor
extends Object
implements SlicingSyncStateWindowProcessor<Long>
A rowtime window rank processor.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.SyncStateWindowProcessor
SyncStateWindowProcessor.SyncStateContext<W>Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor
WindowProcessor.Context<W> -
Constructor Summary
ConstructorsConstructorDescriptionSyncStateWindowRankProcessor(org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> inputSerializer, GeneratedRecordComparator genSortKeyComparator, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> sortKeySerializer, WindowBuffer.Factory bufferFactory, long rankStart, long rankEnd, boolean outputRankNumber, int windowEndIndex, ZoneId shiftTimeZone) -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceProgress(long progress) Advances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.voidclearWindow(long timerTimestamp, Long windowEnd) Clear state and resources associated with the given window namespace.voidclose()The tear-down method of the function.org.apache.flink.api.common.typeutils.TypeSerializer<Long>Returns the serializer of the window type.voidfireWindow(long timerTimestamp, Long windowEnd) Emit results of the given window.voidinitializeWatermark(long watermark) Initializes the watermark which restores from state.voidInitialization method for the function.voidPerforms a preparation before checkpoint.booleanprocessElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element) Process an element with associated key from the input stream.
-
Constructor Details
-
SyncStateWindowRankProcessor
public SyncStateWindowRankProcessor(org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> inputSerializer, GeneratedRecordComparator genSortKeyComparator, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> sortKeySerializer, WindowBuffer.Factory bufferFactory, long rankStart, long rankEnd, boolean outputRankNumber, int windowEndIndex, ZoneId shiftTimeZone)
-
-
Method Details
-
open
Description copied from interface:WindowProcessorInitialization method for the function. It is called before the actual working methods.- Specified by:
openin interfaceWindowProcessor<Long,SyncStateWindowProcessor.SyncStateContext<Long>> - Throws:
Exception
-
initializeWatermark
public void initializeWatermark(long watermark) Description copied from interface:WindowProcessorInitializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Specified by:
initializeWatermarkin interfaceWindowProcessor<Long,SyncStateWindowProcessor.SyncStateContext<Long>> - Parameters:
watermark- the initial watermark
-
processElement
public boolean processElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element) throws Exception Description copied from interface:SyncStateWindowProcessorProcess an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.- Specified by:
processElementin interfaceSyncStateWindowProcessor<Long>- Parameters:
key- the key associated with the elementelement- The element to process.- Throws:
Exception
-
advanceProgress
Description copied from interface:SyncStateWindowProcessorAdvances the progress time, the progress time is watermark if working in event-time mode, or current processing time if working in processing-time mode.This will potentially flush buffered data into states, because the watermark advancement may be in a very small step, but we don't need to flush buffered data for every watermark advancement.
- Specified by:
advanceProgressin interfaceSyncStateWindowProcessor<Long>- Parameters:
progress- the current progress time- Throws:
Exception
-
prepareCheckpoint
Description copied from interface:SyncStateWindowProcessorPerforms a preparation before checkpoint. This usually flushes buffered data into state.- Specified by:
prepareCheckpointin interfaceSyncStateWindowProcessor<Long>- Throws:
Exception
-
clearWindow
Description copied from interface:SyncStateWindowProcessorClear state and resources associated with the given window namespace.Note: the key context has been set.
- Specified by:
clearWindowin interfaceSyncStateWindowProcessor<Long>- Parameters:
timerTimestamp- the fired timestampwindowEnd- the window to clear- Throws:
Exception
-
close
Description copied from interface:WindowProcessorThe tear-down method of the function. It is called after the last call to the main working methods.- Specified by:
closein interfaceWindowProcessor<Long,SyncStateWindowProcessor.SyncStateContext<Long>> - Throws:
Exception
-
createWindowSerializer
Description copied from interface:WindowProcessorReturns the serializer of the window type.- Specified by:
createWindowSerializerin interfaceWindowProcessor<Long,SyncStateWindowProcessor.SyncStateContext<Long>>
-
fireWindow
Description copied from interface:SyncStateWindowProcessorEmit results of the given window.Note: the key context has been set.
- Specified by:
fireWindowin interfaceSyncStateWindowProcessor<Long>- Parameters:
timerTimestamp- the fired timestampwindowEnd- the window to emit- Throws:
Exception
-