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


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/utils/templateUtils.ts:
##########
@@ -45,3 +49,85 @@ export function isTemplateQueuePath(queuePath: string): 
boolean {
     queuePath.includes(marker),
   );
 }
+
+export type QueuePropertyLookup = (
+  queuePath: string,
+  property: string,
+) => {
+  value: string;
+  isStaged: boolean;
+};
+
+export type ResolvedQueueCapacityConfig = {
+  capacityConfig: string;
+  maxCapacityConfig: string;
+};
+
+const isAutoCreationEnabled = (
+  getQueuePropertyValue: QueuePropertyLookup,
+  queuePath: string,
+  property: string,
+): boolean => getQueuePropertyValue(queuePath, property).value.trim() === 
'true';
+
+/**
+ * Resolves the template queue path for an auto-created child queue based on 
the
+ * parent's auto-creation settings:
+ * - flexible v2 (`auto-queue-creation-v2.enabled`) → leaf-template
+ * - legacy (`auto-create-child-queue.enabled`) → leaf-queue-template

Review Comment:
   Thank you for the review @brumi1024!
   I purposely not handle the other because in this PR, it is for fixing the 
bug that the auto leaf-queue capacity is not showing correctly. Therefore, this 
is to check only for the leaf templates.



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