QueueManager { public FSLeafQueue getLeafQueue(String name, boolean create) { return getLeafQueue(name, create, null, true); } QueueManager(FairScheduler scheduler); FSParentQueue getRootQueue(); void initialize(); FSLeafQueue getLeafQueue(String name, boolean create); FSLeafQueue getLeafQueue(String name, boolean create,
                                  ApplicationId applicationId); boolean removeLeafQueue(String name); FSParentQueue getParentQueue(String name, boolean create); FSParentQueue getParentQueue(String name, boolean create,
      boolean recomputeSteadyShares); void removeEmptyDynamicQueues(); void removePendingIncompatibleQueues(); FSQueue getQueue(String name); boolean exists(String name); Collection<FSLeafQueue> getLeafQueues(); Collection<FSQueue> getQueues(); void updateAllocationConfiguration(AllocationConfiguration queueConf); static final String ROOT_QUEUE; }
@Test public void testReloadTurnsLeafQueueIntoParent() { updateConfiguredLeafQueues(queueManager, "queue1"); updateConfiguredLeafQueues(queueManager, "queue1.queue2"); assertNull(queueManager.getLeafQueue("queue1", false)); assertNotNull(queueManager.getLeafQueue("queue1.queue2", false)); updateConfiguredLeafQueues(queueManager, "queue1"); assertNull(queueManager.getLeafQueue("queue1.queue2", false)); assertNotNull(queueManager.getLeafQueue("queue1", false)); FSLeafQueue q1 = queueManager.getLeafQueue("queue1", false); ApplicationId appId = ApplicationId.newInstance(0, 0); q1.addAssignedApp(appId); updateConfiguredLeafQueues(queueManager, "queue1.queue2"); assertNull(queueManager.getLeafQueue("queue1.queue2", false)); assertNotNull(queueManager.getLeafQueue("queue1", false)); q1.removeAssignedApp(appId); updateConfiguredLeafQueues(queueManager, "queue1.queue2"); FSLeafQueue q2 = queueManager.getLeafQueue("queue1.queue2", false); q2.addAssignedApp(appId); updateConfiguredLeafQueues(queueManager, "queue1"); assertNotNull(queueManager.getLeafQueue("queue1.queue2", false)); assertNull(queueManager.getLeafQueue("queue1", false)); updateConfiguredLeafQueues(queueManager, "default.queue3"); assertNull(queueManager.getLeafQueue("default.queue3", false)); assertNotNull(queueManager.getLeafQueue("default", false)); }