slfan1989 commented on code in PR #8686:
URL: https://github.com/apache/hadoop/pull/8686#discussion_r3788178993
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/features/placement-rules/utils/queueOptions.ts:
##########
@@ -26,13 +27,53 @@ export interface QueueOption {
}
/**
- * Check if a queue has children (is a parent queue)
+ * Accessor for a queue's effective property value. Matches the store's
getQueuePropertyValue.
*/
-function isParentQueue(queue: QueueInfo): boolean {
- return !!(
+export type QueuePropertyAccessor = (
+ queuePath: string,
+ property: string,
+) => { value: string; isStaged: boolean };
+
+/**
+ * Check whether Dynamic Queue Creation is enabled for a queue. A queue with
+ * auto queue creation enabled acts as a parent even though it currently has no
+ * static child queues, so it must be selectable as a parent queue in
placement rules.
+ */
+function hasAutoQueueCreation(
+ queue: QueueInfo,
+ getQueuePropertyValue?: QueuePropertyAccessor,
+): boolean {
+ const eligibility = queue.autoCreationEligibility;
+ if (
+ eligibility === AUTO_CREATION_PROPS.ELIGIBILITY_FLEXIBLE ||
+ eligibility === AUTO_CREATION_PROPS.ELIGIBILITY_LEGACY
+ ) {
+ return true;
Review Comment:
This early return prevents the staged configuration from taking effect. If
the queue is currently `flexible`, but the user stages both auto-creation
properties to `false`, the queue will still be included in the parent queue
dropdown.
Could we read both values from `getQueuePropertyValue` first and let staged
values take precedence, falling back to `autoCreationEligibility` only when
neither property has a staged override?
--
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]