brumi1024 commented on code in PR #8674:
URL: https://github.com/apache/hadoop/pull/8674#discussion_r3843431462


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/queue-management/hooks/useQueueTreeData.ts:
##########
@@ -252,6 +252,46 @@ function transformToCardData(queueInfo: QueueInfo, 
stagedChanges: StagedChange[]
   const capacityDisplay = getQueuePropertyValue(queueInfo.queuePath, 
'capacity');
   const maxCapacityDisplay = getQueuePropertyValue(queueInfo.queuePath, 
'maximum-capacity');
 
+  let capacityConfig = capacityDisplay.value;
+  let maxCapacityConfig = maxCapacityDisplay.value;
+
+  const isAutoCreatedQueue =
+    queueInfo.creationMethod === 'dynamicLegacy' ||
+    queueInfo.creationMethod === 'dynamicFlexible';
+
+  if (isAutoCreatedQueue) {
+    const resourcePartitions = 
queueInfo.capacities?.queueCapacitiesByPartition;
+    const defaultResourcePartition = resourcePartitions?.length
+      ? (resourcePartitions.find((entry) => !entry.partitionName) ?? 
resourcePartitions[0])
+      : undefined;
+
+    if (capacityDisplay.isStaged) {
+      // Pending local edit from Edit Capacity — not yet applied to the 
cluster.
+      capacityConfig = capacityDisplay.value;
+    } else {
+      const configuredWeight = queueInfo.weight ?? 
defaultResourcePartition?.weight;
+      if (configuredWeight !== undefined && configuredWeight > 0) {
+        capacityConfig = `${configuredWeight}w`;
+      } else {
+        const configuredCapacity =
+          queueInfo.capacity ?? defaultResourcePartition?.capacity ?? 0;
+        if (configuredCapacity > 0) {
+          capacityConfig = String(configuredCapacity);
+        }

Review Comment:
   Thanks for the update, looks better now. This still doesn't handle a few 
scenarios though:
   
   - legacy AQC can be either percentage or absolute values
   - flexible AQC in legacy queue mode can be weight only.
   - flexible AQC in non-legacy queue mode can be anything, through the 
resource vectors. I.e [vcores=15%,memory=2w,gpu=4] 



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