zhengchenyu commented on code in PR #8547:
URL: https://github.com/apache/hadoop/pull/8547#discussion_r3418533730
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/QueueMetrics.java:
##########
@@ -1275,6 +1275,18 @@ public int getReservedVirtualCores() {
public int getReservedContainers() {
return reservedContainers.value();
}
+
+ public int getAllocatedContainers(String partition) {
+ return getPartitionMetrics(partition).getAllocatedContainers();
+ }
+
+ public int getPendingContainers(String partition) {
+ return getPartitionMetrics(partition).getPendingContainers();
+ }
+
+ public int getReservedContainers(String partition) {
+ return getPartitionMetrics(partition).getReservedContainers();
+ }
Review Comment:
This is a good suggestion to avoid creating partition metrics unnecessarily.
I will fix it.
--
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]