You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2010/10/05 01:01:16 UTC

svn commit: r1004474 - /hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java

Author: stack
Date: Mon Oct  4 23:01:16 2010
New Revision: 1004474

URL: http://svn.apache.org/viewvc?rev=1004474&view=rev
Log:
Add wait on disable to complete to TestHFileOutputFormat by watching regions in transition...; seems to fix unit test

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java?rev=1004474&r1=1004473&r2=1004474&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Mon Oct  4 23:01:16 2010
@@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.client.HB
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.Threads;
 import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
@@ -286,6 +287,11 @@ public class TestHFileOutputFormat  {
       if (shouldChangeRegions) {
         LOG.info("Changing regions in table");
         admin.disableTable(table.getTableName());
+        while(util.getMiniHBaseCluster().getMaster().getAssignmentManager().
+            isRegionsInTransition()) {
+          Threads.sleep(1000);
+          LOG.info("Waiting on table to finish disabling");
+        }
         byte[][] newStartKeys = generateRandomStartKeys(15);
         util.createMultiRegions(util.getConfiguration(),
             table, FAMILY_NAME, newStartKeys);