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

ASF GitHub Bot commented on YARN-5605:
--------------------------------------

Github user templedf commented on a diff in the pull request:

    https://github.com/apache/hadoop/pull/124#discussion_r78411782
  
    --- Diff: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java
 ---
    @@ -557,28 +599,33 @@ private boolean preemptContainerPreCheck() {
             getFairShare());
       }
     
    -  /**
    -   * Is a queue being starved for its min share.
    -   */
    -  @VisibleForTesting
    -  boolean isStarvedForMinShare() {
    -    return isStarved(getMinShare());
    +  private Resource minShareStarvation() {
    +    Resource desiredShare = Resources.min(policy.getResourceCalculator(),
    +        scheduler.getClusterResource(), getMinShare(), getDemand());
    +
    +    Resource starvation = Resources.subtract(desiredShare, 
getResourceUsage());
    +    boolean starved = Resources.greaterThan(policy.getResourceCalculator(),
    +        scheduler.getClusterResource(), starvation, none());
    +
    +    long now = scheduler.getClock().getTime();
    +    if (!starved) {
    +      setLastTimeAtMinShare(now);
    +    }
    +
    +    if (starved &&
    +        (now - lastTimeAtMinShare > getMinSharePreemptionTimeout())) {
    +      return starvation;
    +    } else {
    +      return Resources.clone(Resources.none());
    --- End diff --
    
    You can make it:
    
    ~~~~
        if (!starved ||
            (now - lastTimeAtMinShare < getMinSharePreemptionTimeout())) {
          starvation = Resources.clone(Resources.none());
    
          if (!starved) {
            setLastTimeAtMinShare(now);
          }
        }
    
        return starvation;
    ~~~~


> Preempt containers (all on one node) to meet the requirement of starved 
> applications
> ------------------------------------------------------------------------------------
>
>                 Key: YARN-5605
>                 URL: https://issues.apache.org/jira/browse/YARN-5605
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: fairscheduler
>            Reporter: Karthik Kambatla
>            Assignee: Karthik Kambatla
>         Attachments: yarn-5605-1.patch, yarn-5605-2.patch
>
>
> Required items:
> # Identify starved applications
> # Identify a node that has enough containers from applications over their 
> fairshare.
> # Preempt those containers



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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