nandakumar131 commented on code in PR #7805:
URL: https://github.com/apache/ozone/pull/7805#discussion_r1952368320


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeHeartbeatDispatcher.java:
##########
@@ -200,6 +200,17 @@ public List<SCMCommand> dispatch(SCMHeartbeatRequestProto 
heartbeat) {
         }
       }
     }
+    if (LOG.isDebugEnabled()) {
+      StringBuilder allCommands = new StringBuilder();
+      for (SCMCommand cmd : commands) {
+        allCommands.append(cmd).append(", ");
+      }
+      int len = allCommands.length();
+      if (len > 2) {
+        allCommands.delete(len - 2, len);
+      }
+      LOG.debug("Heartbeat dispatched: datanode=" + datanodeDetails.getUuid() 
+ ", Commands= [" + allCommands + "]");

Review Comment:
   ```suggestion
         LOG.debug("Heartbeat dispatched: datanode=" + 
datanodeDetails.getUuid() + ", Commands= " + commands);
   ```



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/protocol/commands/DeleteBlocksCommand.java:
##########
@@ -68,4 +68,25 @@ public DeleteBlocksCommandProto getProto() {
         .setCmdId(getId())
         .addAllDeletedBlocksTransactions(blocksTobeDeleted).build();
   }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append(getType())
+        .append(": cmdID: ").append(getId())
+        .append(", encodedToken: \"").append(getEncodedToken()).append("\"")
+        .append(", term: ").append(getTerm())
+        .append(", deadlineMsSinceEpoch: ").append(getDeadline())
+        .append(", deletedBlocksTransaction: [");
+    for (DeletedBlocksTransaction txn : blocksTobeDeleted) {
+      sb.append(" txnID:").append(txn.getTxID())
+          .append(",containerID:").append(txn.getContainerID())
+          .append(",deleteBlockCount:").append(txn.getLocalIDCount())
+          .append(",count:").append(txn.getCount())
+          .append(",");
+    }
+    sb.deleteCharAt(sb.length() - 1);

Review Comment:
   ```suggestion
       for (DeletedBlocksTransaction txn : blocksTobeDeleted) {
         sb.append("{ txnID: ").append(txn.getTxID())
             .append(", containerID: ").append(txn.getContainerID())
             .append(", deleteBlockCount: ").append(txn.getLocalIDCount())
             .append(", count: ").append(txn.getCount())
             .append("}, ");
       }
       if (!blocksTobeDeleted.isEmpty()) {
         sb.delete(sb.length() - 2, sb.length());
       }
   ```



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