hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r604309 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt src/java/org/apache/hadoop/hbase/HMaster.java
Date Fri, 14 Dec 2007 21:51:47 GMT
Author: jimk
Date: Fri Dec 14 13:51:45 2007
New Revision: 604309

URL: http://svn.apache.org/viewvc?rev=604309&view=rev
Log:
HADOOP-2430 Master will not shut down if there are no active region servers

Modified:
    lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java

Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?rev=604309&r1=604308&r2=604309&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Fri Dec 14 13:51:45 2007
@@ -81,6 +81,7 @@
    HADOOP-2418 Fix assertion failures in TestTableMapReduce, TestTableIndex,
                and TestTableJoinMapReduce
    HADOOP-2414 Fix ArrayIndexOutOfBoundsException in bloom filters.
+   HADOOP-2430 Master will not shut down if there are no active region servers
    
   IMPROVEMENTS
    HADOOP-2401 Add convenience put method that takes writable

Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java?rev=604309&r1=604308&r2=604309&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java Fri
Dec 14 13:51:45 2007
@@ -1029,6 +1029,10 @@
      */
     try {
       for (RegionServerOperation op = null; !closed.get(); ) {
+        if (shutdownRequested && serversToServerInfo.size() == 0) {
+          startShutdown();
+          break;
+        }
         if (rootRegionLocation.get() != null) {
           // We can't process server shutdowns unless the root region is online 
 
@@ -1174,7 +1178,23 @@
       LOG.error("Failed startup", e);
     }
   }
-  
+
+  /*
+   * Start shutting down the master
+   */
+  private void startShutdown() {
+    closed.set(true);
+    stopScanners();
+    synchronized(toDoQueue) {
+      toDoQueue.clear();                         // Empty the queue
+      delayedToDoQueue.clear();                  // Empty shut down queue
+      toDoQueue.notifyAll();                     // Wake main thread
+    }
+    synchronized (serversToServerInfo) {
+      serversToServerInfo.notifyAll();
+    }
+  }
+
   /*
    * Stop the root and meta scanners so that the region servers serving meta
    * regions can shut down.
@@ -1356,16 +1376,7 @@
       // If the only servers we know about are meta servers, then we can
       // proceed with shutdown
       LOG.info("All user tables quiesced. Proceeding with shutdown");
-      closed.set(true);
-      stopScanners();
-      synchronized(toDoQueue) {
-        toDoQueue.clear();                         // Empty the queue
-        delayedToDoQueue.clear();                  // Empty shut down queue
-        toDoQueue.notifyAll();                     // Wake main thread
-      }
-      synchronized (serversToServerInfo) {
-        serversToServerInfo.notifyAll();
-      }
+      startShutdown();
     }
 
     if (shutdownRequested && !closed.get()) {



Mime
View raw message