<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" import="org.apache.hadoop.io.Text" import="org.apache.hadoop.hbase.util.Bytes" 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.HBaseConfiguration" import="org.apache.hadoop.hbase.HTableDescriptor" %><% HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER); HBaseConfiguration conf = master.getConfiguration(); HServerAddress rootLocation = master.getRootRegionLocation(); Map onlineRegions = master.getOnlineMetaRegions(); Map serverToServerInfos = master.getServersToServerInfo(); int interval = conf.getInt("hbase.regionserver.msginterval", 3000)/1000; if (interval == 0) { interval = 1; } %> HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %>

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


Master 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
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
Filesystem<%= conf.get("fs.default.name") %>Filesystem HBase is running on
HBase Root Directory<%= master.getRootDir().toString() %>Location of HBase home directory
Load average<%= master.getAverageLoad() %>Average load across all region servers. Naive computation.

Catalog Tables

<% if (rootLocation != null) { %> <% if (onlineRegions != null && onlineRegions.size() > 0) { %> <% } %>
TableDescription
><%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %>The -ROOT- table holds references to all .META. regions.
><%= Bytes.toString(HConstants.META_TABLE_NAME) %>The .META. table holds references to all User Table regions
<%} %>

User Tables

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

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

TableDescription
><%= htDesc.getNameAsString() %> <%= 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 url = "http://" + hsi.getServerAddress().getHostname().toString() + ":" + hsi.getInfoPort() + "/"; String hostname = hsi.getServerAddress().getHostname() + ":" + hsi.getServerAddress().getPort(); 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

<% } %>