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

Karthik Kambatla commented on YARN-807:
---------------------------------------

The patch doesn't seem to build anymore, may be because of YARN-1241. 
Otherwise, it applies and looks mostly good. Comments:
# I think it would be nice to add unit tests to verify the changes to 
CapacityScheduler and FifoScheduler as well - to make sure getting apps from 
queues continues to work.
# In ClientRMService itself, would help to add comments as to why we are 
fetching applications from the queues first.
# ClientRMService.appsIters#remove() should throw UnsupportedException for 
completeness.
# An occasional line in the patch slightly over 80 chars. 
# In TestClientRMService below, should probably define the queue names as final 
variables instead of directly using String constants. That way, the test and 
the mocking will continue to stay in sync.
{code}
+    when(yarnScheduler.getAppsInQueue("Q-1")).thenReturn(
+        Arrays.asList(getApplicationAttemptId(101), 
getApplicationAttemptId(102)));
+    when(yarnScheduler.getAppsInQueue("Q-2")).thenReturn(
+        Arrays.asList(getApplicationAttemptId(103)));
{code}

> When querying apps by queue, iterating over all apps is inefficient and 
> limiting 
> ---------------------------------------------------------------------------------
>
>                 Key: YARN-807
>                 URL: https://issues.apache.org/jira/browse/YARN-807
>             Project: Hadoop YARN
>          Issue Type: Improvement
>    Affects Versions: 2.0.4-alpha
>            Reporter: Sandy Ryza
>            Assignee: Sandy Ryza
>         Attachments: YARN-807-1.patch, YARN-807-2.patch, YARN-807.patch
>
>
> The question "which apps are in queue x" can be asked via the RM REST APIs, 
> through the ClientRMService, and through the command line.  In all these 
> cases, the question is answered by scanning through every RMApp and filtering 
> by the app's queue name.
> All schedulers maintain a mapping of queues to applications.  I think it 
> would make more sense to ask the schedulers which applications are in a given 
> queue. This is what was done in MR1. This would also have the advantage of 
> allowing a parent queue to return all the applications on leaf queues under 
> it, and allow queue name aliases, as in the way that "root.default" and 
> "default" refer to the same queue in the fair scheduler.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to