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

Steven Rand commented on YARN-9041:
-----------------------------------

bq. If we not allowed relax locality, it will executes three statements before 
used this patch. Otherwise it executes only one statement after used this 
patch. So I think reorder the conditions can improve the performance.

Yes, but it could also be true that {{bestContainers}} is {{null}}, which would 
short-circuit the other three checks, or that 
{{ResourceRequest.isAnyLocation(rr.getResourceName())}} is true, which would 
also short-circuit the other three. It's not immediately clear to me which 
condition is most likely to not be met / which one makes the most sense to put 
first in the hope of short-circuiting the others.

Anyway though, all four checks should be very cheap since all just involve 
looking at some object that's already in memory, and none have to make RPC 
calls or do any computation. So I'm okay with any order.

> Optimize FSPreemptionThread#identifyContainersToPreempt method
> --------------------------------------------------------------
>
>                 Key: YARN-9041
>                 URL: https://issues.apache.org/jira/browse/YARN-9041
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: scheduler preemption
>            Reporter: Wanqiang Ji
>            Assignee: Wanqiang Ji
>            Priority: Major
>         Attachments: YARN-9041.001.patch, YARN-9041.002.patch, 
> YARN-9041.003.patch, YARN-9041.004.patch, YARN-9041.005.patch
>
>
> In FSPreemptionThread#identifyContainersToPreempt method, I suggest if AM 
> preemption, and locality relaxation is allowed, then the search space is 
> expanded to all nodes changed to the remaining nodes. The remaining nodes are 
> equal to all nodes minus the potential nodes.
> Judging condition changed to:
>  # rr.getRelaxLocality()
>  # !ResourceRequest.isAnyLocation(rr.getResourceName())
>  # bestContainers != null
>  # bestContainers.numAMContainers > 0
> If I understand the deviation, please criticize me. thx~



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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