commit 2fc9794df6c34a5a56511fcaa89da8cfcd690ff4 Author: Todd Lipcon Date: Thu May 20 15:20:31 2010 -0700 Move webapps dir to hbase-webapps dir diff --git pom.xml pom.xml index da79be2..3bd621a 100644 --- pom.xml +++ pom.xml @@ -251,7 +251,7 @@ src/main/resources - src/main/webapps + src/main/hbase-webapps */.gif */.css @@ -340,14 +340,14 @@ - - + + webxml="${basedir}/src/main/resources/hbase-webapps/regionserver/WEB-INF/web.xml"/> diff --git src/assembly/bin.xml src/assembly/bin.xml index 79d2495..a1964c7 100644 --- src/assembly/bin.xml +++ src/assembly/bin.xml @@ -34,8 +34,8 @@ - target/classes/webapps - webapps + target/classes/hbase-webapps + hbase-webapps **/*.jsp diff --git src/main/java/org/apache/hadoop/hbase/util/InfoServer.java src/main/java/org/apache/hadoop/hbase/util/InfoServer.java index 443fe3d..e76dbbd 100644 --- src/main/java/org/apache/hadoop/hbase/util/InfoServer.java +++ src/main/java/org/apache/hadoop/hbase/util/InfoServer.java @@ -35,13 +35,13 @@ import java.util.Map; * is to serve up status information for the server. * There are three contexts: * "/stacks/" -> points to stack trace - * "/static/" -> points to common static files (src/webapps/static) - * "/" -> the jsp server code from (src/webapps/) + * "/static/" -> points to common static files (src/hbase-webapps/static) + * "/" -> the jsp server code from (src/hbase-webapps/) */ public class InfoServer extends HttpServer { /** * Create a status server on the given port. - * The jsp scripts are taken from src/webapps/name. + * The jsp scripts are taken from src/hbase-webapps/name. * @param name The name of the server * @param bindAddress address to bind to * @param port The port to use on the server @@ -110,7 +110,7 @@ public class InfoServer extends HttpServer { throws IOException { URL url = InfoServer.class.getClassLoader().getResource(path); if (url == null) - throw new IOException("webapps not found in CLASSPATH: " + path); + throw new IOException("hbase-webapps not found in CLASSPATH: " + path); return url.toString(); } @@ -123,7 +123,7 @@ public class InfoServer extends HttpServer { public static String getWebAppDir(final String webappName) throws IOException { String webappDir; - webappDir = getWebAppsPath("webapps/" + webappName); + webappDir = getWebAppsPath("hbase-webapps/" + webappName); return webappDir; } } diff --git src/main/resources/hbase-webapps/master/index.html src/main/resources/hbase-webapps/master/index.html new file mode 100644 index 0000000..6d301ab --- /dev/null +++ src/main/resources/hbase-webapps/master/index.html @@ -0,0 +1 @@ + diff --git src/main/resources/hbase-webapps/master/master.jsp src/main/resources/hbase-webapps/master/master.jsp new file mode 100644 index 0000000..0ccc976 --- /dev/null +++ src/main/resources/hbase-webapps/master/master.jsp @@ -0,0 +1,151 @@ +<%@ page contentType="text/html;charset=UTF-8" + import="java.util.*" + import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.hbase.util.Bytes" + import="org.apache.hadoop.hbase.util.JvmVersion" + 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.HServerInfo" + import="org.apache.hadoop.hbase.HServerAddress" + import="org.apache.hadoop.hbase.HTableDescriptor" %><% + HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); + Configuration conf = master.getConfiguration(); + HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation(); + Map onlineRegions = master.getRegionManager().getOnlineMetaRegions(); + Map serverToServerInfos = + master.getServerManager().getServersToServerInfo(); + int interval = conf.getInt("hbase.regionserver.msginterval", 1000)/1000; + if (interval == 0) { + interval = 1; + } + boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); + Map frags = null; + if (showFragmentation) { + frags = master.getTableFragmentation(); + } +%> + + + +HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %> + + + + +

Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%>

+ + +<% if (JvmVersion.isBadJvmVersion()) { %> +
+ Your current JVM version <%= System.getProperty("java.version") %> is known to be + unstable with HBase. Please see the + HBase wiki + for details. +
+<% } %> + +
+ +

Master Attributes

+ + + + + + + + + +<% if (showFragmentation) { %> + +<% } %> + +
Attribute NameValueDescription
HBase Version<%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %>HBase version and svn revision
HBase Compiled<%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %>When HBase version was compiled and by whom
Hadoop Version<%= org.apache.hadoop.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.util.VersionInfo.getRevision() %>Hadoop version and svn revision
Hadoop Compiled<%= org.apache.hadoop.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.util.VersionInfo.getUser() %>When Hadoop version was compiled and by whom
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-.
Zookeeper Quorum<%= master.getZooKeeperWrapper().getQuorumServers() %>Addresses of all registered ZK servers. For more, see zk dump.
+ +

Catalog Tables

+<% + if (rootLocation != null) { %> + + + +<% if (showFragmentation) { %> + +<% } %> + + + + +<% if (showFragmentation) { %> + +<% } %> + + +<% + if (onlineRegions != null && onlineRegions.size() > 0) { %> + + +<% if (showFragmentation) { %> + +<% } %> + + + +<% } %> +
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
+<%} %> + +

User Tables

+<% HTableDescriptor[] tables = new HBaseAdmin(conf).listTables(); + if(tables != null && tables.length > 0) { %> + + + +<% if (showFragmentation) { %> + +<% } %> + + +<% for(HTableDescriptor htDesc : tables ) { %> + + +<% if (showFragmentation) { %> + +<% } %> + + +<% } %> + +

<%= tables.length %> table(s) in set.

+
TableFrag.Description
><%= htDesc.getNameAsString() %> <%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %><%= htDesc.toString() %>
+<% } %> + +

Region Servers

+<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %> +<% int totalRegions = 0; + int totalRequests = 0; +%> + + + +<% String[] serverNames = serverToServerInfos.keySet().toArray(new String[serverToServerInfos.size()]); + Arrays.sort(serverNames); + for (String serverName: serverNames) { + HServerInfo hsi = serverToServerInfos.get(serverName); + String hostname = hsi.getServerAddress().getHostname() + ":" + hsi.getInfoPort(); + String url = "http://" + hostname + "/"; + totalRegions += hsi.getLoad().getNumberOfRegions(); + totalRequests += hsi.getLoad().getNumberOfRequests() / interval; + long startCode = hsi.getStartCode(); +%> + +<% } %> + +
AddressStart CodeLoad
<%= hostname %><%= startCode %><%= hsi.getLoad().toString(interval) %>
Total: servers: <%= serverToServerInfos.size() %> requests=<%= totalRequests %>, regions=<%= totalRegions %>
+ +

Load is requests per second and count of regions loaded

+<% } %> + + diff --git src/main/resources/hbase-webapps/master/table.jsp src/main/resources/hbase-webapps/master/table.jsp new file mode 100644 index 0000000..095d6dd --- /dev/null +++ src/main/resources/hbase-webapps/master/table.jsp @@ -0,0 +1,208 @@ +<%@ page contentType="text/html;charset=UTF-8" + import="java.util.Map" + import="org.apache.hadoop.io.Writable" + import="org.apache.hadoop.conf.Configuration" + 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.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.util.Map" + import="org.apache.hadoop.hbase.HConstants"%><% + HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); + Configuration conf = master.getConfiguration(); + HBaseAdmin hbadmin = new HBaseAdmin(conf); + String tableName = request.getParameter("name"); + HTable table = new HTable(conf, tableName); + Map serverAddressToServerInfos = + master.getServerManager().getServerAddressToServerInfo(); + String tableHeader = "

Table Regions

"; + HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation(); + boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); + Map frags = null; + if (showFragmentation) { + frags = master.getTableFragmentation(); + } +%> + + + + + +<% + String action = request.getParameter("action"); + String key = request.getParameter("key"); + if ( action != null ) { +%> + + + + + +

Table action request accepted

+


+<% + if (action.equals("split")) { + if (key != null && key.length() > 0) { + Writable[] arr = new Writable[1]; + arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key)); + master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, arr); + } else { + master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, null); + } + %> Split request accepted. <% + } else if (action.equals("compact")) { + if (key != null && key.length() > 0) { + Writable[] arr = new Writable[1]; + arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key)); + master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, arr); + } else { + master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, null); + } + %> Compact request accepted. <% + } +%> +

Reload. + +<% +} else { +%> + +Table: <%= tableName %> + + + + +

Table: <%= tableName %>

+ +
+<% + if(tableName.equals(Bytes.toString(HConstants.ROOT_TABLE_NAME))) { +%> +<%= tableHeader %> +<% + int infoPort = serverAddressToServerInfos.get(rootLocation).getInfoPort(); + String url = "http://" + rootLocation.getHostname() + ":" + infoPort + "/"; +%> +
+ + + + + + +
NameRegion ServerEncoded NameStart KeyEnd Key
<%= tableName %><%= rootLocation.getHostname() %>:<%= rootLocation.getPort() %>--
+<% + } else if(tableName.equals(Bytes.toString(HConstants.META_TABLE_NAME))) { +%> +<%= tableHeader %> +<% + Map onlineRegions = master.getRegionManager().getOnlineMetaRegions(); + for (MetaRegion meta: onlineRegions.values()) { + int infoPort = serverAddressToServerInfos.get(meta.getServer()).getInfoPort(); + String url = "http://" + meta.getServer().getHostname() + ":" + infoPort + "/"; +%> + + <%= Bytes.toString(meta.getRegionName()) %> + <%= meta.getServer().getHostname().toString() + ":" + infoPort %> + -<%= Bytes.toString(meta.getStartKey()) %><%= Bytes.toString(meta.getEndKey()) %> + +<% } %> + +<%} else { + try { %> +

Table Attributes

+ + + + + + + + + + +<% 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%.
+<% + Map regions = table.getRegionsInfo(); + if(regions != null && regions.size() > 0) { %> +<%= tableHeader %> +<% + for(Map.Entry hriEntry : regions.entrySet()) { + + int infoPort = serverAddressToServerInfos.get( + hriEntry.getValue()).getInfoPort(); + + String urlRegionServer = + "http://" + hriEntry.getValue().getHostname().toString() + ":" + infoPort + "/"; +%> + + <%= Bytes.toStringBinary(hriEntry.getKey().getRegionName())%> + <%= hriEntry.getValue().getHostname().toString() + ":" + infoPort %> + <%= hriEntry.getKey().getEncodedName()%> <%= Bytes.toStringBinary(hriEntry.getKey().getStartKey())%> + <%= Bytes.toStringBinary(hriEntry.getKey().getEndKey())%> + +<% } %> + +<% } +} catch(Exception ex) { + ex.printStackTrace(); +} +} // end else +%> + +


+Actions: +

+

+ + + + + + + + + + + + + + + + + + + + + + +
+  Region Key (optional):This action will force a compaction of all + regions of the table, or, if a key is supplied, only the region containing the + given key.
 
+  Region Key (optional):This action will force a split of all eligible + regions of the table, or, if a key is supplied, only the region containing the + given key. An eligible region is one that does not contain any references to + other regions. Split requests for noneligible regions will be ignored.
+
+

+ +<% +} +%> + + + diff --git src/main/resources/hbase-webapps/master/zk.jsp src/main/resources/hbase-webapps/master/zk.jsp new file mode 100644 index 0000000..3a0c9f7 --- /dev/null +++ src/main/resources/hbase-webapps/master/zk.jsp @@ -0,0 +1,36 @@ +<%@ page contentType="text/html;charset=UTF-8" + import="java.io.IOException" + import="org.apache.hadoop.conf.Configuration" + import="org.apache.hadoop.hbase.client.HBaseAdmin" + import="org.apache.hadoop.hbase.client.HConnection" + import="org.apache.hadoop.hbase.HRegionInfo" + import="org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper" + import="org.apache.hadoop.hbase.HBaseConfiguration" + import="org.apache.hadoop.hbase.master.HMaster" + import="org.apache.hadoop.hbase.HConstants"%><% + HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); + Configuration conf = master.getConfiguration(); + HBaseAdmin hbadmin = new HBaseAdmin(conf); + HConnection connection = hbadmin.getConnection(); + ZooKeeperWrapper wrapper = connection.getZooKeeperWrapper(); +%> + + + + + +ZooKeeper Dump + + + + +

ZooKeeper Dump

+ +
+
+<%= wrapper.dump() %>
+
+ + + diff --git src/main/resources/hbase-webapps/regionserver/index.html src/main/resources/hbase-webapps/regionserver/index.html new file mode 100644 index 0000000..bdd3c6a --- /dev/null +++ src/main/resources/hbase-webapps/regionserver/index.html @@ -0,0 +1 @@ + diff --git src/main/resources/hbase-webapps/regionserver/regionserver.jsp src/main/resources/hbase-webapps/regionserver/regionserver.jsp new file mode 100644 index 0000000..c2752f5 --- /dev/null +++ src/main/resources/hbase-webapps/regionserver/regionserver.jsp @@ -0,0 +1,77 @@ +<%@ page contentType="text/html;charset=UTF-8" + import="java.util.*" + import="java.io.IOException" + import="org.apache.hadoop.io.Text" + import="org.apache.hadoop.hbase.regionserver.HRegionServer" + import="org.apache.hadoop.hbase.regionserver.HRegion" + import="org.apache.hadoop.hbase.regionserver.metrics.RegionServerMetrics" + import="org.apache.hadoop.hbase.util.Bytes" + import="org.apache.hadoop.hbase.HConstants" + import="org.apache.hadoop.hbase.HServerInfo" + import="org.apache.hadoop.hbase.HServerLoad" + import="org.apache.hadoop.hbase.HRegionInfo" %><% + HRegionServer regionServer = (HRegionServer)getServletContext().getAttribute(HRegionServer.REGIONSERVER); + HServerInfo serverInfo = null; + try { + serverInfo = regionServer.getHServerInfo(); + } catch (IOException e) { + e.printStackTrace(); + } + RegionServerMetrics metrics = regionServer.getMetrics(); + Collection onlineRegions = regionServer.getSortedOnlineRegionInfos(); + int interval = regionServer.getConfiguration().getInt("hbase.regionserver.msginterval", 3000)/1000; + +%> + + + +HBase Region Server: <%= serverInfo.getServerAddress().getHostname() %>:<%= serverInfo.getServerAddress().getPort() %> + + + + + +

Region Server: <%= serverInfo.getServerAddress().getHostname() %>:<%= serverInfo.getServerAddress().getPort() %>

+ +
+ +

Region Server Attributes

+ + + + + + +
Attribute NameValueDescription
HBase Version<%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %>HBase version and svn revision
HBase Compiled<%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %>When HBase version was compiled and by whom
Metrics<%= metrics.toString() %>RegionServer Metrics; file and heap sizes are in megabytes
Zookeeper Quorum<%= regionServer.getZooKeeperWrapper().getQuorumServers() %>Addresses of all registered ZK servers
+ +

Online Regions

+<% if (onlineRegions != null && onlineRegions.size() > 0) { %> + + +<% for (HRegionInfo r: onlineRegions) { + HServerLoad.RegionLoad load = regionServer.createRegionLoad(r.getRegionName()); + %> + + + + +<% } %> +
Region NameEncoded NameStart KeyEnd KeyMetrics
<%= r.getRegionNameAsString() %><%= r.getEncodedName() %><%= Bytes.toStringBinary(r.getStartKey()) %><%= Bytes.toStringBinary(r.getEndKey()) %><%= load.toString() %>
+

Region names are made of the containing table's name, a comma, +the start key, a comma, and a randomly generated region id. To illustrate, +the region named +domains,apache.org,5464829424211263407 is party to the table +domains, has an id of 5464829424211263407 and the first key +in the region is apache.org. The -ROOT- +and .META. 'tables' are internal sytem tables (or 'catalog' tables in db-speak). +The -ROOT- keeps a list of all regions in the .META. table. The .META. table +keeps a list of all regions in the system. The empty key is used to denote +table start and table end. A region with an empty start key is the first region in a table. +If region has both an empty start and an empty end key, its the only region in the table. See +HBase Home for further explication.

+<% } else { %> +

Not serving regions

+<% } %> + + diff --git src/main/resources/hbase-webapps/rest/META-INF/MANIFEST.MF src/main/resources/hbase-webapps/rest/META-INF/MANIFEST.MF new file mode 100644 index 0000000..e69de29 diff --git src/main/resources/hbase-webapps/rest/WEB-INF/web.xml src/main/resources/hbase-webapps/rest/WEB-INF/web.xml new file mode 100644 index 0000000..e69de29 diff --git src/main/resources/hbase-webapps/static/hbase.css src/main/resources/hbase-webapps/static/hbase.css new file mode 100644 index 0000000..16307ef --- /dev/null +++ src/main/resources/hbase-webapps/static/hbase.css @@ -0,0 +1,15 @@ +h1, h2, h3 { color: DarkSlateBlue } +table { border: thin solid DodgerBlue } +tr { border: thin solid DodgerBlue } +td { border: thin solid DodgerBlue } +th { border: thin solid DodgerBlue } +#logo {float: left;} +#logo img {border: none;} +#page_title {padding-top: 27px;} + +div.warning { + border: 1px solid #666; + background-color: #fcc; + font-size: 110%; + font-weight: bold; +} diff --git src/main/resources/hbase-webapps/static/hbase_logo_med.gif src/main/resources/hbase-webapps/static/hbase_logo_med.gif new file mode 100644 index 0000000..36d3e3c Binary files /dev/null and src/main/resources/hbase-webapps/static/hbase_logo_med.gif differ diff --git src/main/resources/hbase-webapps/static/images/minus.gif src/main/resources/hbase-webapps/static/images/minus.gif new file mode 100644 index 0000000..47fb7b7 Binary files /dev/null and src/main/resources/hbase-webapps/static/images/minus.gif differ diff --git src/main/resources/hbase-webapps/static/images/plus.gif src/main/resources/hbase-webapps/static/images/plus.gif new file mode 100644 index 0000000..6906621 Binary files /dev/null and src/main/resources/hbase-webapps/static/images/plus.gif differ diff --git src/main/resources/hbase-webapps/static/images/treeview-default-line.gif src/main/resources/hbase-webapps/static/images/treeview-default-line.gif new file mode 100644 index 0000000..37114d3 Binary files /dev/null and src/main/resources/hbase-webapps/static/images/treeview-default-line.gif differ diff --git src/main/resources/hbase-webapps/static/images/treeview-default.gif src/main/resources/hbase-webapps/static/images/treeview-default.gif new file mode 100644 index 0000000..a12ac52 Binary files /dev/null and src/main/resources/hbase-webapps/static/images/treeview-default.gif differ diff --git src/main/resources/webapps/master/index.html src/main/resources/webapps/master/index.html deleted file mode 100644 index 6d301ab..0000000 --- src/main/resources/webapps/master/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git src/main/resources/webapps/master/master.jsp src/main/resources/webapps/master/master.jsp deleted file mode 100644 index 0ccc976..0000000 --- src/main/resources/webapps/master/master.jsp +++ /dev/null @@ -1,151 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" - import="java.util.*" - import="org.apache.hadoop.conf.Configuration" - import="org.apache.hadoop.hbase.util.Bytes" - import="org.apache.hadoop.hbase.util.JvmVersion" - 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.HServerInfo" - import="org.apache.hadoop.hbase.HServerAddress" - import="org.apache.hadoop.hbase.HTableDescriptor" %><% - HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); - Configuration conf = master.getConfiguration(); - HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation(); - Map onlineRegions = master.getRegionManager().getOnlineMetaRegions(); - Map serverToServerInfos = - master.getServerManager().getServersToServerInfo(); - int interval = conf.getInt("hbase.regionserver.msginterval", 1000)/1000; - if (interval == 0) { - interval = 1; - } - boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); - Map frags = null; - if (showFragmentation) { - frags = master.getTableFragmentation(); - } -%> - - - -HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %> - - - - -

Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%>

- - -<% if (JvmVersion.isBadJvmVersion()) { %> -
- Your current JVM version <%= System.getProperty("java.version") %> is known to be - unstable with HBase. Please see the - HBase wiki - for details. -
-<% } %> - -
- -

Master Attributes

- - - - - - - - - -<% if (showFragmentation) { %> - -<% } %> - -
Attribute NameValueDescription
HBase Version<%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %>HBase version and svn revision
HBase Compiled<%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %>When HBase version was compiled and by whom
Hadoop Version<%= org.apache.hadoop.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.util.VersionInfo.getRevision() %>Hadoop version and svn revision
Hadoop Compiled<%= org.apache.hadoop.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.util.VersionInfo.getUser() %>When Hadoop version was compiled and by whom
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-.
Zookeeper Quorum<%= master.getZooKeeperWrapper().getQuorumServers() %>Addresses of all registered ZK servers. For more, see zk dump.
- -

Catalog Tables

-<% - if (rootLocation != null) { %> - - - -<% if (showFragmentation) { %> - -<% } %> - - - - -<% if (showFragmentation) { %> - -<% } %> - - -<% - if (onlineRegions != null && onlineRegions.size() > 0) { %> - - -<% if (showFragmentation) { %> - -<% } %> - - - -<% } %> -
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
-<%} %> - -

User Tables

-<% HTableDescriptor[] tables = new HBaseAdmin(conf).listTables(); - if(tables != null && tables.length > 0) { %> - - - -<% if (showFragmentation) { %> - -<% } %> - - -<% for(HTableDescriptor htDesc : tables ) { %> - - -<% if (showFragmentation) { %> - -<% } %> - - -<% } %> - -

<%= tables.length %> table(s) in set.

-
TableFrag.Description
><%= htDesc.getNameAsString() %> <%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %><%= htDesc.toString() %>
-<% } %> - -

Region Servers

-<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %> -<% int totalRegions = 0; - int totalRequests = 0; -%> - - - -<% String[] serverNames = serverToServerInfos.keySet().toArray(new String[serverToServerInfos.size()]); - Arrays.sort(serverNames); - for (String serverName: serverNames) { - HServerInfo hsi = serverToServerInfos.get(serverName); - String hostname = hsi.getServerAddress().getHostname() + ":" + hsi.getInfoPort(); - String url = "http://" + hostname + "/"; - totalRegions += hsi.getLoad().getNumberOfRegions(); - totalRequests += hsi.getLoad().getNumberOfRequests() / interval; - long startCode = hsi.getStartCode(); -%> - -<% } %> - -
AddressStart CodeLoad
<%= hostname %><%= startCode %><%= hsi.getLoad().toString(interval) %>
Total: servers: <%= serverToServerInfos.size() %> requests=<%= totalRequests %>, regions=<%= totalRegions %>
- -

Load is requests per second and count of regions loaded

-<% } %> - - diff --git src/main/resources/webapps/master/table.jsp src/main/resources/webapps/master/table.jsp deleted file mode 100644 index 095d6dd..0000000 --- src/main/resources/webapps/master/table.jsp +++ /dev/null @@ -1,208 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" - import="java.util.Map" - import="org.apache.hadoop.io.Writable" - import="org.apache.hadoop.conf.Configuration" - 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.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.util.Map" - import="org.apache.hadoop.hbase.HConstants"%><% - HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); - Configuration conf = master.getConfiguration(); - HBaseAdmin hbadmin = new HBaseAdmin(conf); - String tableName = request.getParameter("name"); - HTable table = new HTable(conf, tableName); - Map serverAddressToServerInfos = - master.getServerManager().getServerAddressToServerInfo(); - String tableHeader = "

Table Regions

"; - HServerAddress rootLocation = master.getRegionManager().getRootRegionLocation(); - boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false); - Map frags = null; - if (showFragmentation) { - frags = master.getTableFragmentation(); - } -%> - - - - - -<% - String action = request.getParameter("action"); - String key = request.getParameter("key"); - if ( action != null ) { -%> - - - - - -

Table action request accepted

-


-<% - if (action.equals("split")) { - if (key != null && key.length() > 0) { - Writable[] arr = new Writable[1]; - arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key)); - master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, arr); - } else { - master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_SPLIT, null); - } - %> Split request accepted. <% - } else if (action.equals("compact")) { - if (key != null && key.length() > 0) { - Writable[] arr = new Writable[1]; - arr[0] = new ImmutableBytesWritable(Bytes.toBytes(key)); - master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, arr); - } else { - master.modifyTable(Bytes.toBytes(tableName), HConstants.Modify.TABLE_COMPACT, null); - } - %> Compact request accepted. <% - } -%> -

Reload. - -<% -} else { -%> - -Table: <%= tableName %> - - - - -

Table: <%= tableName %>

- -
-<% - if(tableName.equals(Bytes.toString(HConstants.ROOT_TABLE_NAME))) { -%> -<%= tableHeader %> -<% - int infoPort = serverAddressToServerInfos.get(rootLocation).getInfoPort(); - String url = "http://" + rootLocation.getHostname() + ":" + infoPort + "/"; -%> -
- - - - - - -
NameRegion ServerEncoded NameStart KeyEnd Key
<%= tableName %><%= rootLocation.getHostname() %>:<%= rootLocation.getPort() %>--
-<% - } else if(tableName.equals(Bytes.toString(HConstants.META_TABLE_NAME))) { -%> -<%= tableHeader %> -<% - Map onlineRegions = master.getRegionManager().getOnlineMetaRegions(); - for (MetaRegion meta: onlineRegions.values()) { - int infoPort = serverAddressToServerInfos.get(meta.getServer()).getInfoPort(); - String url = "http://" + meta.getServer().getHostname() + ":" + infoPort + "/"; -%> - - <%= Bytes.toString(meta.getRegionName()) %> - <%= meta.getServer().getHostname().toString() + ":" + infoPort %> - -<%= Bytes.toString(meta.getStartKey()) %><%= Bytes.toString(meta.getEndKey()) %> - -<% } %> - -<%} else { - try { %> -

Table Attributes

- - - - - - - - - - -<% 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%.
-<% - Map regions = table.getRegionsInfo(); - if(regions != null && regions.size() > 0) { %> -<%= tableHeader %> -<% - for(Map.Entry hriEntry : regions.entrySet()) { - - int infoPort = serverAddressToServerInfos.get( - hriEntry.getValue()).getInfoPort(); - - String urlRegionServer = - "http://" + hriEntry.getValue().getHostname().toString() + ":" + infoPort + "/"; -%> - - <%= Bytes.toStringBinary(hriEntry.getKey().getRegionName())%> - <%= hriEntry.getValue().getHostname().toString() + ":" + infoPort %> - <%= hriEntry.getKey().getEncodedName()%> <%= Bytes.toStringBinary(hriEntry.getKey().getStartKey())%> - <%= Bytes.toStringBinary(hriEntry.getKey().getEndKey())%> - -<% } %> - -<% } -} catch(Exception ex) { - ex.printStackTrace(); -} -} // end else -%> - -


-Actions: -

-

- - - - - - - - - - - - - - - - - - - - - - -
-  Region Key (optional):This action will force a compaction of all - regions of the table, or, if a key is supplied, only the region containing the - given key.
 
-  Region Key (optional):This action will force a split of all eligible - regions of the table, or, if a key is supplied, only the region containing the - given key. An eligible region is one that does not contain any references to - other regions. Split requests for noneligible regions will be ignored.
-
-

- -<% -} -%> - - - diff --git src/main/resources/webapps/master/zk.jsp src/main/resources/webapps/master/zk.jsp deleted file mode 100644 index 3a0c9f7..0000000 --- src/main/resources/webapps/master/zk.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" - import="java.io.IOException" - import="org.apache.hadoop.conf.Configuration" - import="org.apache.hadoop.hbase.client.HBaseAdmin" - import="org.apache.hadoop.hbase.client.HConnection" - import="org.apache.hadoop.hbase.HRegionInfo" - import="org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper" - import="org.apache.hadoop.hbase.HBaseConfiguration" - import="org.apache.hadoop.hbase.master.HMaster" - import="org.apache.hadoop.hbase.HConstants"%><% - HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); - Configuration conf = master.getConfiguration(); - HBaseAdmin hbadmin = new HBaseAdmin(conf); - HConnection connection = hbadmin.getConnection(); - ZooKeeperWrapper wrapper = connection.getZooKeeperWrapper(); -%> - - - - - -ZooKeeper Dump - - - - -

ZooKeeper Dump

- -
-
-<%= wrapper.dump() %>
-
- - - diff --git src/main/resources/webapps/regionserver/index.html src/main/resources/webapps/regionserver/index.html deleted file mode 100644 index bdd3c6a..0000000 --- src/main/resources/webapps/regionserver/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git src/main/resources/webapps/regionserver/regionserver.jsp src/main/resources/webapps/regionserver/regionserver.jsp deleted file mode 100644 index c2752f5..0000000 --- src/main/resources/webapps/regionserver/regionserver.jsp +++ /dev/null @@ -1,77 +0,0 @@ -<%@ page contentType="text/html;charset=UTF-8" - import="java.util.*" - import="java.io.IOException" - import="org.apache.hadoop.io.Text" - import="org.apache.hadoop.hbase.regionserver.HRegionServer" - import="org.apache.hadoop.hbase.regionserver.HRegion" - import="org.apache.hadoop.hbase.regionserver.metrics.RegionServerMetrics" - import="org.apache.hadoop.hbase.util.Bytes" - import="org.apache.hadoop.hbase.HConstants" - import="org.apache.hadoop.hbase.HServerInfo" - import="org.apache.hadoop.hbase.HServerLoad" - import="org.apache.hadoop.hbase.HRegionInfo" %><% - HRegionServer regionServer = (HRegionServer)getServletContext().getAttribute(HRegionServer.REGIONSERVER); - HServerInfo serverInfo = null; - try { - serverInfo = regionServer.getHServerInfo(); - } catch (IOException e) { - e.printStackTrace(); - } - RegionServerMetrics metrics = regionServer.getMetrics(); - Collection onlineRegions = regionServer.getSortedOnlineRegionInfos(); - int interval = regionServer.getConfiguration().getInt("hbase.regionserver.msginterval", 3000)/1000; - -%> - - - -HBase Region Server: <%= serverInfo.getServerAddress().getHostname() %>:<%= serverInfo.getServerAddress().getPort() %> - - - - - -

Region Server: <%= serverInfo.getServerAddress().getHostname() %>:<%= serverInfo.getServerAddress().getPort() %>

- -
- -

Region Server Attributes

- - - - - - -
Attribute NameValueDescription
HBase Version<%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %>HBase version and svn revision
HBase Compiled<%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %>When HBase version was compiled and by whom
Metrics<%= metrics.toString() %>RegionServer Metrics; file and heap sizes are in megabytes
Zookeeper Quorum<%= regionServer.getZooKeeperWrapper().getQuorumServers() %>Addresses of all registered ZK servers
- -

Online Regions

-<% if (onlineRegions != null && onlineRegions.size() > 0) { %> - - -<% for (HRegionInfo r: onlineRegions) { - HServerLoad.RegionLoad load = regionServer.createRegionLoad(r.getRegionName()); - %> - - - - -<% } %> -
Region NameEncoded NameStart KeyEnd KeyMetrics
<%= r.getRegionNameAsString() %><%= r.getEncodedName() %><%= Bytes.toStringBinary(r.getStartKey()) %><%= Bytes.toStringBinary(r.getEndKey()) %><%= load.toString() %>
-

Region names are made of the containing table's name, a comma, -the start key, a comma, and a randomly generated region id. To illustrate, -the region named -domains,apache.org,5464829424211263407 is party to the table -domains, has an id of 5464829424211263407 and the first key -in the region is apache.org. The -ROOT- -and .META. 'tables' are internal sytem tables (or 'catalog' tables in db-speak). -The -ROOT- keeps a list of all regions in the .META. table. The .META. table -keeps a list of all regions in the system. The empty key is used to denote -table start and table end. A region with an empty start key is the first region in a table. -If region has both an empty start and an empty end key, its the only region in the table. See -HBase Home for further explication.

-<% } else { %> -

Not serving regions

-<% } %> - - diff --git src/main/resources/webapps/rest/META-INF/MANIFEST.MF src/main/resources/webapps/rest/META-INF/MANIFEST.MF deleted file mode 100644 index e69de29..0000000 diff --git src/main/resources/webapps/rest/WEB-INF/web.xml src/main/resources/webapps/rest/WEB-INF/web.xml deleted file mode 100644 index e69de29..0000000 diff --git src/main/resources/webapps/static/hbase.css src/main/resources/webapps/static/hbase.css deleted file mode 100644 index 16307ef..0000000 --- src/main/resources/webapps/static/hbase.css +++ /dev/null @@ -1,15 +0,0 @@ -h1, h2, h3 { color: DarkSlateBlue } -table { border: thin solid DodgerBlue } -tr { border: thin solid DodgerBlue } -td { border: thin solid DodgerBlue } -th { border: thin solid DodgerBlue } -#logo {float: left;} -#logo img {border: none;} -#page_title {padding-top: 27px;} - -div.warning { - border: 1px solid #666; - background-color: #fcc; - font-size: 110%; - font-weight: bold; -} diff --git src/main/resources/webapps/static/hbase_logo_med.gif src/main/resources/webapps/static/hbase_logo_med.gif deleted file mode 100644 index 36d3e3c..0000000 Binary files src/main/resources/webapps/static/hbase_logo_med.gif and /dev/null differ diff --git src/main/resources/webapps/static/images/minus.gif src/main/resources/webapps/static/images/minus.gif deleted file mode 100644 index 47fb7b7..0000000 Binary files src/main/resources/webapps/static/images/minus.gif and /dev/null differ diff --git src/main/resources/webapps/static/images/plus.gif src/main/resources/webapps/static/images/plus.gif deleted file mode 100644 index 6906621..0000000 Binary files src/main/resources/webapps/static/images/plus.gif and /dev/null differ diff --git src/main/resources/webapps/static/images/treeview-default-line.gif src/main/resources/webapps/static/images/treeview-default-line.gif deleted file mode 100644 index 37114d3..0000000 Binary files src/main/resources/webapps/static/images/treeview-default-line.gif and /dev/null differ diff --git src/main/resources/webapps/static/images/treeview-default.gif src/main/resources/webapps/static/images/treeview-default.gif deleted file mode 100644 index a12ac52..0000000 Binary files src/main/resources/webapps/static/images/treeview-default.gif and /dev/null differ