hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1499801 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Date Thu, 04 Jul 2013 16:31:10 GMT
Author: stack
Date: Thu Jul  4 16:31:10 2013
New Revision: 1499801

URL: http://svn.apache.org/r1499801
Log:
HBASE-8814 Possible NPE in split if a region has empty store files; ADDENDUM

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1499801&r1=1499800&r2=1499801&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
Thu Jul  4 16:31:10 2013
@@ -442,7 +442,6 @@ public class TestSplitTransactionOnClust
     HColumnDescriptor hcd = new HColumnDescriptor("col");
     htd.addFamily(hcd);
     admin.createTable(htd);
-    ZKAssign.blockUntilNoRIT(zkw);
     HTable table = new HTable(conf, userTableName);
     try {
       for (int i = 0; i <= 5; i++) {
@@ -678,12 +677,14 @@ public class TestSplitTransactionOnClust
 
   @Test(timeout = 60000)
   public void testTableExistsIfTheSpecifiedTableRegionIsSplitParent() throws Exception {
+    ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(TESTING_UTIL);
     final byte[] tableName =
         Bytes.toBytes("testTableExistsIfTheSpecifiedTableRegionIsSplitParent");
     // Create table then get the single region for our new table.
     HTable t = createTableAndWait(tableName, Bytes.toBytes("cf"));
+    List<HRegion> regions = null;
     try {
-      List<HRegion> regions = cluster.getRegions(tableName);
+      regions = cluster.getRegions(tableName);
       int regionServerIndex = cluster.getServerWith(regions.get(0).getRegionName());
       HRegionServer regionServer = cluster.getRegionServer(regionServerIndex);
       insertData(tableName, admin, t);
@@ -707,6 +708,11 @@ public class TestSplitTransactionOnClust
           Bytes.toString(tableName));
       assertEquals("The specified table should present.", true, tableExists);
     } finally {
+      if (regions != null) {
+        String node = ZKAssign.getNodeName(zkw, regions.get(0).getRegionInfo()
+            .getEncodedName());
+        ZKUtil.deleteNodeFailSilent(zkw, node);
+      }
       admin.setBalancerRunning(true, false);
       cluster.getMaster().setCatalogJanitorEnabled(true);
       t.close();



Mime
View raw message