コード例 #1
0
        public FifoSchedulerInfo(ResourceManager rm)
        {
            // JAXB needs this
            RMContext     rmContext = rm.GetRMContext();
            FifoScheduler fs        = (FifoScheduler)rm.GetResourceScheduler();

            qName = fs.GetQueueInfo(string.Empty, false, false).GetQueueName();
            QueueInfo qInfo = fs.GetQueueInfo(qName, true, true);

            this.usedCapacity           = qInfo.GetCurrentCapacity();
            this.capacity               = qInfo.GetCapacity();
            this.minQueueMemoryCapacity = fs.GetMinimumResourceCapability().GetMemory();
            this.maxQueueMemoryCapacity = fs.GetMaximumResourceCapability().GetMemory();
            this.qstate            = qInfo.GetQueueState();
            this.numNodes          = rmContext.GetRMNodes().Count;
            this.usedNodeCapacity  = 0;
            this.availNodeCapacity = 0;
            this.totalNodeCapacity = 0;
            this.numContainers     = 0;
            foreach (RMNode ni in rmContext.GetRMNodes().Values)
            {
                SchedulerNodeReport report = fs.GetNodeReport(ni.GetNodeID());
                this.usedNodeCapacity  += report.GetUsedResource().GetMemory();
                this.availNodeCapacity += report.GetAvailableResource().GetMemory();
                this.totalNodeCapacity += ni.GetTotalCapability().GetMemory();
                this.numContainers     += fs.GetNodeReport(ni.GetNodeID()).GetNumContainers();
            }
        }