You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2010/04/08 23:51:50 UTC
svn commit: r932136 - in /hadoop/hbase/branches/0.20_pre_durability: ./
src/java/org/apache/hadoop/hbase/master/
src/java/org/apache/hadoop/hbase/regionserver/
src/java/org/apache/hadoop/hbase/regionserver/metrics/
src/java/org/apache/hadoop/hbase/util...
Author: jdcryans
Date: Thu Apr 8 21:51:50 2010
New Revision: 932136
URL: http://svn.apache.org/viewvc?rev=932136&view=rev
Log:
HBASE-2165 Improve fragmentation display and implementation
Modified:
hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt
hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/master/HMaster.java
hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/util/FSUtils.java
hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/master.jsp
hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/table.jsp
Modified: hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20_pre_durability/CHANGES.txt Thu Apr 8 21:51:50 2010
@@ -2,6 +2,7 @@ HBase Change Log
Release 0.20.4 - Unreleased
INCOMPATIBLE CHANGES
+ HBASE-2165 Improve fragmentation display and implementation
BUG FIXES
HBASE-2173 New idx javadoc not included with the rest
Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/master/HMaster.java Thu Apr 8 21:51:50 2010
@@ -159,9 +159,6 @@ public class HMaster extends Thread impl
private MasterMetrics metrics;
- private long lastFragmentationQuery = -1L;
- private Map<String, Integer> fragmentation = null;
-
/**
* Build the HMaster out of a raw configuration item.
* @param conf configuration
@@ -1181,17 +1178,6 @@ public class HMaster extends Thread impl
}
}
- public Map<String, Integer> getTableFragmentation() throws IOException {
- long now = System.currentTimeMillis();
- // only check every two minutes by default
- int check = this.conf.getInt("hbase.master.fragmentation.check.frequency", 2 * 60 * 1000);
- if (lastFragmentationQuery == -1 || now - lastFragmentationQuery > check) {
- fragmentation = FSUtils.getTableFragmentation(this);
- lastFragmentationQuery = now;
- }
- return fragmentation;
- }
-
/*
* Main program
*/
Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java Thu Apr 8 21:51:50 2010
@@ -234,14 +234,4 @@ class CompactSplitThread extends Thread
this.interrupt();
}
}
-
- /**
- * Returns the current size of the queue containing regions that are
- * processed.
- *
- * @return The current size of the regions queue.
- */
- public int getCompactionQueueSize() {
- return compactionQueue.size();
- }
}
\ No newline at end of file
Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Thu Apr 8 21:51:50 2010
@@ -1106,8 +1106,6 @@ public class HRegionServer implements HC
this.metrics.storefiles.set(storefiles);
this.metrics.memstoreSizeMB.set((int)(memstoreSize/(1024*1024)));
this.metrics.storefileIndexSizeMB.set((int)(storefileIndexSize/(1024*1024)));
- this.metrics.compactionQueueSize.set(compactSplitThread.
- getCompactionQueueSize());
LruBlockCache lruBlockCache = (LruBlockCache)StoreFile.getBlockCache(conf);
if (lruBlockCache != null) {
Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java Thu Apr 8 21:51:50 2010
@@ -108,12 +108,6 @@ public class RegionServerMetrics impleme
new MetricsIntValue("memstoreSizeMB", registry);
/**
- * Size of the compaction queue.
- */
- public final MetricsIntValue compactionQueueSize =
- new MetricsIntValue("compactionQueueSize", registry);
-
- /**
* filesystem read latency
*/
public final MetricsTimeVaryingRate fsReadLatency =
@@ -164,7 +158,7 @@ public class RegionServerMetrics impleme
this.memstoreSizeMB.pushMetric(this.metricsRecord);
this.regions.pushMetric(this.metricsRecord);
this.requests.pushMetric(this.metricsRecord);
- this.compactionQueueSize.pushMetric(this.metricsRecord);
+
this.blockCacheSize.pushMetric(this.metricsRecord);
this.blockCacheFree.pushMetric(this.metricsRecord);
this.blockCacheCount.pushMetric(this.metricsRecord);
@@ -237,8 +231,6 @@ public class RegionServerMetrics impleme
Integer.valueOf(this.storefileIndexSizeMB.get()));
sb = Strings.appendKeyValue(sb, "memstoreSize",
Integer.valueOf(this.memstoreSizeMB.get()));
- sb = Strings.appendKeyValue(sb, "compactionQueueSize",
- Integer.valueOf(this.compactionQueueSize.get()));
// Duplicate from jvmmetrics because metrics are private there so
// inaccessible.
MemoryUsage memory =
Modified: hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/util/FSUtils.java (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/java/org/apache/hadoop/hbase/util/FSUtils.java Thu Apr 8 21:51:50 2010
@@ -24,8 +24,6 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,7 +37,6 @@ import org.apache.hadoop.hbase.HBaseConf
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
-import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.hdfs.protocol.FSConstants;
@@ -371,98 +368,6 @@ public class FSUtils {
}
/**
- * Returns the total overall fragmentation percentage. Includes .META. and
- * -ROOT- as well.
- *
- * @param master The master defining the HBase root and file system.
- * @return A map for each table and its percentage.
- * @throws IOException When scanning the directory fails.
- */
- public static int getTotalTableFragmentation(final HMaster master)
- throws IOException {
- Map<String, Integer> map = getTableFragmentation(master);
- return map != null && map.size() > 0 ? map.get("-TOTAL-").intValue() : -1;
- }
-
- /**
- * Runs through the HBase rootdir and checks how many stores for each table
- * have more than one file in them. Checks -ROOT- and .META. too. The total
- * percentage across all tables is stored under the special key "-TOTAL-".
- *
- * @param master The master defining the HBase root and file system.
- * @return A map for each table and its percentage.
- * @throws IOException When scanning the directory fails.
- */
- public static Map<String, Integer> getTableFragmentation(
- final HMaster master)
- throws IOException {
- Path path = master.getRootDir();
- // since HMaster.getFileSystem() is package private
- FileSystem fs = path.getFileSystem(master.getConfiguration());
- return getTableFragmentation(fs, path);
- }
-
- /**
- * Runs through the HBase rootdir and checks how many stores for each table
- * have more than one file in them. Checks -ROOT- and .META. too. The total
- * percentage across all tables is stored under the special key "-TOTAL-".
- *
- * @param fs The file system to use.
- * @param hbaseRootDir The root directory to scan.
- * @return A map for each table and its percentage.
- * @throws IOException When scanning the directory fails.
- */
- public static Map<String, Integer> getTableFragmentation(
- final FileSystem fs, final Path hbaseRootDir)
- throws IOException {
- Map<String, Integer> frags = new HashMap<String, Integer>();
- int cfCountTotal = 0;
- int cfFragTotal = 0;
- DirFilter df = new DirFilter(fs);
- // presumes any directory under hbase.rootdir is a table
- FileStatus [] tableDirs = fs.listStatus(hbaseRootDir, df);
- for (int i = 0; i < tableDirs.length; i++) {
- // Skip the .log directory. All others should be tables. Inside a table,
- // there are compaction.dir directories to skip. Otherwise, all else
- // should be regions. Then in each region, should only be family
- // directories. Under each of these, should be one file only.
- Path d = tableDirs[i].getPath();
- if (d.getName().equals(HConstants.HREGION_LOGDIR_NAME)) {
- continue;
- }
- int cfCount = 0;
- int cfFrag = 0;
- FileStatus [] regionDirs = fs.listStatus(d, df);
- for (int j = 0; j < regionDirs.length; j++) {
- Path dd = regionDirs[j].getPath();
- if (dd.getName().equals(HConstants.HREGION_COMPACTIONDIR_NAME)) {
- continue;
- }
- // else its a region name, now look in region for families
- FileStatus [] familyDirs = fs.listStatus(dd, df);
- for (int k = 0; k < familyDirs.length; k++) {
- cfCount++;
- cfCountTotal++;
- Path family = familyDirs[k].getPath();
- // now in family make sure only one file
- FileStatus [] familyStatus = fs.listStatus(family);
- if (familyStatus.length > 1) {
- cfFrag++;
- cfFragTotal++;
- }
- }
- }
- // compute percentage per table and store in result list
- frags.put(d.getName(), new Integer(
- Math.round((float) cfFrag / cfCount * 100)));
- }
- // set overall percentage for all tables
- frags.put("-TOTAL-", new Integer(
- Math.round((float) cfFragTotal / cfCountTotal * 100)));
- return frags;
- }
-
- /**
* Expects to find -ROOT- directory.
* @param fs
* @param hbaseRootDir
Modified: hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/master.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/master.jsp?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/master.jsp (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/master.jsp Thu Apr 8 21:51:50 2010
@@ -1,119 +1,106 @@
-<%@ page contentType="text/html;charset=UTF-8"
- import="java.util.*"
- import="java.net.URLEncoder"
- import="org.apache.hadoop.io.Text"
- import="org.apache.hadoop.hbase.util.Bytes"
- 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);
- HBaseConfiguration conf = master.getConfiguration();
- HServerAddress rootLocation = master.getRootRegionLocation();
- Map<byte [], MetaRegion> onlineRegions = master.getOnlineMetaRegions();
- Map<String, HServerInfo> serverToServerInfos =
- master.getServersToServerInfo();
- int interval = conf.getInt("hbase.regionserver.msginterval", 1000)/1000;
- if (interval == 0) {
- interval = 1;
- }
- Map<String, Integer> frags = master.getTableFragmentation();
-%><?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-<title>HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %></title>
-<link rel="stylesheet" type="text/css" href="/static/hbase.css" />
-</head>
-<body>
-
-<a id="logo" href="http://wiki.apache.org/lucene-hadoop/Hbase"><img src="/static/hbase_logo_med.gif" alt="HBase Logo" title="HBase Logo" /></a>
-<h1 id="page_title">Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%></h1>
-<p id="links_menu"><a href="/logs/">Local logs</a>, <a href="/stacks">Thread Dump</a>, <a href="/logLevel">Log Level</a></p>
-<hr id="head_rule" />
-
-<h2>Master Attributes</h2>
-<table>
-<tr><th>Attribute Name</th><th>Value</th><th>Description</th></tr>
-<tr><td>HBase Version</td><td><%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %></td><td>HBase version and svn revision</td></tr>
-<tr><td>HBase Compiled</td><td><%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %></td><td>When HBase version was compiled and by whom</td></tr>
-<tr><td>Hadoop Version</td><td><%= org.apache.hadoop.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.util.VersionInfo.getRevision() %></td><td>Hadoop version and svn revision</td></tr>
-<tr><td>Hadoop Compiled</td><td><%= org.apache.hadoop.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.util.VersionInfo.getUser() %></td><td>When Hadoop version was compiled and by whom</td></tr>
-<tr><td>HBase Root Directory</td><td><%= master.getRootDir().toString() %></td><td>Location of HBase home directory</td></tr>
-<tr><td>Load average</td><td><%= master.getAverageLoad() %></td><td>Average number of regions per regionserver. Naive computation.</td></tr>
-<tr><td>Regions On FS</td><td><%= master.countRegionsOnFS() %></td><td>Number of regions on FileSystem. Rough count.</td></tr>
-<tr><td>Fragmentation</td><td><%= frags.get("-TOTAL-") != null ? frags.get("-TOTAL-").intValue() + "%" : "n/a" %></td><td>Overall fragmentation of all tables, including .META. and -ROOT-.</td></tr>
-<tr><td>Zookeeper Quorum</td><td><%= master.getZooKeeperWrapper().getQuorumServers() %></td><td>Addresses of all registered ZK servers. For more, see <a href="/zk.jsp">zk dump</a>.</td></tr>
-</table>
-
-<h2>Catalog Tables</h2>
-<%
- if (rootLocation != null) { %>
-<table>
-<tr><th>Table</th><th title="Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.">Frag.</th><th>Description</th></tr>
-<tr><td><a href="/table.jsp?name=<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %>"><%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %></a></td>
-<td align="center"><%= frags.get("-ROOT-") != null ? frags.get("-ROOT-").intValue() + "%" : "n/a" %></td>
-<td>The -ROOT- table holds references to all .META. regions.</td>
-</tr>
-<%
- if (onlineRegions != null && onlineRegions.size() > 0) { %>
-<tr><td><a href="/table.jsp?name=<%= Bytes.toString(HConstants.META_TABLE_NAME) %>"><%= Bytes.toString(HConstants.META_TABLE_NAME) %></a></td>
-<td align="center"><%= frags.get(".META.") != null ? frags.get(".META.").intValue() + "%" : "n/a" %></td>
-<td>The .META. table holds references to all User Table regions</td>
-</tr>
-
-<% } %>
-</table>
-<%} %>
-
-<h2>User Tables</h2>
-<% HTableDescriptor[] tables = new HBaseAdmin(conf).listTables();
- if(tables != null && tables.length > 0) { %>
-<table>
-<tr><th>Table</th><th title="Fragmentation - Will be 0% after a major compaction and fluctuate during normal usage.">Frag.</th><th>Description</th></tr>
-<% for(HTableDescriptor htDesc : tables ) { %>
-<tr><td><a href=/table.jsp?name=<%= htDesc.getNameAsString() %>><%= htDesc.getNameAsString() %></a> </td>
-<td align="center"><%= frags.get(htDesc.getNameAsString()) != null ? frags.get(htDesc.getNameAsString()).intValue() + "%" : "n/a" %></td>
-<td><%= htDesc.toString() %></td>
-</tr>
-<% } %>
-
-<p> <%= tables.length %> table(s) in set.</p>
-</table>
-<% } %>
-
-<h2>Region Servers</h2>
-<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %>
-<% int totalRegions = 0;
- int totalRequests = 0;
-%>
-
-<table>
-<tr><th rowspan="<%= serverToServerInfos.size() + 1%>"></th><th>Address</th><th>Start Code</th><th>Load</th></tr>
-<% 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();
-%>
-<tr><td><a href="<%= url %>"><%= hostname %></a></td><td><%= startCode %></td><td><%= hsi.getLoad().toString(interval) %></td></tr>
-<% } %>
-<tr><th>Total: </th><td>servers: <%= serverToServerInfos.size() %></td><td> </td><td>requests=<%= totalRequests %>, regions=<%= totalRegions %></td></tr>
-</table>
-
-<p>Load is requests per second and count of regions loaded</p>
-<% } %>
-</body>
-</html>
+<%@ page contentType="text/html;charset=UTF-8"
+ import="java.util.*"
+ import="java.net.URLEncoder"
+ 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.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);
+ HBaseConfiguration conf = master.getConfiguration();
+ HServerAddress rootLocation = master.getRootRegionLocation();
+ Map<byte [], MetaRegion> onlineRegions = master.getOnlineMetaRegions();
+ Map<String, HServerInfo> serverToServerInfos =
+ master.getServersToServerInfo();
+ int interval = conf.getInt("hbase.regionserver.msginterval", 1000)/1000;
+ if (interval == 0) {
+ interval = 1;
+ }
+%><?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+<title>HBase Master: <%= master.getMasterAddress().getHostname()%>:<%= master.getMasterAddress().getPort() %></title>
+<link rel="stylesheet" type="text/css" href="/static/hbase.css" />
+</head>
+<body>
+
+<a id="logo" href="http://wiki.apache.org/lucene-hadoop/Hbase"><img src="/static/hbase_logo_med.gif" alt="HBase Logo" title="HBase Logo" /></a>
+<h1 id="page_title">Master: <%=master.getMasterAddress().getHostname()%>:<%=master.getMasterAddress().getPort()%></h1>
+<p id="links_menu"><a href="/logs/">Local logs</a>, <a href="/stacks">Thread Dump</a>, <a href="/logLevel">Log Level</a></p>
+<hr id="head_rule" />
+
+<h2>Master Attributes</h2>
+<table>
+<tr><th>Attribute Name</th><th>Value</th><th>Description</th></tr>
+<tr><td>HBase Version</td><td><%= org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.hbase.util.VersionInfo.getRevision() %></td><td>HBase version and svn revision</td></tr>
+<tr><td>HBase Compiled</td><td><%= org.apache.hadoop.hbase.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.hbase.util.VersionInfo.getUser() %></td><td>When HBase version was compiled and by whom</td></tr>
+<tr><td>Hadoop Version</td><td><%= org.apache.hadoop.util.VersionInfo.getVersion() %>, r<%= org.apache.hadoop.util.VersionInfo.getRevision() %></td><td>Hadoop version and svn revision</td></tr>
+<tr><td>Hadoop Compiled</td><td><%= org.apache.hadoop.util.VersionInfo.getDate() %>, <%= org.apache.hadoop.util.VersionInfo.getUser() %></td><td>When Hadoop version was compiled and by whom</td></tr>
+<tr><td>HBase Root Directory</td><td><%= master.getRootDir().toString() %></td><td>Location of HBase home directory</td></tr>
+<tr><td>Load average</td><td><%= master.getAverageLoad() %></td><td>Average number of regions per regionserver. Naive computation.</td></tr>
+<tr><td>Regions On FS</td><td><%= master.countRegionsOnFS() %></td><td>Number of regions on FileSystem. Rough count.</td></tr>
+<tr><td>Zookeeper Quorum</td><td><%= master.getZooKeeperWrapper().getQuorumServers() %></td><td>Addresses of all registered ZK servers. For more, see <a href="/zk.jsp">zk dump</a>.</td></tr>
+</table>
+
+<h2>Catalog Tables</h2>
+<%
+ if (rootLocation != null) { %>
+<table>
+<tr><th>Table</th><th>Description</th></tr>
+<tr><td><a href="/table.jsp?name=<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %>"><%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %></a></td><td>The -ROOT- table holds references to all .META. regions.</td></tr>
+<%
+ if (onlineRegions != null && onlineRegions.size() > 0) { %>
+<tr><td><a href="/table.jsp?name=<%= Bytes.toString(HConstants.META_TABLE_NAME) %>"><%= Bytes.toString(HConstants.META_TABLE_NAME) %></a></td><td>The .META. table holds references to all User Table regions</td></tr>
+<% } %>
+</table>
+<%} %>
+
+<h2>User Tables</h2>
+<% HTableDescriptor[] tables = new HBaseAdmin(conf).listTables();
+ if(tables != null && tables.length > 0) { %>
+<table>
+<tr><th>Table</th><th>Description</th></tr>
+<% for(HTableDescriptor htDesc : tables ) { %>
+<tr><td><a href=/table.jsp?name=<%= htDesc.getNameAsString() %>><%= htDesc.getNameAsString() %></a> </td><td><%= htDesc.toString() %></td></tr>
+<% } %>
+
+<p> <%= tables.length %> table(s) in set.</p>
+</table>
+<% } %>
+
+<h2>Region Servers</h2>
+<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %>
+<% int totalRegions = 0;
+ int totalRequests = 0;
+%>
+
+<table>
+<tr><th rowspan="<%= serverToServerInfos.size() + 1%>"></th><th>Address</th><th>Start Code</th><th>Load</th></tr>
+<% 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();
+%>
+<tr><td><a href="<%= url %>"><%= hostname %></a></td><td><%= startCode %></td><td><%= hsi.getLoad().toString(interval) %></td></tr>
+<% } %>
+<tr><th>Total: </th><td>servers: <%= serverToServerInfos.size() %></td><td> </td><td>requests=<%= totalRequests %>, regions=<%= totalRegions %></td></tr>
+</table>
+
+<p>Load is requests per second and count of regions loaded</p>
+<% } %>
+</body>
+</html>
Modified: hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/table.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/table.jsp?rev=932136&r1=932135&r2=932136&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/table.jsp (original)
+++ hadoop/hbase/branches/0.20_pre_durability/src/webapps/master/table.jsp Thu Apr 8 21:51:50 2010
@@ -27,7 +27,6 @@
master.getServerAddressToServerInfo();
String tableHeader = "<h2>Table Regions</h2><table><tr><th>Name</th><th>Region Server</th><th>Encoded Name</th><th>Start Key</th><th>End Key</th></tr>";
HServerAddress rootLocation = master.getRootRegionLocation();
- Map<String, Integer> frags = master.getTableFragmentation();
%>
<?xml version="1.0" encoding="UTF-8" ?>
@@ -121,7 +120,6 @@
<table>
<tr><th>Attribute Name</th><th>Value</th><th>Description</th></tr>
<tr><td>Enabled</td><td><%= hbadmin.isTableEnabled(table.getTableName()) %></td><td>Is the table enabled</td></tr>
- <tr><td>Fragmentation</td><td><%= frags.get(tableName) != null ? frags.get(tableName).intValue() + "%" : "n/a" %></td><td>How fragmented is the table. After a major compaction it is 0%.</td></tr>
</table>
<%
Map<HRegionInfo, HServerAddress> regions = table.getRegionsInfo();