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


##########
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:
   Yes, i will do it.



##########
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:
   > same NPE problem
   Yes, i will do it.
   



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

Reply via email to