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


##########
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:
   I went ahead a made the change, as it was pretty simple. If the worst 
happens and we need to revert we can diff the files! But I think it will be OK 
- its basically double locked without this change which is just going to hurt 
performance.



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