tomicooler commented on code in PR #5783:
URL: https://github.com/apache/hadoop/pull/5783#discussion_r1252720289


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/helper/CapacitySchedulerInfoHelper.java:
##########
@@ -64,22 +69,23 @@ public class CapacitySchedulerInfoHelper {
 
   private CapacitySchedulerInfoHelper() {}
 
-  public static String getMode(CSQueue queue) throws YarnRuntimeException {
-    if (queue.getCapacityConfigType() ==
-        AbstractCSQueue.CapacityConfigType.ABSOLUTE_RESOURCE) {
-      return "absolute";
-    } else if (queue.getCapacityConfigType() ==
-        AbstractCSQueue.CapacityConfigType.PERCENTAGE) {
-      float weight = queue.getQueueCapacities().getWeight();
-      if (weight == -1) {
-        //-1 indicates we are not in weight mode
+  public static String getMode(CSQueue queue) {
+    final Set<QueueCapacityVector.ResourceUnitCapacityType> 
definedCapacityTypes =
+        queue.getConfiguredCapacityVector(NO_LABEL).getDefinedCapacityTypes();
+    if (definedCapacityTypes.size() == 1) {

Review Comment:
   IMHO it's self explanatory, more than 1 capacity type => mixed, otherwise we 
can check the type.



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