@Override protected Resource getPlanQueueCapacity(String planQueueName) { Resource minAllocation = getMinAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); CSQueue planQueue = capScheduler.getQueue(planQueueName); return rescCalc.multiplyAndNormalizeDown(capScheduler.getClusterResource(), planQueue.getAbsoluteCapacity(), minAllocation); }
new CapacityReservationSystem(); CapacitySchedulerConfiguration conf = capScheduler.getConfiguration(); RMContext mockContext = capScheduler.getRMContext(); reservationSystem.setRMContext(mockContext); try { reservationSystem.reinitialize(capScheduler.getConfiguration(), mockContext); } catch (YarnException e) { Assert.assertNull(reservationSystem.getPlan(newQ)); testUtil.updateQueueConfiguration(conf, newQ); try { reservationSystem.reinitialize(conf, mockContext); } catch (YarnException e) { Assert.fail(e.getMessage());
@Test public void testInitialize() { ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil(); CapacityScheduler capScheduler = null; try { capScheduler = testUtil.mockCapacityScheduler(10); } catch (IOException e) { Assert.fail(e.getMessage()); } CapacityReservationSystem reservationSystem = new CapacityReservationSystem(); reservationSystem.setRMContext(capScheduler.getRMContext()); try { reservationSystem.reinitialize(capScheduler.getConf(), capScheduler.getRMContext()); } catch (YarnException e) { Assert.fail(e.getMessage()); } String planQName = testUtil.getreservationQueueName(); ReservationSystemTestUtil.validateReservationQueue(reservationSystem, planQName); }
public AbstractReservationSystem configureReservationSystem() { switch (getSchedulerType()) { case CAPACITY: return new CapacityReservationSystem(); case FAIR: return new FairReservationSystem(); } return null; }
@Override protected Resource getPlanQueueCapacity(String planQueueName) { Resource minAllocation = getMinAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); CSQueue planQueue = capScheduler.getQueue(planQueueName); return rescCalc.multiplyAndNormalizeDown(capScheduler.getClusterResource(), planQueue.getAbsoluteCapacity(), minAllocation); }
@Override protected Resource getPlanQueueCapacity(String planQueueName) { Resource minAllocation = getMinAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); CSQueue planQueue = capScheduler.getQueue(planQueueName); return rescCalc.multiplyAndNormalizeDown(capScheduler.getClusterResource(), planQueue.getAbsoluteCapacity(), minAllocation); }