@Override public int compare(CSQueue q1, CSQueue q2) { if (q1.getUsedCapacity() < q2.getUsedCapacity()) { return -1; } else if (q1.getUsedCapacity() > q2.getUsedCapacity()) { return 1; } return q1.getQueuePath().compareTo(q2.getQueuePath()); } };
@Override public int compare(CSQueue q1, CSQueue q2) { if (q1.getUsedCapacity() < q2.getUsedCapacity()) { return -1; } else if (q1.getUsedCapacity() > q2.getUsedCapacity()) { return 1; } return q1.getQueuePath().compareTo(q2.getQueuePath()); } };
@Override public int compare(CSQueue q1, CSQueue q2) { int result = Float.compare(q1.getUsedCapacity(), q2.getUsedCapacity()); if (result < 0) { return -1; } else if (result > 0) { return 1; } return q1.getQueuePath().compareTo(q2.getQueuePath()); } };
String getChildQueuesToPrint() { StringBuilder sb = new StringBuilder(); for (CSQueue q : childQueues) { sb.append(q.getQueuePath() + "usedCapacity=(" + q.getUsedCapacity() + "), " + " label=(" + StringUtils.join(q.getAccessibleNodeLabels().iterator(), ",") + ")"); } return sb.toString(); }
String getChildQueuesToPrint() { StringBuilder sb = new StringBuilder(); for (CSQueue q : childQueues) { sb.append(q.getQueuePath() + "usedCapacity=(" + q.getUsedCapacity() + "), " + " label=(" + StringUtils.join(q.getAccessibleNodeLabels().iterator(), ",") + ")"); } return sb.toString(); }
String getChildQueuesToPrint() { StringBuilder sb = new StringBuilder(); for (CSQueue q : childQueues) { sb.append(q.getQueuePath() + "usedCapacity=(" + q.getUsedCapacity() + "), " + " label=(" + StringUtils.join(q.getAccessibleNodeLabels().iterator(), ",") + ")"); } return sb.toString(); }
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); }
private void verifyQueueMetrics(CSQueue queue, int expectedMemory, Resource clusterResource) { assertEquals( computeQueueAbsoluteUsedCapacity(queue, expectedMemory, clusterResource), queue.getAbsoluteUsedCapacity(), DELTA); assertEquals( computeQueueUsedCapacity(queue, expectedMemory, clusterResource), queue.getUsedCapacity(), DELTA); }
private void verifyQueueMetrics(CSQueue queue, int expectedMemory, Resource clusterResource) { assertEquals( computeQueueAbsoluteUsedCapacity(queue, expectedMemory, clusterResource), queue.getAbsoluteUsedCapacity(), DELTA); assertEquals( computeQueueUsedCapacity(queue, expectedMemory, clusterResource), queue.getUsedCapacity(), DELTA); }
private void verifyQueueMetrics(CSQueue queue, int expectedMemory, Resource clusterResource) { assertEquals( computeQueueAbsoluteUsedCapacity(queue, expectedMemory, clusterResource), queue.getAbsoluteUsedCapacity(), DELTA); assertEquals( computeQueueUsedCapacity(queue, expectedMemory, clusterResource), queue.getUsedCapacity(), DELTA); }
private void verifyQueueMetrics(CSQueue queue, int expectedMemory, Resource clusterResource) { assertEquals( computeQueueAbsoluteUsedCapacity(queue, expectedMemory, clusterResource), queue.getAbsoluteUsedCapacity(), DELTA); assertEquals( computeQueueUsedCapacity(queue, expectedMemory, clusterResource), queue.getUsedCapacity(), DELTA); }
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); } }
qr.setEffectiveMinResource(partitionName, parseResourceFromString(values[0].trim())); when(queue.getUsedCapacity()).thenReturn(used); when(queue.getEffectiveCapacity(partitionName)) .thenReturn(parseResourceFromString(values[0].trim()));
usedCapacity = q.getUsedCapacity() * 100;
csqinfo.label.length() == 0 ? "<DEFAULT_PARTITION>" : csqinfo.label; used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource();
csqinfo.label.length() == 0 ? "<DEFAULT_PARTITION>" : csqinfo.label; used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource();