Revert "HBASE-16677 Add table size (total store file size) to table page"

This reverts commit f5351e2dbd.
This commit is contained in:
chenheng 2016-09-25 10:47:20 +08:00
parent f5351e2dbd
commit b14fb14886
1 changed files with 1 additions and 49 deletions

View File

@ -73,25 +73,6 @@
} }
String action = request.getParameter("action"); String action = request.getParameter("action");
String key = request.getParameter("key"); String key = request.getParameter("key");
long totalStoreFileSizeMB = 0;
final String numRegionsParam = request.getParameter("numRegions");
// By default, the page render up to 10000 regions to improve the page load time
int numRegionsToRender = 10000;
if (numRegionsParam != null) {
// either 'all' or a number
if (numRegionsParam.equals("all")) {
numRegionsToRender = -1;
} else {
try {
numRegionsToRender = Integer.parseInt(numRegionsParam);
} catch (NumberFormatException ex) {
// ignore
}
}
}
int numRegions = 0;
%> %>
<!--[if IE]> <!--[if IE]>
<!DOCTYPE html> <!DOCTYPE html>
@ -361,7 +342,6 @@ if ( fqtn != null ) {
totalSize += regionload.getStorefileSizeMB(); totalSize += regionload.getStorefileSizeMB();
totalStoreFileCount += regionload.getStorefiles(); totalStoreFileCount += regionload.getStorefiles();
totalMemSize += regionload.getMemStoreSizeMB(); totalMemSize += regionload.getMemStoreSizeMB();
totalStoreFileSizeMB += regionload.getStorefileSizeMB();
} else { } else {
RegionLoad load0 = new RegionLoad(ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(HBaseProtos.RegionSpecifier.newBuilder().setValue(ByteString.copyFrom(regionInfo.getRegionName())).build()).build()); RegionLoad load0 = new RegionLoad(ClusterStatusProtos.RegionLoad.newBuilder().setRegionSpecifier(HBaseProtos.RegionSpecifier.newBuilder().setValue(ByteString.copyFrom(regionInfo.getRegionName())).build()).build());
regionsToLoad.put(regionInfo, load0); regionsToLoad.put(regionInfo, load0);
@ -567,12 +547,7 @@ ShowDetailName&Start/End Key<input type="checkbox" id="showWhole" style="margin-
}); });
} }
} }
numRegions = regions.size();
int numRegionsRendered = 0;
// render all regions
if (numRegionsToRender < 0) {
numRegionsToRender = numRegions;
}
for (Map.Entry<HRegionInfo, RegionLoad> hriEntry : entryList) { for (Map.Entry<HRegionInfo, RegionLoad> hriEntry : entryList) {
HRegionInfo regionInfo = hriEntry.getKey(); HRegionInfo regionInfo = hriEntry.getKey();
ServerName addr = regionsToServer.get(regionInfo); ServerName addr = regionsToServer.get(regionInfo);
@ -608,8 +583,6 @@ ShowDetailName&Start/End Key<input type="checkbox" id="showWhole" style="margin-
} }
} }
} }
if (numRegionsRendered < numRegionsToRender) {
numRegionsRendered++;
%> %>
<tr> <tr>
<td><%= escapeXml(showWhole?Bytes.toStringBinary(regionInfo.getRegionName()):regionInfo.getEncodedName()) %></td> <td><%= escapeXml(showWhole?Bytes.toStringBinary(regionInfo.getRegionName()):regionInfo.getEncodedName()) %></td>
@ -643,15 +616,7 @@ ShowDetailName&Start/End Key<input type="checkbox" id="showWhole" style="margin-
%> %>
</tr> </tr>
<% } %> <% } %>
+<% } %>
</table> </table>
<% if (numRegions > numRegionsRendered) {
String allRegionsUrl = "?name=" + fqtn + "&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> <h2>Regions by Region Server</h2>
<% <%
if (withReplica) { if (withReplica) {
@ -691,19 +656,6 @@ if (withReplica) {
} // end else } // end else
%> %>
<h2>Table Stats</h2>
<table class="table table-striped">
<tr>
<th>Name</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>Size</td>
<td><%= StringUtils.TraditionalBinaryPrefix.long2String(totalStoreFileSizeMB * 1024 * 1024, "B", 2)%></td>
<td>Total size of store files (in bytes)</td>
</tr>
</table>
<% if (!readOnly) { %> <% if (!readOnly) { %>
<p><hr/></p> <p><hr/></p>