hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1344805 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master: AssignmentManager.java HMaster.java MasterFileSystem.java
Date Thu, 31 May 2012 16:38:24 GMT
Author: ramkrishna
Date: Thu May 31 16:38:23 2012
New Revision: 1344805

URL: http://svn.apache.org/viewvc?rev=1344805&view=rev
Log:
HBASE-6089 SSH and AM.joinCluster causes Concurrent Modification exception. (Rajesh)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1344805&r1=1344804&r2=1344805&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Thu May 31 16:38:23 2012
@@ -328,7 +328,6 @@ public class AssignmentManager extends Z
   /**
    * Called on startup.
    * Figures whether a fresh cluster start of we are joining extant running cluster.
-   * @param onlineServers onlined servers when master started
    * @throws IOException
    * @throws KeeperException
    * @throws InterruptedException
@@ -391,18 +390,19 @@ public class AssignmentManager extends Z
     }
     // Run through all regions.  If they are not assigned and not in RIT, then
     // its a clean cluster startup, else its a failover.
-    for (Map.Entry<HRegionInfo, ServerName> e: this.regions.entrySet()) {
-      if (!e.getKey().isMetaTable()
-          && e.getValue() != null) {
-        LOG.debug("Found " + e + " out on cluster");
-        this.failover = true;
-        break;
-      }
-      if (nodes.contains(e.getKey().getEncodedName())) {
-        LOG.debug("Found " + e.getKey().getRegionNameAsString() + " in RITs");
-        // Could be a meta region.
-        this.failover = true;
-        break;
+    synchronized (this.regions) {
+      for (Map.Entry<HRegionInfo, ServerName> e : this.regions.entrySet()) {
+        if (!e.getKey().isMetaTable() && e.getValue() != null) {
+          LOG.debug("Found " + e + " out on cluster");
+          this.failover = true;
+          break;
+        }
+        if (nodes.contains(e.getKey().getEncodedName())) {
+          LOG.debug("Found " + e.getKey().getRegionNameAsString() + " in RITs");
+          // Could be a meta region.
+          this.failover = true;
+          break;
+        }
       }
     }
 
@@ -2446,8 +2446,6 @@ public class AssignmentManager extends Z
    * <p>
    * Returns a map of servers that are not found to be online and the regions
    * they were hosting.
-   * @param onlineServers if one region's location belongs to onlineServers, it
-   *          doesn't need to be assigned.
    * @return map of servers not online to their assigned regions, as stored
    *         in META
    * @throws IOException
@@ -2523,8 +2521,10 @@ public class AssignmentManager extends Z
         // add only if region not in disabled and enabling table
         if (false == checkIfRegionBelongsToDisabled(regionInfo)
             && false == checkIfRegionsBelongsToEnabling(regionInfo)) {
-          regions.put(regionInfo, regionLocation);
-          addToServers(regionLocation, regionInfo);
+          synchronized (this.regions) {
+            regions.put(regionInfo, regionLocation);
+            addToServers(regionLocation, regionInfo);
+          }
         }
         disablingOrEnabling = addTheTablesInPartialState(this.disablingTables,
             this.enablingTables, regionInfo, tableName);
@@ -3203,7 +3203,6 @@ public class AssignmentManager extends Z
    * Run through remaining regionservers and unassign all catalog regions.
    */
   void unassignCatalogRegions() {
-    this.servers.entrySet();
     synchronized (this.regions) {
       for (Map.Entry<ServerName, Set<HRegionInfo>> e: this.servers.entrySet())
{
         Set<HRegionInfo> regions = e.getValue();

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1344805&r1=1344804&r2=1344805&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu May
31 16:38:23 2012
@@ -581,7 +581,6 @@ Server {
   /**
    * Override to change master's splitLogAfterStartup. Used testing
    * @param mfs
-   * @param onlineServers
    */
   protected void splitLogAfterStartup(final MasterFileSystem mfs) {
     mfs.splitLogAfterStartup();

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java?rev=1344805&r1=1344804&r2=1344805&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Thu May 31 16:38:23 2012
@@ -183,8 +183,6 @@ public class MasterFileSystem {
   /**
    * Inspect the log directory to recover any log file without
    * an active region server.
-   * @param onlineServers Set of online servers keyed by
-   * {@link ServerName}
    */
   void splitLogAfterStartup() {
     boolean retrySplitting = !conf.getBoolean("hbase.hlog.split.skip.errors",



Mime
View raw message