@Override public void run() { for (int i=0; i < 500; i++) { schedulable.addApp(app, true); } } });
trackRunnableApp(next); FSAppAttempt appSched = next; next.getQueue().addApp(appSched, true); noLongerPendingApps.add(appSched);
trackRunnableApp(next); FSAppAttempt appSched = next; next.getQueue().addApp(appSched, true); noLongerPendingApps.add(appSched);
trackRunnableApp(next); FSAppAttempt appSched = next; next.getQueue().addApp(appSched, true); noLongerPendingApps.add(appSched);
queue.addApp(attempt, runnable); if (runnable) { maxRunningEnforcer.trackRunnableApp(attempt);
newQueue.addApp(attempt, nowRunnable);
newQueue.addApp(attempt, nowRunnable);
queue.addApp(attempt, runnable); if (runnable) { maxRunningEnforcer.trackRunnableApp(attempt);
queue.addApp(attempt, runnable); if (runnable) { maxRunningEnforcer.trackRunnableApp(attempt);
@Test public void testUpdateDemand() { conf.set(FairSchedulerConfiguration.ASSIGN_MULTIPLE, "false"); resourceManager = new MockRM(conf); resourceManager.start(); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); String queueName = "root.queue1"; FSLeafQueue schedulable = new FSLeafQueue(queueName, scheduler, null); schedulable.setMaxShare(new ConfigurableResource(maxResource)); assertEquals(schedulable.getMetrics().getMaxApps(), Integer.MAX_VALUE); assertEquals(schedulable.getMetrics().getSchedulingPolicy(), SchedulingPolicy.DEFAULT_POLICY.getName()); FSAppAttempt app = mock(FSAppAttempt.class); Mockito.when(app.getDemand()).thenReturn(maxResource); Mockito.when(app.getResourceUsage()).thenReturn(Resources.none()); schedulable.addApp(app, true); schedulable.addApp(app, true); schedulable.updateDemand(); assertTrue("Demand is greater than max allowed ", Resources.equals(schedulable.getDemand(), maxResource)); }
private FSAppAttempt addApp(FSLeafQueue queue, String user) { ApplicationId appId = ApplicationId.newInstance(0l, appNum++); ApplicationAttemptId attId = ApplicationAttemptId.newInstance(appId, 0); FSAppAttempt app = new FSAppAttempt(scheduler, attId, user, queue, null, rmContext); boolean runnable = maxAppsEnforcer.canAppBeRunnable(queue, app); queue.addApp(app, runnable); if (runnable) { maxAppsEnforcer.trackRunnableApp(app); } else { maxAppsEnforcer.trackNonRunnableApp(app); } return app; }
private FSAppAttempt addApp(FSLeafQueue queue, String user) { ApplicationId appId = ApplicationId.newInstance(0l, appNum++); ApplicationAttemptId attId = ApplicationAttemptId.newInstance(appId, 0); boolean runnable = maxAppsEnforcer.canAppBeRunnable(queue, user); FSAppAttempt app = new FSAppAttempt(scheduler, attId, user, queue, null, rmContext); queue.addApp(app, runnable); if (runnable) { maxAppsEnforcer.trackRunnableApp(app); } else { maxAppsEnforcer.trackNonRunnableApp(app); } return app; }
Mockito.when(app.getDemand()).thenReturn(resource); Mockito.when(app.getResourceUsage()).thenReturn(resource); child1.addApp(app, true); child1.updateDemand();
newQueue.addApp(attempt, nowRunnable);
q.addApp(appAttempt, true); queueManager.removeEmptyDynamicQueues(); q = queueManager.getLeafQueue("root.leaf1", false);