hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhangshilong (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-4090) Make Collections.sort() more efficient in FSParentQueue.java
Date Mon, 27 Feb 2017 03:21:45 GMT

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

zhangshilong commented on YARN-4090:
------------------------------------

[~yufeigu]  I found one problem when doing this issue.
In FSLeafQueue:   I think resourceUsage of app should not be changed in assignContainer because
 FairShareComparator uses resourceUsage to sort Apps.
{code:java}
private TreeSet<FSAppAttempt> fetchAppsWithDemand() {
    TreeSet<FSAppAttempt> pendingForResourceApps =
        new TreeSet<>(policy.getComparator());
    readLock.lock();
    try {
      for (FSAppAttempt app : runnableApps) {
        Resource pending = app.getAppAttemptResourceUsage().getPending();
        if (!pending.equals(none())) {
          pendingForResourceApps.add(app);
        }
      }
    } finally {
      readLock.unlock();
    }
    return pendingForResourceApps;
  }
{code}
But In FSPreemptionThread run->preemptContainers->app.trackContainerForPreemption  
preemptedResources of app will be changed without FairScheduler Lock.
So  getResourceUsage of App will be changed in function: assignContainer in FSLeafQueue.
{code:java}
@Override
  public Resource getResourceUsage() {
    /*
     * getResourcesToPreempt() returns zero, except when there are containers
     * to preempt. Avoid creating an object in the common case.
     */
    return getPreemptedResources().equals(Resources.none())
        ? getCurrentConsumption()
        : Resources.subtract(getCurrentConsumption(), getPreemptedResources());
  }
{code}

> Make Collections.sort() more efficient in FSParentQueue.java
> ------------------------------------------------------------
>
>                 Key: YARN-4090
>                 URL: https://issues.apache.org/jira/browse/YARN-4090
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: fairscheduler
>            Reporter: Xianyin Xin
>            Assignee: zhangshilong
>         Attachments: sampling1.jpg, sampling2.jpg, YARN-4090.001.patch, YARN-4090.002.patch,
YARN-4090.003.patch, YARN-4090.004.patch, YARN-4090.005.patch, YARN-4090.006.patch, YARN-4090-preview.patch,
YARN-4090-TestResult.pdf
>
>
> Collections.sort() consumes too much time in a scheduling round.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message