YARN-4634. Scheduler UI/Metrics need to consider cases like non-queue label mappings. (Sunil G via wangda)

(cherry picked from commit 12b11e2e68)
This commit is contained in:
Wangda Tan 2016-03-31 14:32:37 -07:00
parent 3afc2caec8
commit d36d9d676d
1 changed files with 14 additions and 2 deletions

View File

@ -405,8 +405,20 @@ class CapacitySchedulerPage extends RmView {
CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, cs); CapacitySchedulerInfo sinfo = new CapacitySchedulerInfo(root, cs);
csqinfo.csinfo = sinfo; csqinfo.csinfo = sinfo;
if (null == nodeLabelsInfo || (nodeLabelsInfo.size() == 1 boolean hasAnyLabelLinkedToNM = false;
&& nodeLabelsInfo.get(0).getLabelName().isEmpty())) { if (null != nodeLabelsInfo) {
for (RMNodeLabel label : nodeLabelsInfo) {
if (label.getLabelName().length() == 0) {
// Skip DEFAULT_LABEL
continue;
}
if (label.getNumActiveNMs() > 0) {
hasAnyLabelLinkedToNM = true;
break;
}
}
}
if (!hasAnyLabelLinkedToNM) {
used = sinfo.getUsedCapacity() / 100; used = sinfo.getUsedCapacity() / 100;
//label is not enabled in the cluster or there's only "default" label, //label is not enabled in the cluster or there's only "default" label,
ul.li(). ul.li().