adoroszlai commented on code in PR #4341:
URL: https://github.com/apache/ozone/pull/4341#discussion_r1126491352


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java:
##########
@@ -463,8 +460,6 @@ private void initializeEventHandlers() {
     eventQueue.addHandler(SCMEvents.DATANODE_COMMAND, scmNodeManager);
     eventQueue.addHandler(SCMEvents.RETRIABLE_DATANODE_COMMAND, 
scmNodeManager);
     eventQueue.addHandler(SCMEvents.NODE_REPORT, nodeReportHandler);
-    eventQueue.addHandler(SCMEvents.COMMAND_QUEUE_REPORT,

Review Comment:
   I guess we can also remove the definition of `COMMAND_QUEUE_REPORT`:
   
   
https://github.com/apache/ozone/blob/4afa68e4605dd3b0c9692877a1e9ddf85ce7a740/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/events/SCMEvents.java#L52-L60



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/CommandQueue.java:
##########
@@ -124,6 +127,30 @@ public int getDatanodeCommandCount(
     }
   }
 
+  /**
+   * Return a summary of all commands currently queued for the given Datanode.
+   * Note that any commands which return false for their
+   * Command.contributesToQueueSize() method will not be included in the count.
+   * At the current time, only low priority ReplicateContainerCommands meet 
this
+   * condition.
+   * @param datanodeUuid Datanode UUID
+   * @return A map containing the command summary. Note the returned map is a
+   *         copy of the internal map and can be modified safely by the caller.
+   */
+  public Map<SCMCommandProto.Type, Integer> getDatanodeCommandSummary(
+      final UUID datanodeUuid) {
+    lock.lock();

Review Comment:
   `CommandQueue` is only used by `SCMNodeManager`.  Now that we have the 
higher level R/W lock, should we get rid of this lower level simple lock?  (Not 
only here, but from all of `CommandQueue`.)



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