@GET @Path(RMWSConsts.SCHEDULER) @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) @Override public SchedulerTypeInfo getSchedulerInfo() { initForReadableEndpoints(); ResourceScheduler rs = rm.getResourceScheduler(); SchedulerInfo sinfo; if (rs instanceof CapacityScheduler) { CapacityScheduler cs = (CapacityScheduler) rs; CSQueue root = cs.getRootQueue(); sinfo = new CapacitySchedulerInfo(root, cs); } else if (rs instanceof FairScheduler) { FairScheduler fs = (FairScheduler) rs; sinfo = new FairSchedulerInfo(fs); } else if (rs instanceof FifoScheduler) { sinfo = new FifoSchedulerInfo(this.rm); } else { throw new NotFoundException("Unknown scheduler configured"); } return new SchedulerTypeInfo(sinfo); }
} else { info = new CapacitySchedulerQueueInfo(queue); info.queues = getQueues(queue);
CSQueue origRootQ = cs.getRootQueue(); CapacitySchedulerInfo oldInfo = new CapacitySchedulerInfo(origRootQ, cs); int origNumAppsA = getNumAppsInQueue("a", origRootQ.getChildQueues()); int origNumAppsRoot = origRootQ.getNumApplications(); int newNumAppsRoot = newRootQ.getNumApplications(); CapacitySchedulerInfo newInfo = new CapacitySchedulerInfo(newRootQ, cs); CapacitySchedulerLeafQueueInfo origOldA1 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a1", oldInfo.getQueues()); CapacitySchedulerLeafQueueInfo origNewA1 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a1", newInfo.getQueues()); CapacitySchedulerLeafQueueInfo targetOldA2 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a2", oldInfo.getQueues()); CapacitySchedulerLeafQueueInfo targetNewA2 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a2", newInfo.getQueues());
CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, cs); csqinfo.csinfo = sinfo; used = sinfo.getUsedCapacity() / 100; String nodeLabelDisplay = csqinfo.label.length() == 0 ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : csqinfo.label; PartitionQueueCapacitiesInfo capacities = sinfo.getCapacities() .getPartitionQueueCapacitiesInfo(csqinfo.label); used = capacities.getUsedCapacity() / 100;
CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); csqinfo.csinfo = sinfo; csqinfo.qinfo = null; used = sinfo.getUsedCapacity() / 100; CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, label); csqinfo.csinfo = sinfo; csqinfo.qinfo = null;
CSQueue origRootQ = cs.getRootQueue(); CapacitySchedulerInfo oldInfo = new CapacitySchedulerInfo(origRootQ, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); int origNumAppsA = getNumAppsInQueue("a", origRootQ.getChildQueues()); int newNumAppsRoot = newRootQ.getNumApplications(); CapacitySchedulerInfo newInfo = new CapacitySchedulerInfo(newRootQ, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); CapacitySchedulerLeafQueueInfo origOldA1 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a1", oldInfo.getQueues()); CapacitySchedulerLeafQueueInfo origNewA1 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a1", newInfo.getQueues()); CapacitySchedulerLeafQueueInfo targetOldA2 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a2", oldInfo.getQueues()); CapacitySchedulerLeafQueueInfo targetNewA2 = (CapacitySchedulerLeafQueueInfo) getQueueInfo("a2", newInfo.getQueues());
CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); csqinfo.csinfo = sinfo; csqinfo.qinfo = null; used = sinfo.getUsedCapacity() / 100; CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, label); csqinfo.csinfo = sinfo; csqinfo.qinfo = null;
} else { info = new CapacitySchedulerQueueInfo(queue, nodeLabel.getLabelName()); info.queues = getQueues(queue, nodeLabel);
@GET @Path("/scheduler") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public SchedulerTypeInfo getSchedulerInfo() { init(); ResourceScheduler rs = rm.getResourceScheduler(); SchedulerInfo sinfo; if (rs instanceof CapacityScheduler) { CapacityScheduler cs = (CapacityScheduler) rs; CSQueue root = cs.getRootQueue(); sinfo = new CapacitySchedulerInfo(root, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); } else if (rs instanceof FairScheduler) { FairScheduler fs = (FairScheduler) rs; sinfo = new FairSchedulerInfo(fs); } else if (rs instanceof FifoScheduler) { sinfo = new FifoSchedulerInfo(this.rm); } else { throw new NotFoundException("Unknown scheduler configured"); } return new SchedulerTypeInfo(sinfo); }
} else { info = new CapacitySchedulerQueueInfo(queue, nodeLabel.getLabelName()); info.queues = getQueues(queue, nodeLabel);
@GET @Path("/scheduler") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public SchedulerTypeInfo getSchedulerInfo() { init(); ResourceScheduler rs = rm.getResourceScheduler(); SchedulerInfo sinfo; if (rs instanceof CapacityScheduler) { CapacityScheduler cs = (CapacityScheduler) rs; CSQueue root = cs.getRootQueue(); sinfo = new CapacitySchedulerInfo(root, new NodeLabel( RMNodeLabelsManager.NO_LABEL)); } else if (rs instanceof FairScheduler) { FairScheduler fs = (FairScheduler) rs; sinfo = new FairSchedulerInfo(fs); } else if (rs instanceof FifoScheduler) { sinfo = new FifoSchedulerInfo(this.rm); } else { throw new NotFoundException("Unknown scheduler configured"); } return new SchedulerTypeInfo(sinfo); }
public CapacitySchedulerInfo(final CSQueue parent, final NodeLabel nodeLabel) { String label = nodeLabel.getLabelName(); QueueCapacities parentQueueCapacities = parent.getQueueCapacities(); this.queueName = parent.getQueueName(); this.usedCapacity = parent.getUsedCapacity(label) * 100; this.capacity = parentQueueCapacities.getCapacity(label) * 100; float max = parentQueueCapacities.getMaximumCapacity(label); if (max < EPSILON || max > 1f) max = 1f; this.maxCapacity = max * 100; queues = getQueues(parent, nodeLabel); }
public CapacitySchedulerInfo(final CSQueue parent, final NodeLabel nodeLabel) { String label = nodeLabel.getLabelName(); QueueCapacities parentQueueCapacities = parent.getQueueCapacities(); this.queueName = parent.getQueueName(); this.usedCapacity = parent.getUsedCapacity(label) * 100; this.capacity = parentQueueCapacities.getCapacity(label) * 100; float max = parentQueueCapacities.getMaximumCapacity(label); if (max < EPSILON || max > 1f) max = 1f; this.maxCapacity = max * 100; queues = getQueues(parent, nodeLabel); }
public CapacitySchedulerInfo(CSQueue parent, CapacityScheduler cs) { this.queueName = parent.getQueueName(); this.usedCapacity = parent.getUsedCapacity() * 100; this.capacity = parent.getCapacity() * 100; float max = parent.getMaximumCapacity(); if (max < EPSILON || max > 1f) max = 1f; this.maxCapacity = max * 100; capacities = new QueueCapacitiesInfo(parent.getQueueCapacities(), parent.getQueueResourceQuotas(), false); queues = getQueues(parent); health = new CapacitySchedulerHealthInfo(cs); }
@Override public void render(Block html) { ArrayList<CapacitySchedulerQueueInfo> subQueues = (csqinfo.qinfo == null) ? csqinfo.csinfo.getQueues().getQueueInfoList() : csqinfo.qinfo.getQueues().getQueueInfoList();
@Override public void render(Block html) { ArrayList<CapacitySchedulerQueueInfo> subQueues = (csqinfo.qinfo == null) ? csqinfo.csinfo.getQueues().getQueueInfoList() : csqinfo.qinfo.getQueues().getQueueInfoList(); UL<Hamlet> ul = html.ul("#pq");
@Override public void render(Block html) { ArrayList<CapacitySchedulerQueueInfo> subQueues = (csqinfo.qinfo == null) ? csqinfo.csinfo.getQueues().getQueueInfoList() : csqinfo.qinfo.getQueues().getQueueInfoList(); UL<Hamlet> ul = html.ul("#pq");