hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1330106 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/master/AssignmentManager.java test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
Date Wed, 25 Apr 2012 05:07:22 GMT
Author: larsh
Date: Wed Apr 25 05:07:22 2012
New Revision: 1330106

URL: http://svn.apache.org/viewvc?rev=1330106&view=rev
Log:
HBASE-5848 Addendum

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.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=1330106&r1=1330105&r2=1330106&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
Wed Apr 25 05:07:22 2012
@@ -1755,7 +1755,11 @@ public class AssignmentManager extends Z
       ZKAssign.asyncCreateNodeOffline(master.getZooKeeper(), state.getRegion(),
         this.master.getServerName(), cb, ctx);
     } catch (KeeperException e) {
-      master.abort("Unexpected ZK exception creating/setting node OFFLINE", e);
+      if (e instanceof NodeExistsException) {
+        LOG.warn("Node for " + state.getRegion() + " already exists");
+      } else { 
+        master.abort("Unexpected ZK exception creating/setting node OFFLINE", e);
+      }
       return false;
     }
     return true;

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java?rev=1330106&r1=1330105&r2=1330106&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java (original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java Wed
Apr 25 05:07:22 2012
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -78,7 +79,8 @@ public class TestRegionRebalancing {
   public void testRebalanceOnRegionServerNumberChange()
   throws IOException, InterruptedException {
     HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
-    admin.createTable(this.desc, HBaseTestingUtility.KEYS);
+    admin.createTable(this.desc, Arrays.copyOfRange(HBaseTestingUtility.KEYS,
+        1, HBaseTestingUtility.KEYS.length));
     this.table = new HTable(UTIL.getConfiguration(), this.desc.getName());
     CatalogTracker ct = new CatalogTracker(UTIL.getConfiguration());
     ct.start();
@@ -88,7 +90,7 @@ public class TestRegionRebalancing {
       ct.stop();
     }
     assertEquals("Test table should have right number of regions",
-      HBaseTestingUtility.KEYS.length + 1/*One extra to account for start/end keys*/,
+      HBaseTestingUtility.KEYS.length,
       this.table.getStartKeys().length);
 
     // verify that the region assignments are balanced to start out



Mime
View raw message