Interface SupportsWriterState<InputT,WriterStateT>
-
- Type Parameters:
InputT- The type of the sink's inputWriterStateT- The type of the sink writer's state
- All Known Subinterfaces:
StatefulSink<InputT,WriterStateT>
@Public public interface SupportsWriterState<InputT,WriterStateT>A mixin interface for aSinkwhich supports a statefulStatefulSinkWriter.The
Sinkneeds to be serializable. All configuration should be validated eagerly. The respective sink writers are transient and will only be created in the subtasks on the taskmanagers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSupportsWriterState.WithCompatibleStateA mix-in forSupportsWriterStatethat allows users to migrate from a sink with a compatible state to this sink.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SimpleVersionedSerializer<WriterStateT>getWriterStateSerializer()Any stateful sink needs to provide this state serializer and implementStatefulSinkWriter.snapshotState(long)properly.StatefulSinkWriter<InputT,WriterStateT>restoreWriter(WriterInitContext context, Collection<WriterStateT> recoveredState)Create aStatefulSinkWriterfrom a recovered state.
-
-
-
Method Detail
-
restoreWriter
StatefulSinkWriter<InputT,WriterStateT> restoreWriter(WriterInitContext context, Collection<WriterStateT> recoveredState) throws IOException
Create aStatefulSinkWriterfrom a recovered state.- Parameters:
context- the runtime context.recoveredState- the state to recover from.- Returns:
- A sink writer.
- Throws:
IOException- for any failure during creation.
-
getWriterStateSerializer
SimpleVersionedSerializer<WriterStateT> getWriterStateSerializer()
Any stateful sink needs to provide this state serializer and implementStatefulSinkWriter.snapshotState(long)properly. The respective state is used inrestoreWriter(WriterInitContext, Collection)on recovery.- Returns:
- the serializer of the writer's state type.
-
-