@Override protected int getNumberOfApplications(Queue queue) { CSQueue csQueue = (CSQueue) queue; int numberOfApplications = csQueue.getNumApplications(); return numberOfApplications; }
@Override protected int getNumberOfApplications(Queue queue) { CSQueue csQueue = (CSQueue)queue; int numberOfApplications = csQueue.getNumApplications(); return numberOfApplications; }
public boolean isSystemAppsLimitReached() { if (getRootQueue().getNumApplications() < conf .getMaximumSystemApplications()) { return false; } return true; }
private int getNumAppsInQueue(String name, List<CSQueue> queues) { for (CSQueue queue : queues) { if (queue.getQueueName().equals(name)) { return queue.getNumApplications(); } } return -1; }
private int getNumAppsInQueue(String name, List<CSQueue> queues) { for (CSQueue queue : queues) { if (queue.getQueueName().equals(name)) { return queue.getNumApplications(); } } return -1; }
CSQueue queueA1 = cs.getQueue("a1"); CSQueue queueB1 = cs.getQueue("b1"); Assert.assertEquals(1, rootQ.getNumApplications()); Assert.assertEquals(0, queueA.getNumApplications()); Assert.assertEquals(1, queueB.getNumApplications()); Assert.assertEquals(0, queueA1.getNumApplications()); Assert.assertEquals(1, queueB1.getNumApplications());
CapacitySchedulerQueueInfo(final CSQueue q, final String nodeLabel) { QueueCapacities qCapacities = q.getQueueCapacities(); ResourceUsage queueResourceUsage = q.getQueueResourceUsage(); queuePath = q.getQueuePath(); capacity = qCapacities.getCapacity(nodeLabel) * 100; usedCapacity = q.getUsedCapacity(nodeLabel) * 100; maxCapacity = qCapacities.getMaximumCapacity(nodeLabel); if (maxCapacity < EPSILON || maxCapacity > 1f) maxCapacity = 1f; maxCapacity *= 100; absoluteCapacity = cap(qCapacities.getAbsoluteCapacity(nodeLabel), 0f, 1f) * 100; absoluteMaxCapacity = cap(qCapacities.getAbsoluteMaximumCapacity(nodeLabel), 0f, 1f) * 100; absoluteUsedCapacity = q.getAbsoluteUsedCapacity(nodeLabel) * 100; numApplications = q.getNumApplications(); queueName = q.getQueueName(); state = q.getState(); resourcesUsed = new ResourceInfo(queueResourceUsage.getUsed(nodeLabel)); if (q instanceof PlanQueue && !((PlanQueue) q).showReservationsAsQueues()) { hideReservationQueues = true; } // add labels Set<String> labelSet = q.getAccessibleNodeLabels(); if (labelSet != null) { nodeLabels.addAll(labelSet); Collections.sort(nodeLabels); } }
CapacitySchedulerQueueInfo(final CSQueue q, final String nodeLabel) { QueueCapacities qCapacities = q.getQueueCapacities(); ResourceUsage queueResourceUsage = q.getQueueResourceUsage(); queuePath = q.getQueuePath(); capacity = qCapacities.getCapacity(nodeLabel) * 100; usedCapacity = q.getUsedCapacity(nodeLabel) * 100; maxCapacity = qCapacities.getMaximumCapacity(nodeLabel); if (maxCapacity < EPSILON || maxCapacity > 1f) maxCapacity = 1f; maxCapacity *= 100; absoluteCapacity = cap(qCapacities.getAbsoluteCapacity(nodeLabel), 0f, 1f) * 100; absoluteMaxCapacity = cap(qCapacities.getAbsoluteMaximumCapacity(nodeLabel), 0f, 1f) * 100; absoluteUsedCapacity = q.getAbsoluteUsedCapacity(nodeLabel) * 100; numApplications = q.getNumApplications(); queueName = q.getQueueName(); state = q.getState(); resourcesUsed = new ResourceInfo(queueResourceUsage.getUsed(nodeLabel)); if (q instanceof PlanQueue && !((PlanQueue) q).showReservationsAsQueues()) { hideReservationQueues = true; } // add labels Set<String> labelSet = q.getAccessibleNodeLabels(); if (labelSet != null) { nodeLabels.addAll(labelSet); Collections.sort(nodeLabels); } }
Assert.assertEquals(0, queueA1.getNumApplications()); Assert.assertEquals(1, queueB.getNumApplications()); Assert.assertEquals(0, queueB1.getNumApplications()); Assert.assertEquals(0, queueA1.getNumApplications()); Assert.assertEquals(1, queueB.getNumApplications()); Assert.assertEquals(1, queueB1.getNumApplications());
absoluteUsedCapacity = cap(q.getAbsoluteUsedCapacity(), 0f, 1f) * 100; numApplications = q.getNumApplications(); allocatedContainers = q.getMetrics().getAllocatedContainers(); pendingContainers = q.getMetrics().getPendingContainers();
RMNodeLabelsManager.NO_LABEL)); int origNumAppsA = getNumAppsInQueue("a", origRootQ.getChildQueues()); int origNumAppsRoot = origRootQ.getNumApplications(); int newNumAppsRoot = newRootQ.getNumApplications(); CapacitySchedulerInfo newInfo = new CapacitySchedulerInfo(newRootQ, new NodeLabel(
new CapacitySchedulerInfo(origRootQ, cs); int origNumAppsA = getNumAppsInQueue("a", origRootQ.getChildQueues()); int origNumAppsRoot = origRootQ.getNumApplications(); int newNumAppsRoot = newRootQ.getNumApplications(); CapacitySchedulerInfo newInfo = new CapacitySchedulerInfo(newRootQ, cs);