Hean-Chhinling commented on code in PR #8674:
URL: https://github.com/apache/hadoop/pull/8674#discussion_r3853476138
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/queue-management/hooks/useQueueTreeData.ts:
##########
@@ -247,11 +247,59 @@ function getAutoCreationStatus(
}
function transformToCardData(queueInfo: QueueInfo, stagedChanges:
StagedChange[]): QueueCardData {
- const getQueuePropertyValue =
useSchedulerStore.getState().getQueuePropertyValue;
+ const { getQueuePropertyValue, getQueuePartitionCapacities } =
useSchedulerStore.getState();
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' ||
+ (queueInfo as { isAutoCreatedLeafQueue?: boolean }).isAutoCreatedLeafQueue
=== true;
+
+ if (isAutoCreatedQueue) {
+ const defaultResourcePartition =
+ getQueuePartitionCapacities(queueInfo.queuePath, '') ??
+ queueInfo.capacities?.queueCapacitiesByPartition?.find((entry) =>
!entry.partitionName) ??
+ queueInfo.capacities?.queueCapacitiesByPartition?.[0];
+ const configuredMinResource =
defaultResourcePartition?.configuredMinResource;
+
+ if (!capacityDisplay.isStaged) {
+ const configuredWeight = queueInfo.weight ??
defaultResourcePartition?.weight;
+ const configuredCapacity =
+ queueInfo.capacity ?? defaultResourcePartition?.capacity ?? 0;
+
+ if (configuredWeight !== undefined && configuredWeight > 0) {
+ capacityConfig = `${configuredWeight}w`;
+ } else if (
+ configuredMinResource &&
+ (configuredMinResource.memory > 0 || configuredMinResource.vCores > 0)
+ ) {
+ capacityConfig =
`[memory-mb=${configuredMinResource.memory},vcores=${configuredMinResource.vCores}]`;
Review Comment:
Thanks! I am able to test out successfully once I triggered the queue
creation in mixed mode.
Now it shows correctly in the UI:
<img width="1614" height="898" alt="Screenshot 2026-08-25 at 15 27 52"
src="https://github.com/user-attachments/assets/5201b6ce-7b95-462f-8bb5-46f3986d2670"
/>
Except for the MaxCapacity, I am not sure how would it be possible to handle
mixedMode within /scheduler endpoint. Because the `maxCapacityVector` is not
exist anywhere there.
--
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]