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 04:51:18 UTC
[GitHub] [inlong] gong commented on a diff in pull request #6658: [INLONG-6657][Sort] Add dirty data metric for Hive
gong commented on code in PR #6658:
URL: https://github.com/apache/inlong/pull/6658#discussion_r1034297118
##########
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:
dirty metric can't be reported if throw RumtimeException
--
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