/** * 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()); }
private void setupCluster() throws IOException { resourceManager = new MockRM(conf); scheduler = (FairScheduler) resourceManager.getResourceScheduler(); // YARN-6249, FSLeafQueue#lastTimeAtMinShare is initialized to the time in // the real world, so we should keep the clock up with it. clock.setTime(SystemClock.getInstance().getTime()); scheduler.setClock(clock); resourceManager.start(); // Create and add two nodes to the cluster, with capacities // disproportional to the container requests. addNode(NODE_CAPACITY_MULTIPLE * GB, 3 * NODE_CAPACITY_MULTIPLE); addNode(NODE_CAPACITY_MULTIPLE * GB, 3 * NODE_CAPACITY_MULTIPLE); // Reinitialize the scheduler so DRF policy picks up cluster capacity // TODO (YARN-6194): One shouldn't need to call this scheduler.reinitialize(conf, resourceManager.getRMContext()); // Verify if child-1 and child-2 are preemptable FSQueue child1 = scheduler.getQueueManager().getQueue("nonpreemptable.child-1"); assertFalse(child1.isPreemptable()); FSQueue child2 = scheduler.getQueueManager().getQueue("nonpreemptable.child-2"); assertFalse(child2.isPreemptable()); }
preemptable = queue.isPreemptable(); childQueues = getChildQueues(queue, scheduler);