hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1503388 - /hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Date Mon, 15 Jul 2013 18:09:05 GMT
Author: jxiang
Date: Mon Jul 15 18:09:05 2013
New Revision: 1503388

URL: http://svn.apache.org/r1503388
Log:
HBASE-8662 [rest] support impersonation - ADDENDUM 2

Modified:
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1503388&r1=1503387&r2=1503388&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Mon Jul 15 18:09:05 2013
@@ -2095,7 +2095,12 @@ public class HBaseTestingUtility extends
    */
   public void waitTableAvailable(byte[] table)
       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,8 +2112,13 @@ public class HBaseTestingUtility extends
    */
   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 {
     long startWait = System.currentTimeMillis();
-    while (!getHBaseAdmin().isTableAvailable(table)) {
+    while (!admin.isTableAvailable(table)) {
       assertTrue("Timed out waiting for table to become available " +
         Bytes.toStringBinary(table),
         System.currentTimeMillis() - startWait < timeoutMillis);
@@ -2120,7 +2130,7 @@ public class HBaseTestingUtility extends
     // Below we do a get.  The get will retry if a NotServeringRegionException or a
     // RegionOpeningException.  It is crass but when done all will be online.
     try {
-      Canary.sniff(getHBaseAdmin(), Bytes.toString(table));
+      Canary.sniff(admin, Bytes.toString(table));
     } catch (Exception e) {
       throw new IOException(e);
     }
@@ -2162,7 +2172,7 @@ public class HBaseTestingUtility extends
   public void waitTableEnabled(HBaseAdmin admin, byte[] table, long timeoutMillis)
   throws InterruptedException, IOException {
     long startWait = System.currentTimeMillis();
-    waitTableAvailable(table, timeoutMillis);
+    waitTableAvailable(admin, table, timeoutMillis);
     long remainder = System.currentTimeMillis() - startWait;
     while (!admin.isTableEnabled(table)) {
       assertTrue("Timed out waiting for table to become available and enabled " +
@@ -2171,8 +2181,8 @@ public class HBaseTestingUtility extends
       Thread.sleep(200);
     }
     LOG.debug("REMOVE AFTER table=" + Bytes.toString(table) + ", isTableAvailable=" +
-        getHBaseAdmin().isTableAvailable(table) +
-        ", isTableEnabled=" + getHBaseAdmin().isTableEnabled(table));
+        admin.isTableAvailable(table) +
+        ", isTableEnabled=" + admin.isTableEnabled(table));
   }
 
   /**



Mime
View raw message