InputT
- The type of the sink writer's inputCommT
- The type of information needed to commit data staged by the sinkWriterStateT
- The type of the writer's stateSinkWriter
or a derivative.@Deprecated @PublicEvolving public interface SinkWriter<InputT,CommT,WriterStateT> extends AutoCloseable
SinkWriter
is responsible for writing data and handling any potential tmp area used
to write yet un-staged data, e.g. in-progress files. The data (or metadata pointing to where the
actual data is staged) ready to commit is returned to the system by the prepareCommit(boolean)
.Modifier and Type | Interface and Description |
---|---|
static interface |
SinkWriter.Context
Deprecated.
Please migrate to
SinkWriter and use
SinkWriter.Context . |
Modifier and Type | Method and Description |
---|---|
List<CommT> |
prepareCommit(boolean flush)
Deprecated.
Prepare for a commit.
|
default List<WriterStateT> |
snapshotState()
Deprecated.
implement
snapshotState(long) |
default List<WriterStateT> |
snapshotState(long checkpointId)
Deprecated.
|
void |
write(InputT element,
SinkWriter.Context context)
Deprecated.
Add an element to the writer.
|
default void |
writeWatermark(Watermark watermark)
Deprecated.
Add 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
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
List<CommT> prepareCommit(boolean flush) throws IOException, InterruptedException
This will be called before we checkpoint the Writer's state in Streaming execution mode.
In case the sink has no explicit committer, this method is still called to allow the writer to implement a 1-phase commit protocol.
flush
- Whether flushing the un-staged data or notIOException
- if fail to prepare for a commit.InterruptedException
default List<WriterStateT> snapshotState() throws IOException
snapshotState(long)
IOException
- if fail to snapshot writer's state.default List<WriterStateT> snapshotState(long checkpointId) throws IOException
IOException
- if fail to snapshot writer's state.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.