@Internal public interface WindowBuffer
Modifier and Type | Interface and Description |
---|---|
static interface |
WindowBuffer.Factory
A factory that creates a
WindowBuffer . |
static interface |
WindowBuffer.LocalFactory
A factory that creates a
WindowBuffer . |
Modifier and Type | Method and Description |
---|---|
void |
addElement(RowData key,
long window,
RowData element)
Adds an element with associated key into the buffer.
|
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 |
close()
Release resources allocated by this buffer.
|
void |
flush()
Flushes all intermediate buffered data to the underlying backend or output stream.
|
void addElement(RowData key, long window, RowData element) throws Exception
It may be that adding this element fills up an internal buffer and causes the buffer flushing of a batch of internally buffered elements.
key
- the key associated with the elementelement
- The element to add.Exception
- Thrown, if the element cannot be added to the buffer, or if the flushing
throws an exception.void advanceProgress(long progress) throws Exception
This will potentially flush buffered data into states or to the output stream, because the watermark advancement may be in a very small step, but we don't need to flush buffered data for every watermark advancement.
progress
- the current progress timeException
void flush() throws Exception
Exception
- Thrown if the buffer cannot be flushed, or if the output stream throws an
exception.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.