Class WindowRankProcessor
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.rank.window.processors.WindowRankProcessor
-
- All Implemented Interfaces:
Serializable,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.slicing.SlicingWindowProcessor
SlicingWindowProcessor.Context<W>
-
-
Constructor Summary
Constructors Constructor Description WindowRankProcessor(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, java.time.ZoneId shiftTimeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceProgress(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 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>createWindowSerializer()Returns the serializer of the window type.voidfireWindow(Long windowEnd)Emit results of the given window.voidinitializeWatermark(long watermark)Initializes the watermark which restores from state.voidopen(SlicingWindowProcessor.Context<Long> context)Initialization method for the function.voidprepareCheckpoint()Performs 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 Detail
-
WindowRankProcessor
public WindowRankProcessor(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, java.time.ZoneId shiftTimeZone)
-
-
Method Detail
-
open
public void open(SlicingWindowProcessor.Context<Long> context) throws Exception
Description copied from interface:SlicingWindowProcessorInitialization method for the function. It is called before the actual working methods.- Specified by:
openin interfaceSlicingWindowProcessor<Long>- Throws:
Exception
-
initializeWatermark
public void initializeWatermark(long watermark)
Description copied from interface:SlicingWindowProcessorInitializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Specified by:
initializeWatermarkin interfaceSlicingWindowProcessor<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 ExceptionDescription copied from interface:SlicingWindowProcessorProcess an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.- Specified by:
processElementin interfaceSlicingWindowProcessor<Long>- Parameters:
key- the key associated with the elementelement- The element to process.- Throws:
Exception
-
advanceProgress
public void advanceProgress(long progress) throws ExceptionDescription copied from interface:SlicingWindowProcessorAdvances 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 interfaceSlicingWindowProcessor<Long>- Parameters:
progress- the current progress time- Throws:
Exception
-
prepareCheckpoint
public void prepareCheckpoint() throws ExceptionDescription copied from interface:SlicingWindowProcessorPerforms a preparation before checkpoint. This usually flushes buffered data into state.- Specified by:
prepareCheckpointin interfaceSlicingWindowProcessor<Long>- Throws:
Exception
-
clearWindow
public void clearWindow(Long windowEnd) throws Exception
Description copied from interface:SlicingWindowProcessorClear state and resources associated with the given window namespace.Note: the key context has been set.
- Specified by:
clearWindowin interfaceSlicingWindowProcessor<Long>- Parameters:
windowEnd- the window to clear- Throws:
Exception
-
close
public void close() throws ExceptionDescription copied from interface:SlicingWindowProcessorThe tear-down method of the function. It is called after the last call to the main working methods.- Specified by:
closein interfaceSlicingWindowProcessor<Long>- Throws:
Exception
-
createWindowSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<Long> createWindowSerializer()
Description copied from interface:SlicingWindowProcessorReturns the serializer of the window type.- Specified by:
createWindowSerializerin interfaceSlicingWindowProcessor<Long>
-
fireWindow
public void fireWindow(Long windowEnd) throws Exception
Description copied from interface:SlicingWindowProcessorEmit results of the given window.Note: the key context has been set.
- Specified by:
fireWindowin interfaceSlicingWindowProcessor<Long>- Parameters:
windowEnd- the window to emit- Throws:
Exception
-
-