Quickly looked at the patch and tested it on a single node. It works fine. Some review comments, mostly minor:
- In CapacityTaskScheduler.getJobs(), we can cache the return value from jobQueuesManager.getJobQueue(queueName) to avoid repetitive lookups.
- Test-cases testSubmitToQueues(), testGetJobs() and the newly added testJobsForContainerQueues() share a lot of common stuff and test a single concept - job submission to capacity-scheduler. They can be combined into a single testJobSubmission(). Further, instead of creating all the internal queue-related data-structures ourselves, we can simply create a configuration file and start the scheduler. See TestRefreshOfQueues.testSuccessfulCapacityRefresh() for an example. You may need to do some refactoring to facilitate this.
One orthogonal point which this issue may not concern itself with, jobtracker.jsp is now printing the number of root-queues under a header 'queues'. Just looking at it, it didn't tell me what it actually represents. We can (1) rename it to root-queues to be clear, or (2) print both root-queues' and job-queues' number or (3) do away with these numbers altogether and just give a hyper-link to the queues page. Thoughts?