YARN-7420. YARN UI changes to depict auto created queues. (Suma Shivaprasad via wangda)

Change-Id: I8039d3772a191ddede132cd1f8b08a8ca2e275b7
This commit is contained in:
Wangda Tan 2017-12-08 15:10:47 -08:00
parent b38643c9a8
commit f548bfffbd
3 changed files with 27 additions and 2 deletions

View File

@ -66,6 +66,7 @@ class CapacitySchedulerPage extends RmView {
static final String Q_END = "left:101%";
static final String Q_GIVEN =
"left:0%;background:none;border:1px dashed #BFBFBF";
static final String Q_AUTO_CREATED = "background:#F4F0CB";
static final String Q_OVER = "background:#FFA333";
static final String Q_UNDER = "background:#5BD75B";
static final String ACTIVE_USER = "background:#FFFF00"; // Yellow highlight
@ -299,9 +300,16 @@ class CapacitySchedulerPage extends RmView {
absMaxCap = partitionQueueCapsInfo.getAbsoluteMaxCapacity() / 100;
absUsedCap = partitionQueueCapsInfo.getAbsoluteUsedCapacity() / 100;
boolean isAutoCreatedLeafQueue = info.isLeafQueue() ?
((CapacitySchedulerLeafQueueInfo) info).isAutoCreatedLeafQueue()
: false;
String Q_WIDTH = width(absMaxCap * Q_MAX_WIDTH);
LI<UL<Hamlet>> li = ul.
li().
a(_Q).$style(width(absMaxCap * Q_MAX_WIDTH)).
a(_Q).$style(isAutoCreatedLeafQueue? join( Q_AUTO_CREATED, ";",
Q_WIDTH)
: Q_WIDTH).
$title(join("Absolute Capacity:", percent(absCap))).
span().$style(join(Q_GIVEN, ";font-size:1px;", width(absCap/absMaxCap))).
__('.').__().
@ -313,7 +321,7 @@ class CapacitySchedulerPage extends RmView {
__(join(percent(used), " used")).__();
csqinfo.qinfo = info;
if (info.getQueues() == null) {
if (info.isLeafQueue()) {
li.ul("#lq").li().__(LeafQueueInfoBlock.class).__().__();
li.ul("#lq").li().__(QueueUsersInfoBlock.class).__().__();
} else {
@ -422,6 +430,8 @@ class CapacitySchedulerPage extends RmView {
__("Max Capacity").__().
span().$class("qlegend ui-corner-all").$style(ACTIVE_USER).
__("Users Requesting Resources").__().
span().$class("qlegend ui-corner-all").$style(Q_AUTO_CREATED).
__("Auto Created Queues").__().
__();
float used = 0;

View File

@ -27,6 +27,8 @@ import javax.xml.bind.annotation.XmlTransient;
import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueResourceQuotas;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceUsage;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity
.AutoCreatedLeafQueue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.UserInfo;
@ -49,6 +51,7 @@ public class CapacitySchedulerLeafQueueInfo extends CapacitySchedulerQueueInfo {
protected boolean preemptionDisabled;
protected String defaultNodeLabelExpression;
protected int defaultPriority;
protected boolean isAutoCreatedLeafQueue;
@XmlTransient
protected String orderingPolicyInfo;
@ -82,6 +85,10 @@ public class CapacitySchedulerLeafQueueInfo extends CapacitySchedulerQueueInfo {
.getPartitionResourceUsageInfo(RMNodeLabelsManager.NO_LABEL)
.getAMLimit();
}
if ( q instanceof AutoCreatedLeafQueue) {
isAutoCreatedLeafQueue = true;
}
}
@Override
@ -155,4 +162,8 @@ public class CapacitySchedulerLeafQueueInfo extends CapacitySchedulerQueueInfo {
public int getDefaultApplicationPriority() {
return defaultPriority;
}
public boolean isAutoCreatedLeafQueue() {
return isAutoCreatedLeafQueue;
}
}

View File

@ -219,4 +219,8 @@ public class CapacitySchedulerQueueInfo {
public ResourceInfo getMaxEffectiveCapacity(){
return maxEffectiveCapacity;
}
public boolean isLeafQueue() {
return getQueues() == null;
}
}