hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1352262 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Date Wed, 20 Jun 2012 18:45:24 GMT
Author: tedyu
Date: Wed Jun 20 18:45:23 2012
New Revision: 1352262

URL: http://svn.apache.org/viewvc?rev=1352262&view=rev
Log:
HBASE-6229 AM.assign() should not set table state to ENABLED directly (Rajesh)


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1352262&r1=1352261&r2=1352262&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Wed Jun 20 18:45:23 2012
@@ -1714,7 +1714,17 @@ public class AssignmentManager extends Z
           if (isDisabledorDisablingRegionInRIT(region)) {
             return;
           }
-          setEnabledTable(region);
+          // In case of assignment from EnableTableHandler table state is ENABLING. Any how
+          // EnableTableHandler will set ENABLED after assigning all the table regions. If
we
+          // try to set to ENABLED directly then client api may think table is enabled.
+          // When we have a case such as all the regions are added directly into .META. and
we call
+          // assignRegion then we need to make the table ENABLED. Hence in such case the
table
+          // will not be in ENABLING or ENABLED state.
+          String tableName = region.getTableNameAsString();
+          if (!zkTable.isEnablingTable(tableName) && !zkTable.isEnabledTable(tableName))
{
+            LOG.debug("Setting table " + tableName + " to ENABLED state.");
+            setEnabledTable(region);
+          }
         }
       }
       if (setOfflineInZK && versionOfOfflineNode == -1) {



Mime
View raw message