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


##########
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:
   build() does not serialize the request to a byte array; it creates the 
immutable protobuf message, and getSerializedSize() computes the exact encoded 
size. This is performed once per heartbeat.
   
   Calculating it manually would duplicate protobuf size accounting for every 
populated field, including tags and length-prefix varints, and could become 
incorrect when heartbeat fields change. The 10% margin is intended as 
RPC/framing headroom rather than compensation for approximate payload accounting



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