public final class WindowRankProcessor extends Object implements SlicingWindowProcessor<Long>
WindowProcessor.Context<W>| Constructor and 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,
ZoneId shiftTimeZone) |
| Modifier and Type | Method and 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.
|
org.apache.flink.api.common.typeutils.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(org.apache.flink.table.data.RowData key,
org.apache.flink.table.data.RowData element)
Process an element with associated key from the input stream.
|
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,
ZoneId shiftTimeZone)
public void open(WindowProcessor.Context<Long> context) throws Exception
WindowProcessoropen in interface WindowProcessor<Long>Exceptionpublic void initializeWatermark(long watermark)
WindowProcessorinitializeWatermark in interface WindowProcessor<Long>watermark - the initial watermarkpublic boolean processElement(org.apache.flink.table.data.RowData key,
org.apache.flink.table.data.RowData element)
throws Exception
WindowProcessorprocessElement in interface WindowProcessor<Long>key - the key associated with the elementelement - The element to process.Exceptionpublic void advanceProgress(long progress)
throws Exception
WindowProcessorThis 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.
advanceProgress in interface WindowProcessor<Long>progress - the current progress timeExceptionpublic void prepareCheckpoint()
throws Exception
WindowProcessorprepareCheckpoint in interface WindowProcessor<Long>Exceptionpublic void clearWindow(long timerTimestamp,
Long windowEnd)
throws Exception
WindowProcessorNote: the key context has been set.
clearWindow in interface WindowProcessor<Long>timerTimestamp - the fired timestampwindowEnd - the window to clearExceptionpublic void close()
throws Exception
WindowProcessorclose in interface WindowProcessor<Long>Exceptionpublic org.apache.flink.api.common.typeutils.TypeSerializer<Long> createWindowSerializer()
WindowProcessorcreateWindowSerializer in interface WindowProcessor<Long>public void fireWindow(long timerTimestamp,
Long windowEnd)
throws Exception
WindowProcessorNote: the key context has been set.
fireWindow in interface WindowProcessor<Long>timerTimestamp - the fired timestampwindowEnd - the window to emitExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.