You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/12/06 02:14:18 UTC

[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #6726: [INLONG-6575][Sort] Add dirty data metric for Filesystem

yunqingmoswu commented on code in PR #6726:
URL: https://github.com/apache/inlong/pull/6726#discussion_r1040349083


##########
inlong-sort/sort-connectors/filesystem/src/main/java/org/apache/inlong/sort/filesystem/stream/AbstractStreamingWriter.java:
##########
@@ -129,7 +136,20 @@ public void open() throws Exception {
      * Commit up to this checkpoint id.
      */
     protected void commitUpToCheckpoint(long checkpointId) throws Exception {
-        helper.commitUpToCheckpoint(checkpointId);
+        try {
+            helper.commitUpToCheckpoint(checkpointId);
+            if (sinkMetricData != null) {
+                sinkMetricData.invoke(rowSize, dataSize);
+            }
+        } catch (Exception e) {

Review Comment:
   It is recommended to throw an exception first to ensure that data is not lost.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org