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


##########
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:
   Yea I did think about removing the commandQueue lock, especially as its a 
"lock" rather than "RW Lock", so its throughput would be worse than a RW lock. 
I was just a bit nervous about taking its lock away, but as you say, its an 
internal structure to the NodeManager, so provided we guard any accesses inside 
NodeManager it should be OK. Should we do this in a followup Jira?



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