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

Eric Payne commented on YARN-4945:
----------------------------------

[~sunilg], I'm afraid I gave you bad advice [in my comment 
above|https://issues.apache.org/jira/browse/YARN-4945?focusedCommentId=15495060&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15495060]
 regarding the fix for {{LeafQueue#getAllApplications()}}

My original suggestion was to create a new {{TreeSet}} object for {{apps}}:
{code}
    Collection<FiCaSchedulerApp> apps = new TreeSet<FiCaSchedulerApp>(
        pendingOrderingPolicy.getSchedulableEntities());
{code}
But that causes the {{SchedulingMonitor}} thread to crash with the following 
exception:
{noformat}
2016-09-17 17:07:31,156 [SchedulingMonitor 
(ProportionalCapacityPreemptionPolicy)] ERROR 
yarn.YarnUncaughtExceptionHandler: Thread Thread[SchedulingMonitor 
(ProportionalCapacityPreemptionPolicy),5,main] threw an Exception.
java.lang.ClassCastException: 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp
 cannot be cast to java.lang.Comparable
        at java.util.TreeMap.compare(TreeMap.java:1290)
        at java.util.TreeMap.put(TreeMap.java:538)
        at java.util.TreeSet.add(TreeSet.java:255)
        at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
        at java.util.TreeSet.addAll(TreeSet.java:312)
        at 
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue.getAllApplications(LeafQueue.java:1859)
{noformat}
I originally suggested using {{TreeSet}} because that is what is returned by 
{{getSchedulableEntities()}}. But, since that causes an exception, I tried 
using {{HashSet}} instead. That seems to work (but I'm not sure if that's the 
best solution):
{code}
    Collection<FiCaSchedulerApp> apps = new HashSet<FiCaSchedulerApp>(
        pendingOrderingPolicy.getSchedulableEntities());
{code}

> [Umbrella] Capacity Scheduler Preemption Within a queue
> -------------------------------------------------------
>
>                 Key: YARN-4945
>                 URL: https://issues.apache.org/jira/browse/YARN-4945
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Wangda Tan
>         Attachments: Intra-Queue Preemption Use Cases.pdf, 
> IntraQueuepreemption-CapacityScheduler (Design).pdf, YARN-2009-wip.2.patch, 
> YARN-2009-wip.patch, YARN-2009-wip.v3.patch, YARN-2009.v0.patch, 
> YARN-2009.v1.patch, YARN-2009.v2.patch, YARN-2009.v3.patch
>
>
> This is umbrella ticket to track efforts of preemption within a queue to 
> support features like:
> YARN-2009. YARN-2113. YARN-4781.



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