gaoyunhaii commented on a change in pull request #16385:
URL: https://github.com/apache/flink/pull/16385#discussion_r666731384
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/TwoPhaseCommitSinkFunction.java
##########
@@ -211,6 +211,16 @@ protected void recoverAndAbort(TXN transaction) {
*/
protected void finishRecoveringContext(Collection<TXN>
handledTransactions) {}
+ /**
+ * This method is called at the end of data processing.
+ *
+ * <p>The method is expected to flush all remaining buffered data.
Exceptions will cause the
+ * pipeline to be recognized as failed, because the last data items are
not processed properly.
+ * You may use this method to flush remaining buffered elements in the
state into the current
+ * transaction which will be committed in the last checkpoint.
+ */
+ protected void finishProcessing(TXN transaction) {}
Review comment:
Perhaps we mark `TXN` as `@Nullable` ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]