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

Jian He commented on YARN-2498:
-------------------------------

- remove below 
{code}
NavigableSet<FiCaSchedulerApp> ns =
    (NavigableSet<FiCaSchedulerApp>) leafQueue.getApplications();
{code}
- this piece is dup with addToPreemptMap method ?
{code}
Set<RMContainer> toPreemptContainers =
    preemptMap.get(fc.getApplicationAttemptId());
if (null == toPreemptContainers) {
  toPreemptContainers = new HashSet<RMContainer>();
}
preemptMap.put(fc.getApplicationAttemptId(), toPreemptContainers);
{code}
- below code at line 744 is dup with the check at line 650 ?
{code}
if (resToObtainByPartition.isEmpty()) {
  return;
}
{code}
- tryPreemptContainerAndDeductResToObtain can also include the addToPreemptMap 
method so that every caller doesn’t need to invoke that.
- TempQueuePartition -> TempQueuePerPartition
-  a few long lines: e.g. tryPreemptContainerAndDeductResToObtain
- remove LeafQueue#getIgnoreExclusivityResourceByPartition
- simplify below a  bit
{code}
private TempQueuePartition getQueueByPartition(String queueName,
    String partition) {
  if (!queueToPartitions.containsKey(queueName)) {
    return null;
  }
  if (!queueToPartitions.get(queueName).containsKey(partition)) {
    return null;
  }
  return queueToPartitions.get(queueName).get(partition);
}
{code}


> Respect labels in preemption policy of capacity scheduler for inter-queue 
> preemption
> ------------------------------------------------------------------------------------
>
>                 Key: YARN-2498
>                 URL: https://issues.apache.org/jira/browse/YARN-2498
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>            Reporter: Wangda Tan
>            Assignee: Wangda Tan
>         Attachments: STALED-YARN-2498.zip, YARN-2498.1.patch, 
> YARN-2498.2.patch
>
>
> There're 3 stages in ProportionalCapacityPreemptionPolicy,
> # Recursively calculate {{ideal_assigned}} for queue. This is depends on 
> available resource, resource used/pending in each queue and guaranteed 
> capacity of each queue.
> # Mark to-be preempted containers: For each over-satisfied queue, it will 
> mark some containers will be preempted.
> # Notify scheduler about to-be preempted container.
> We need respect labels in the cluster for both #1 and #2:
> For #1, when calculating ideal_assigned for each queue, we need get 
> by-partition-ideal-assigned according to queue's 
> guaranteed/maximum/used/pending resource on specific partition.
> For #2, when we make decision about whether we need preempt a container, we 
> need make sure, resource this container is *possibly* usable by a queue which 
> is under-satisfied and has pending resource.
> In addition, we need to handle ignore_partition_exclusivity case, when we 
> need to preempt containers from a queue's partition, we will first preempt 
> ignore_partition_exclusivity allocated containers.



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

Reply via email to