Search in sources :

Example 1 with InitContext

use of org.apache.flink.api.connector.sink2.Sink.InitContext in project flink by apache.

the class SinkWriterOperator method initializeState.

@Override
public void initializeState(StateInitializationContext context) throws Exception {
    super.initializeState(context);
    OptionalLong checkpointId = context.getRestoredCheckpointId();
    restoredCheckpointId = checkpointId;
    InitContext initContext = createInitContext(checkpointId.isPresent() ? checkpointId.getAsLong() : null);
    sinkWriter = writerStateHandler.createWriter(initContext, context);
}
Also used : InitContext(org.apache.flink.api.connector.sink2.Sink.InitContext) OptionalLong(java.util.OptionalLong)

Aggregations

OptionalLong (java.util.OptionalLong)1 InitContext (org.apache.flink.api.connector.sink2.Sink.InitContext)1