public final class WindowRankProcessor extends Object implements SlicingWindowProcessor<Long>
SlicingWindowProcessor.Context<W>
Constructor and Description |
---|
WindowRankProcessor(TypeSerializer<RowData> inputSerializer,
GeneratedRecordComparator genSortKeyComparator,
TypeSerializer<RowData> sortKeySerializer,
WindowBuffer.Factory bufferFactory,
long rankStart,
long rankEnd,
boolean outputRankNumber,
int windowEndIndex,
java.time.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 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 windowEnd)
Emit results of the given window.
|
void |
initializeWatermark(long watermark)
Initializes the watermark which restores from state.
|
void |
open(SlicingWindowProcessor.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.
|
public WindowRankProcessor(TypeSerializer<RowData> inputSerializer, GeneratedRecordComparator genSortKeyComparator, TypeSerializer<RowData> sortKeySerializer, WindowBuffer.Factory bufferFactory, long rankStart, long rankEnd, boolean outputRankNumber, int windowEndIndex, java.time.ZoneId shiftTimeZone)
public void open(SlicingWindowProcessor.Context<Long> context) throws Exception
SlicingWindowProcessor
open
in interface SlicingWindowProcessor<Long>
Exception
public void initializeWatermark(long watermark)
SlicingWindowProcessor
initializeWatermark
in interface SlicingWindowProcessor<Long>
watermark
- the initial watermarkpublic boolean processElement(RowData key, RowData element) throws Exception
SlicingWindowProcessor
processElement
in interface SlicingWindowProcessor<Long>
key
- the key associated with the elementelement
- The element to process.Exception
public void advanceProgress(long progress) throws Exception
SlicingWindowProcessor
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.
advanceProgress
in interface SlicingWindowProcessor<Long>
progress
- the current progress timeException
public void prepareCheckpoint() throws Exception
SlicingWindowProcessor
prepareCheckpoint
in interface SlicingWindowProcessor<Long>
Exception
public void clearWindow(Long windowEnd) throws Exception
SlicingWindowProcessor
Note: the key context has been set.
clearWindow
in interface SlicingWindowProcessor<Long>
windowEnd
- the window to clearException
public void close() throws Exception
SlicingWindowProcessor
close
in interface SlicingWindowProcessor<Long>
Exception
public TypeSerializer<Long> createWindowSerializer()
SlicingWindowProcessor
createWindowSerializer
in interface SlicingWindowProcessor<Long>
public void fireWindow(Long windowEnd) throws Exception
SlicingWindowProcessor
Note: the key context has been set.
fireWindow
in interface SlicingWindowProcessor<Long>
windowEnd
- the window to emitException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.