HBASE-8662 [rest] support impersonation - ADDENDUM 2

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1503387 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jxiang 2013-07-15 18:07:57 +00:00
parent eef2e34797
commit dd2fc5334f
1 changed files with 13 additions and 3 deletions

View File

@ -2096,7 +2096,12 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
*/ */
public void waitTableAvailable(byte[] table) public void waitTableAvailable(byte[] table)
throws InterruptedException, IOException { throws InterruptedException, IOException {
waitTableAvailable(table, 30000); waitTableAvailable(getHBaseAdmin(), table, 30000);
}
public void waitTableAvailable(HBaseAdmin admin, byte[] table)
throws InterruptedException, IOException {
waitTableAvailable(admin, table, 30000);
} }
/** /**
@ -2107,9 +2112,14 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
* @throws IOException * @throws IOException
*/ */
public void waitTableAvailable(byte[] table, long timeoutMillis) public void waitTableAvailable(byte[] table, long timeoutMillis)
throws InterruptedException, IOException {
waitTableAvailable(getHBaseAdmin(), table, timeoutMillis);
}
public void waitTableAvailable(HBaseAdmin admin, byte[] table, long timeoutMillis)
throws InterruptedException, IOException { throws InterruptedException, IOException {
long startWait = System.currentTimeMillis(); long startWait = System.currentTimeMillis();
while (!getHBaseAdmin().isTableAvailable(table)) { while (!admin.isTableAvailable(table)) {
assertTrue("Timed out waiting for table to become available " + assertTrue("Timed out waiting for table to become available " +
Bytes.toStringBinary(table), Bytes.toStringBinary(table),
System.currentTimeMillis() - startWait < timeoutMillis); System.currentTimeMillis() - startWait < timeoutMillis);
@ -2153,7 +2163,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
public void waitTableEnabled(HBaseAdmin admin, byte[] table, long timeoutMillis) public void waitTableEnabled(HBaseAdmin admin, byte[] table, long timeoutMillis)
throws InterruptedException, IOException { throws InterruptedException, IOException {
long startWait = System.currentTimeMillis(); long startWait = System.currentTimeMillis();
waitTableAvailable(table, timeoutMillis); waitTableAvailable(admin, table, timeoutMillis);
long remainder = System.currentTimeMillis() - startWait; long remainder = System.currentTimeMillis() - startWait;
while (!admin.isTableEnabled(table)) { while (!admin.isTableEnabled(table)) {
assertTrue("Timed out waiting for table to become available and enabled " + assertTrue("Timed out waiting for table to become available and enabled " +