private void initializeNewPlans(Configuration conf) { LOG.info("Refreshing Reservation system"); writeLock.lock(); try { // Create a plan corresponding to every new reservable queue Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { if (!plans.containsKey(planQueueName)) { Plan plan = initializePlan(planQueueName); plans.put(planQueueName, plan); } else { LOG.warn("Plan based on reservation queue {} already exists.", planQueueName); } } // Update the plan follower with the active plans if (planFollower != null) { planFollower.setPlans(plans.values()); } } catch (YarnException e) { LOG.warn("Exception while trying to refresh reservable queues", e); } finally { writeLock.unlock(); } }
private void initializeNewPlans(Configuration conf) { LOG.info("Refreshing Reservation system"); writeLock.lock(); try { // Create a plan corresponding to every new reservable queue Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { if (!plans.containsKey(planQueueName)) { Plan plan = initializePlan(planQueueName); plans.put(planQueueName, plan); } else { LOG.warn("Plan based on reservation queue {0} already exists.", planQueueName); } } // Update the plan follower with the active plans if (planFollower != null) { planFollower.setPlans(plans.values()); } } catch (YarnException e) { LOG.warn("Exception while trying to refresh reservable queues", e); } finally { writeLock.unlock(); } }
private void initializeNewPlans(Configuration conf) { LOG.info("Refreshing Reservation system"); writeLock.lock(); try { // Create a plan corresponding to every new reservable queue Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { if (!plans.containsKey(planQueueName)) { Plan plan = initializePlan(planQueueName); plans.put(planQueueName, plan); } else { LOG.warn("Plan based on reservation queue {0} already exists.", planQueueName); } } // Update the plan follower with the active plans if (planFollower != null) { planFollower.setPlans(plans.values()); } } catch (YarnException e) { LOG.warn("Exception while trying to refresh reservable queues", e); } finally { writeLock.unlock(); } }
public ReservationsACLsManager(ResourceScheduler scheduler, Configuration conf) throws YarnException { this.isReservationACLsEnable = conf.getBoolean(YarnConfiguration.YARN_RESERVATION_ACL_ENABLE, YarnConfiguration.DEFAULT_YARN_RESERVATION_ACL_ENABLE) && conf.getBoolean(YarnConfiguration.YARN_ACL_ENABLE, YarnConfiguration.DEFAULT_YARN_ACL_ENABLE); if (scheduler instanceof CapacityScheduler) { CapacitySchedulerConfiguration csConf = new CapacitySchedulerConfiguration(conf); for (String planQueue : scheduler.getPlanQueues()) { CSQueue queue = ((CapacityScheduler) scheduler).getQueue(planQueue); reservationAcls.put(planQueue, csConf.getReservationAcls(queue .getQueuePath())); } } else if (scheduler instanceof FairScheduler) { AllocationConfiguration aConf = ((FairScheduler) scheduler) .getAllocationConfiguration(); for (String planQueue : scheduler.getPlanQueues()) { reservationAcls.put(planQueue, aConf.getReservationAcls(planQueue)); } } }
private void initialize(Configuration conf) throws YarnException { LOG.info("Initializing Reservation system"); this.conf = conf; scheduler = rmContext.getScheduler(); // Get the plan step size planStepSize = conf.getTimeDuration( YarnConfiguration.RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP, YarnConfiguration.DEFAULT_RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP, TimeUnit.MILLISECONDS); if (planStepSize < 0) { planStepSize = YarnConfiguration.DEFAULT_RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP; } // Create a plan corresponding to every reservable queue Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { Plan plan = initializePlan(planQueueName); plans.put(planQueueName, plan); } }
private void initialize(Configuration conf) throws YarnException { LOG.info("Initializing Reservation system"); this.conf = conf; scheduler = rmContext.getScheduler(); // Get the plan step size planStepSize = conf.getTimeDuration( YarnConfiguration.RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP, YarnConfiguration.DEFAULT_RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP, TimeUnit.MILLISECONDS); if (planStepSize < 0) { planStepSize = YarnConfiguration.DEFAULT_RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP; } // Create a plan corresponding to every reservable queue Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { Plan plan = initializePlan(planQueueName); plans.put(planQueueName, plan); } }
Set<String> planQueueNames = scheduler.getPlanQueues(); for (String planQueueName : planQueueNames) { Plan plan = initializePlan(planQueueName);