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 getPendingContainers(); 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() { FairSchedulerConfiguration fsConf = new FairSchedulerConfiguration(); RMContext rmContext = mock(RMContext.class); PlacementManager placementManager = new PlacementManager(); SystemClock clock = SystemClock.getInstance(); FairScheduler scheduler = mock(FairScheduler.class); when(scheduler.getConf()).thenReturn(fsConf); when(scheduler.getConfig()).thenReturn(fsConf); when(scheduler.getRMContext()).thenReturn(rmContext); when(rmContext.getQueuePlacementManager()).thenReturn(placementManager); when(scheduler.getClusterResource()).thenReturn( Resource.newInstance(1, 1)); when(scheduler.getResourceCalculator()).thenReturn( new DefaultResourceCalculator()); when(scheduler.getClock()).thenReturn(clock); AllocationConfiguration allocConf = new AllocationConfiguration(scheduler); when(scheduler.getAllocationConfiguration()).thenReturn(allocConf); QueueManager queueManager = new QueueManager(scheduler); queueManager.initialize(); 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()); }