private void loadPlan(String planName, Map<ReservationId, ReservationAllocationStateProto> reservations) throws PlanningException { Plan plan = plans.get(planName); Resource minAllocation = getMinAllocation(); ResourceCalculator rescCalculator = getResourceCalculator(); for (Entry<ReservationId, ReservationAllocationStateProto> currentReservation : reservations .entrySet()) { plan.addReservation(ReservationSystemUtil.toInMemoryAllocation(planName, currentReservation.getKey(), currentReservation.getValue(), minAllocation, rescCalculator), true); resQMap.put(currentReservation.getKey(), planName); } LOG.info("Recovered reservations for Plan: {}", planName); }
protected Plan initializePlan(String planQueueName) throws YarnException { String planQueuePath = getPlanQueuePath(planQueueName); SharingPolicy adPolicy = getAdmissionPolicy(planQueuePath); adPolicy.init(planQueuePath, getReservationSchedulerConfiguration()); // Calculate the max plan capacity Resource minAllocation = getMinAllocation(); Resource maxAllocation = getMaxAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); Resource totCap = getPlanQueueCapacity(planQueueName); Plan plan = new InMemoryPlan(getRootQueueMetrics(), adPolicy, getAgent(planQueuePath), totCap, planStepSize, rescCalc, minAllocation, maxAllocation, planQueueName, getReplanner(planQueuePath), getReservationSchedulerConfiguration().getMoveOnExpiry(planQueuePath), maxPeriodicity, rmContext); LOG.info("Initialized plan {} based on reservable queue {}", plan.toString(), planQueueName); return plan; }
protected Plan initializePlan(String planQueueName) throws YarnException { String planQueuePath = getPlanQueuePath(planQueueName); SharingPolicy adPolicy = getAdmissionPolicy(planQueuePath); adPolicy.init(planQueuePath, getReservationSchedulerConfiguration()); // Calculate the max plan capacity Resource minAllocation = getMinAllocation(); Resource maxAllocation = getMaxAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); Resource totCap = getPlanQueueCapacity(planQueueName); Plan plan = new InMemoryPlan(getRootQueueMetrics(), adPolicy, getAgent(planQueuePath), totCap, planStepSize, rescCalc, minAllocation, maxAllocation, planQueueName, getReplanner(planQueuePath), getReservationSchedulerConfiguration() .getMoveOnExpiry(planQueuePath)); LOG.info("Intialized plan {0} based on reservable queue {1}", plan.toString(), planQueueName); return plan; }
protected Plan initializePlan(String planQueueName) throws YarnException { String planQueuePath = getPlanQueuePath(planQueueName); SharingPolicy adPolicy = getAdmissionPolicy(planQueuePath); adPolicy.init(planQueuePath, getReservationSchedulerConfiguration()); // Calculate the max plan capacity Resource minAllocation = getMinAllocation(); Resource maxAllocation = getMaxAllocation(); ResourceCalculator rescCalc = getResourceCalculator(); Resource totCap = getPlanQueueCapacity(planQueueName); Plan plan = new InMemoryPlan(getRootQueueMetrics(), adPolicy, getAgent(planQueuePath), totCap, planStepSize, rescCalc, minAllocation, maxAllocation, planQueueName, getReplanner(planQueuePath), getReservationSchedulerConfiguration() .getMoveOnExpiry(planQueuePath)); LOG.info("Intialized plan {0} based on reservable queue {1}", plan.toString(), planQueueName); return plan; }