private FSLeafQueue getLeafQueue(String name, boolean create, ApplicationId applicationId, boolean recomputeSteadyShares) { FSQueue queue = getQueue(name, create, FSQueueType.LEAF, recomputeSteadyShares, applicationId); if (queue instanceof FSParentQueue) { return null; } return (FSLeafQueue) queue; }
/** * Get a leaf queue by name, creating it if the create param is true and is necessary. * If the queue is not or can not be a leaf queue, i.e. it already exists as a * parent queue, or one of the parents in its name is already a leaf queue, * null is returned. * * The root part of the name is optional, so a queue underneath the root * named "queue1" could be referred to as just "queue1", and a queue named * "queue2" underneath a parent named "parent1" that is underneath the root * could be referred to as just "parent1.queue2". */ public FSLeafQueue getLeafQueue(String name, boolean create) { FSQueue queue = getQueue(name, create, FSQueueType.LEAF); if (queue instanceof FSParentQueue) { return null; } return (FSLeafQueue) queue; }
@Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; }
@Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; }
@Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; }
@Override public synchronized boolean checkAccess(UserGroupInformation callerUGI, QueueACL acl, String queueName) { FSQueue queue = getQueueManager().getQueue(queueName); if (queue == null) { if (LOG.isDebugEnabled()) { LOG.debug("ACL not found for queue access-type " + acl + " for queue " + queueName); } return false; } return queue.hasAccess(acl, callerUGI); }
@Override public synchronized boolean checkAccess(UserGroupInformation callerUGI, QueueACL acl, String queueName) { FSQueue queue = getQueueManager().getQueue(queueName); if (queue == null) { if (LOG.isDebugEnabled()) { LOG.debug("ACL not found for queue access-type " + acl + " for queue " + queueName); } return false; } return queue.hasAccess(acl, callerUGI); }
@Override public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException { if (!queueMgr.exists(queueName)) { throw new IOException("queue " + queueName + " does not exist"); } return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues, recursive); }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException { if (!queueMgr.exists(queueName)) { throw new IOException("queue " + queueName + " does not exist"); } return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues, recursive); }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override protected String getReservationQueueName(String planQueueName, String reservationQueueName) { String planQueueNameFullPath = fs.getQueueManager().getQueue (planQueueName).getName(); if (!reservationQueueName.startsWith(planQueueNameFullPath)) { // If name is not a path we need full path for FairScheduler. See // YARN-2773 for the root cause return planQueueNameFullPath + "." + reservationQueueName; } return reservationQueueName; }
@Override public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException { if (!queueMgr.exists(queueName)) { throw new IOException("queue " + queueName + " does not exist"); } return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues, recursive); }
@Override public boolean checkAccess(UserGroupInformation callerUGI, QueueACL acl, String queueName) { readLock.lock(); try { FSQueue queue = getQueueManager().getQueue(queueName); if (queue == null) { if (LOG.isDebugEnabled()) { LOG.debug("ACL not found for queue access-type " + acl + " for queue " + queueName); } return false; } return queue.hasAccess(acl, callerUGI); } finally { readLock.unlock(); } }
private void ensureQueueExistsAndIsCompatibleAndIsStatic( AllocationConfiguration queueConf, FSQueueType queueType) { for (String name : queueConf.getConfiguredQueues().get(queueType)) { Boolean removed = removeEmptyIncompatibleQueues(name, queueType).orElse(null); if (Boolean.FALSE.equals(removed)) { incompatibleQueuesPendingRemoval.add( new IncompatibleQueueRemovalTask(name, queueType)); } else { FSQueue queue = getQueue(name, true, queueType, false, null); if (queue != null) { queue.setDynamic(false); } } } }
private String handleMoveToPlanQueue(String targetQueueName) { FSQueue dest = queueMgr.getQueue(targetQueueName); if (dest != null && allocConf.isReservable(dest.getQueueName())) { // use the default child reservation queue of the plan targetQueueName = getDefaultQueueForPlanQueue(targetQueueName); } return targetQueueName; }
@Override public Plan getPlan(String planName) { // make sure plan name is a full queue name in fair scheduler. For example, // "root.default" is the full queue name for "default". FSQueue queue = fairScheduler.getQueueManager().getQueue(planName); if (queue != null) { return super.getPlan(queue.getQueueName()); } else { return null; } } }
private String handleMoveToPlanQueue(String targetQueueName) { FSQueue dest = queueMgr.getQueue(targetQueueName); if (dest != null && allocConf.isReservable(dest.getQueueName())) { // use the default child reservation queue of the plan targetQueueName = getDefaultQueueForPlanQueue(targetQueueName); } return targetQueueName; } }
private String handleMoveToPlanQueue(String targetQueueName) { FSQueue dest = queueMgr.getQueue(targetQueueName); if (dest != null && allocConf.isReservable(dest.getQueueName())) { // use the default child reservation queue of the plan targetQueueName = getDefaultQueueForPlanQueue(targetQueueName); } return targetQueueName; } }
/** * Submit an application to a given queue and take over the entire cluster. * * @param queueName queue name */ private void takeAllResources(String queueName) { // Create an app that takes up all the resources on the cluster ApplicationAttemptId appAttemptId = createSchedulingRequest(GB, 1, queueName, "default", NODE_CAPACITY_MULTIPLE * rmNodes.size()); greedyApp = scheduler.getSchedulerApp(appAttemptId); scheduler.update(); sendEnoughNodeUpdatesToAssignFully(); assertEquals(8, greedyApp.getLiveContainers().size()); // Verify preemptable for queue and app attempt assertTrue( scheduler.getQueueManager().getQueue(queueName).isPreemptable() == greedyApp.isPreemptable()); }