You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2010/12/02 21:18:30 UTC
svn commit: r1041569 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Author: jdcryans
Date: Thu Dec 2 20:18:29 2010
New Revision: 1041569
URL: http://svn.apache.org/viewvc?rev=1041569&view=rev
Log:
HBASE-3296 Newly created table ends up disabled instead of assigned
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1041569&r1=1041568&r2=1041569&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Dec 2 20:18:29 2010
@@ -738,6 +738,7 @@ Release 0.90.0 - Unreleased
and it's very confusing
HBASE-3301 Treat java.net.SocketTimeoutException same as ConnectException
assigning/unassigning regions
+ HBASE-3296 Newly created table ends up disabled instead of assigned
IMPROVEMENTS
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1041569&r1=1041568&r2=1041569&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu Dec 2 20:18:29 2010
@@ -767,18 +767,27 @@ implements HMasterInterface, HMasterRegi
throw new TableExistsException(tableName);
}
for(HRegionInfo newRegion : newRegions) {
- // 1. Create HRegion
+
+ // 1. Set table enabling flag up in zk.
+ try {
+ assignmentManager.getZKTable().setEnabledTable(tableName);
+ } catch (KeeperException e) {
+ throw new IOException("Unable to ensure that the table will be" +
+ " enabled because of a ZooKeeper issue", e);
+ }
+
+ // 2. Create HRegion
HRegion region = HRegion.createHRegion(newRegion,
fileSystemManager.getRootDir(), conf);
- // 2. Insert into META
+ // 3. Insert into META
MetaEditor.addRegionToMeta(catalogTracker, region.getRegionInfo());
- // 3. Close the new region to flush to disk. Close log file too.
+ // 4. Close the new region to flush to disk. Close log file too.
region.close();
region.getLog().closeAndDelete();
- // 4. Trigger immediate assignment of this region
+ // 5. Trigger immediate assignment of this region
assignmentManager.assign(region.getRegionInfo(), true);
}