HBASE-23278 Add a table-level compaction progress display on the UI (#816)
Signed-off-by: Guangxu Cheng <gxcheng@apache.org>
This commit is contained in:
parent
54be3d1d86
commit
c6ad71e256
|
@ -22,6 +22,7 @@
|
|||
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
|
||||
import="java.util.ArrayList"
|
||||
import="java.util.Collection"
|
||||
import="java.util.HashMap"
|
||||
import="java.util.LinkedHashMap"
|
||||
import="java.util.List"
|
||||
import="java.util.Map"
|
||||
|
@ -62,6 +63,8 @@
|
|||
<%@ page import="org.apache.hadoop.hbase.RegionMetrics" %>
|
||||
<%@ page import="org.apache.hadoop.hbase.Size" %>
|
||||
<%@ page import="org.apache.hadoop.hbase.RegionMetricsBuilder" %>
|
||||
<%@ page import="org.apache.hadoop.hbase.master.assignment.RegionStates" %>
|
||||
<%@ page import="org.apache.hadoop.hbase.master.RegionState" %>
|
||||
<%!
|
||||
/**
|
||||
* @return An empty region load stamped with the passed in <code>regionInfo</code>
|
||||
|
@ -132,14 +135,11 @@
|
|||
</jsp:include>
|
||||
|
||||
<%
|
||||
if (fqtn != null && master.isInitialized()) {
|
||||
if (fqtn != null && master.isInitialized()) {
|
||||
try {
|
||||
table = master.getConnection().getTable(TableName.valueOf(fqtn));
|
||||
if (table.getTableDescriptor().getRegionReplication() > 1) {
|
||||
tableHeader = "<h2>Table Regions</h2><table id=\"tableRegionTable\" class=\"tablesorter table table-striped\" style=\"table-layout: fixed; word-wrap: break-word;\"><thead><tr><th>Name</th><th>Region Server</th><th>ReadRequests</th><th>WriteRequests</th><th>StorefileSize</th><th>Num.Storefiles</th><th>MemSize</th><th>Locality</th><th>Start Key</th><th>End Key</th><th>ReplicaID</th></tr></thead>";
|
||||
withReplica = true;
|
||||
} else {
|
||||
tableHeader = "<h2>Table Regions</h2><table id=\"tableRegionTable\" class=\"tablesorter table table-striped\" style=\"table-layout: fixed; word-wrap: break-word;\"><thead><tr><th>Name</th><th>Region Server</th><th>ReadRequests</th><th>WriteRequests</th><th>StorefileSize</th><th>Num.Storefiles</th><th>MemSize</th><th>Locality</th><th>Start Key</th><th>End Key</th></tr></thead>";
|
||||
}
|
||||
if ( !readOnly && action != null ) {
|
||||
%>
|
||||
|
@ -149,8 +149,8 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<h1>Table action request accepted</h1>
|
||||
</div>
|
||||
</div>
|
||||
<p><hr><p>
|
||||
<%
|
||||
<p><hr><p>
|
||||
<%
|
||||
if (action.equals("split")) {
|
||||
if (key != null && key.length() > 0) {
|
||||
admin.split(TableName.valueOf(fqtn), Bytes.toBytes(key));
|
||||
|
@ -180,10 +180,10 @@ if (fqtn != null && master.isInitialized()) {
|
|||
%> Merge request accepted. <%
|
||||
}
|
||||
%>
|
||||
<jsp:include page="redirect.jsp" />
|
||||
<jsp:include page="redirect.jsp" />
|
||||
</div>
|
||||
<%
|
||||
} else {
|
||||
} else {
|
||||
%>
|
||||
<div class="container-fluid content">
|
||||
<div class="row inner_header">
|
||||
|
@ -192,12 +192,45 @@ if (fqtn != null && master.isInitialized()) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<%
|
||||
<%
|
||||
if(fqtn.equals(TableName.META_TABLE_NAME.getNameAsString())) {
|
||||
%>
|
||||
<%= tableHeader %>
|
||||
<tbody>
|
||||
<%
|
||||
%>
|
||||
<h2>Table Regions</h2>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="active">
|
||||
<a href="#metaTab_baseStats" data-toggle="tab">Base Stats</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#metaTab_compactStats" data-toggle="tab">Compactions</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
|
||||
<div class="tab-pane active" id="metaTab_baseStats">
|
||||
<table id="tableRegionTable" class="tablesorter table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Region Server</th>
|
||||
<th>ReadRequests</th>
|
||||
<th>WriteRequests</th>
|
||||
<th>StorefileSize</th>
|
||||
<th>Num.Storefiles</th>
|
||||
<th>MemSize</th>
|
||||
<th>Locality</th>
|
||||
<th>Start Key</th>
|
||||
<th>End Key</th>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<th>ReplicaID</th>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
// NOTE: Presumes meta with one or more replicas
|
||||
for (int j = 0; j < numMetaReplicas; j++) {
|
||||
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
|
||||
|
@ -211,7 +244,6 @@ if (fqtn != null && master.isInitialized()) {
|
|||
String fileCount = "N/A";
|
||||
String memSize = ZEROMB;
|
||||
float locality = 0.0f;
|
||||
|
||||
if (metaLocation != null) {
|
||||
ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
|
||||
// The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
|
||||
|
@ -235,8 +267,8 @@ if (fqtn != null && master.isInitialized()) {
|
|||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<tr>
|
||||
%>
|
||||
<tr>
|
||||
<td><%= escapeXml(meta.getRegionNameAsString()) %></td>
|
||||
<td><a href="http://<%= hostAndPort %>/rs-status/"><%= StringEscapeUtils.escapeHtml4(hostAndPort) %></a></td>
|
||||
<td><%= readReq%></td>
|
||||
|
@ -247,23 +279,88 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<td><%= locality%></td>
|
||||
<td><%= escapeXml(Bytes.toString(meta.getStartKey())) %></td>
|
||||
<td><%= escapeXml(Bytes.toString(meta.getEndKey())) %></td>
|
||||
<%
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
%>
|
||||
<td><%= meta.getReplicaId() %></td>
|
||||
<%
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
<% } %>
|
||||
<%} %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane" id="metaTab_compactStats">
|
||||
<table id="metaTableCompactStatsTable" class="tablesorter table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Region Server</th>
|
||||
<th>Num. Compacting Cells</th>
|
||||
<th>Num. Compacted Cells</th>
|
||||
<th>Remaining Cells</th>
|
||||
<th>Compaction Progress</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
// NOTE: Presumes meta with one or more replicas
|
||||
for (int j = 0; j < numMetaReplicas; j++) {
|
||||
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
|
||||
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
|
||||
ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
|
||||
for (int i = 0; i < 1; i++) {
|
||||
String hostAndPort = "";
|
||||
long compactingCells = 0;
|
||||
long compactedCells = 0;
|
||||
String compactionProgress = "";
|
||||
if (metaLocation != null) {
|
||||
ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
|
||||
hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + ":" + master.getRegionServerInfoPort(metaLocation);
|
||||
if (sl != null) {
|
||||
Map<byte[], RegionMetrics> map = sl.getRegionMetrics();
|
||||
if (map.containsKey(meta.getRegionName())) {
|
||||
RegionMetrics load = map.get(meta.getRegionName());
|
||||
compactingCells = load.getCompactingCellCount();
|
||||
compactedCells = load.getCompactedCellCount();
|
||||
if (compactingCells > 0) {
|
||||
compactionProgress = String.format("%.2f", 100 * ((float)
|
||||
compactedCells / compactingCells)) + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<tr>
|
||||
<td><%= escapeXml(meta.getRegionNameAsString()) %></td>
|
||||
<td><a href="http://<%= hostAndPort %>/rs-status/"><%= StringEscapeUtils.escapeHtml4(hostAndPort) %></a></td>
|
||||
<td><%= String.format("%,1d", compactingCells)%></td>
|
||||
<td><%= String.format("%,1d", compactedCells)%></td>
|
||||
<td><%= String.format("%,1d", compactingCells - compactedCells)%></td>
|
||||
<td><%= compactionProgress%></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<%} %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%} else {
|
||||
RegionStates states = master.getAssignmentManager().getRegionStates();
|
||||
Map<RegionState.State, List<RegionInfo>> regionStates = states.getRegionByStateOfTable(table.getName());
|
||||
Map<String, RegionState.State> stateMap = new HashMap<>();
|
||||
for (RegionState.State regionState : regionStates.keySet()) {
|
||||
for (RegionInfo regionInfo : regionStates.get(regionState)) {
|
||||
stateMap.put(regionInfo.getEncodedName(), regionState);
|
||||
}
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
<% } %>
|
||||
<%} %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%} else {
|
||||
RegionLocator r = master.getConnection().getRegionLocator(table.getName());
|
||||
try { %>
|
||||
<h2>Table Attributes</h2>
|
||||
<table class="table table-striped">
|
||||
<h2>Table Attributes</h2>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Attribute Name</th>
|
||||
<th>Value</th>
|
||||
|
@ -277,7 +374,7 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<tr>
|
||||
<td>Compaction</td>
|
||||
<td>
|
||||
<%
|
||||
<%
|
||||
if (master.getAssignmentManager().isTableEnabled(table.getName())) {
|
||||
try {
|
||||
CompactionState compactionState = admin.getCompactionState(table.getName()).get();
|
||||
|
@ -292,18 +389,18 @@ if (fqtn != null && master.isInitialized()) {
|
|||
} else {
|
||||
%><%= CompactionState.NONE %><%
|
||||
}
|
||||
%>
|
||||
%>
|
||||
</td>
|
||||
<td>Is the table compacting</td>
|
||||
</tr>
|
||||
<% if (showFragmentation) { %>
|
||||
<% if (showFragmentation) { %>
|
||||
<tr>
|
||||
<td>Fragmentation</td>
|
||||
<td><%= frags.get(fqtn) != null ? frags.get(fqtn).intValue() + "%" : "n/a" %></td>
|
||||
<td>How fragmented is the table. After a major compaction it is 0%.</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<%
|
||||
<% } %>
|
||||
<%
|
||||
if (quotasEnabled) {
|
||||
TableName tn = TableName.valueOf(fqtn);
|
||||
SpaceQuotaSnapshot masterSnapshot = null;
|
||||
|
@ -319,7 +416,7 @@ if (fqtn != null && master.isInitialized()) {
|
|||
}
|
||||
if (quota != null && quota.hasSpace()) {
|
||||
SpaceQuota spaceQuota = quota.getSpace();
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td>Space Quota</td>
|
||||
<td>
|
||||
|
@ -336,9 +433,9 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<td>Policy</td>
|
||||
<td><%= spaceQuota.getViolationPolicy() %></td>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
if (masterSnapshot != null) {
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td>Usage</td>
|
||||
<td><%= StringUtils.byteDesc(masterSnapshot.getUsage()) %></td>
|
||||
|
@ -347,19 +444,19 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<td>State</td>
|
||||
<td><%= masterSnapshot.getQuotaStatus().isInViolation() ? "In Violation" : "In Observance" %></td>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
}
|
||||
%>
|
||||
%>
|
||||
</table>
|
||||
</td>
|
||||
<td>Information about a Space Quota on this table, if set.</td>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
}
|
||||
if (quota != null && quota.hasThrottle()) {
|
||||
List<ThrottleSettings> throttles = QuotaSettingsFactory.fromTableThrottles(table.getName(), quota.getThrottle());
|
||||
if (throttles.size() > 0) {
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td>Throttle Quota</td>
|
||||
<td>
|
||||
|
@ -370,30 +467,30 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<th>TimeUnit</th>
|
||||
<th>Scope</th>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
for (ThrottleSettings throttle : throttles) {
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td><%= throttle.getSoftLimit() %></td>
|
||||
<td><%= throttle.getThrottleType() %></td>
|
||||
<td><%= throttle.getTimeUnit() %></td>
|
||||
<td><%= throttle.getQuotaScope() %></td>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
}
|
||||
%>
|
||||
%>
|
||||
</table>
|
||||
</td>
|
||||
<td>Information about a Throttle Quota on this table, if set.</td>
|
||||
</tr>
|
||||
<%
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
<h2>Table Schema</h2>
|
||||
<table class="table table-striped">
|
||||
%>
|
||||
</table>
|
||||
<h2>Table Schema</h2>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Column Family Name</th>
|
||||
<th></th>
|
||||
|
@ -427,13 +524,16 @@ if (fqtn != null && master.isInitialized()) {
|
|||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</table>
|
||||
<%
|
||||
</table>
|
||||
<%
|
||||
long totalReadReq = 0;
|
||||
long totalWriteReq = 0;
|
||||
long totalSize = 0;
|
||||
long totalStoreFileCount = 0;
|
||||
long totalMemSize = 0;
|
||||
long totalCompactingCells = 0;
|
||||
long totalCompactedCells = 0;
|
||||
String totalCompactionProgress = "";
|
||||
String totalMemSizeStr = ZEROMB;
|
||||
String totalSizeStr = ZEROMB;
|
||||
String urlRegionServer = null;
|
||||
|
@ -452,13 +552,15 @@ if (fqtn != null && master.isInitialized()) {
|
|||
if (sl != null) {
|
||||
RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName());
|
||||
regionsToLoad.put(regionInfo, regionMetrics);
|
||||
if(regionMetrics != null) {
|
||||
if (regionMetrics != null) {
|
||||
totalReadReq += regionMetrics.getReadRequestCount();
|
||||
totalWriteReq += regionMetrics.getWriteRequestCount();
|
||||
totalSize += regionMetrics.getStoreFileSize().get(Size.Unit.MEGABYTE);
|
||||
totalStoreFileCount += regionMetrics.getStoreFileCount();
|
||||
totalMemSize += regionMetrics.getMemStoreSize().get(Size.Unit.MEGABYTE);
|
||||
totalStoreFileSizeMB += regionMetrics.getStoreFileSize().get(Size.Unit.MEGABYTE);
|
||||
totalCompactingCells += regionMetrics.getCompactingCellCount();
|
||||
totalCompactedCells += regionMetrics.getCompactedCellCount();
|
||||
} else {
|
||||
RegionMetrics load0 = getEmptyRegionMetrics(regionInfo);
|
||||
regionsToLoad.put(regionInfo, load0);
|
||||
|
@ -478,34 +580,48 @@ if (fqtn != null && master.isInitialized()) {
|
|||
if (totalMemSize > 0) {
|
||||
totalMemSizeStr = StringUtils.byteDesc(totalMemSize*1024l*1024);
|
||||
}
|
||||
|
||||
if(regions != null && regions.size() > 0) { %>
|
||||
<h2>Table Regions</h2>
|
||||
<table id="regionServerDetailsTable" class="tablesorter table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name(<%= String.format("%,1d", regions.size())%>)</th>
|
||||
<th>Region Server</th>
|
||||
<th>ReadRequests<br>(<%= String.format("%,1d", totalReadReq)%>)</th>
|
||||
<th>WriteRequests<br>(<%= String.format("%,1d", totalWriteReq)%>)</th>
|
||||
<th>StorefileSize<br>(<%= totalSizeStr %>)</th>
|
||||
<th>Num.Storefiles<br>(<%= String.format("%,1d", totalStoreFileCount)%>)</th>
|
||||
<th>MemSize<br>(<%= totalMemSizeStr %>)</th>
|
||||
<th>Locality</th>
|
||||
<th>Start Key</th>
|
||||
<th>End Key</th>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<th>ReplicaID</th>
|
||||
<%
|
||||
if (totalCompactingCells > 0) {
|
||||
totalCompactionProgress = String.format("%.2f", 100 *
|
||||
((float) totalCompactedCells / totalCompactingCells)) + "%";
|
||||
}
|
||||
%>
|
||||
</thead>
|
||||
</tr>
|
||||
<tbody>
|
||||
|
||||
<%
|
||||
if(regions != null && regions.size() > 0) { %>
|
||||
<h2>Table Regions</h2>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-pills">
|
||||
<li class="active">
|
||||
<a href="#tab_baseStats" data-toggle="tab">Base Stats</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#tab_compactStats" data-toggle="tab">Compactions</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
|
||||
<div class="tab-pane active" id="tab_baseStats">
|
||||
<table id="regionServerDetailsTable" class="tablesorter table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name(<%= String.format("%,1d", regions.size())%>)</th>
|
||||
<th>Region Server</th>
|
||||
<th>ReadRequests<br>(<%= String.format("%,1d", totalReadReq)%>)</th>
|
||||
<th>WriteRequests<br>(<%= String.format("%,1d", totalWriteReq)%>)</th>
|
||||
<th>StorefileSize<br>(<%= totalSizeStr %>)</th>
|
||||
<th>Num.Storefiles<br>(<%= String.format("%,1d", totalStoreFileCount)%>)</th>
|
||||
<th>MemSize<br>(<%= totalMemSizeStr %>)</th>
|
||||
<th>Locality</th>
|
||||
<th>Start Key</th>
|
||||
<th>End Key</th>
|
||||
<th>Region State</th>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<th>ReplicaID</th>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
List<Map.Entry<RegionInfo, RegionMetrics>> entryList = new ArrayList<>(regionsToLoad.entrySet());
|
||||
numRegions = regions.size();
|
||||
int numRegionsRendered = 0;
|
||||
|
@ -523,7 +639,8 @@ if (fqtn != null && master.isInitialized()) {
|
|||
String fileCount = "N/A";
|
||||
String memSize = ZEROMB;
|
||||
float locality = 0.0f;
|
||||
if(load != null) {
|
||||
String state = "N/A";
|
||||
if (load != null) {
|
||||
readReq = String.format("%,1d", load.getReadRequestCount());
|
||||
writeReq = String.format("%,1d", load.getWriteRequestCount());
|
||||
double rSize = load.getStoreFileSize().get(Size.Unit.BYTE);
|
||||
|
@ -537,7 +654,9 @@ if (fqtn != null && master.isInitialized()) {
|
|||
}
|
||||
locality = load.getDataLocality();
|
||||
}
|
||||
|
||||
if (stateMap.containsKey(regionInfo.getEncodedName())) {
|
||||
state = stateMap.get(regionInfo.getEncodedName()).toString();
|
||||
}
|
||||
if (addr != null) {
|
||||
ServerMetrics sl = master.getServerManager().getLoad(addr);
|
||||
// This port might be wrong if RS actually ended up using something else.
|
||||
|
@ -556,8 +675,8 @@ if (fqtn != null && master.isInitialized()) {
|
|||
}
|
||||
if (numRegionsRendered < numRegionsToRender) {
|
||||
numRegionsRendered++;
|
||||
%>
|
||||
<tr>
|
||||
%>
|
||||
<tr>
|
||||
<td><%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %></td>
|
||||
<%
|
||||
if (urlRegionServer != null) {
|
||||
|
@ -580,6 +699,7 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<td><%= locality%></td>
|
||||
<td><%= escapeXml(Bytes.toStringBinary(regionInfo.getStartKey()))%></td>
|
||||
<td><%= escapeXml(Bytes.toStringBinary(regionInfo.getEndKey()))%></td>
|
||||
<td><%= state%></td>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
|
@ -587,51 +707,124 @@ if (fqtn != null && master.isInitialized()) {
|
|||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if (numRegions > numRegionsRendered) {
|
||||
</tr>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if (numRegions > numRegionsRendered) {
|
||||
String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn,"UTF-8") + "&numRegions=all";
|
||||
%>
|
||||
%>
|
||||
<p>This table has <b><%= numRegions %></b> regions in total, in order to improve the page load time,
|
||||
only <b><%= numRegionsRendered %></b> regions are displayed here, <a href="<%= allRegionsUrl %>">click
|
||||
here</a> to see all regions.</p>
|
||||
<% } %>
|
||||
<h2>Regions by Region Server</h2>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th><th>Primary Region Count</th></tr></thead>
|
||||
<%
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab_compactStats">
|
||||
<table id="tableCompactStatsTable" class="tablesorter table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name(<%= String.format("%,1d", regions.size())%>)</th>
|
||||
<th>Region Server</th>
|
||||
<th>Num. Compacting Cells<br>(<%= String.format("%,1d", totalCompactingCells)%>)</th>
|
||||
<th>Num. Compacted Cells<br>(<%= String.format("%,1d", totalCompactedCells)%>)</th>
|
||||
<th>Remaining Cells<br>(<%= String.format("%,1d", totalCompactingCells-totalCompactedCells)%>)</th>
|
||||
<th>Compaction Progress<br>(<%= totalCompactionProgress %>)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
numRegionsRendered = 0;
|
||||
for (Map.Entry<RegionInfo, RegionMetrics> hriEntry : entryList) {
|
||||
RegionInfo regionInfo = hriEntry.getKey();
|
||||
ServerName addr = regionsToServer.get(regionInfo);
|
||||
RegionMetrics load = hriEntry.getValue();
|
||||
long compactingCells = 0;
|
||||
long compactedCells = 0;
|
||||
String compactionProgress = "";
|
||||
if (load != null) {
|
||||
compactingCells = load.getCompactingCellCount();
|
||||
compactedCells = load.getCompactedCellCount();
|
||||
if (compactingCells > 0) {
|
||||
compactionProgress = String.format("%.2f", 100 * ((float)
|
||||
compactedCells / compactingCells)) + "%";
|
||||
}
|
||||
}
|
||||
if (addr != null) {
|
||||
// This port might be wrong if RS actually ended up using something else.
|
||||
urlRegionServer =
|
||||
"//" + URLEncoder.encode(addr.getHostname()) + ":" + master.getRegionServerInfoPort(addr) + "/rs-status";
|
||||
}
|
||||
if (numRegionsRendered < numRegionsToRender) {
|
||||
numRegionsRendered++;
|
||||
%>
|
||||
<tr>
|
||||
<td><%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %></td>
|
||||
<%
|
||||
if (urlRegionServer != null) {
|
||||
%>
|
||||
<td>
|
||||
<a href="<%= urlRegionServer %>"><%= addr == null? "-": StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a>
|
||||
</td>
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
<td class="undeployed-region">not deployed</td>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<td><%= String.format("%,1d", compactingCells)%></td>
|
||||
<td><%= String.format("%,1d", compactedCells)%></td>
|
||||
<td><%= String.format("%,1d", compactingCells - compactedCells)%></td>
|
||||
<td><%= compactionProgress%></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if (numRegions > numRegionsRendered) {
|
||||
String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn,"UTF-8") + "&numRegions=all";
|
||||
%>
|
||||
<p>This table has <b><%= numRegions %></b> regions in total, in order to improve the page load time,
|
||||
only <b><%= numRegionsRendered %></b> regions are displayed here, <a href="<%= allRegionsUrl %>">click
|
||||
here</a> to see all regions.</p>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Regions by Region Server</h2>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th><th>Primary Region Count</th></tr></thead>
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
<table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th></tr></thead>
|
||||
<tbody>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
<table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th></tr></thead>
|
||||
<tbody>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
for (Map.Entry<ServerName, Integer> rdEntry : regDistribution.entrySet()) {
|
||||
ServerName addr = rdEntry.getKey();
|
||||
String url = "//" + URLEncoder.encode(addr.getHostname()) + ":" + master.getRegionServerInfoPort(addr) + "/rs-status";
|
||||
%>
|
||||
<tr>
|
||||
%>
|
||||
<tr>
|
||||
<td><a href="<%= url %>"><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a></td>
|
||||
<td><%= rdEntry.getValue()%></td>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<%
|
||||
if (withReplica) {
|
||||
%>
|
||||
<td><%= primaryRegDistribution.get(addr)%></td>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% }
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</tr>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% }
|
||||
} catch(Exception ex) {
|
||||
for(StackTraceElement element : ex.getStackTrace()) {
|
||||
%><%= StringEscapeUtils.escapeHtml4(element.toString()) %><%
|
||||
|
@ -642,8 +835,8 @@ if (withReplica) {
|
|||
} // end else
|
||||
%>
|
||||
|
||||
<h2>Table Stats</h2>
|
||||
<table class="table table-striped">
|
||||
<h2>Table Stats</h2>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
|
@ -666,15 +859,15 @@ if (withReplica) {
|
|||
%>
|
||||
<td>Total size of store files</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<% if (!readOnly) { %>
|
||||
<p><hr/></p>
|
||||
Actions:
|
||||
<p>
|
||||
<center>
|
||||
<table class="table" style="border: 0;" width="95%" >
|
||||
<tr>
|
||||
<% if (!readOnly) { %>
|
||||
<p><hr/></p>
|
||||
Actions:
|
||||
<p>
|
||||
<center>
|
||||
<table class="table" style="border: 0;" width="95%" >
|
||||
<tr>
|
||||
<form method="get">
|
||||
<input type="hidden" name="action" value="compact" />
|
||||
<input type="hidden" name="name" value="<%= escaped_fqtn %>" />
|
||||
|
@ -690,8 +883,8 @@ Actions:
|
|||
given key.
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<form method="get">
|
||||
<input type="hidden" name="action" value="split" />
|
||||
<input type="hidden" name="name" value="<%= escaped_fqtn %>" />
|
||||
|
@ -708,8 +901,8 @@ Actions:
|
|||
other regions. Split requests for noneligible regions will be ignored.
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<form method="get">
|
||||
<input type="hidden" name="action" value="merge" />
|
||||
<input type="hidden" name="name" value="<%= escaped_fqtn %>" />
|
||||
|
@ -725,16 +918,16 @@ Actions:
|
|||
noneligible regions will be ignored.
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</p>
|
||||
<% } %>
|
||||
</div>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</p>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% }
|
||||
} catch(TableNotFoundException e) { %>
|
||||
<div class="container-fluid content">
|
||||
} catch(TableNotFoundException e) { %>
|
||||
<div class="container-fluid content">
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
<h1>Table not found</h1>
|
||||
|
@ -742,9 +935,9 @@ Actions:
|
|||
</div>
|
||||
<p><hr><p>
|
||||
<p>Go <a href="javascript:history.back()">Back</a>
|
||||
</div> <%
|
||||
} catch(IllegalArgumentException e) { %>
|
||||
<div class="container-fluid content">
|
||||
</div> <%
|
||||
} catch(IllegalArgumentException e) { %>
|
||||
<div class="container-fluid content">
|
||||
<div class="row inner_header">
|
||||
<div class="page-header">
|
||||
<h1>Table qualifier must not be empty</h1>
|
||||
|
@ -752,10 +945,10 @@ Actions:
|
|||
</div>
|
||||
<p><hr><p>
|
||||
<p>Go <a href="javascript:history.back()">Back</a>
|
||||
</div> <%
|
||||
</div> <%
|
||||
}
|
||||
}
|
||||
else { // handle the case for fqtn is null or master is not initialized with error message + redirect
|
||||
else { // handle the case for fqtn is null or master is not initialized with error message + redirect
|
||||
%>
|
||||
<div class="container-fluid content">
|
||||
<div class="row inner_header">
|
||||
|
@ -763,8 +956,8 @@ Actions:
|
|||
<h1>Table not ready</h1>
|
||||
</div>
|
||||
</div>
|
||||
<p><hr><p>
|
||||
<jsp:include page="redirect.jsp" />
|
||||
<p><hr><p>
|
||||
<jsp:include page="redirect.jsp" />
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
|
@ -774,7 +967,7 @@ Actions:
|
|||
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function()
|
||||
$(document).ready(function()
|
||||
{
|
||||
$.tablesorter.addParser(
|
||||
{
|
||||
|
@ -832,6 +1025,20 @@ $(document).ready(function()
|
|||
6: {sorter: 'filesize'}
|
||||
}
|
||||
});
|
||||
$("#tableCompactStatsTable").tablesorter({
|
||||
headers: {
|
||||
2: {sorter: 'separator'},
|
||||
3: {sorter: 'separator'},
|
||||
4: {sorter: 'separator'}
|
||||
}
|
||||
);
|
||||
});
|
||||
$("#metaTableCompactStatsTable").tablesorter({
|
||||
headers: {
|
||||
2: {sorter: 'separator'},
|
||||
3: {sorter: 'separator'},
|
||||
4: {sorter: 'separator'}
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue