InputT
- The type of the sink writer's input@Public public interface SinkWriter<InputT> extends AutoCloseable
SinkWriter
is responsible for writing data.Modifier and Type | Interface and Description |
---|---|
static interface |
SinkWriter.Context
Context that
write(InputT, org.apache.flink.api.connector.sink2.SinkWriter.Context) can use for getting additional data about an input record. |
Modifier and Type | Method and Description |
---|---|
void |
flush(boolean endOfInput)
Called on checkpoint or end of input so that the writer to flush all pending data for
at-least-once.
|
void |
write(InputT element,
SinkWriter.Context context)
Adds an element to the writer.
|
default void |
writeWatermark(Watermark watermark)
Adds a watermark to the writer.
|
close
void write(InputT element, SinkWriter.Context context) throws IOException, InterruptedException
element
- The input recordcontext
- The additional information about the input recordIOException
- if fail to add an element.InterruptedException
void flush(boolean endOfInput) throws IOException, InterruptedException
IOException
InterruptedException
default void writeWatermark(Watermark watermark) throws IOException, InterruptedException
This method is intended for advanced sinks that propagate watermarks.
watermark
- The watermark.IOException
- if fail to add a watermark.InterruptedException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.