pvary commented on code in PR #23555: URL: https://github.com/apache/flink/pull/23555#discussion_r1401888264
########## flink-core/src/main/java/org/apache/flink/api/connector/sink2/Sink.java: ########## @@ -55,17 +53,11 @@ public interface Sink<InputT> extends Serializable { * @return A sink writer. * @throws IOException for any failure during creation. */ - SinkWriter<InputT> createWriter(InitContext context) throws IOException; + SinkWriter<InputT> createWriter(WriterInitContext context) throws IOException; /** The interface exposes some runtime info for creating a {@link SinkWriter}. */ @PublicEvolving - interface InitContext { - /** - * The first checkpoint id when an application is started and not recovered from a - * previously taken checkpoint or savepoint. - */ - long INITIAL_CHECKPOINT_ID = 1; - + interface WriterInitContext extends InitContext { Review Comment: We discussed the possibility of `CommitterInitContext` inheriting from the `InitContext`, but that would have been a short term solution only and the resulting API would be inconsistent. That is why the decision was to have `WriterInitContext` and `CommitterInitContext`, and accept that the connectors has to update the code. If you are interested in the Source related changes please follow FLIP-372 too, as there will be similar changes there. ########## flink-core/src/main/java/org/apache/flink/api/connector/sink2/Sink.java: ########## @@ -55,17 +53,11 @@ public interface Sink<InputT> extends Serializable { * @return A sink writer. * @throws IOException for any failure during creation. */ - SinkWriter<InputT> createWriter(InitContext context) throws IOException; + SinkWriter<InputT> createWriter(WriterInitContext context) throws IOException; /** The interface exposes some runtime info for creating a {@link SinkWriter}. */ @PublicEvolving - interface InitContext { - /** - * The first checkpoint id when an application is started and not recovered from a - * previously taken checkpoint or savepoint. - */ - long INITIAL_CHECKPOINT_ID = 1; - + interface WriterInitContext extends InitContext { Review Comment: @Jiabao-Sun: We discussed the possibility of `CommitterInitContext` inheriting from the `InitContext`, but that would have been a short term solution only and the resulting API would be inconsistent. That is why the decision was to have `WriterInitContext` and `CommitterInitContext`, and accept that the connectors has to update the code. If you are interested in the Source related changes please follow FLIP-372 too, as there will be similar changes there. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org