[ 
https://issues.apache.org/jira/browse/YARN-10596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17271419#comment-17271419
 ] 

Benjamin Teke commented on YARN-10596:
--------------------------------------

[~gandras] thanks for the patch. I have a suggestion for making the condition a 
bit more readable (for me at least). Consider the following part:

{code:java}
boolean isEligibleForAutoQueueCreation = false;

    // Auto created parent queues might not have static children, but they
    // must be kept as a ParentQueue
    CSQueue oldQueue = oldQueues.get(fullQueueName);
    if (oldQueue instanceof ParentQueue) {
      isEligibleForAutoQueueCreation = ((ParentQueue) 
oldQueue).isDynamicQueue();
    }

    // if a queue is eligible for auto queue creation v2
    // it must be a ParentQueue
    if (!isEligibleForAutoQueueCreation) {
      isEligibleForAutoQueueCreation =
          conf.isAutoQueueCreationV2Enabled(fullQueueName);
    }
{code}

Basically the condition is: if the queue is a dynamic parent, or it has the the 
AutoQueueCreationV2 enabled then it can be an empty parent. As the old 
autoQueueEnabled flag is parsed and stored as a boolean I think it would be 
nicer if you got the conf.isAutoQueueCreationV2Enabled there and kept the 
isDynamicParent intact (as isDynamicParent induces the eligibility for auto 
creation, however it is not the same). You could skip the (bit) misleading  if 
(!isEligibleForAutoQueueCreation) part, and instead of the     if 
(childQueueNames.size() == 0 && !isEligibleForAutoQueueCreation) condition you 
could say that the queue should not have 0 childQueues, should not be a dynamic 
parent and should not be eligible for auto creation based on the config.

> Allow static definition of childless ParentQueues with auto-queue-creation-v2 
> enabled
> -------------------------------------------------------------------------------------
>
>                 Key: YARN-10596
>                 URL: https://issues.apache.org/jira/browse/YARN-10596
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Andras Gyori
>            Assignee: Andras Gyori
>            Priority: Major
>         Attachments: YARN-10596.001.patch
>
>
> The old auto queue creation/managed queue logic allowed the definition of 
> childless parents to be created statically, if the auto-create-child-queue 
> flag was turned on the parent (thus making it a ManagedParentQueue).
> Since it is not an edge case, we also need to support the creation of a 
> ParentQueue instead of a LeafQueue, if auto-queue-creation-v2 is enabled, 
> even when no child queue is defined under the parent.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to