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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java:
##########
@@ -466,6 +515,141 @@ List<Message> getIncrementalReports(
     return reportsToReturn;
   }
 
+  private List<Message> getIncrementalReportsExcludingCommandStatus(
+      HostAndPort endpoint, int maxLimit) {
+    List<Message> reportsToReturn = new LinkedList<>();
+    synchronized (incrementalReportsQueue) {
+      List<Message> reportsForEndpoint =
+          incrementalReportsQueue.get(endpoint);
+      if (reportsForEndpoint != null) {
+        Iterator<Message> iterator = reportsForEndpoint.iterator();
+        while (iterator.hasNext() && reportsToReturn.size() < maxLimit) {
+          Message report = iterator.next();
+          if (!(report instanceof CommandStatusReportsProto)) {
+            reportsToReturn.add(report);
+            iterator.remove();
+          }
+        }
+      }
+    }
+    return reportsToReturn;
+  }
+
+  private CommandStatusReportSplit splitCommandStatusReport(

Review Comment:
   We can avoid split, as each command response will be of similar size as set 
of command send by SCM.



##########
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 will involve serialized using build, may be we can get size by 
iterating list inside it. We can go approximation as small change will be 
covered by 90% of overall size as taken.



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/HeartbeatEndpointTask.java:
##########
@@ -109,6 +118,18 @@ public HeartbeatEndpointTask(EndpointStateMachine 
rpcEndpoint,
         HDDS_PIPELINE_ACTION_MAX_LIMIT_DEFAULT);
     this.maxReportsPerHB = Math.max(1, 
conf.getInt(HDDS_HEARTBEAT_REPORT_MAX_LIMIT,
         HDDS_HEARTBEAT_REPORT_MAX_LIMIT_DEFAULT));
+    this.maxCommandStatusReportBytes = (long) conf.getStorageSize(

Review Comment:
   IMO, we do not need this config, we can have max size as required for 
sending repoert to 90%, no need further sub-category for this.



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