@Override public int compareTo(NodeLabel o) { // We should always put empty label entry first after sorting if (labelName.isEmpty() != o.getLabelName().isEmpty()) { if (labelName.isEmpty()) { return -1; } return 1; } return labelName.compareTo(o.getLabelName()); }
@Override public int compareTo(NodeLabel o) { // We should always put empty label entry first after sorting if (labelName.isEmpty() != o.getLabelName().isEmpty()) { if (labelName.isEmpty()) { return -1; } return 1; } return labelName.compareTo(o.getLabelName()); }
@Override public boolean equals(Object obj) { if (obj instanceof NodeLabel) { NodeLabel other = (NodeLabel) obj; return Resources.equals(resource, other.getResource()) && StringUtils.equals(labelName, other.getLabelName()) && (other.getNumActiveNMs() == numActiveNMs); } return false; }
@Override public boolean equals(Object obj) { if (obj instanceof NodeLabel) { NodeLabel other = (NodeLabel) obj; return Resources.equals(resource, other.getResource()) && StringUtils.equals(labelName, other.getLabelName()) && (other.getNumActiveNMs() == numActiveNMs); } return false; }
for (CSQueue queue : parent.getChildQueues()) { if (!((AbstractCSQueue) queue).accessibleToPartition(nodeLabel .getLabelName())) { info = new CapacitySchedulerLeafQueueInfo((LeafQueue) queue, nodeLabel.getLabelName()); } else { info = new CapacitySchedulerQueueInfo(queue, nodeLabel.getLabelName()); info.queues = getQueues(queue, nodeLabel);
for (CSQueue queue : parent.getChildQueues()) { if (!((AbstractCSQueue) queue).accessibleToPartition(nodeLabel .getLabelName())) { info = new CapacitySchedulerLeafQueueInfo((LeafQueue) queue, nodeLabel.getLabelName()); } else { info = new CapacitySchedulerQueueInfo(queue, nodeLabel.getLabelName()); info.queues = getQueues(queue, 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(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); }
TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td( info.getLabelName().isEmpty() ? "<NO_LABEL>" : info .getLabelName()); int nActiveNMs = info.getNumActiveNMs(); if (nActiveNMs > 0) { row = row.td() .a(url("nodes", "?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()), String.valueOf(nActiveNMs)) ._();
TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td( info.getLabelName().isEmpty() ? "<NO_LABEL>" : info .getLabelName()); int nActiveNMs = info.getNumActiveNMs(); if (nActiveNMs > 0) { row = row.td() .a(url("nodes", "?" + YarnWebParams.NODE_LABEL + "=" + info.getLabelName()), String.valueOf(nActiveNMs)) ._();
private void checkNodeLabelInfo(List<NodeLabel> infos, String labelName, int activeNMs, int memory) { for (NodeLabel info : infos) { if (info.getLabelName().equals(labelName)) { Assert.assertEquals(activeNMs, info.getNumActiveNMs()); Assert.assertEquals(memory, info.getResource().getMemory()); return; } } Assert.fail("Failed to find info has label=" + labelName); }
if (null == nodeLabelsInfo || (nodeLabelsInfo.size() == 1 && nodeLabelsInfo.get(0) .getLabelName().isEmpty())) { CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = csqinfo.csinfo = sinfo; csqinfo.qinfo = null; csqinfo.label = label.getLabelName(); String nodeLabel = csqinfo.label.length() == 0 ? "<DEFAULT_PARTITION>" : csqinfo.label; used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource();
if (null == nodeLabelsInfo || (nodeLabelsInfo.size() == 1 && nodeLabelsInfo.get(0) .getLabelName().isEmpty())) { CSQueue root = cs.getRootQueue(); CapacitySchedulerInfo sinfo = csqinfo.csinfo = sinfo; csqinfo.qinfo = null; csqinfo.label = label.getLabelName(); String nodeLabel = csqinfo.label.length() == 0 ? "<DEFAULT_PARTITION>" : csqinfo.label; used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource();