hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r678581 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/master/BaseScanner.java src/java/org/apache/hadoop/hbase/master/ServerManager.java
Date Mon, 21 Jul 2008 21:54:45 GMT
Author: stack
Date: Mon Jul 21 14:54:44 2008
New Revision: 678581

URL: http://svn.apache.org/viewvc?rev=678581&view=rev
Log:
HBASE-743   bin/hbase migrate upgrade fails when redo logs exists

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/BaseScanner.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ServerManager.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=678581&r1=678580&r2=678581&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Jul 21 14:54:44 2008
@@ -197,6 +197,7 @@
    HBASE-424   Should be able to enable/disable .META. table
    HBASE-679   Regionserver addresses are still not right in the new tables page
    HBASE-758   Throwing IOE read-only when should be throwing NSRE
+   HBASE-743   bin/hbase migrate upgrade fails when redo logs exists
    
   IMPROVEMENTS
    HBASE-559   MR example job to count table rows

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/BaseScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/BaseScanner.java?rev=678581&r1=678580&r2=678581&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/BaseScanner.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/BaseScanner.java Mon Jul 21
14:54:44 2008
@@ -172,7 +172,7 @@
         String serverName = Writables.cellToString(values.get(COL_SERVER));
         long startCode = Writables.cellToLong(values.get(COL_STARTCODE));
         if (LOG.isDebugEnabled()) {
-          LOG.debug(Thread.currentThread().getName() + info.toString() +
+          LOG.debug(Thread.currentThread().getName() + " " + info.toString() +
             "}, SERVER => '" + serverName + "', STARTCODE => " + startCode);
         }
 
@@ -261,25 +261,17 @@
     RowResult rowContent)
   throws IOException {
     boolean result = false;
-
     boolean hasReferencesA = hasReferences(metaRegionName, srvr,
         parent.getRegionName(), rowContent, COL_SPLITA);
     boolean hasReferencesB = hasReferences(metaRegionName, srvr,
         parent.getRegionName(), rowContent, COL_SPLITB);
-    
     if (!hasReferencesA && !hasReferencesB) {
       LOG.info("Deleting region " + parent.getRegionNameAsString() +
         " because daughter splits no longer hold references");
       HRegion.deleteRegion(master.fs, master.rootdir, parent);
-      
       HRegion.removeRegionFromMETA(srvr, metaRegionName,
         parent.getRegionName());
       result = true;
-    } else if (LOG.isDebugEnabled()) {
-      // If debug, note we checked and current state of daughters.
-      LOG.debug("Checked " + parent.getRegionNameAsString() +
-        " for references: splitA: " + hasReferencesA + ", splitB: "+
-        hasReferencesB);
     }
     return result;
   }

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=678581&r1=678580&r2=678581&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ServerManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ServerManager.java Mon Jul
21 14:54:44 2008
@@ -73,6 +73,10 @@
   
   private HMaster master;
   private final Leases serverLeases;
+  
+  // Last time we logged average load.
+  private volatile long lastLogOfAverageLaod = 0;
+  private final long loggingPeriodForAverageLoad;
 
   /**
    * @param master
@@ -82,6 +86,8 @@
     serverLeases = new Leases(master.leaseTimeout, 
       master.getConfiguration().getInt("hbase.master.lease.thread.wakefrequency",
         15 * 1000));
+    this.loggingPeriodForAverageLoad = master.getConfiguration().
+      getLong("hbase.master.avgload.logging.period", 15000);
   }
   
   /**
@@ -557,18 +563,19 @@
     int totalLoad = 0;
     int numServers = 0;
     double averageLoad = 0.0;
-    
     synchronized (serversToLoad) {
       numServers = serversToLoad.size();
-      
       for (HServerLoad load : serversToLoad.values()) {
         totalLoad += load.getNumberOfRegions();
       }
-      
       averageLoad = Math.ceil((double)totalLoad / (double)numServers);
-      if (LOG.isDebugEnabled()) {
+      // Only log on a period, not on every invocation of this method.
+      long now = System.currentTimeMillis();
+      if (LOG.isDebugEnabled() &&
+          (now > (this.loggingPeriodForAverageLoad + this.lastLogOfAverageLaod))) {
         LOG.debug("Total Load: " + totalLoad + ", Num Servers: " + numServers 
           + ", Avg Load: " + averageLoad);
+        this.lastLogOfAverageLaod = now;
       }
     }
     return averageLoad;



Mime
View raw message