Interface SlicingWindowProcessor<W>
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractWindowAggProcessor,RowTimeWindowDeduplicateProcessor,SliceSharedWindowAggProcessor,SliceUnsharedWindowAggProcessor,WindowRankProcessor
@Internal public interface SlicingWindowProcessor<W> extends Serializable
A processor that processes elements for slicing windows.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSlicingWindowProcessor.Context<W>Information available in an invocation of methods ofSlicingWindowProcessor.
-
Method Summary
All Methods Instance Methods Abstract 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(W window)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<W>createWindowSerializer()Returns the serializer of the window type.voidfireWindow(W window)Emit results of the given window.voidinitializeWatermark(long watermark)Initializes the watermark which restores from state.voidopen(SlicingWindowProcessor.Context<W> 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.
-
-
-
Method Detail
-
open
void open(SlicingWindowProcessor.Context<W> context) throws Exception
Initialization method for the function. It is called before the actual working methods.- Throws:
Exception
-
initializeWatermark
void initializeWatermark(long watermark)
Initializes the watermark which restores from state. The method is called after open method and before the actual working methods.- Parameters:
watermark- the initial watermark
-
processElement
boolean processElement(org.apache.flink.table.data.RowData key, org.apache.flink.table.data.RowData element) throws ExceptionProcess an element with associated key from the input stream. Returns true if this element is dropped because of late arrival.- Parameters:
key- the key associated with the elementelement- The element to process.- Throws:
Exception
-
advanceProgress
void advanceProgress(long progress) throws ExceptionAdvances 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.
- Parameters:
progress- the current progress time- Throws:
Exception
-
prepareCheckpoint
void prepareCheckpoint() throws ExceptionPerforms a preparation before checkpoint. This usually flushes buffered data into state.- Throws:
Exception
-
fireWindow
void fireWindow(W window) throws Exception
Emit results of the given window.Note: the key context has been set.
- Parameters:
window- the window to emit- Throws:
Exception
-
clearWindow
void clearWindow(W window) throws Exception
Clear state and resources associated with the given window namespace.Note: the key context has been set.
- Parameters:
window- the window to clear- Throws:
Exception
-
close
void close() throws ExceptionThe tear-down method of the function. It is called after the last call to the main working methods.- Throws:
Exception
-
createWindowSerializer
org.apache.flink.api.common.typeutils.TypeSerializer<W> createWindowSerializer()
Returns the serializer of the window type.
-
-