Class WindowRankProcessor
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.rank.window.processors.WindowRankProcessor
-
- All Implemented Interfaces:
Serializable
,WindowProcessor<Long>
,SlicingWindowProcessor<Long>
public final class WindowRankProcessor extends Object implements SlicingWindowProcessor<Long>
A rowtime window rank processor.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.common.WindowProcessor
WindowProcessor.Context<W>
-
-
Constructor Summary
Constructors Constructor Description WindowRankProcessor(TypeSerializer<RowData> inputSerializer, GeneratedRecordComparator genSortKeyComparator, TypeSerializer<RowData> sortKeySerializer, WindowBuffer.Factory bufferFactory, long rankStart, long rankEnd, boolean outputRankNumber, int windowEndIndex, ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advanceProgress(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.void
clearWindow(long timerTimestamp, Long windowEnd)
Clear state and resources associated with the given window namespace.void
close()
The tear-down method of the function.TypeSerializer<Long>
createWindowSerializer()
Returns the serializer of the window type.void
fireWindow(long timerTimestamp, Long windowEnd)
Emit results of the given window.void
initializeWatermark(long watermark)
Initializes the watermark which restores from state.void
open(WindowProcessor.Context<Long> context)
Initialization method for the function.void
prepareCheckpoint()
Performs a preparation before checkpoint.boolean
processElement(RowData key, RowData element)
Process an element with associated key from the input stream.
-
-
-
Constructor Detail
-
WindowRankProcessor
public WindowRankProcessor(TypeSerializer<RowData> inputSerializer, GeneratedRecordComparator genSortKeyComparator, TypeSerializer<RowData> sortKeySerializer, WindowBuffer.Factory bufferFactory, long rankStart, long rankEnd, boolean outputRankNumber, int windowEndIndex, ZoneId shiftTimeZone)
-
-
Method Detail
-
open
public void open(WindowProcessor.Context<Long> context) throws Exception
Description copied from interface:WindowProcessor
Initialization method for the function. It is called before the actual working methods.- Specified by:
open
in interfaceWindowProcessor<Long>
- Throws:
Exception
-
initializeWatermark
public void initializeWatermark(long watermark)
Description copied from interface:WindowProcessor
Initializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Specified by:
initializeWatermark
in interfaceWindowProcessor<Long>
- Parameters:
watermark
- the initial watermark
-
processElement
public boolean processElement(RowData key, RowData element) throws Exception
Description copied from interface:WindowProcessor
Process an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.- Specified by:
processElement
in interfaceWindowProcessor<Long>
- Parameters:
key
- the key associated with the elementelement
- The element to process.- Throws:
Exception
-
advanceProgress
public void advanceProgress(long progress) throws Exception
Description copied from interface:WindowProcessor
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.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:
advanceProgress
in interfaceWindowProcessor<Long>
- Parameters:
progress
- the current progress time- Throws:
Exception
-
prepareCheckpoint
public void prepareCheckpoint() throws Exception
Description copied from interface:WindowProcessor
Performs a preparation before checkpoint. This usually flushes buffered data into state.- Specified by:
prepareCheckpoint
in interfaceWindowProcessor<Long>
- Throws:
Exception
-
clearWindow
public void clearWindow(long timerTimestamp, Long windowEnd) throws Exception
Description copied from interface:WindowProcessor
Clear state and resources associated with the given window namespace.Note: the key context has been set.
- Specified by:
clearWindow
in interfaceWindowProcessor<Long>
- Parameters:
timerTimestamp
- the fired timestampwindowEnd
- the window to clear- Throws:
Exception
-
close
public void close() throws Exception
Description copied from interface:WindowProcessor
The tear-down method of the function. It is called after the last call to the main working methods.- Specified by:
close
in interfaceWindowProcessor<Long>
- Throws:
Exception
-
createWindowSerializer
public TypeSerializer<Long> createWindowSerializer()
Description copied from interface:WindowProcessor
Returns the serializer of the window type.- Specified by:
createWindowSerializer
in interfaceWindowProcessor<Long>
-
fireWindow
public void fireWindow(long timerTimestamp, Long windowEnd) throws Exception
Description copied from interface:WindowProcessor
Emit results of the given window.Note: the key context has been set.
- Specified by:
fireWindow
in interfaceWindowProcessor<Long>
- Parameters:
timerTimestamp
- the fired timestampwindowEnd
- the window to emit- Throws:
Exception
-
-