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

Siddharth Ahuja edited comment on YARN-9996 at 4/11/20, 6:11 AM:
-----------------------------------------------------------------

Further details:

The overall aim of the code (as understood) is to get the last child in the 
queue hierarchy that has queue information available to check for admin user 
access. Until this queue information is available, keep going up in the queue 
hierarchy one child at a time.

+*Before* (un-important bits extracted away):+
{code}
for each queue
{
    if the queue has a child, get the last child.
    Try getting the queue info for this child.
    
    while we do not have queue info
    {
        get the queue minus its last child (move up in the hierarchy)
        if the trimmed queue has a child, get the last child.

        Try getting the queue info for this child.
    }
    ...
}

After*(un-important bits extracted away):+
{code}
for each queue
{
    while we do not have queue info
    {
        if the queue has a child, get the last child.
        Try getting the queue info for this child.
        if the queue has a child, trim the queue and get the queue minus its 
last child (move up in the hierarchy). 
           
    }
    ...
}
{code}


was (Author: sahuja):
Further details:

The overall aim of the code (as understood) is to get the last child in the 
queue hierarchy that has queue information available to check for admin user 
access. Until this queue information is available, keep going up in the queue 
hierarchy one child at a time.

+*Before *(un-important bits extracted away):+
{code}
for each queue
{
    if the queue has a child, get the last child.
    Try getting the queue info for this child.
    
    while we do not have queue info
    {
        get the queue minus its last child (move up in the hierarchy)
        if the trimmed queue has a child, get the last child.

        Try getting the queue info for this child.
    }
    ...
}

+*After*(un-important bits extracted away):+
{code}
for each queue
{
    while we do not have queue info
    {
        if the queue has a child, get the last child.
        Try getting the queue info for this child.
        if the queue has a child, trim the queue and get the queue minus its 
last child (move up in the hierarchy). 
           
    }
    ...
}
{code}

> Code cleanup in QueueAdminConfigurationMutationACLPolicy
> --------------------------------------------------------
>
>                 Key: YARN-9996
>                 URL: https://issues.apache.org/jira/browse/YARN-9996
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Szilard Nemeth
>            Assignee: Siddharth Ahuja
>            Priority: Major
>         Attachments: YARN-9996.001.patch
>
>
> Method 'isMutationAllowed' contains many uses of substring and lastIndexOf.
> These could be extracted and simplified. 
> Also, some logging could be added as well.



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