@Override public List<QueueUserACLInfo> getQueueUserAclInfo() { UserGroupInformation user; try { user = UserGroupInformation.getCurrentUser(); } catch (IOException ioe) { return new ArrayList<QueueUserACLInfo>(); } return queueMgr.getRootQueue().getQueueUserAclInfo(user); }
@Override public List<QueueUserACLInfo> getQueueUserAclInfo() { UserGroupInformation user; try { user = UserGroupInformation.getCurrentUser(); } catch (IOException ioe) { return new ArrayList<QueueUserACLInfo>(); } return queueMgr.getRootQueue().getQueueUserAclInfo(user); }
@Override public List<QueueUserACLInfo> getQueueUserAclInfo() { UserGroupInformation user; try { user = UserGroupInformation.getCurrentUser(); } catch (IOException ioe) { return new ArrayList<QueueUserACLInfo>(); } return queueMgr.getRootQueue().getQueueUserAclInfo(user); }
/** * Process resource update on a node and update Queue. */ @Override public synchronized void updateNodeResource(RMNode nm, ResourceOption resourceOption) { super.updateNodeResource(nm, resourceOption); updateRootQueueMetrics(); queueMgr.getRootQueue().setSteadyFairShare(clusterResource); queueMgr.getRootQueue().recomputeSteadyShares(); }
/** * Process resource update on a node and update Queue. */ @Override public synchronized void updateNodeResource(RMNode nm, ResourceOption resourceOption) { super.updateNodeResource(nm, resourceOption); updateRootQueueMetrics(); queueMgr.getRootQueue().setSteadyFairShare(clusterResource); queueMgr.getRootQueue().recomputeSteadyShares(); }
public FairSchedulerInfo(FairScheduler fs) { scheduler = fs; rootQueue = new FairSchedulerQueueInfo(scheduler.getQueueManager(). getRootQueue(), scheduler); }
public FairSchedulerInfo(FairScheduler fs) { scheduler = fs; rootQueue = new FairSchedulerQueueInfo(scheduler.getQueueManager(). getRootQueue(), scheduler); }
public FairSchedulerInfo(FairScheduler fs) { scheduler = fs; rootQueue = new FairSchedulerQueueInfo(scheduler.getQueueManager(). getRootQueue(), scheduler); }
/** * Process resource update on a node and update Queue. */ @Override public void updateNodeResource(RMNode nm, ResourceOption resourceOption) { writeLock.lock(); try { super.updateNodeResource(nm, resourceOption); updateRootQueueMetrics(); queueMgr.getRootQueue().setSteadyFairShare(getClusterResource()); queueMgr.getRootQueue().recomputeSteadyShares(); } finally { writeLock.unlock(); } }
/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
private synchronized void addNode(RMNode node) { FSSchedulerNode schedulerNode = new FSSchedulerNode(node, usePortForNodeName); nodes.put(node.getNodeID(), schedulerNode); Resources.addTo(clusterResource, schedulerNode.getTotalResource()); updateRootQueueMetrics(); updateMaximumAllocation(schedulerNode, true); queueMgr.getRootQueue().setSteadyFairShare(clusterResource); queueMgr.getRootQueue().recomputeSteadyShares(); LOG.info("Added node " + node.getNodeAddress() + " cluster capacity: " + clusterResource); }
private synchronized void addNode(RMNode node) { FSSchedulerNode schedulerNode = new FSSchedulerNode(node, usePortForNodeName); nodes.put(node.getNodeID(), schedulerNode); Resources.addTo(clusterResource, schedulerNode.getTotalResource()); updateRootQueueMetrics(); updateMaximumAllocation(schedulerNode, true); queueMgr.getRootQueue().setSteadyFairShare(clusterResource); queueMgr.getRootQueue().recomputeSteadyShares(); LOG.info("Added node " + node.getNodeAddress() + " cluster capacity: " + clusterResource); }
private void addNode(List<NMContainerStatus> containerReports, RMNode node) { writeLock.lock(); try { FSSchedulerNode schedulerNode = new FSSchedulerNode(node, usePortForNodeName); nodeTracker.addNode(schedulerNode); triggerUpdate(); Resource clusterResource = getClusterResource(); queueMgr.getRootQueue().setSteadyFairShare(clusterResource); queueMgr.getRootQueue().recomputeSteadyShares(); LOG.info("Added node " + node.getNodeAddress() + " cluster capacity: " + clusterResource); recoverContainersOnNode(containerReports, node); updateRootQueueMetrics(); } finally { writeLock.unlock(); } }
/** * Dump scheduler state including states of all queues. */ private void dumpSchedulerState() { FSQueue rootQueue = queueMgr.getRootQueue(); Resource clusterResource = getClusterResource(); STATE_DUMP_LOG.debug( "FairScheduler state: Cluster Capacity: " + clusterResource + " Allocations: " + rootMetrics.getAllocatedResources() + " Availability: " + Resource.newInstance( rootMetrics.getAvailableMB(), rootMetrics.getAvailableVirtualCores()) + " Demand: " + rootQueue.getDemand()); STATE_DUMP_LOG.debug(rootQueue.dumpState()); }
@Test public void testMoveNonRunnableApp() throws Exception { scheduler.init(conf); scheduler.start(); scheduler.reinitialize(conf, resourceManager.getRMContext()); QueueManager queueMgr = scheduler.getQueueManager(); FSLeafQueue oldQueue = queueMgr.getLeafQueue("queue1", true); FSLeafQueue targetQueue = queueMgr.getLeafQueue("queue2", true); scheduler.getAllocationConfiguration().queueMaxApps.put("root.queue1", 0); scheduler.getAllocationConfiguration().queueMaxApps.put("root.queue2", 0); ApplicationAttemptId appAttId = createSchedulingRequest(1024, 1, "queue1", "user1", 3); assertEquals(0, oldQueue.getNumRunnableApps()); scheduler.moveApplication(appAttId.getApplicationId(), "queue2"); assertEquals(0, oldQueue.getNumRunnableApps()); assertEquals(0, targetQueue.getNumRunnableApps()); assertEquals(0, queueMgr.getRootQueue().getNumRunnableApps()); }
@Test public void testMoveNonRunnableApp() throws Exception { QueueManager queueMgr = scheduler.getQueueManager(); FSLeafQueue oldQueue = queueMgr.getLeafQueue("queue1", true); FSLeafQueue targetQueue = queueMgr.getLeafQueue("queue2", true); oldQueue.setMaxRunningApps(0); targetQueue.setMaxRunningApps(0); ApplicationAttemptId appAttId = createSchedulingRequest(1024, 1, "queue1", "user1", 3); assertEquals(0, oldQueue.getNumRunnableApps()); scheduler.moveApplication(appAttId.getApplicationId(), "queue2"); assertEquals(0, oldQueue.getNumRunnableApps()); assertEquals(0, targetQueue.getNumRunnableApps()); assertEquals(0, queueMgr.getRootQueue().getNumRunnableApps()); }
@Test public void testPreemptionVariablesForQueueCreatedRuntime() throws Exception { // Set preemption variables for the root queue FSParentQueue root = scheduler.getQueueManager().getRootQueue(); root.setMinSharePreemptionTimeout(10000); root.setFairSharePreemptionTimeout(15000); root.setFairSharePreemptionThreshold(.6f); // User1 submits one application ApplicationAttemptId appAttemptId = createAppAttemptId(1, 1); createApplicationWithAMResource(appAttemptId, "default", "user1", null); // The user1 queue should inherit the configurations from the root queue FSLeafQueue userQueue = scheduler.getQueueManager().getLeafQueue("user1", true); assertEquals(1, userQueue.getNumRunnableApps()); assertEquals(10000, userQueue.getMinSharePreemptionTimeout()); assertEquals(15000, userQueue.getFairSharePreemptionTimeout()); assertEquals(.6f, userQueue.getFairSharePreemptionThreshold(), 0.001); }
@Test public void testMoveMakesAppRunnable() throws Exception { QueueManager queueMgr = scheduler.getQueueManager(); FSLeafQueue oldQueue = queueMgr.getLeafQueue("queue1", true); FSLeafQueue targetQueue = queueMgr.getLeafQueue("queue2", true); oldQueue.setMaxRunningApps(0); ApplicationAttemptId appAttId = createSchedulingRequest(1024, 1, "queue1", "user1", 3); FSAppAttempt app = scheduler.getSchedulerApp(appAttId); assertTrue(oldQueue.isNonRunnableApp(app)); scheduler.moveApplication(appAttId.getApplicationId(), "queue2"); assertFalse(oldQueue.isNonRunnableApp(app)); assertFalse(targetQueue.isNonRunnableApp(app)); assertTrue(targetQueue.isRunnableApp(app)); assertEquals(1, targetQueue.getNumRunnableApps()); assertEquals(1, queueMgr.getRootQueue().getNumRunnableApps()); } }