hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1029949 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
Date Tue, 02 Nov 2010 04:16:56 GMT
Author: jgray
Date: Tue Nov  2 04:16:56 2010
New Revision: 1029949

URL: http://svn.apache.org/viewvc?rev=1029949&view=rev
Log:
HBASE-3180: Review periodic master logging, especially ServerManager once a minute

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1029949&r1=1029948&r2=1029949&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Tue Nov  2 04:16:56 2010
@@ -1088,6 +1088,8 @@ Release 0.21.0 - Unreleased
    HBASE-3120  [rest] Content transcoding
    HBASE-3181  Review, document, and fix up Regions-in-Transition timeout
                logic
+   HBASE-3180  Review periodic master logging, especially ServerManager once
+               a minute
 
 
   NEW FEATURES

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java?rev=1029949&r1=1029948&r2=1029949&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java Tue Nov 
2 04:16:56 2010
@@ -110,8 +110,13 @@ class CatalogJanitor extends Chore {
     for (Map.Entry<HRegionInfo, Result> e : splitParents.entrySet()) {
       if (cleanParent(e.getKey(), e.getValue())) cleaned++;
     }
-    LOG.info("Scanned " + count.get() + " catalog row(s) and gc'd " + cleaned +
+    if (cleaned != 0) {
+      LOG.info("Scanned " + count.get() + " catalog row(s) and gc'd " + cleaned +
+        " unreferenced parent region(s)");
+    } else if (LOG.isDebugEnabled()) {
+      LOG.debug("Scanned " + count.get() + " catalog row(s) and gc'd " + cleaned +
       " unreferenced parent region(s)");
+    }
   }
 
   /**

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java?rev=1029949&r1=1029948&r2=1029949&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java Tue Nov  2
04:16:56 2010
@@ -155,12 +155,10 @@ public class LoadBalancer {
     if(serversByLoad.lastKey().getLoad().getNumberOfRegions() <= max &&
        serversByLoad.firstKey().getLoad().getNumberOfRegions() >= min) {
       // Skipped because no server outside (min,max) range
-      if(LOG.isDebugEnabled()) {
-        LOG.debug("Skipping load balancing.  servers=" + numServers + " " +
-            "regions=" + numRegions + " average=" + average + " " +
-            "mostloaded=" + serversByLoad.lastKey().getLoad().getNumberOfRegions() +
-            " leastloaded=" + serversByLoad.lastKey().getLoad().getNumberOfRegions());
-      }
+      LOG.info("Skipping load balancing.  servers=" + numServers + " " +
+          "regions=" + numRegions + " average=" + average + " " +
+          "mostloaded=" + serversByLoad.lastKey().getLoad().getNumberOfRegions() +
+          " leastloaded=" + serversByLoad.lastKey().getLoad().getNumberOfRegions());
       return null;
     }
 
@@ -394,6 +392,7 @@ public class LoadBalancer {
    * @return ordered list of hosts holding blocks of the specified region
    * @throws IOException if any filesystem errors
    */
+  @SuppressWarnings("unused")
   private List<String> getTopBlockLocations(FileSystem fs, HRegionInfo region)
   throws IOException {
     String encodedName = region.getEncodedName();

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=1029949&r1=1029948&r2=1029949&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java Tue Nov  2
04:16:56 2010
@@ -31,7 +31,6 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.Chore;
 import org.apache.hadoop.hbase.HMsg;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HServerAddress;
@@ -39,7 +38,6 @@ import org.apache.hadoop.hbase.HServerIn
 import org.apache.hadoop.hbase.HServerLoad;
 import org.apache.hadoop.hbase.PleaseHoldException;
 import org.apache.hadoop.hbase.Server;
-import org.apache.hadoop.hbase.Stoppable;
 import org.apache.hadoop.hbase.YouAreDeadException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
 import org.apache.hadoop.hbase.client.HConnection;
@@ -50,10 +48,7 @@ import org.apache.hadoop.hbase.master.ha
 import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
 import org.apache.hadoop.hbase.master.metrics.MasterMetrics;
 import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException;
-import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.util.Threads;
-import org.apache.hadoop.util.StringUtils;
-import org.apache.zookeeper.KeeperException;
 
 /**
  * The ServerManager class manages info about region servers - HServerInfo,
@@ -89,8 +84,6 @@ public class ServerManager {
   private final Server master;
   private final MasterServices services;
 
-  private final ServerMonitor serverMonitorThread;
-
   private final LogCleaner logCleaner;
 
   // Reporting to track master metrics.
@@ -99,31 +92,10 @@ public class ServerManager {
   final DeadServer deadservers = new DeadServer();
 
   /**
-   * Dumps into log current stats on dead servers and number of servers
-   * TODO: Make this a metric; dump metrics into log.
-   */
-  class ServerMonitor extends Chore {
-    ServerMonitor(final int period, final Stoppable stopper) {
-      super("ServerMonitor", period, stopper);
-    }
-
-    @Override
-    protected void chore() {
-      int numServers = countOfRegionServers();
-      int numDeadServers = deadservers.size();
-      double averageLoad = getAverageLoad();
-      String deadServersList = deadservers.toString();
-      LOG.info("regionservers=" + numServers +
-        ", averageload=" + StringUtils.limitDecimalTo2(averageLoad) +
-        ((numDeadServers > 0)?  (", deadservers=" + deadServersList): ""));
-    }
-  }
-
-  /**
    * Constructor.
    * @param master
    * @param services
-   * @param metrics 
+   * @param metrics
    * @param freshClusterStartup True if we are original master on a fresh
    * cluster startup else if false, we are joining an already running cluster.
    */
@@ -133,10 +105,7 @@ public class ServerManager {
     this.services = services;
     this.metrics = metrics;
     Configuration c = master.getConfiguration();
-    int monitorInterval = c.getInt("hbase.master.monitor.interval", 60 * 1000);
-    this.serverMonitorThread = new ServerMonitor(monitorInterval, master);
     String n = Thread.currentThread().getName();
-    Threads.setDaemonThreadRunning(this.serverMonitorThread, n + ".serverMonitor");
     this.logCleaner =
       new LogCleaner(c.getInt("hbase.master.cleaner.interval", 60 * 1000),
         master, c, this.services.getMasterFileSystem().getFileSystem(),
@@ -538,7 +507,7 @@ public class ServerManager {
    * @param server server to open a region
    * @param region region to open
    */
-  public void sendRegionOpen(HServerInfo server, HRegionInfo region) 
+  public void sendRegionOpen(HServerInfo server, HRegionInfo region)
   throws IOException {
     HRegionInterface hri = getServerConnection(server);
     if (hri == null) {
@@ -618,7 +587,7 @@ public class ServerManager {
   /**
    * Waits for the regionservers to report in.
    * @return Count of regions out on cluster
-   * @throws InterruptedException 
+   * @throws InterruptedException
    */
   public int waitForRegionServers()
   throws InterruptedException {
@@ -681,7 +650,6 @@ public class ServerManager {
    * Currently just interrupts the ServerMonitor and LogCleaner chores.
    */
   public void stop() {
-    this.serverMonitorThread.interrupt();
     this.logCleaner.interrupt();
   }
 }



Mime
View raw message