diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon index 23330096cf39..d837b8504623 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon @@ -299,7 +299,12 @@ $(document).ready(function() type: "numeric" }); - $("#baseStatsTable").tablesorter(); + $("#baseStatsTable").tablesorter({ + headers: { + 1: {empty: 'emptyMin'}, + 2: {empty: 'emptyMax'} + } + }); $("#requestStatsTable").tablesorter({ headers: { 1: {sorter: 'separator'}, diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 56a0c8096d32..fdec6849de0a 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -93,7 +93,7 @@ * its region server. * @return an anchor tag if one can be built, {@code null} otherwise. */ - private static String buildRegionServerLink(final ServerName serverName, final int rsInfoPort, + private static String buildRegionLink(final ServerName serverName, final int rsInfoPort, final RegionInfo regionInfo, final RegionState.State regionState) { if (serverName == null || regionInfo == null) { return null; } @@ -107,15 +107,74 @@ + "?name=" + regionInfo.getEncodedName(); return "" + serverName.getServerName() + ""; } + + /** + * Render an
tag guide user to see all region messages. + */ + private static String moreRegionsToRender(int numRegionsRendered, int numRegions, String fqtn) { + if (numRegions > numRegionsRendered) { + String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn) + "&numRegions=all"; + + return "This table has " + numRegions + + " regions in total, in order to improve the page load time, only " + + numRegionsRendered + " regions are displayed here, click here to see all regions.
"; + } + return ""; + } %> + +
+
+
- <% - if (action.equals("split")) { +<% return; + } %> + +<% // table split/compact/merge actions + if ( !readOnly && action != null ) { %> +
+<% if (action.equals("split")) {
if (key != null && key.length() > 0) {
admin.split(TableName.valueOf(fqtn), Bytes.toBytes(key));
} else {
admin.split(TableName.valueOf(fqtn));
}
-
- %> Split request accepted. <%
+%> Split request accepted. <%
} else if (action.equals("major compact")) {
if (key != null && key.length() > 0) {
List
| Name | -Region Server | -ReadRequests | -WriteRequests | -Uncompressed StoreFileSize | -StorefileSize | -Num.Storefiles | -MemSize | -Start Key | -End Key | - <% - if (withReplica) { - %> -ReplicaID | - <% - } - %> -
|---|
| Name | +Region Server | +ReadRequests | +WriteRequests | +Uncompressed StoreFileSize | +StorefileSize | +Num.Storefiles | +MemSize | +Start Key | +End Key | +ReplicaID | +
|---|---|---|---|---|---|---|---|---|---|---|
| <%= escapeXml(meta.getRegionNameAsString()) %> | -<%= StringEscapeUtils.escapeHtml4(hostAndPort) %> | -<%= readReq%> | -<%= writeReq%> | -<%= fileSizeUncompressed%> | -<%= fileSize%> | -<%= fileCount%> | -<%= memSize%> | -<%= escapeXml(Bytes.toString(meta.getStartKey())) %> | -<%= escapeXml(Bytes.toString(meta.getEndKey())) %> | - <% - if (withReplica) { - %> -<%= meta.getReplicaId() %> | - <% } - %> -
| Name | -Region Server | -Locality | -LocalityForSsd | -|||||||
|---|---|---|---|---|---|---|---|---|---|---|
| <%= escapeXml(meta.getRegionNameAsString()) %> | +<%= StringEscapeUtils.escapeHtml4(hostAndPort) %> | +<%= readReq%> | +<%= writeReq%> | +<%= fileSizeUncompressed%> | +<%= fileSize%> | +<%= fileCount%> | +<%= memSize%> | +<%= escapeXml(Bytes.toString(meta.getStartKey())) %> | +<%= escapeXml(Bytes.toString(meta.getEndKey())) %> | +<%= meta.getReplicaId() %> | +
| Name | +Region Server | +Locality | +LocalityForSsd | +
|---|---|---|---|
| <%= escapeXml(meta.getRegionNameAsString()) %> | -<%= StringEscapeUtils.escapeHtml4(hostAndPort) %> | -<%= locality%> | -<%= localityForSsd%> | -
| Name | -Region Server | -Num. Compacting Cells | -Num. Compacted Cells | -Remaining Cells | -Compaction Progress | -
|---|---|---|---|---|---|
| <%= escapeXml(meta.getRegionNameAsString()) %> | +<%= StringEscapeUtils.escapeHtml4(hostAndPort) %> | +<%= locality%> | +<%= localityForSsd%> | +
| Name | +Region Server | +Num. Compacting Cells | +Num. Compacted Cells | +Remaining Cells | +Compaction Progress | +
|---|---|---|---|---|---|
| <%= escapeXml(meta.getRegionNameAsString()) %> | -<%= StringEscapeUtils.escapeHtml4(hostAndPort) %> | -<%= String.format("%,1d", compactingCells)%> | -<%= String.format("%,1d", compactedCells)%> | -<%= String.format("%,1d", compactingCells - compactedCells)%> | -<%= compactionProgress%> | -
| Attribute Name | +Value | +Description | +||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enabled | +<%= master.getTableStateManager().isTableState(table.getName(), TableState.State.ENABLED) %> | +Is the table enabled | +||||||||||
| Compaction | ++<% + if (master.getTableStateManager().isTableState(table.getName(), TableState.State.ENABLED)) { + CompactionState compactionState = master.getCompactionState(table.getName()); + %><%= compactionState==null?"UNKNOWN":compactionState %><% + } else { + %><%= CompactionState.NONE %><% + } +%> + | +Is the table compacting | +||||||||||
| Fragmentation | +<%= frags.get(fqtn) != null ? frags.get(fqtn).intValue() + "%" : "n/a" %> | +How fragmented is the table. After a major compaction it is 0%. | +
| Attribute Name | -Value | -Description | -||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enabled | -<%= master.getTableStateManager().isTableState(table.getName(), TableState.State.ENABLED) %> | -Is the table enabled | -||||||||||
| Compaction | -- <% - if (master.getTableStateManager().isTableState(table.getName(), TableState.State.ENABLED)) { - CompactionState compactionState = master.getCompactionState(table.getName()); - %><%= compactionState==null?"UNKNOWN":compactionState %><% - } else { - %><%= CompactionState.NONE %><% - } - %> - | -Is the table compacting | -||||||||||
| Fragmentation | -<%= frags.get(fqtn) != null ? frags.get(fqtn).intValue() + "%" : "n/a" %> | -How fragmented is the table. After a major compaction it is 0%. | -||||||||||
| Space Quota | -
-
|
- Information about a Space Quota on this table, if set. | -||||||||||
| Throttle Quota | -
-
|
- Information about a Throttle Quota on this table, if set. | -
| Space Quota | +
+
|
+ Information about a Space Quota on this table, if set. | +||||||||||
| Throttle Quota | +
+
|
+ Information about a Throttle Quota on this table, if set. | +
| Name(<%= String.format("%,1d", regions.size())%>) | -Region Server | -ReadRequests (<%= String.format("%,1d", totalReadReq)%>) |
- WriteRequests (<%= String.format("%,1d", totalWriteReq)%>) |
- Uncompressed StoreFileSize (<%= totalSizeUncompressedStr %>) |
- StorefileSize (<%= totalSizeStr %>) |
- Num.Storefiles (<%= String.format("%,1d", totalStoreFileCount)%>) |
- MemSize (<%= totalMemSizeStr %>) |
- Start Key | -End Key | -Region State | - <% - if (withReplica) { - %> -ReplicaID | - <% - } - %> -
|---|
| Name(<%= String.format("%,1d", regions.size())%>) | +Region Server | +ReadRequests (<%= String.format("%,1d", totalReadReq)%>) |
+ WriteRequests (<%= String.format("%,1d", totalWriteReq)%>) |
+ Uncompressed StoreFileSize (<%= totalSizeUncompressedStr %>) |
+ StorefileSize (<%= totalSizeStr %>) |
+ Num.Storefiles (<%= String.format("%,1d", totalStoreFileCount)%>) |
+ MemSize (<%= totalMemSizeStr %>) |
+ Start Key | +End Key | +Region State | +ReplicaID | +|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %> | - <% - if (urlRegionServer != null) { - %> -- <%= addr == null? "-": StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> - | - <% - } else { - %> -not deployed | - <% - } - %> -<%= readReq%> | -<%= writeReq%> | -<%= regionSizeUncompressed%> | -<%= regionSize%> | -<%= fileCount%> | -<%= memSize%> | -<%= escapeXml(Bytes.toStringBinary(regionInfo.getStartKey()))%> | -<%= escapeXml(Bytes.toStringBinary(regionInfo.getEndKey()))%> | -<%= state%> | - <% - if (withReplica) { - %> -<%= regionInfo.getReplicaId() %> | - <% - } - %> -
This table has <%= numRegions %> regions in total, in order to improve the page load time, - only <%= numRegionsRendered %> regions are displayed here, click - here to see all regions.
- <% } %> -| Name(<%= String.format("%,1d", regions.size())%>) | -Region Server | -Locality (<%= totalLocality %>) |
- LocalityForSsd (<%= totalLocalityForSsd %>) |
- |
|---|---|---|---|---|
| <%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %> | - <% - if (urlRegionServer != null) { - %> -- <%= addr == null? "-": StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> - | - <% - } else { - %> -not deployed | - <% + double rSizeUncompressed = load.getUncompressedStoreFileSize().get(Size.Unit.BYTE); + if (rSizeUncompressed > 0) { + regionSizeUncompressed = StringUtils.byteDesc((long)rSizeUncompressed); } - %> -<%= locality%> | -<%= localityForSsd%> | -
| Name(<%= String.format("%,1d", regions.size())%>) | -Region Server | -Num. Compacting Cells (<%= String.format("%,1d", totalCompactingCells)%>) |
- Num. Compacted Cells (<%= String.format("%,1d", totalCompactedCells)%>) |
- Remaining Cells (<%= String.format("%,1d", totalCompactingCells-totalCompactedCells)%>) |
- Compaction Progress (<%= totalCompactionProgress %>) |
- |
|---|---|---|---|---|---|---|
| <%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %> | - <% - if (urlRegionServer != null) { - %> -- <%= addr == null? "-": StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> - | - <% - } else { - %> -not deployed | - <% + fileCount = String.format("%,1d", load.getStoreFileCount()); + double mSize = load.getMemStoreSize().get(Size.Unit.BYTE); + if (mSize > 0) { + memSize = StringUtils.byteDesc((long)mSize); + } + } + + if (stateMap.containsKey(regionInfo.getEncodedName())) { + state = stateMap.get(regionInfo.getEncodedName()).toString(); + } + + if (addr != null) { + ServerMetrics sl = master.getServerManager().getLoad(addr); + if(sl != null) { + Integer i = regDistribution.get(addr); + if (null == i) i = Integer.valueOf(0); + regDistribution.put(addr, i + 1); + if (RegionReplicaUtil.isDefaultReplica(regionInfo.getReplicaId())) { + i = primaryRegDistribution.get(addr); + if (null == i) i = Integer.valueOf(0); + primaryRegDistribution.put(addr, i+1); } - %> -<%= String.format("%,1d", compactingCells)%> | -<%= String.format("%,1d", compactedCells)%> | -<%= String.format("%,1d", compactingCells - compactedCells)%> | -<%= compactionProgress%> | -
This table has <%= numRegions %> regions in total, in order to improve the page load time, - only <%= numRegionsRendered %> regions are displayed here, click - here to see all regions.
- <% } %> -| Region Server | Region Count | Primary Region Count |
|---|
| Region Server | Region Count |
|---|
| Name(<%= String.format("%,1d", regions.size())%>) | +Region Server | +Locality (<%= totalLocality %>) |
+ LocalityForSsd (<%= totalLocalityForSsd %>) |
+
|---|---|---|---|
| <%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %> | + <%= buildRegionDeployedServerTag(regionInfo, master, regionsToServer) %> +<%= locality%> | +<%= localityForSsd%> | +
| Name(<%= String.format("%,1d", regions.size())%>) | +Region Server | +Num. Compacting Cells (<%= String.format("%,1d", totalCompactingCells)%>) |
+ Num. Compacted Cells (<%= String.format("%,1d", totalCompactedCells)%>) |
+ Remaining Cells (<%= String.format("%,1d", totalCompactingCells-totalCompactedCells)%>) |
+ Compaction Progress (<%= totalCompactionProgress %>) |
+ ||
|---|---|---|---|---|---|---|---|
| <%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> | -<%= rdEntry.getValue()%> | - <% - if (withReplica) { - %> -<%= primaryRegDistribution.get(addr)%> | - <% - } - %> +<%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %> | + <%= buildRegionDeployedServerTag(regionInfo, master, regionsToServer) %> +<%= String.format("%,1d", compactingCells)%> | +<%= String.format("%,1d", compactedCells)%> | +<%= String.format("%,1d", compactingCells - compactedCells)%> | +<%= compactionProgress%> |
| Region Server | Region Count | Primary Region Count | +
|---|---|---|
| <%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + + ":" + master.getRegionServerInfoPort(addr) %> | +<%= rdEntry.getValue()%> | +<%= primaryRegDistribution.get(addr) == null ? 0 : primaryRegDistribution.get(addr)%> | +
-
+
-