sadanand48 commented on code in PR #11962:
URL: https://github.com/apache/ozone/pull/11962#discussion_r4534656356


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/HeartbeatEndpointTask.java:
##########
@@ -233,6 +262,41 @@ private void addReports(SCMHeartbeatRequestProto.Builder 
requestBuilder) {
         }
       }
     }
+    return reportCount;
+  }
+
+  private CommandStatusReportSelection addCommandStatusReports(
+      SCMHeartbeatRequestProto.Builder requestBuilder,
+      int remainingReportCount) {
+    long currentHeartbeatSize = requestBuilder.build().getSerializedSize();

Review Comment:
   Thanks for the performance context. I removed the intermediate 
requestBuilder.build().getSerializedSize() call. The heartbeat now accumulates 
each field’s wire size as it is added using 
CodedOutputStream.computeMessageSize(fieldNumber, message), including tags and 
length prefixes. The complete heartbeat is built only once, immediately before 
sending it to SCM.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to