You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/03/06 15:12:22 UTC
[GitHub] [ozone] adoroszlai commented on a diff in pull request #4341: HDDS-8074. Improve synchronization around command queue updates in Node Manager
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org