FairSchedulerQueueInfo { protected FairSchedulerQueueInfoList getChildQueues(FSQueue queue, FairScheduler scheduler) { Collection<FSQueue> children = queue.getChildQueues(); if (children.isEmpty()) { return null; } FairSchedulerQueueInfoList list = new FairSchedulerQueueInfoList(); for (FSQueue child : children) { if (child instanceof FSLeafQueue) { list.addToQueueInfoList( new FairSchedulerLeafQueueInfo((FSLeafQueue) child, scheduler)); } else { list.addToQueueInfoList( new FairSchedulerQueueInfo(child, scheduler)); } } return list; } FairSchedulerQueueInfo();  FairSchedulerQueueInfo(FSQueue queue, FairScheduler scheduler); long getAllocatedContainers(); long getReservedContainers(); float getSteadyFairShareMemoryFraction(); float getFairShareMemoryFraction(); ResourceInfo getSteadyFairShare(); ResourceInfo getFairShare(); ResourceInfo getMinResources(); ResourceInfo getMaxResources(); ResourceInfo getMaxContainerAllocation(); ResourceInfo getReservedResources(); int getMaxApplications(); String getQueueName(); ResourceInfo getUsedResources(); ResourceInfo getAMUsedResources(); ResourceInfo getAMMaxResources(); ResourceInfo getDemandResources(); float getUsedMemoryFraction(); float getMaxResourcesFraction(); String getSchedulingPolicy(); Collection<FairSchedulerQueueInfo> getChildQueues(); boolean isPreemptable();  }
@Test public void testEmptyChildQueues() throws Exception { FairSchedulerConfiguration conf = new FairSchedulerConfiguration(); FairScheduler scheduler = mock(FairScheduler.class); AllocationConfiguration allocConf = new AllocationConfiguration(conf); when(scheduler.getAllocationConfiguration()).thenReturn(allocConf); when(scheduler.getConf()).thenReturn(conf); when(scheduler.getClusterResource()).thenReturn(Resource.newInstance(1, 1)); when(scheduler.getResourceCalculator()).thenReturn( new DefaultResourceCalculator()); SystemClock clock = SystemClock.getInstance(); when(scheduler.getClock()).thenReturn(clock); QueueManager queueManager = new QueueManager(scheduler); queueManager.initialize(conf); FSQueue testQueue = queueManager.getLeafQueue("test", true); FairSchedulerQueueInfo queueInfo = new FairSchedulerQueueInfo(testQueue, scheduler); Collection<FairSchedulerQueueInfo> childQueues = queueInfo.getChildQueues(); Assert.assertNotNull(childQueues); Assert.assertEquals("Child QueueInfo was not empty", 0, childQueues.size()); }