You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ns...@apache.org on 2011/10/11 04:09:57 UTC

svn commit: r1181457 - in /hbase/branches/0.89/src/main: java/org/apache/hadoop/hbase/master/RegionManager.java resources/hbase-webapps/master/master.jsp

Author: nspiegelberg
Date: Tue Oct 11 02:09:57 2011
New Revision: 1181457

URL: http://svn.apache.org/viewvc?rev=1181457&view=rev
Log:
remove incorrect region count in Master UI

Summary:
The master web ui displays the region count twice.

The first is an approx region count based on FS, and this is incorrect because
it (the TableDirFilter() logic) doesn't exclude the .oldlogs directory when
checking for Table directories.

The other region count (towards the bottom) is a count of the active regions
and more helpful.

For checking if regions on disk and online regions are consistent, we are
separately doing routine " hbck" calls.

This also slows master UI page load & healthcheck times. On prod cluster the
production cluster, it is reporting that we have 7000 odd regions on FS, while
in reality we just have 472 regions.]

Removing this code from master.jsp. I checked 90 (open source trunk) and this
has already been removed there.

[Separately, need to check why .oldlogs is growing and not getting cleaned up.]

Test Plan:
Run on dev cluster and make sure we no longer display this info.

DiffCamp Revision: 190079
Reviewed By: kranganathan
Reviewers: kranganathan
CC: kranganathan, hbase@lists
Revert Plan:
OK

Modified:
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
    hbase/branches/0.89/src/main/resources/hbase-webapps/master/master.jsp

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=1181457&r1=1181456&r2=1181457&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/master/RegionManager.java Tue Oct 11 02:09:57 2011
@@ -549,27 +549,6 @@ public class RegionManager {
   }
 
   /**
-   * @return the rough number of the regions on fs
-   * Note: this method simply counts the regions on fs by accumulating all the dirs
-   * in each table dir (${HBASE_ROOT}/$TABLE) and skipping logfiles, compaction dirs.
-   * @throws IOException
-   */
-  public int countRegionsOnFS() throws IOException {
-    int regions = 0;
-    FileStatus [] tableDirs =
-      this.master.getFileSystem().listStatus(this.master.getRootDir(), new TableDirFilter());
-    FileStatus[] regionDirs;
-    RegionDirFilter rdf = new RegionDirFilter();
-    for(FileStatus tabledir : tableDirs) {
-      if(tabledir.isDir()) {
-        regionDirs = this.master.getFileSystem().listStatus(tabledir.getPath(), rdf);
-        regions += regionDirs.length;
-      }
-    }
-    return regions;
-  }
-
-  /**
    * @return Read-only map of online regions.
    */
   public Map<byte [], MetaRegion> getOnlineMetaRegions() {

Modified: hbase/branches/0.89/src/main/resources/hbase-webapps/master/master.jsp
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/resources/hbase-webapps/master/master.jsp?rev=1181457&r1=1181456&r2=1181457&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/resources/hbase-webapps/master/master.jsp (original)
+++ hbase/branches/0.89/src/main/resources/hbase-webapps/master/master.jsp Tue Oct 11 02:09:57 2011
@@ -68,7 +68,6 @@
 <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.getServerManager().getAverageLoad() %></td><td>Average number of regions per regionserver. Naive computation.</td></tr>
-<tr><td>Regions On FS</td><td><%= master.getRegionManager().countRegionsOnFS() %></td><td>Number of regions on FileSystem. Rough count.</td></tr>
 <%  if (showFragmentation) { %>
         <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>
 <%  } %>