public Resource getResourceByLabel(String label, Resource clusterResource) { label = normalizeLabel(label); try { readLock.lock(); if (null == labelCollections.get(label)) { return Resources.none(); } return labelCollections.get(label).getResource(); } finally { readLock.unlock(); } }
public Resource getResourceByLabel(String label, Resource clusterResource) { label = normalizeLabel(label); try { readLock.lock(); if (null == labelCollections.get(label)) { return Resources.none(); } return labelCollections.get(label).getResource(); } finally { readLock.unlock(); } }
@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; }
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); }
row = row.td(String.valueOf(nActiveNMs)); row.td(info.getResource().toString())._();
row = row.td(String.valueOf(nActiveNMs)); row.td(info.getResource().toString())._();
used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource(); ul.li(). a(_Q).$style(width(Q_MAX_WIDTH)).
used = root.getUsedCapacity(label.getLabelName()); String partitionUiTag = "Partition: " + nodeLabel + " " + label.getResource(); ul.li(). a(_Q).$style(width(Q_MAX_WIDTH)).