From ebd009051af698189d1147960b833391db1f37b2 Mon Sep 17 00:00:00 2001 From: jeffreyz Date: Thu, 17 Oct 2013 19:01:47 +0000 Subject: [PATCH] HBASE-9776: Test Load And Verify Fails with TableNotEnabledException git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1533209 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/IntegrationTestLazyCfLoading.java | 5 +--- .../test/IntegrationTestLoadAndVerify.java | 23 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java index c3e0122277e..ceb4fa2edda 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestLazyCfLoading.java @@ -198,10 +198,7 @@ public class IntegrationTestLazyCfLoading { private void deleteTable() throws Exception { if (util.getHBaseAdmin().tableExists(TABLE_NAME)) { LOG.info("Deleting table"); - if (!util.getHBaseAdmin().isTableDisabled(TABLE_NAME)) { - util.getHBaseAdmin().disableTable(TABLE_NAME); - } - util.getHBaseAdmin().deleteTable(TABLE_NAME); + util.deleteTable(TABLE_NAME); LOG.info("Deleted table"); } } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java index c7a5345b02f..316e93ba30d 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestLoadAndVerify.java @@ -385,26 +385,7 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase { // Only disable and drop if we succeeded to verify - otherwise it's useful // to leave it around for post-mortem - deleteTable(admin, htd); - } - - private void deleteTable(HBaseAdmin admin, HTableDescriptor htd) - throws IOException, InterruptedException { - // Use disableTestAsync because disable can take a long time to complete - System.out.print("Disabling table " + htd.getTableName() +" "); - admin.disableTableAsync(htd.getTableName()); - - long start = System.currentTimeMillis(); - // NOTE tables can be both admin.isTableEnabled=false and - // isTableDisabled=false, when disabling must use isTableDisabled! - while (!admin.isTableDisabled(htd.getTableName())) { - System.out.print("."); - Thread.sleep(1000); - } - long delta = System.currentTimeMillis() - start; - System.out.println(" " + delta +" ms"); - System.out.println("Deleting table " + htd.getTableName() +" "); - admin.deleteTable(htd.getTableName()); + getTestingUtil(getConf()).deleteTable(htd.getName()); } public void usage() { @@ -467,7 +448,7 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase { if (doVerify) { doVerify(getConf(), htd); if (doDelete) { - deleteTable(admin, htd); + getTestingUtil(getConf()).deleteTable(htd.getName()); } } return 0;