-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HBASE-25791 UI of master-status to show a recent history of that why …
…balancer was rejected to run (#3278) Signed-off-by: Duo Zhang <[email protected]>
- Loading branch information
1 parent
d19e058
commit 3040be1
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
hbase-server/src/main/resources/hbase-webapps/master/namedQueueLog.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<%-- | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
--%> | ||
<%@ page contentType="text/html;charset=UTF-8" | ||
import="java.util.Date" | ||
import="java.util.List" | ||
import="org.apache.hadoop.conf.Configuration" | ||
import="org.apache.hadoop.hbase.client.Admin" | ||
import="org.apache.hadoop.hbase.client.SnapshotDescription" | ||
import="org.apache.hadoop.hbase.http.InfoServer" | ||
import="org.apache.hadoop.hbase.master.HMaster" | ||
import="org.apache.hadoop.hbase.snapshot.SnapshotInfo" | ||
import="org.apache.hadoop.util.StringUtils" | ||
import="org.apache.hadoop.hbase.TableName" | ||
import="org.apache.hadoop.hbase.client.ServerType" | ||
import="org.apache.hadoop.hbase.client.LogEntry" | ||
import="org.apache.hadoop.hbase.client.BalancerRejection" | ||
%> | ||
<% | ||
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); | ||
Configuration conf = master.getConfiguration(); | ||
List<BalancerRejection> logList = null; | ||
if(master.isInitialized()) { | ||
try (Admin admin = master.getConnection().getAdmin()) { | ||
logList = (List<BalancerRejection>)(List<?>)admin.getLogEntries(null, "BALANCER_REJECTION", ServerType.MASTER, 250, null); | ||
} | ||
} | ||
%> | ||
|
||
<jsp:include page="header.jsp"> | ||
<jsp:param name="pageTitle" value="${pageTitle}"/> | ||
</jsp:include> | ||
|
||
|
||
<div class="container-fluid content"> | ||
<div class="row"> | ||
<div class="page-header"> | ||
<h2>Named Queues</h2> | ||
</div> | ||
</div> | ||
<div class="tabbable"> | ||
<ul class="nav nav-pills"> | ||
<li class="active"> | ||
<a href="#tab_named_queue1" data-toggle="tab"> Balancer Rejection </a> | ||
</li> | ||
</ul> | ||
<div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;"> | ||
<div class="tab-pane active" id="tab_named_queue1"> | ||
<table class="table table-striped"> | ||
<tr> | ||
<th>Reason</th> | ||
<th>CostFunctions Details</th> | ||
</tr> | ||
<% if (logList == null) { %> | ||
<% } else { %> | ||
<% for (BalancerRejection entry: logList) { %> | ||
<tr> | ||
<td><%=entry.getReason()%></td> | ||
<td> | ||
<% List<String> costFunctions = entry.getCostFuncInfoList(); | ||
if (costFunctions != null && !costFunctions.isEmpty()) { %> | ||
<table> | ||
<% for (String costFunctionInfo: entry.getCostFuncInfoList() ) { %> | ||
<tr><td><%= costFunctionInfo %></td></tr> | ||
<% }%> | ||
</table> | ||
<% } %> | ||
</td> | ||
</tr> | ||
<% } %> | ||
<% } %> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<jsp:include page="footer.jsp" /> |