InputT
- The type of the sink's inputWriterStateT
- The type of the sink writer's state@Public public interface SupportsWriterState<InputT,WriterStateT>
Sink
which supports a stateful StatefulSinkWriter
.
The Sink
needs 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.
Modifier and Type | Interface and Description |
---|---|
static interface |
SupportsWriterState.WithCompatibleState
A mix-in for
SupportsWriterState that allows users to migrate from a sink with a
compatible state to this sink. |
Modifier and Type | Method and Description |
---|---|
SimpleVersionedSerializer<WriterStateT> |
getWriterStateSerializer()
Any stateful sink needs to provide this state serializer and implement
StatefulSinkWriter.snapshotState(long) properly. |
StatefulSinkWriter<InputT,WriterStateT> |
restoreWriter(WriterInitContext context,
Collection<WriterStateT> recoveredState)
Create a
StatefulSinkWriter from a recovered state. |
StatefulSinkWriter<InputT,WriterStateT> restoreWriter(WriterInitContext context, Collection<WriterStateT> recoveredState) throws IOException
StatefulSinkWriter
from a recovered state.context
- the runtime context.recoveredState
- the state to recover from.IOException
- for any failure during creation.SimpleVersionedSerializer<WriterStateT> getWriterStateSerializer()
StatefulSinkWriter.snapshotState(long)
properly. The respective state is used in restoreWriter(WriterInitContext, Collection)
on recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.