Author: liyin Date: Sat Apr 5 18:18:23 2014 New Revision: 1585155 URL: http://svn.apache.org/r1585155 Log: [master] dis/enalble table before modifying META table
Author: daviddeng Summary: Dis/enalble table before modifying `.META.` table Test Plan: `TestHFileOutputFormat` Reviewers: manukranthk, gauravm, liyintang, rshroff Reviewed By: manukranthk CC: hbase-eng@ Differential Revision: https://phabricator.fb.com/D1260883 Task ID: 3297517, 3762458 Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1585155&r1=1585154&r2=1585155&view=diff ============================================================================== --- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original) +++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Sat Apr 5 18:18:23 2014 @@ -913,6 +913,12 @@ public class HBaseTestingUtility { throws IOException { byte[][] startKeys = startKeysAndFavNodes.getFirst(); byte[][] favNodes = startKeysAndFavNodes.getSecond(); + + HBaseAdmin admin = new HBaseAdmin(conf); + + // Disable the table before modifying the META table + admin.disableTable(table.getTableName()); + Arrays.sort(startKeys, Bytes.BYTES_COMPARATOR); HTable meta = new HTable(c, HConstants.META_TABLE_NAME); HTableDescriptor htd = table.getTableDescriptor(); @@ -948,6 +954,9 @@ public class HBaseTestingUtility { Bytes.toStringBinary(row)); meta.delete(new Delete(row)); } + + admin.enableTable(table.getTableName()); + // flush cache of regions HConnection conn = table.getConnectionAndResetOperationContext(); conn.clearRegionCache(); Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java?rev=1585155&r1=1585154&r2=1585155&view=diff ============================================================================== --- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java (original) +++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Sat Apr 5 18:18:23 2014 @@ -592,6 +592,7 @@ public class TestHFileOutputFormat { // handle the split case if (shouldChangeRegions) { LOG.info("Changing regions in table"); + admin.disableTable(table.getTableName()); admin.deleteTable(table.getTableName()); byte[][] newSplitKeys = generateRandomSplitKeys(14);
