hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r816824 - in /hadoop/hbase/branches/0.20: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/master/ src/java/org/apache/hadoop/hbase/regionserver/ src/test/org/apache/hadoop/hbase/io/ src/webapps/master/
Date Sat, 19 Sep 2009 00:14:16 GMT
Author: jdcryans
Date: Sat Sep 19 00:14:15 2009
New Revision: 816824

URL: http://svn.apache.org/viewvc?rev=816824&view=rev
Log:
HBASE-1854  Remove the Region Historian

Removed:
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/RegionHistorian.java
    hadoop/hbase/branches/0.20/src/webapps/master/regionhistorian.jsp
Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/io/TestHeapSize.java
    hadoop/hbase/branches/0.20/src/webapps/master/table.jsp

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Sat Sep 19 00:14:15 2009
@@ -31,6 +31,7 @@
    HBASE-1574  Client and server APIs to do batch deletes
    HBASE-1833  hfile.main fixes
    HBASE-1684  Backup (Export/Import) contrib tool for 0.20
+   HBASE-1854  Remove the Region Historian
 
 Release 0.20.0 - Tue Sep  8 12:48:41 PDT 2009
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/HMaster.java Sat Sep
19 00:14:15 2009
@@ -55,7 +55,6 @@
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.LocalHBaseCluster;
 import org.apache.hadoop.hbase.MasterNotRunningException;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.TableExistsException;
 import org.apache.hadoop.hbase.client.Get;
@@ -438,7 +437,6 @@
     /*
      * Clean up and close up shop
      */
-    RegionHistorian.getInstance().offline();
     if (this.infoServer != null) {
       LOG.info("Stopping infoServer");
       try {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
Sat Sep 19 00:14:15 2009
@@ -24,7 +24,6 @@
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.HServerInfo;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -66,8 +65,6 @@
       // back on the toDoQueue
       return true;
     }
-
-    final RegionHistorian historian = RegionHistorian.getInstance();
     HRegionInterface server =
         master.connection.getHRegionConnection(getMetaRegion().getServer());
     LOG.info(regionInfo.getRegionNameAsString() + " open on " +
@@ -83,13 +80,6 @@
     LOG.info("Updated row " + regionInfo.getRegionNameAsString() +
       " in region " + Bytes.toString(metaRegionName) + " with startcode=" +
       serverInfo.getStartCode() + ", server=" + serverInfo.getServerAddress());
-    if (!historian.isOnline()) {
-      // This is safest place to do the onlining of the historian in
-      // the master.  When we get to here, we know there is a .META.
-      // for the historian to go against.
-      historian.online(this.master.getConfiguration());
-    }
-    historian.addRegionOpen(regionInfo, serverInfo.getServerAddress());
     synchronized (master.regionManager) {
       if (isMetaTable) {
         // It's a meta region.

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/RegionManager.java
Sat Sep 19 00:14:15 2009
@@ -48,7 +48,6 @@
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.HServerInfo;
 import org.apache.hadoop.hbase.HServerLoad;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.regionserver.HRegion;
@@ -105,7 +104,6 @@
   private final int maxAssignInOneGo;
 
   final HMaster master;
-  private final RegionHistorian historian;
   private final LoadBalancer loadBalancer;
 
   /** Set of regions to split. */
@@ -137,7 +135,6 @@
     HBaseConfiguration conf = master.getConfiguration();
 
     this.master = master;
-    this.historian = RegionHistorian.getInstance();
     this.maxAssignInOneGo = conf.getInt("hbase.regions.percheckin", 10);
     this.loadBalancer = new LoadBalancer(conf);
 
@@ -325,31 +322,6 @@
     rs.setPendingOpen(sinfo.getServerName());
     this.regionsInTransition.put(regionName, rs);
 
-    // Since the meta/root may not be available at this moment, we
-    try {
-      // TODO move this into an actual class, and use the RetryableMetaOperation
-      master.toDoQueue.put(
-        new RegionServerOperation(master) {
-            protected boolean process() throws IOException {
-              if (!rootAvailable() || !metaTableAvailable()) {
-                return true; // the two above us will put us on the delayed queue
-              }
-              
-              // this call can cause problems if meta/root is offline!
-              historian.addRegionAssignment(rs.getRegionInfo(),
-                  sinfo.getServerName());
-              return true;
-            }
-          public String toString() {
-            return "RegionAssignmentHistorian from " + sinfo.getServerName();
-          }
-        }
-      );
-    } catch (InterruptedException e) {
-      // ignore and don't write the region historian
-      LOG.info("doRegionAssignment: Couldn't queue the region historian due to exception:
" + e);
-    }
-
     returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, rs.getRegionInfo()));
   }
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Sat Sep 19 00:14:15 2009
@@ -47,7 +47,6 @@
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.NotServingRegionException;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
@@ -113,7 +112,6 @@
    * Once set, it is never cleared.
    */
   final AtomicBoolean closing = new AtomicBoolean(false);
-  private final RegionHistorian historian;
 
   //////////////////////////////////////////////////////////////////////////////
   // Members
@@ -221,7 +219,6 @@
     this.conf = null;
     this.flushListener = null;
     this.fs = null;
-    this.historian = null;
     this.memstoreFlushSize = 0;
     this.log = null;
     this.regionCompactionDir = null;
@@ -262,7 +259,6 @@
     this.threadWakeFrequency = conf.getLong(THREAD_WAKE_FREQUENCY, 10 * 1000);
     String encodedNameStr = Integer.toString(this.regionInfo.getEncodedName());
     this.regiondir = new Path(basedir, encodedNameStr);
-    this.historian = RegionHistorian.getInstance();
     if (LOG.isDebugEnabled()) {
       // Write out region name as string and its encoded name.
       LOG.debug("Opening region " + this + ", encoded=" +
@@ -669,8 +665,6 @@
         LOG.debug("Cleaned up " + FSUtils.getPath(splits) + " " + deleted);
       }
       HRegion regions[] = new HRegion [] {regionA, regionB};
-      this.historian.addRegionSplit(this.regionInfo,
-        regionA.getRegionInfo(), regionB.getRegionInfo());
       return regions;
     }
   }
@@ -786,7 +780,6 @@
         String timeTaken = StringUtils.formatTimeDiff(System.currentTimeMillis(), 
             startTime);
         LOG.info("compaction completed on region " + this + " in " + timeTaken);
-        this.historian.addRegionCompaction(regionInfo, timeTaken);
       } finally {
         synchronized (writestate) {
           writestate.compacting = false;
@@ -971,14 +964,10 @@
     
     if (LOG.isDebugEnabled()) {
       long now = System.currentTimeMillis();
-      String timeTaken = StringUtils.formatTimeDiff(now, startTime);
       LOG.debug("Finished memstore flush of ~" +
         StringUtils.humanReadableInt(currentMemStoreSize) + " for region " +
         this + " in " + (now - startTime) + "ms, sequence id=" + sequenceId +
         ", compaction requested=" + compactionRequested);
-      if (!regionInfo.isMetaRegion()) {
-        this.historian.addRegionFlush(regionInfo, timeTaken);
-      }
     }
     return compactionRequested;
   }
@@ -1841,10 +1830,6 @@
     Path regionDir = HRegion.getRegionDir(tableDir, info.getEncodedName());
     FileSystem fs = FileSystem.get(conf);
     fs.mkdirs(regionDir);
-    // Note in historian the creation of new region.
-    if (!info.isMetaRegion()) {
-      RegionHistorian.getInstance().addRegionCreation(info);
-    }
     HRegion region = new HRegion(tableDir,
       new HLog(fs, new Path(regionDir, HREGION_LOGDIR_NAME), conf, null),
       fs, conf, info, null);
@@ -2388,7 +2373,7 @@
 
   public static final long FIXED_OVERHEAD = ClassSize.align(
       (3 * Bytes.SIZEOF_LONG) + (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN +
-      (20 * ClassSize.REFERENCE) + ClassSize.OBJECT);
+      (19 * ClassSize.REFERENCE) + ClassSize.OBJECT);
   
   public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
       ClassSize.OBJECT + (2 * ClassSize.ATOMIC_BOOLEAN) + 
@@ -2397,7 +2382,6 @@
       (16 * ClassSize.CONCURRENT_HASHMAP_ENTRY) + 
       (16 * ClassSize.CONCURRENT_HASHMAP_SEGMENT) +
       ClassSize.CONCURRENT_SKIPLISTMAP + ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY +
-      RegionHistorian.FIXED_OVERHEAD + HLog.FIXED_OVERHEAD +
       ClassSize.align(ClassSize.OBJECT + (5 * Bytes.SIZEOF_BOOLEAN)) +
       (3 * ClassSize.REENTRANT_LOCK));
   

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Sat Sep 19 00:14:15 2009
@@ -71,7 +71,6 @@
 import org.apache.hadoop.hbase.Leases;
 import org.apache.hadoop.hbase.LocalHBaseCluster;
 import org.apache.hadoop.hbase.NotServingRegionException;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.UnknownRowLockException;
 import org.apache.hadoop.hbase.UnknownScannerException;
@@ -601,7 +600,6 @@
         abort();
       }
     }
-    RegionHistorian.getInstance().offline();
     this.leases.closeAfterLeasesExpire();
     this.worker.stop();
     this.server.stop();
@@ -1558,11 +1556,6 @@
   }
   
   void openRegion(final HRegionInfo regionInfo) {
-    // If historian is not online and this is not a meta region, online it.
-    if (!regionInfo.isMetaRegion() &&
-        !RegionHistorian.getInstance().isOnline()) {
-      RegionHistorian.getInstance().online(this.conf);
-    }
     Integer mapKey = Bytes.mapKey(regionInfo.getRegionName());
     HRegion region = this.onlineRegions.get(mapKey);
     if (region == null) {

Modified: hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/io/TestHeapSize.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/io/TestHeapSize.java?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/io/TestHeapSize.java (original)
+++ hadoop/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/io/TestHeapSize.java Sat Sep
19 00:14:15 2009
@@ -16,7 +16,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.RegionHistorian;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.io.hfile.CachedBlock;
@@ -291,15 +290,6 @@
       assertEquals(expected, actual);
     }
     
-    // RegionHistorian Overhead
-    cl = RegionHistorian.class;
-    actual = RegionHistorian.FIXED_OVERHEAD;
-    expected = ClassSize.estimateBase(cl, false);
-    if(expected != actual) {
-      ClassSize.estimateBase(cl, true);
-      assertEquals(expected, actual);
-    }
-    
     // Currently NOT testing Deep Overheads of many of these classes.
     // Deep overheads cover a vast majority of stuff, but will not be 100%
     // accurate because it's unclear when we're referencing stuff that's already

Modified: hadoop/hbase/branches/0.20/src/webapps/master/table.jsp
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/webapps/master/table.jsp?rev=816824&r1=816823&r2=816824&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/webapps/master/table.jsp (original)
+++ hadoop/hbase/branches/0.20/src/webapps/master/table.jsp Sat Sep 19 00:14:15 2009
@@ -131,15 +131,11 @@
     int infoPort = serverAddressToServerInfos.get(
         hriEntry.getValue()).getInfoPort();
     
-    String urlRegionHistorian =
-        "/regionhistorian.jsp?regionname="+
-                Bytes.toStringBinary(hriEntry.getKey().getRegionName());
-
     String urlRegionServer =
         "http://" + hriEntry.getValue().getHostname().toString() + ":" + infoPort + "/";
 %>
 <tr>
-  <td><a href="<%= urlRegionHistorian %>"><%= Bytes.toStringBinary(hriEntry.getKey().getRegionName())%></a></td>
+  <td><%= Bytes.toStringBinary(hriEntry.getKey().getRegionName())%></td>
   <td><a href="<%= urlRegionServer %>"><%= hriEntry.getValue().getHostname().toString()
+ ":" + infoPort %></a></td>
   <td><%= hriEntry.getKey().getEncodedName()%></td> <td><%= Bytes.toStringBinary(hriEntry.getKey().getStartKey())%></td>
   <td><%= Bytes.toStringBinary(hriEntry.getKey().getEndKey())%></td>



Mime
View raw message