HBASE-25906 UI of master-status to show recent history of balancer desicion (#3296)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
parent
21aa553bc1
commit
36affdaa8e
|
@ -61,9 +61,7 @@
|
||||||
<% if (master.isActiveMaster()){ %>
|
<% if (master.isActiveMaster()){ %>
|
||||||
<li><a href="/procedures.jsp">Procedures & Locks</a></li>
|
<li><a href="/procedures.jsp">Procedures & Locks</a></li>
|
||||||
<li><a href="/hbck.jsp">HBCK Report</a></li>
|
<li><a href="/hbck.jsp">HBCK Report</a></li>
|
||||||
<% if (master.getConfiguration().getBoolean(BaseLoadBalancer.BALANCER_REJECTION_BUFFER_ENABLED, false)) { %>
|
|
||||||
<li><a href="/namedQueueLog.jsp">Named Queue Logs</a></li>
|
<li><a href="/namedQueueLog.jsp">Named Queue Logs</a></li>
|
||||||
<% }%>
|
|
||||||
<% if (master.getConfiguration().getBoolean(QuotaUtil.QUOTA_CONF_KEY, false)) { %>
|
<% if (master.getConfiguration().getBoolean(QuotaUtil.QUOTA_CONF_KEY, false)) { %>
|
||||||
<li><a href="/quotas.jsp">Quotas</a></li>
|
<li><a href="/quotas.jsp">Quotas</a></li>
|
||||||
<% }%>
|
<% }%>
|
||||||
|
|
|
@ -31,16 +31,18 @@
|
||||||
import="org.apache.hadoop.hbase.client.ServerType"
|
import="org.apache.hadoop.hbase.client.ServerType"
|
||||||
import="org.apache.hadoop.hbase.client.LogEntry"
|
import="org.apache.hadoop.hbase.client.LogEntry"
|
||||||
import="org.apache.hadoop.hbase.client.BalancerRejection"
|
import="org.apache.hadoop.hbase.client.BalancerRejection"
|
||||||
|
import="org.apache.hadoop.hbase.client.BalancerDecision"
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
|
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
|
||||||
Configuration conf = master.getConfiguration();
|
Configuration conf = master.getConfiguration();
|
||||||
|
|
||||||
List<BalancerRejection> logList = null;
|
List<BalancerRejection> logList = null;
|
||||||
|
List<BalancerDecision> decisionList = null;
|
||||||
if(master.isInitialized()) {
|
if(master.isInitialized()) {
|
||||||
try (Admin admin = master.getConnection().getAdmin()) {
|
try (Admin admin = master.getConnection().getAdmin()) {
|
||||||
logList = (List<BalancerRejection>)(List<?>)admin.getLogEntries(null, "BALANCER_REJECTION", ServerType.MASTER, 250, null);
|
logList = (List<BalancerRejection>)(List<?>)admin.getLogEntries(null, "BALANCER_REJECTION", ServerType.MASTER, 250, null);
|
||||||
|
decisionList = (List<BalancerDecision>)(List<?>)admin.getLogEntries(null, "BALANCER_DECISION", ServerType.MASTER, 250, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%>
|
%>
|
||||||
|
@ -61,6 +63,9 @@
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a href="#tab_named_queue1" data-toggle="tab"> Balancer Rejection </a>
|
<a href="#tab_named_queue1" data-toggle="tab"> Balancer Rejection </a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="">
|
||||||
|
<a href="#tab_named_queue2" data-toggle="tab"> Balancer Decision </a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
|
<div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
|
||||||
<div class="tab-pane active" id="tab_named_queue1">
|
<div class="tab-pane active" id="tab_named_queue1">
|
||||||
|
@ -89,6 +94,42 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane" id="tab_named_queue2">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Initial Function Costs</th>
|
||||||
|
<th>Final Function Costs</th>
|
||||||
|
<th>Init Total Cost</th>
|
||||||
|
<th>Computed Total Cost</th>
|
||||||
|
<th>Computed Steps</th>
|
||||||
|
<th>Region Plans</th>
|
||||||
|
</tr>
|
||||||
|
<% if (decisionList == null) { %>
|
||||||
|
<% } else { %>
|
||||||
|
<% for (BalancerDecision decision: decisionList) { %>
|
||||||
|
<tr>
|
||||||
|
<td><%=decision.getInitialFunctionCosts()%></td>
|
||||||
|
<td><%=decision.getFinalFunctionCosts()%></td>
|
||||||
|
<td><%=StringUtils.format("%.2f", decision.getInitTotalCost())%></td>
|
||||||
|
<td><%=StringUtils.format("%.2f", decision.getComputedTotalCost())%></td>
|
||||||
|
<td><%=decision.getComputedSteps()%></td>
|
||||||
|
<%
|
||||||
|
List<String> regionPlans = decision.getRegionPlans();
|
||||||
|
if ( regionPlans == null) {%>
|
||||||
|
<td></td>
|
||||||
|
<% } else { %>
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<% for (String plan : regionPlans) { %>
|
||||||
|
<tr><td><%=plan%></td></tr>
|
||||||
|
<% } %>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<% } %>
|
||||||
|
</tr>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue