@Override protected ReservationSchedulerConfiguration getReservationSchedulerConfiguration() { return fairScheduler.getAllocationConfiguration(); }
@Override protected ReservationSchedulerConfiguration getReservationSchedulerConfiguration() { return fairScheduler.getAllocationConfiguration(); }
@Override protected ReservationSchedulerConfiguration getReservationSchedulerConfiguration() { return fairScheduler.getAllocationConfiguration(); }
public boolean hasAccess(QueueACL acl, UserGroupInformation user) { return scheduler.getAllocationConfiguration().hasAccess(name, acl, user); }
@Override public Resource getMinShare() { return scheduler.getAllocationConfiguration().getMinResources(getName()); }
@Override public Resource getMaxShare() { return scheduler.getAllocationConfiguration().getMaxResources(getName()); }
@Override public Resource getMinShare() { return scheduler.getAllocationConfiguration().getMinResources(getName()); }
@Override public ResourceWeights getWeights() { return scheduler.getAllocationConfiguration().getQueueWeight(getName()); }
@Override public ResourceWeights getWeights() { return scheduler.getAllocationConfiguration().getQueueWeight(getName()); }
@Override public Resource getMaxShare() { return scheduler.getAllocationConfiguration().getMaxResources(getName()); }
/** Allows setting weight for a dynamically created queue * Currently only used for reservation based queues * @param weight queue weight */ public void setWeights(float weight) { scheduler.getAllocationConfiguration().setQueueWeight(getName(), new ResourceWeights(weight)); }
/** Allows setting weight for a dynamically created queue * Currently only used for reservation based queues * @param weight queue weight */ public void setWeights(float weight) { scheduler.getAllocationConfiguration().setQueueWeight(getName(), new ResourceWeights(weight)); }
/** * Helper method to check if the queue should attempt assigning resources * * @return true if check passes (can assign) or false otherwise */ protected boolean assignContainerPreCheck(FSSchedulerNode node) { if (!Resources.fitsIn(getResourceUsage(), scheduler.getAllocationConfiguration().getMaxResources(getName())) || node.getReservedContainer() != null) { return false; } return true; }
/** * Helper method to check if the queue should attempt assigning resources * * @return true if check passes (can assign) or false otherwise */ protected boolean assignContainerPreCheck(FSSchedulerNode node) { if (!Resources.fitsIn(getResourceUsage(), scheduler.getAllocationConfiguration().getMaxResources(getName())) || node.getReservedContainer() != null) { return false; } return true; }
private void setupPlanFollower() throws Exception { mClock = mock(Clock.class); mAgent = mock(ReservationAgent.class); String reservationQ = ReservationSystemTestUtil.getFullReservationQueueName(); AllocationConfiguration allocConf = fs.getAllocationConfiguration(); allocConf.setReservationWindow(20L); allocConf.setAverageCapacity(20); policy.init(reservationQ, allocConf); }
private void setupPlanFollower() throws Exception { ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil(); mClock = mock(Clock.class); mAgent = mock(ReservationAgent.class); String reservationQ = testUtil.getFullReservationQueueName(); AllocationConfiguration allocConf = fs.getAllocationConfiguration(); allocConf.setReservationWindow(20L); allocConf.setAverageCapacity(20); policy.init(reservationQ, allocConf); }
public FSQueue(String name, FairScheduler scheduler, FSParentQueue parent) { this.name = name; this.scheduler = scheduler; this.authorizer = YarnAuthorizationProvider.getInstance(scheduler.getConf()); this.queueEntity = new PrivilegedEntity(EntityType.QUEUE, name); this.metrics = FSQueueMetrics.forQueue(getName(), parent, true, scheduler.getConf()); this.parent = parent; setPolicy(scheduler.getAllocationConfiguration().getSchedulingPolicy(name)); reinit(false); }
@Test (expected = YarnException.class) public void testMoveWouldViolateMaxAppsConstraints() throws Exception { scheduler.init(conf); scheduler.start(); scheduler.reinitialize(conf, resourceManager.getRMContext()); QueueManager queueMgr = scheduler.getQueueManager(); queueMgr.getLeafQueue("queue2", true); scheduler.getAllocationConfiguration().queueMaxApps.put("root.queue2", 0); ApplicationAttemptId appAttId = createSchedulingRequest(1024, 1, "queue1", "user1", 3); scheduler.moveApplication(appAttId.getApplicationId(), "queue2"); }
/** * Test creation of a simple parent queue. */ @Test public void testCreateParentQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.PARENT); assertNotNull("Parent queue root.queue1 was not created", queueManager.getParentQueue("root.queue1", false)); assertEquals("createQueue() returned wrong queue", "root.queue1", q1.getName()); }
/** * Test simple leaf queue creation. */ @Test public void testCreateLeafQueue() { AllocationConfiguration allocConf = scheduler.getAllocationConfiguration(); queueManager.updateAllocationConfiguration(allocConf); FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.LEAF); assertNotNull("Leaf queue root.queue1 was not created", queueManager.getLeafQueue("root.queue1", false)); assertEquals("createQueue() returned wrong queue", "root.queue1", q1.getName()); }