Hean-Chhinling commented on code in PR #8674:
URL: https://github.com/apache/hadoop/pull/8674#discussion_r3851898947


##########
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:
   I am resolving this thread as we are discussing the implementation of 
handling absolute mode memory in other thread. 
   
   Thank you for the review!



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