QueueManager { @VisibleForTesting boolean isQueueNameValid(String node) { return !node.isEmpty() && node.equals(FairSchedulerUtilities.trimQueueName(node)); } QueueManager(FairScheduler scheduler); FSParentQueue getRootQueue(); void initialize(Configuration conf); 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 testCheckQueueNodeName() { assertFalse(queueManager.isQueueNameValid("")); assertFalse(queueManager.isQueueNameValid(" ")); assertFalse(queueManager.isQueueNameValid(" a")); assertFalse(queueManager.isQueueNameValid("a ")); assertFalse(queueManager.isQueueNameValid(" a ")); assertFalse(queueManager.isQueueNameValid("\u00a0")); assertFalse(queueManager.isQueueNameValid("a\u00a0")); assertFalse(queueManager.isQueueNameValid("\u00a0a\u00a0")); assertTrue(queueManager.isQueueNameValid("a b")); assertTrue(queueManager.isQueueNameValid("a")); }