hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1144009 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Thu, 07 Jul 2011 19:58:27 GMT
Author: stack
Date: Thu Jul  7 19:58:27 2011
New Revision: 1144009

URL: http://svn.apache.org/viewvc?rev=1144009&view=rev
Log:
HBASE-4033 The shutdown RegionServer could be added to AssignmentManager.servers again

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1144009&r1=1144008&r2=1144009&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Jul  7 19:58:27 2011
@@ -399,6 +399,8 @@ Release 0.90.4 - Unreleased
    HBASE-4045  [replication] NPE in ReplicationSource when ZK is gone
    HBASE-4034  HRegionServer should be stopped even if no META regions
                are hosted by the HRegionServer (Akash Ashok)
+   HBASE-4033  The shutdown RegionServer could be added to
+               AssignmentManager.servers again (Jieshan Bean)
 
   IMPROVEMENT
    HBASE-3882  hbase-config.sh needs to be updated so it can auto-detects the

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1144009&r1=1144008&r2=1144009&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java Thu Jul
 7 19:58:27 2011
@@ -882,9 +882,15 @@ public class AssignmentManager extends Z
       ServerName oldSn = this.regions.get(regionInfo);
       if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() +
         " on " + oldSn + " with " + sn);
-      this.regions.put(regionInfo, sn);
-      addToServers(sn, regionInfo);
-      this.regions.notifyAll();
+      
+      if (isServerOnline(sn)) {
+        this.regions.put(regionInfo, sn);
+        addToServers(sn, regionInfo);
+        this.regions.notifyAll();
+      } else {
+        LOG.info("The server is not in online servers, ServerName=" + 
+          sn.getServerName() + ", region=" + regionInfo.getEncodedName());
+      }
     }
     // Remove plan if one.
     clearRegionPlan(regionInfo);
@@ -2364,4 +2370,11 @@ public class AssignmentManager extends Z
   public void stop() {
     this.timeoutMonitor.interrupt();
   }
+  
+  /**
+   * Check whether the RegionServer is online.
+   */
+  public boolean isServerOnline(ServerName serverName) {
+    return this.serverManager.isServerOnline(serverName);
+  }
 }



Mime
View raw message