private void InitScheduler(Configuration conf) { lock (this) { ValidateConf(conf); //Use ConcurrentSkipListMap because applications need to be ordered this.applications = new ConcurrentSkipListMap <ApplicationId, SchedulerApplication <FiCaSchedulerApp> >(); this.minimumAllocation = Resources.CreateResource(conf.GetInt(YarnConfiguration.RmSchedulerMinimumAllocationMb , YarnConfiguration.DefaultRmSchedulerMinimumAllocationMb)); InitMaximumResourceCapability(Resources.CreateResource(conf.GetInt(YarnConfiguration .RmSchedulerMaximumAllocationMb, YarnConfiguration.DefaultRmSchedulerMaximumAllocationMb ), conf.GetInt(YarnConfiguration.RmSchedulerMaximumAllocationVcores, YarnConfiguration .DefaultRmSchedulerMaximumAllocationVcores))); this.usePortForNodeName = conf.GetBoolean(YarnConfiguration.RmSchedulerIncludePortInNodeName , YarnConfiguration.DefaultRmSchedulerUsePortForNodeName); this.metrics = QueueMetrics.ForQueue(DefaultQueueName, null, false, conf); this.activeUsersManager = new ActiveUsersManager(metrics); } }
/// <exception cref="System.IO.IOException"/> public AbstractCSQueue(CapacitySchedulerContext cs, string queueName, CSQueue parent , CSQueue old) { // Track resource usage-by-label like used-resource/pending-resource, etc. // Track capacities like used-capcity/abs-used-capacity/capacity/abs-capacity, // etc. this.labelManager = cs.GetRMContext().GetNodeLabelManager(); this.parent = parent; this.queueName = queueName; this.resourceCalculator = cs.GetResourceCalculator(); // must be called after parent and queueName is set this.metrics = old != null?old.GetMetrics() : QueueMetrics.ForQueue(GetQueuePath (), parent, cs.GetConfiguration().GetEnableUserMetrics(), cs.GetConf()); this.csContext = cs; this.minimumAllocation = csContext.GetMinimumResourceCapability(); // initialize ResourceUsage queueUsage = new ResourceUsage(); queueEntity = new PrivilegedEntity(PrivilegedEntity.EntityType.Queue, GetQueuePath ()); // initialize QueueCapacities queueCapacities = new QueueCapacities(parent == null); }