@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
@Override public Set<String> getPlanQueues() throws YarnException { Set<String> planQueues = new HashSet<String>(); for (FSQueue fsQueue : queueMgr.getQueues()) { String queueName = fsQueue.getName(); if (allocConf.isReservable(queueName)) { planQueues.add(queueName); } } return planQueues; }
/** * Removes all empty dynamic queues (including empty dynamic parent queues). */ public void removeEmptyDynamicQueues() { synchronized (queues) { Set<FSParentQueue> parentQueuesToCheck = new HashSet<>(); for (FSQueue queue : getQueues()) { if (queue.isDynamic() && queue.getChildQueues().isEmpty()) { boolean removed = removeQueueIfEmpty(queue); if (removed && queue.getParent().isDynamic()) { parentQueuesToCheck.add(queue.getParent()); } } } while (!parentQueuesToCheck.isEmpty()) { FSParentQueue queue = parentQueuesToCheck.iterator().next(); if (queue.getChildQueues().isEmpty()) { removeQueue(queue); if (queue.getParent().isDynamic()) { parentQueuesToCheck.add(queue.getParent()); } } parentQueuesToCheck.remove(queue); } } }
/** * After reloading the allocation config, the max resource settings for any * ad hoc queues will be missing. This method goes through the queue manager's * queue list and adds back the max resources settings for any ad hoc queues. * Note that the new max resource settings will be based on the new config. * The old settings are lost. */ private void applyChildDefaults() { Collection<FSQueue> queues = queueMgr.getQueues(); Set<String> configuredLeafQueues = allocConf.getConfiguredQueues().get(FSQueueType.LEAF); Set<String> configuredParentQueues = allocConf.getConfiguredQueues().get(FSQueueType.PARENT); for (FSQueue queue : queues) { // If the queue is ad hoc and not root, apply the child defaults if ((queue.getParent() != null) && !configuredLeafQueues.contains(queue.getName()) && !configuredParentQueues.contains(queue.getName())) { ConfigurableResource max = queue.getParent(). getMaxChildQueueResource(); if (max != null) { queue.setMaxShare(max); } } } }
resourceManager.start(); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); for(FSQueue queue: scheduler.getQueueManager().getQueues()) { assertEquals(queue.getMetrics().getMaxApps(), Integer.MAX_VALUE); assertEquals(queue.getMetrics().getSchedulingPolicy(),