Index: core/src/main/resources/webapps/master/table.jsp =================================================================== --- core/src/main/resources/webapps/master/table.jsp (revision 934197) +++ core/src/main/resources/webapps/master/table.jsp (working copy) @@ -1,22 +1,16 @@ <%@ page contentType="text/html;charset=UTF-8" - import="java.io.IOException" import="java.util.Map" - import="java.net.URLEncoder" - import="org.apache.hadoop.io.Text" import="org.apache.hadoop.io.Writable" import="org.apache.hadoop.conf.Configuration" - import="org.apache.hadoop.hbase.HTableDescriptor" import="org.apache.hadoop.hbase.client.HTable" import="org.apache.hadoop.hbase.client.HBaseAdmin" import="org.apache.hadoop.hbase.HRegionInfo" import="org.apache.hadoop.hbase.HServerAddress" import="org.apache.hadoop.hbase.HServerInfo" - import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.io.ImmutableBytesWritable" import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.master.MetaRegion" import="org.apache.hadoop.hbase.util.Bytes" - import="java.io.IOException" import="java.util.Map" import="org.apache.hadoop.hbase.HConstants"%><% HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); @@ -28,7 +22,11 @@ master.getServerManager().getServerAddressToServerInfo(); String tableHeader = "

Table Regions

"; HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation(); - Map frags = master.getTableFragmentation(); + boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); + Map frags = null; + if (showFragmentation) { + frags = master.getTableFragmentation(); + } %> @@ -120,9 +118,22 @@ try { %>

Table Attributes

NameRegion ServerEncoded NameStart KeyEnd Key
- - - + + + + + + + + + +<% if (showFragmentation) { %> + + + + + +<% } %>
Attribute NameValueDescription
Enabled<%= hbadmin.isTableEnabled(table.getTableName()) %>Is the table enabled
Fragmentation<%= frags.get(tableName) != null ? frags.get(tableName).intValue() + "%" : "n/a" %>How fragmented is the table. After a major compaction it is 0%.
Attribute NameValueDescription
Enabled<%= hbadmin.isTableEnabled(table.getTableName()) %>Is the table enabled
Fragmentation<%= frags.get(tableName) != null ? frags.get(tableName).intValue() + "%" : "n/a" %>How fragmented is the table. After a major compaction it is 0%.
<% Map regions = table.getRegionsInfo(); Index: core/src/main/resources/webapps/master/master.jsp =================================================================== --- core/src/main/resources/webapps/master/master.jsp (revision 934197) +++ core/src/main/resources/webapps/master/master.jsp (working copy) @@ -1,20 +1,14 @@ <%@ page contentType="text/html;charset=UTF-8" import="java.util.*" - import="java.net.URLEncoder" import="org.apache.hadoop.conf.Configuration" - import="org.apache.hadoop.io.Text" import="org.apache.hadoop.hbase.util.Bytes" import="org.apache.hadoop.hbase.util.JvmVersion" - import="org.apache.hadoop.hbase.util.FSUtils" import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.master.MetaRegion" import="org.apache.hadoop.hbase.client.HBaseAdmin" - import="org.apache.hadoop.hbase.io.ImmutableBytesWritable" import="org.apache.hadoop.hbase.HServerInfo" import="org.apache.hadoop.hbase.HServerAddress" - import="org.apache.hadoop.hbase.HBaseConfiguration" - import="org.apache.hadoop.hbase.HColumnDescriptor" import="org.apache.hadoop.hbase.HTableDescriptor" %><% HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); Configuration conf = master.getConfiguration(); @@ -26,7 +20,11 @@ if (interval == 0) { interval = 1; } - Map frags = master.getTableFragmentation(); + boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); + Map frags = null; + if (showFragmentation) { + frags = master.getTableFragmentation(); + } %> @@ -61,7 +59,9 @@ HBase Root Directory<%= master.getRootDir().toString() %>Location of HBase home directory Load average<%= master.getServerManager().getAverageLoad() %>Average number of regions per regionserver. Naive computation. Regions On FS<%= master.getRegionManager().countRegionsOnFS() %>Number of regions on FileSystem. Rough count. -Fragmentation<%= frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a" %>Overall fragmentation of all tables, including .META. and -ROOT-. +<% if (showFragmentation) { %> + Fragmentation<%= frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a" %>Overall fragmentation of all tables, including .META. and -ROOT-. +<% } %> Zookeeper Quorum<%= master.getZooKeeperWrapper().getQuorumServers() %>Addresses of all registered ZK servers. For more, see zk dump. @@ -69,16 +69,28 @@ <% if (rootLocation != null) { %> - - - - + + +<% if (showFragmentation) { %> + +<% } %> + + + +<% if (showFragmentation) { %> + +<% } %> + + <% if (onlineRegions != null && onlineRegions.size() > 0) { %> - - - + + +<% if (showFragmentation) { %> + +<% } %> + <% } %> @@ -89,11 +101,20 @@ <% HTableDescriptor[] tables = new HBaseAdmin(conf).listTables(); if(tables != null && tables.length > 0) { %>
TableFrag.Description
<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %><%= frags.get("-ROOT-") != null ? frags.get("-ROOT-").intValue() + "%" : "n/a" %>The -ROOT- table holds references to all .META. regions.
TableFrag.Description
<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %><%= frags.get("-ROOT-") != null ? frags.get("-ROOT-").intValue() + "%" : "n/a" %>The -ROOT- table holds references to all .META. regions.
<%= Bytes.toString(HConstants.META_TABLE_NAME) %><%= frags.get(".META.") != null ? frags.get(".META.").intValue() + "%" : "n/a" %>The .META. table holds references to all User Table regions
<%= Bytes.toString(HConstants.META_TABLE_NAME) %><%= frags.get(".META.") != null ? frags.get(".META.").intValue() + "%" : "n/a" %>The .META. table holds references to all User Table regions
- + + +<% if (showFragmentation) { %> + +<% } %> + + <% for(HTableDescriptor htDesc : tables ) { %> - - - + + +<% if (showFragmentation) { %> + +<% } %> + <% } %>
TableFrag.Description
TableFrag.Description
><%= htDesc.getNameAsString() %> <%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %><%= htDesc.toString() %>
><%= htDesc.getNameAsString() %> <%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %><%= htDesc.toString() %>