HBASE-7856 HTU#waitTableAvailable should have a default value of 30s

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1446898 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2013-02-16 14:20:17 +00:00
parent 900be56ea1
commit 9f638ad2d3
11 changed files with 23 additions and 13 deletions

View File

@ -1853,6 +1853,11 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
return HFileSystem.get(conf); return HFileSystem.get(conf);
} }
public void waitTableAvailable(byte[] table)
throws InterruptedException, IOException {
waitTableAvailable(table, 30000);
}
public void waitTableAvailable(byte[] table, long timeoutMillis) public void waitTableAvailable(byte[] table, long timeoutMillis)
throws InterruptedException, IOException { throws InterruptedException, IOException {
long startWait = System.currentTimeMillis(); long startWait = System.currentTimeMillis();
@ -1864,6 +1869,11 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
} }
} }
public void waitTableEnabled(byte[] table)
throws InterruptedException, IOException {
waitTableEnabled(table, 30000);
}
public void waitTableEnabled(byte[] table, long timeoutMillis) public void waitTableEnabled(byte[] table, long timeoutMillis)
throws InterruptedException, IOException { throws InterruptedException, IOException {
long startWait = System.currentTimeMillis(); long startWait = System.currentTimeMillis();

View File

@ -72,7 +72,7 @@ public class TestMultiParallel {
UTIL.startMiniCluster(slaves); UTIL.startMiniCluster(slaves);
HTable t = UTIL.createTable(Bytes.toBytes(TEST_TABLE), Bytes.toBytes(FAMILY)); HTable t = UTIL.createTable(Bytes.toBytes(TEST_TABLE), Bytes.toBytes(FAMILY));
UTIL.createMultiRegions(t, Bytes.toBytes(FAMILY)); UTIL.createMultiRegions(t, Bytes.toBytes(FAMILY));
UTIL.waitTableAvailable(Bytes.toBytes(TEST_TABLE), 15 * 1000); UTIL.waitTableEnabled(Bytes.toBytes(TEST_TABLE));
t.close(); t.close();
} }

View File

@ -637,7 +637,7 @@ public class TestClassLoading {
private void waitForTable(byte[] name) throws InterruptedException, IOException { private void waitForTable(byte[] name) throws InterruptedException, IOException {
// First wait until all regions are online // First wait until all regions are online
TEST_UTIL.waitTableEnabled(name, 5000); TEST_UTIL.waitTableEnabled(name);
// Now wait a bit longer for the coprocessor hosts to load the CPs // Now wait a bit longer for the coprocessor hosts to load the CPs
Thread.sleep(1000); Thread.sleep(1000);
} }

View File

@ -439,7 +439,7 @@ public class TestHFileOutputFormat {
LOG.info("Waiting for table to disable"); LOG.info("Waiting for table to disable");
} }
admin.enableTable(TABLE_NAME); admin.enableTable(TABLE_NAME);
util.waitTableAvailable(TABLE_NAME, 30000); util.waitTableAvailable(TABLE_NAME);
assertEquals("Data should remain after reopening of regions", assertEquals("Data should remain after reopening of regions",
tableDigestBefore, util.checksumRows(table)); tableDigestBefore, util.checksumRows(table));
} finally { } finally {

View File

@ -153,7 +153,7 @@ public class TestLoadIncrementalHFiles {
admin.createTable(htd, SPLIT_KEYS); admin.createTable(htd, SPLIT_KEYS);
HTable table = new HTable(util.getConfiguration(), TABLE); HTable table = new HTable(util.getConfiguration(), TABLE);
util.waitTableAvailable(TABLE, 30000); util.waitTableEnabled(TABLE);
LoadIncrementalHFiles loader = new LoadIncrementalHFiles(util.getConfiguration(), useSecure); LoadIncrementalHFiles loader = new LoadIncrementalHFiles(util.getConfiguration(), useSecure);
loader.doBulkLoad(dir, table); loader.doBulkLoad(dir, table);
@ -184,7 +184,7 @@ public class TestLoadIncrementalHFiles {
admin.createTable(htd, SPLIT_KEYS); admin.createTable(htd, SPLIT_KEYS);
HTable table = new HTable(util.getConfiguration(), TABLE); HTable table = new HTable(util.getConfiguration(), TABLE);
util.waitTableAvailable(TABLE, 30000); util.waitTableEnabled(TABLE);
LoadIncrementalHFiles loader = new LoadIncrementalHFiles( LoadIncrementalHFiles loader = new LoadIncrementalHFiles(
util.getConfiguration()); util.getConfiguration());

View File

@ -49,7 +49,7 @@ public class TestSecureLoadIncrementalHFiles extends TestLoadIncrementalHFiles{
util.startMiniCluster(); util.startMiniCluster();
// Wait for the ACL table to become available // Wait for the ACL table to become available
util.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000); util.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
} }
} }

View File

@ -54,7 +54,7 @@ public class TestSecureLoadIncrementalHFilesSplitRecovery extends TestLoadIncrem
util.startMiniCluster(); util.startMiniCluster();
// Wait for the ACL table to become available // Wait for the ACL table to become available
util.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000); util.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
} }
//Disabling this test as it does not work in secure mode //Disabling this test as it does not work in secure mode

View File

@ -97,7 +97,7 @@ public class TestRestartCluster {
UTIL.createTable(TABLE, FAMILY); UTIL.createTable(TABLE, FAMILY);
} }
for(byte [] TABLE : TABLES) { for(byte [] TABLE : TABLES) {
UTIL.waitTableAvailable(TABLE, 30000); UTIL.waitTableEnabled(TABLE);
} }
List<HRegionInfo> allRegions = List<HRegionInfo> allRegions =
@ -128,7 +128,7 @@ public class TestRestartCluster {
} catch(TableExistsException tee) { } catch(TableExistsException tee) {
LOG.info("Table already exists as expected"); LOG.info("Table already exists as expected");
} }
UTIL.waitTableAvailable(TABLE, 30000); UTIL.waitTableAvailable(TABLE);
} }
} }

View File

@ -74,7 +74,7 @@ public class TestAccessControlFilter {
conf.set("hbase.superuser", conf.get("hbase.superuser", "") + conf.set("hbase.superuser", conf.get("hbase.superuser", "") +
String.format(",%s.hfs.0,%s.hfs.1,%s.hfs.2", baseuser, baseuser, baseuser)); String.format(",%s.hfs.0,%s.hfs.1,%s.hfs.2", baseuser, baseuser, baseuser));
TEST_UTIL.startMiniCluster(); TEST_UTIL.startMiniCluster();
TEST_UTIL.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000); TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
ADMIN = User.createUserForTesting(conf, "admin", new String[]{"supergroup"}); ADMIN = User.createUserForTesting(conf, "admin", new String[]{"supergroup"});
READER = User.createUserForTesting(conf, "reader", new String[0]); READER = User.createUserForTesting(conf, "reader", new String[0]);

View File

@ -135,7 +135,7 @@ public class TestAccessController {
Coprocessor.PRIORITY_HIGHEST, 1, conf); Coprocessor.PRIORITY_HIGHEST, 1, conf);
// Wait for the ACL table to become available // Wait for the ACL table to become available
TEST_UTIL.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000); TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
// create a set of test users // create a set of test users
SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" }); SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
@ -819,7 +819,7 @@ public class TestAccessController {
HTable table = new HTable(conf, tableName); HTable table = new HTable(conf, tableName);
try { try {
TEST_UTIL.waitTableAvailable(tableName, 30000); TEST_UTIL.waitTableEnabled(tableName);
LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf); LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf);
loader.doBulkLoad(loadPath, table); loader.doBulkLoad(loadPath, table);
} finally { } finally {

View File

@ -93,7 +93,7 @@ public class TestTablePermissions {
UTIL.startMiniCluster(); UTIL.startMiniCluster();
// Wait for the ACL table to become available // Wait for the ACL table to become available
UTIL.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000); UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);
ZKW = new ZooKeeperWatcher(UTIL.getConfiguration(), ZKW = new ZooKeeperWatcher(UTIL.getConfiguration(),
"TestTablePermissions", ABORTABLE); "TestTablePermissions", ABORTABLE);