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/08/23 01:48:06 UTC

[GitHub] [inlong] thesumery commented on a diff in pull request #5638: [INLONG-5637][Sort] Fix kafka load node npe error

thesumery commented on code in PR #5638:
URL: https://github.com/apache/inlong/pull/5638#discussion_r952064773


##########
inlong-sort/sort-connectors/kafka/src/main/java/org/apache/inlong/sort/kafka/FlinkKafkaProducer.java:
##########
@@ -928,19 +928,15 @@ public void onCompletion(RecordMetadata metadata, Exception exception) {
     }
 
     private void sendOutMetrics(Long rowSize, Long dataSize) {
-        if (metricData.getNumRecordsOut() != null) {
+        if (metricData != null) {
             metricData.getNumRecordsOut().inc(rowSize);
-        }
-        if (metricData.getNumBytesOut() != null) {
             metricData.getNumBytesOut().inc(dataSize);
         }
     }
 
     private void sendDirtyMetrics(Long rowSize, Long dataSize) {
         if (metricData.getDirtyRecords() != null) {
             metricData.getDirtyRecords().inc(rowSize);

Review Comment:
   use SinkMetricData#invoke instead ?



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