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
This commit is contained in:
jeffreyz 2013-10-17 19:01:47 +00:00
parent bcff872bf1
commit ebd009051a
2 changed files with 3 additions and 25 deletions

View File

@ -198,10 +198,7 @@ public class IntegrationTestLazyCfLoading {
private void deleteTable() throws Exception { private void deleteTable() throws Exception {
if (util.getHBaseAdmin().tableExists(TABLE_NAME)) { if (util.getHBaseAdmin().tableExists(TABLE_NAME)) {
LOG.info("Deleting table"); LOG.info("Deleting table");
if (!util.getHBaseAdmin().isTableDisabled(TABLE_NAME)) { util.deleteTable(TABLE_NAME);
util.getHBaseAdmin().disableTable(TABLE_NAME);
}
util.getHBaseAdmin().deleteTable(TABLE_NAME);
LOG.info("Deleted table"); LOG.info("Deleted table");
} }
} }

View File

@ -385,26 +385,7 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase {
// Only disable and drop if we succeeded to verify - otherwise it's useful // Only disable and drop if we succeeded to verify - otherwise it's useful
// to leave it around for post-mortem // to leave it around for post-mortem
deleteTable(admin, htd); getTestingUtil(getConf()).deleteTable(htd.getName());
}
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());
} }
public void usage() { public void usage() {
@ -467,7 +448,7 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase {
if (doVerify) { if (doVerify) {
doVerify(getConf(), htd); doVerify(getConf(), htd);
if (doDelete) { if (doDelete) {
deleteTable(admin, htd); getTestingUtil(getConf()).deleteTable(htd.getName());
} }
} }
return 0; return 0;