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

Sunil G commented on YARN-6953:
-------------------------------

[~maniraj...@gmail.com], I could see that the optimization done here in this 
patch is to unroll the existing *for* loop. 

But as I see here, we are filling for minimum and maximum separately. Overall 
below elements are variable ones.
Top level, we need to do for minimum and maximum. So we could have 
{{setAllocationForMandatoryResources}} and could take minimum or maximum as 
param. Inside this method, we can invoke another method which can take 
memory/vcores as input param and fill in same. 
This may be more neater and readable than replicating same code in various 
places.

> Clean up ResourceUtils.setMinimumAllocationForMandatoryResources() and 
> setMaximumAllocationForMandatoryResources()
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-6953
>                 URL: https://issues.apache.org/jira/browse/YARN-6953
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>    Affects Versions: YARN-3926
>            Reporter: Daniel Templeton
>            Assignee: Manikandan R
>            Priority: Minor
>              Labels: newbie
>         Attachments: YARN-6953-YARN-3926.001.patch, 
> YARN-6953-YARN-3926.002.patch, YARN-6953-YARN-3926.003.patch, 
> YARN-6953-YARN-3926.004.patch
>
>
> The {{setMinimumAllocationForMandatoryResources()}} and 
> {{setMaximumAllocationForMandatoryResources()}} methods are quite convoluted. 
>  They'd be much simpler if they just handled CPU and memory manually instead 
> of trying to be clever about doing it in a loop.  There are also issues, such 
> as the log warning always talking about memory or the last element of the 
> inner array being a copy of the first element.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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