private void InitializeNewPlans(Configuration conf) { Log.Info("Refreshing Reservation system"); writeLock.Lock(); try { // Create a plan corresponding to every new reservable queue ICollection <string> planQueueNames = scheduler.GetPlanQueues(); foreach (string planQueueName in planQueueNames) { if (!plans.Contains(planQueueName)) { Plan plan = InitializePlan(planQueueName); plans[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(); } }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> private void Initialize(Configuration conf) { Log.Info("Initializing Reservation system"); this.conf = conf; scheduler = rmContext.GetScheduler(); // Get the plan step size planStepSize = conf.GetTimeDuration(YarnConfiguration.RmReservationSystemPlanFollowerTimeStep , YarnConfiguration.DefaultRmReservationSystemPlanFollowerTimeStep, TimeUnit.Milliseconds ); if (planStepSize < 0) { planStepSize = YarnConfiguration.DefaultRmReservationSystemPlanFollowerTimeStep; } // Create a plan corresponding to every reservable queue ICollection <string> planQueueNames = scheduler.GetPlanQueues(); foreach (string planQueueName in planQueueNames) { Plan plan = InitializePlan(planQueueName); plans[planQueueName] = plan; } }