Interface SinkWriter<InputT,CommT,WriterStateT>
-
- Type Parameters:
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 state
- All Superinterfaces:
AutoCloseable
@Deprecated @PublicEvolving public interface SinkWriter<InputT,CommT,WriterStateT> extends AutoCloseable
Deprecated.Please useSinkWriteror a derivative.TheSinkWriteris 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 theprepareCommit(boolean).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSinkWriter.ContextDeprecated.Please migrate toSinkWriterand useSinkWriter.Context.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description List<CommT>prepareCommit(boolean flush)Deprecated.Prepare for a commit.default List<WriterStateT>snapshotState()Deprecated.implementsnapshotState(long)default List<WriterStateT>snapshotState(long checkpointId)Deprecated.voidwrite(InputT element, SinkWriter.Context context)Deprecated.Add an element to the writer.default voidwriteWatermark(Watermark watermark)Deprecated.Add a watermark to the writer.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
write
void write(InputT element, SinkWriter.Context context) throws IOException, InterruptedException
Deprecated.Add an element to the writer.- Parameters:
element- The input recordcontext- The additional information about the input record- Throws:
IOException- if fail to add an element.InterruptedException
-
writeWatermark
default void writeWatermark(Watermark watermark) throws IOException, InterruptedException
Deprecated.Add a watermark to the writer.This method is intended for advanced sinks that propagate watermarks.
- Parameters:
watermark- The watermark.- Throws:
IOException- if fail to add a watermark.InterruptedException
-
prepareCommit
List<CommT> prepareCommit(boolean flush) throws IOException, InterruptedException
Deprecated.Prepare for a commit.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.
- Parameters:
flush- Whether flushing the un-staged data or not- Returns:
- The data is ready to commit.
- Throws:
IOException- if fail to prepare for a commit.InterruptedException
-
snapshotState
default List<WriterStateT> snapshotState() throws IOException
Deprecated.implementsnapshotState(long)- Returns:
- The writer's state.
- Throws:
IOException- if fail to snapshot writer's state.
-
snapshotState
default List<WriterStateT> snapshotState(long checkpointId) throws IOException
Deprecated.- Returns:
- The writer's state.
- Throws:
IOException- if fail to snapshot writer's state.
-
-