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/11/29 11:33:20 UTC

[GitHub] [inlong] haifxu commented on a diff in pull request #6658: [INLONG-6657][Sort] Add dirty data metric for Hive

haifxu commented on code in PR #6658:
URL: https://github.com/apache/inlong/pull/6658#discussion_r1034636198


##########
inlong-sort/sort-connectors/hive/src/main/java/org/apache/inlong/sort/hive/filesystem/AbstractStreamingWriter.java:
##########
@@ -195,14 +199,21 @@ public void processWatermark(Watermark mark) throws Exception {
     }
 
     @Override
-    public void processElement(StreamRecord<IN> element) throws Exception {
-        helper.onElement(
-                element.getValue(),
-                getProcessingTimeService().getCurrentProcessingTime(),
-                element.hasTimestamp() ? element.getTimestamp() : null,
-                currentWatermark);
-        if (metricData != null) {
-            metricData.invokeWithEstimate(element.getValue());
+    public void processElement(StreamRecord<IN> element) {
+        try {
+            helper.onElement(
+                    element.getValue(),
+                    getProcessingTimeService().getCurrentProcessingTime(),
+                    element.hasTimestamp() ? element.getTimestamp() : null,
+                    currentWatermark);
+            if (metricData != null) {
+                metricData.invokeWithEstimate(element.getValue());
+            }
+        } catch (Exception e) {
+            if (metricData != null) {
+                metricData.invokeDirtyWithEstimate(element.getValue());
+            }
+            throw new RuntimeException(e);

Review Comment:
   Ok, don't throw exceptions temporarily.



-- 
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