@Override public void onCheck() { queueMgr.removeEmptyDynamicQueues(); queueMgr.removePendingIncompatibleQueues(); } }
@Test public void testRemovalOfChildlessParentQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSParentQueue q1 = queueManager.getParentQueue("root.test.childB", false); assertNotNull("Queue root.test.childB was not created", q1); assertEquals("createQueue() returned wrong queue", "root.test.childB", q1.getName()); assertFalse("root.test.childB is a dynamic queue", q1.isDynamic()); // static queues should not be deleted queueManager.removePendingIncompatibleQueues(); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getParentQueue("root.test.childB", false); assertNotNull("Queue root.test.childB was deleted", q1); // next we remove root.test.childB from the allocation config allocConf.configuredQueues.get(FSQueueType.PARENT) .remove("root.test.childB"); queueManager.updateAllocationConfiguration(allocConf); queueManager.setQueuesToDynamic(Collections.singleton("root.test.childB")); // the next removeEmptyDynamicQueues() call should clean // root.test.childB up queueManager.removePendingIncompatibleQueues(); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getParentQueue("root.leaf1", false); assertNull("Queue root.leaf1 was not deleted", q1); }
queueManager.removeEmptyDynamicQueues(); q = queueManager.getLeafQueue("root.a", false); assertNotNull("root.a does not exist", q); queueManager.removeEmptyDynamicQueues(); FSParentQueue p = queueManager.getParentQueue("root.a", false); assertNotNull("root.a does not exist", p);
queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.leaf1", false); assertNotNull("Queue root.leaf1 was deleted", q1); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.leaf1", false); assertNotNull("Queue root.leaf1 was deleted", q1);
@Test public void testRemovalOfDynamicLeafQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSQueue q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", true); assertNotNull("Queue root.test.childB.dynamic1 was not created", q1); assertEquals("createQueue() returned wrong queue", "root.test.childB.dynamic1", q1.getName()); assertTrue("root.test.childB.dynamic1 is not a dynamic queue", q1.isDynamic()); // an application is submitted to root.test.childB.dynamic1 notEmptyQueues.add(q1); // root.test.childB.dynamic1 is not empty and should not be removed queueManager.removePendingIncompatibleQueues(); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", false); assertNotNull("Queue root.test.childB.dynamic1 was deleted", q1); // the application finishes, the next removeEmptyDynamicQueues() should // clean root.test.childB.dynamic1 up, but keep its static parent notEmptyQueues.remove(q1); queueManager.removePendingIncompatibleQueues(); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", false); assertNull("Queue root.test.childB.dynamic1 was not deleted", q1); assertNotNull("The static parent of root.test.childB.dynamic1 was deleted", queueManager.getParentQueue("root.test.childB", false)); }
queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.test.childA", false); assertNotNull("Queue root.test.childA was deleted", q1); queueManager.removeEmptyDynamicQueues();
queueManager.removeEmptyDynamicQueues(); q = queueManager.getLeafQueue("root.leaf1", false); assertNotNull("root.leaf1 has been removed", q); "a_user", q, activeUsersManager, rmContext); q.addApp(appAttempt, true); queueManager.removeEmptyDynamicQueues(); q = queueManager.getLeafQueue("root.leaf1", false); assertNotNull("root.leaf1 has been removed", q); queueManager.removeEmptyDynamicQueues(); q = queueManager.getLeafQueue("root.leaf1", false); assertNull("root.leaf1 has not been removed", q);
@Test public void testRemovalOfDynamicParentQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSQueue q1 = queueManager.getLeafQueue("root.parent1.dynamic1", true); assertNotNull("Queue root.parent1.dynamic1 was not created", q1); assertEquals("createQueue() returned wrong queue", "root.parent1.dynamic1", q1.getName()); assertTrue("root.parent1.dynamic1 is not a dynamic queue", q1.isDynamic()); FSQueue p1 = queueManager.getParentQueue("root.parent1", false); assertNotNull("Queue root.parent1 was not created", p1); assertTrue("root.parent1 is not a dynamic queue", p1.isDynamic()); queueManager.removePendingIncompatibleQueues(); queueManager.removeEmptyDynamicQueues(); q1 = queueManager.getLeafQueue("root.parent1.dynamic1", false); p1 = queueManager.getParentQueue("root.parent1", false); assertNull("Queue root.parent1.dynamic1 was not deleted", q1); assertNull("Queue root.parent1 was not deleted", p1); }