Hi Adrien,

Yes, we recommend using org.apache.flink.api.connector.sink2.Sink instead of 
org.apache.flink.streaming.api.functions.sink.SinkFunction or 
org.apache.flink.api.connector.sink.Sink.

As for why these codes are still retained in 1.20, one reason is because Sink 
The InitContext was only marked as Depreciated in 1.19[1]. Immediate removal of 
related APIs or implementations may result in forward compatibility issues,For 
SinkFunctions, they are widely used in various modules (including test code), 
and completely removing them is a huge workload. 

We have completed the task of thoroughly cleaning these APIs from the user 
visible APIs in Flink 2.0-preview[2], completely cleaned up the implementation 
of Sink V1 API, only retaining the API and its implementation of Sink V2, But 
for SinkFunction, due to their extensive use in testing code, we have not 
completely cleaned them up yet.

The Sink API proposed in FLIP-372[1] is also maintained in Flink2.0, so relying 
on this API in implementation can reduce upgrade costs in the future.

[1] 
https://cwiki.apache.org/confluence/display/FLINK/FLIP-372%3A+Enhance+and+synchronize+Sink+API+to+match+the+Source+API
[2] https://flink.apache.org/2024/10/23/preview-release-of-apache-flink-2.0/#api



> 2024年11月11日 18:37,Adrien Merat via user <user@flink.apache.org> 写道:
> 
> org.apache.flink.api.connector.sink2.Sink

Reply via email to