hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zg...@apache.org
Subject [1/3] hbase git commit: HBASE-18234 Revisit the async admin api
Date Mon, 26 Jun 2017 09:40:51 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 d9dd31939 -> 289938337


http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldSecureEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldSecureEndpoint.java
b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldSecureEndpoint.java
index 10a4d19..dc895f6 100644
--- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldSecureEndpoint.java
+++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldSecureEndpoint.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.regionserver;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.logging.Log;
@@ -136,7 +137,7 @@ public class TestHRegionServerBulkLoadWithOldSecureEndpoint extends TestHRegionS
               conn.getAdmin(getLocation().getServerName());
             CompactRegionRequest request =
               RequestConverter.buildCompactRegionRequest(
-                getLocation().getRegionInfo().getRegionName(), true, null);
+                getLocation().getRegionInfo().getRegionName(), true, Optional.empty());
             server.compactRegion(null, request);
             numCompactions.incrementAndGet();
             return null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBalancerAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBalancerAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBalancerAdminApi.java
index b1df40e..00303e2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBalancerAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBalancerAdminApi.java
@@ -29,23 +29,23 @@ public class TestAsyncBalancerAdminApi extends TestAsyncAdminBase {
 
   @Test
   public void testBalancer() throws Exception {
-    boolean initialState = admin.isBalancerEnabled().get();
+    boolean initialState = admin.isBalancerOn().get();
 
     // Start the balancer, wait for it.
-    boolean prevState = admin.setBalancerRunning(!initialState).get();
+    boolean prevState = admin.setBalancerOn(!initialState).get();
 
     // The previous state should be the original state we observed
     assertEquals(initialState, prevState);
 
     // Current state should be opposite of the original
-    assertEquals(!initialState, admin.isBalancerEnabled().get());
+    assertEquals(!initialState, admin.isBalancerOn().get());
 
     // Reset it back to what it was
-    prevState = admin.setBalancerRunning(initialState).get();
+    prevState = admin.setBalancerOn(initialState).get();
 
     // The previous state should be the opposite of the initial state
     assertEquals(!initialState, prevState);
     // Current state should be the original state again
-    assertEquals(initialState, admin.isBalancerEnabled().get());
+    assertEquals(initialState, admin.isBalancerOn().get());
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java
index ed2e246..eccff3f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java
@@ -74,7 +74,7 @@ public class TestAsyncNamespaceAdminApi extends TestAsyncAdminBase {
 
     // create namespace and verify
     admin.createNamespace(NamespaceDescriptor.create(nsName).build()).join();
-    assertEquals(3, admin.listNamespaceDescriptors().get().length);
+    assertEquals(3, admin.listNamespaceDescriptors().get().size());
     TEST_UTIL.waitFor(60000, new Waiter.Predicate<Exception>() {
       @Override
       public boolean evaluate() throws Exception {
@@ -84,7 +84,7 @@ public class TestAsyncNamespaceAdminApi extends TestAsyncAdminBase {
     assertNotNull(zkNamespaceManager.get(nsName));
     // delete namespace and verify
     admin.deleteNamespace(nsName).join();
-    assertEquals(2, admin.listNamespaceDescriptors().get().length);
+    assertEquals(2, admin.listNamespaceDescriptors().get().size());
     assertEquals(2, zkNamespaceManager.list().size());
     assertNull(zkNamespaceManager.get(nsName));
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcedureAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcedureAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcedureAdminApi.java
index 82f627c..832bcbe 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcedureAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcedureAdminApi.java
@@ -34,6 +34,7 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Random;
 
@@ -94,8 +95,8 @@ public class TestAsyncProcedureAdminApi extends TestAsyncAdminBase {
 
   @Test
   public void listProcedure() throws Exception {
-    ProcedureInfo[] procList = admin.listProcedures().get();
-    assertTrue(procList.length >= 0);
+    List<ProcedureInfo> procList = admin.listProcedures().get();
+    assertTrue(procList.size() >= 0);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
index 3bdd5fd..a3afabc 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java
@@ -25,6 +25,7 @@ import static org.junit.Assert.fail;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 import java.util.Random;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -84,8 +85,8 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.getTable().isSystemTable()) {
         info = regionInfo;
-        boolean closed = admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(),
-          rs.getServerName().getServerName()).get();
+        boolean closed = admin.closeRegion(regionInfo.getRegionName(),
+          Optional.of(rs.getServerName())).get();
         assertTrue(closed);
       }
     }
@@ -114,7 +115,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
           info = regionInfo;
           boolean catchNotServingException = false;
           try {
-            admin.closeRegionWithEncodedRegionName("sample", rs.getServerName().getServerName())
+            admin.closeRegion(Bytes.toBytes("sample"), Optional.of(rs.getServerName()))
                 .get();
           } catch (Exception e) {
             catchNotServingException = true;
@@ -130,76 +131,19 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
   }
 
   @Test
-  public void testCloseRegionWhenServerNameIsNull() throws Exception {
-    byte[] TABLENAME = Bytes.toBytes("TestHBACloseRegion3");
-    createTableWithDefaultConf(TableName.valueOf(TABLENAME));
-
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
-
-    try {
-      List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
-      for (HRegionInfo regionInfo : onlineRegions) {
-        if (!regionInfo.isMetaTable()) {
-          if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion3")) {
-            admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(), null).get();
-          }
-        }
-      }
-      fail("The test should throw exception if the servername passed is null.");
-    } catch (IllegalArgumentException e) {
-    }
-  }
-
-  @Test
   public void testCloseRegionWhenServerNameIsEmpty() throws Exception {
     byte[] TABLENAME = Bytes.toBytes("TestHBACloseRegionWhenServerNameIsEmpty");
     createTableWithDefaultConf(TableName.valueOf(TABLENAME));
 
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
-
-    try {
-      List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
-      for (HRegionInfo regionInfo : onlineRegions) {
-        if (!regionInfo.isMetaTable()) {
-          if (regionInfo.getRegionNameAsString()
-              .contains("TestHBACloseRegionWhenServerNameIsEmpty")) {
-            admin.closeRegionWithEncodedRegionName(regionInfo.getEncodedName(), " ").get();
-          }
-        }
-      }
-      fail("The test should throw exception if the servername passed is empty.");
-    } catch (IllegalArgumentException e) {
-    }
-  }
-
-  @Test
-  public void testCloseRegionWhenEncodedRegionNameIsNotGiven() throws Exception {
-    byte[] TABLENAME = Bytes.toBytes("TestHBACloseRegion4");
-    createTableWithDefaultConf(TableName.valueOf(TABLENAME));
-
-    HRegionInfo info = null;
-    HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TableName.valueOf(TABLENAME));
-
     List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
-        if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion4")) {
-          info = regionInfo;
-          boolean catchNotServingException = false;
-          try {
-            admin.closeRegionWithEncodedRegionName(regionInfo.getRegionNameAsString(),
-              rs.getServerName().getServerName()).get();
-          } catch (Exception e) {
-            // expected, ignore it.
-            catchNotServingException = true;
-          }
-          assertTrue(catchNotServingException);
+        if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegionWhenServerNameIsEmpty"))
{
+          admin.closeRegion(regionInfo.getRegionName(), Optional.empty()).get();
         }
       }
     }
-    onlineRegions = ProtobufUtil.getOnlineRegions(rs.getRSRpcServices());
-    assertTrue("The region should be present in online regions list.",
-      onlineRegions.contains(info));
   }
 
   @Test
@@ -214,10 +158,10 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
       HRegionLocation regionLocation = locator.getRegionLocation(Bytes.toBytes("mmm"));
       HRegionInfo region = regionLocation.getRegionInfo();
       byte[] regionName = region.getRegionName();
-      Pair<HRegionInfo, ServerName> pair = rawAdmin.getRegion(regionName).get();
-      assertTrue(Bytes.equals(regionName, pair.getFirst().getRegionName()));
-      pair = rawAdmin.getRegion(region.getEncodedNameAsBytes()).get();
-      assertTrue(Bytes.equals(regionName, pair.getFirst().getRegionName()));
+      HRegionLocation location = rawAdmin.getRegionLocation(regionName).get();
+      assertTrue(Bytes.equals(regionName, location.getRegionInfo().getRegionName()));
+      location = rawAdmin.getRegionLocation(region.getEncodedNameAsBytes()).get();
+      assertTrue(Bytes.equals(regionName, location.getRegionInfo().getRegionName()));
     }
   }
 
@@ -289,7 +233,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
     table.put(puts);
 
     if (isSplitRegion) {
-      admin.splitRegion(regions.get(0).getRegionName(), splitPoint).get();
+      admin.splitRegion(regions.get(0).getRegionName(), Optional.ofNullable(splitPoint)).get();
     } else {
       if (splitPoint == null) {
         admin.split(tableName).get();
@@ -456,7 +400,7 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
         }
       }
       assertTrue(destServerName != null && !destServerName.equals(serverName));
-      admin.move(hri.getEncodedNameAsBytes(), Bytes.toBytes(destServerName.getServerName())).get();
+      admin.move(hri.getRegionName(), Optional.of(destServerName)).get();
 
       long timeoutTime = System.currentTimeMillis() + 30000;
       while (true) {
@@ -607,15 +551,15 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
       assertTrue(countBefore > 0); // there should be some data files
       if (expectedState == CompactionState.MINOR) {
         if (singleFamily) {
-          admin.compact(table, family).get();
+          admin.compact(table, Optional.of(family)).get();
         } else {
-          admin.compact(table).get();
+          admin.compact(table, Optional.empty()).get();
         }
       } else {
         if (singleFamily) {
-          admin.majorCompact(table, family).get();
+          admin.majorCompact(table, Optional.of(family)).get();
         } else {
-          admin.majorCompact(table).get();
+          admin.majorCompact(table, Optional.empty()).get();
         }
       }
       long curt = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSnapshotAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSnapshotAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSnapshotAdminApi.java
index f71f311..3e0c261 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSnapshotAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncSnapshotAdminApi.java
@@ -53,9 +53,9 @@ public class TestAsyncSnapshotAdminApi extends TestAsyncAdminBase {
 
   @After
   public void cleanup() throws Exception {
-    admin.deleteSnapshots(".*").get();
-    admin.disableTables(".*").get();
-    admin.deleteTables(".*").get();
+    admin.deleteSnapshots(Pattern.compile(".*")).get();
+    admin.disableTables(Pattern.compile(".*")).get();
+    admin.deleteTables(Pattern.compile(".*")).get();
   }
 
   @Test
@@ -175,13 +175,22 @@ public class TestAsyncSnapshotAdminApi extends TestAsyncAdminBase {
     admin.snapshot(snapshotName3, tableName).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 3);
 
-    Assert.assertEquals(admin.listSnapshots("(.*)").get().size(), 3);
-    Assert.assertEquals(admin.listSnapshots("snapshotName(\\d+)").get().size(), 3);
-    Assert.assertEquals(admin.listSnapshots("snapshotName[1|3]").get().size(), 2);
+    Assert.assertEquals(admin.listSnapshots(Pattern.compile("(.*)")).get().size(), 3);
+    Assert.assertEquals(admin.listSnapshots(Pattern.compile("snapshotName(\\d+)")).get().size(),
3);
+    Assert.assertEquals(admin.listSnapshots(Pattern.compile("snapshotName[1|3]")).get().size(),
2);
     Assert.assertEquals(admin.listSnapshots(Pattern.compile("snapshot(.*)")).get().size(),
3);
-    Assert.assertEquals(admin.listTableSnapshots("testListSnapshots", "s(.*)").get().size(),
3);
-    Assert.assertEquals(admin.listTableSnapshots("fakeTableName", "snap(.*)").get().size(),
0);
-    Assert.assertEquals(admin.listTableSnapshots("test(.*)", "snap(.*)[1|3]").get().size(),
2);
+    Assert.assertEquals(
+      admin.listTableSnapshots(Pattern.compile("testListSnapshots"), Pattern.compile("s(.*)")).get()
+          .size(),
+      3);
+    Assert.assertEquals(
+      admin.listTableSnapshots(Pattern.compile("fakeTableName"), Pattern.compile("snap(.*)")).get()
+          .size(),
+      0);
+    Assert.assertEquals(
+      admin.listTableSnapshots(Pattern.compile("test(.*)"), Pattern.compile("snap(.*)[1|3]")).get()
+          .size(),
+      2);
   }
 
   @Test
@@ -201,19 +210,19 @@ public class TestAsyncSnapshotAdminApi extends TestAsyncAdminBase {
     admin.deleteSnapshot(snapshotName1).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 2);
 
-    admin.deleteSnapshots("(.*)abc").get();
+    admin.deleteSnapshots(Pattern.compile("(.*)abc")).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 2);
 
-    admin.deleteSnapshots("(.*)1").get();
+    admin.deleteSnapshots(Pattern.compile("(.*)1")).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 2);
 
-    admin.deleteTableSnapshots("(.*)", "(.*)1").get();
+    admin.deleteTableSnapshots(Pattern.compile("(.*)"), Pattern.compile("(.*)1")).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 2);
 
-    admin.deleteTableSnapshots("(.*)", "(.*)2").get();
+    admin.deleteTableSnapshots(Pattern.compile("(.*)"), Pattern.compile("(.*)2")).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 1);
 
-    admin.deleteTableSnapshots("(.*)", "(.*)3").get();
+    admin.deleteTableSnapshots(Pattern.compile("(.*)"), Pattern.compile("(.*)3")).get();
     Assert.assertEquals(admin.listSnapshots().get().size(), 0);
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
index c0ccd5e..6586a03 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncTableAdminApi.java
@@ -80,7 +80,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
 
   @Test
   public void testListTables() throws Exception {
-    int numTables = admin.listTables().get().length;
+    int numTables = admin.listTables().get().size();
     final TableName tableName1 = TableName.valueOf(name.getMethodName() + "1");
     final TableName tableName2 = TableName.valueOf(name.getMethodName() + "2");
     final TableName tableName3 = TableName.valueOf(name.getMethodName() + "3");
@@ -89,13 +89,13 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
       TEST_UTIL.createTable(tables[i], FAMILY);
     }
 
-    TableDescriptor[] tableDescs = admin.listTables().get();
-    int size = tableDescs.length;
+    List<TableDescriptor> tableDescs = admin.listTables().get();
+    int size = tableDescs.size();
     assertTrue(size >= tables.length);
     for (int i = 0; i < tables.length && i < size; i++) {
       boolean found = false;
-      for (int j = 0; j < tableDescs.length; j++) {
-        if (tableDescs[j].getTableName().equals(tables[i])) {
+      for (int j = 0; j < size; j++) {
+        if (tableDescs.get(j).getTableName().equals(tables[i])) {
           found = true;
           break;
         }
@@ -103,13 +103,13 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
       assertTrue("Not found: " + tables[i], found);
     }
 
-    TableName[] tableNames = admin.listTableNames().get();
-    size = tableNames.length;
+    List<TableName> tableNames = admin.listTableNames().get();
+    size = tableNames.size();
     assertTrue(size == (numTables + tables.length));
     for (int i = 0; i < tables.length && i < size; i++) {
       boolean found = false;
-      for (int j = 0; j < tableNames.length; j++) {
-        if (tableNames[j].equals(tables[i])) {
+      for (int j = 0; j < size; j++) {
+        if (tableNames.get(j).equals(tables[i])) {
           found = true;
           break;
         }
@@ -121,10 +121,10 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
       TEST_UTIL.deleteTable(tables[i]);
     }
 
-    tableDescs = admin.listTables((Pattern) null, true).get();
-    assertTrue("Not found system tables", tableDescs.length > 0);
-    tableNames = admin.listTableNames((Pattern) null, true).get();
-    assertTrue("Not found system tables", tableNames.length > 0);
+    tableDescs = admin.listTables(Optional.empty(), true).get();
+    assertTrue("Not found system tables", tableDescs.size() > 0);
+    tableNames = admin.listTableNames(Optional.empty(), true).get();
+    assertTrue("Not found system tables", tableNames.size() > 0);
   }
 
   @Test(timeout = 300000)
@@ -143,13 +143,13 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
 
   @Test(timeout = 300000)
   public void testCreateTable() throws Exception {
-    TableDescriptor[] tables = admin.listTables().get();
-    int numTables = tables.length;
+    List<TableDescriptor> tables = admin.listTables().get();
+    int numTables = tables.size();
     final  TableName tableName = TableName.valueOf(name.getMethodName());
     admin.createTable(new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(FAMILY)))
         .join();
     tables = admin.listTables().get();
-    assertEquals(numTables + 1, tables.length);
+    assertEquals(numTables + 1, tables.size());
     assertTrue("Table must be enabled.", TEST_UTIL.getHBaseCluster().getMaster()
         .getTableStateManager().isTableState(tableName, TableState.State.ENABLED));
     assertEquals(TableState.State.ENABLED, getStateFromMeta(tableName));
@@ -449,8 +449,8 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
           } catch (Exception e) {
           }
         });
-    TableDescriptor[] failed = admin.deleteTables(Pattern.compile("testDeleteTables.*")).get();
-    assertEquals(0, failed.length);
+    List<TableDescriptor> failed = admin.deleteTables(Pattern.compile("testDeleteTables.*")).get();
+    assertEquals(0, failed.size());
     Arrays.stream(tables).forEach((table) -> {
       admin.tableExists(table).thenAccept((exist) -> assertFalse(exist)).join();
     });
@@ -572,7 +572,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
     ht1.get(get);
     ht2.get(get);
 
-    this.admin.disableTables("testDisableAndEnableTable.*").join();
+    this.admin.disableTables(Pattern.compile("testDisableAndEnableTable.*")).join();
 
     // Test that tables are disabled
     get = new Get(row);
@@ -589,7 +589,7 @@ public class TestAsyncTableAdminApi extends TestAsyncAdminBase {
     assertEquals(TableState.State.DISABLED, getStateFromMeta(tableName2));
 
     assertTrue(ok);
-    this.admin.enableTables("testDisableAndEnableTable.*").join();
+    this.admin.enableTables(Pattern.compile("testDisableAndEnableTable.*")).join();
 
     // Test that tables are enabled
     try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
index 61fe2cc..d640cbf 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
@@ -28,6 +28,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.logging.Log;
@@ -236,7 +237,7 @@ public class TestHRegionServerBulkLoad {
             AdminProtos.AdminService.BlockingInterface server =
               conn.getAdmin(getLocation().getServerName());
             CompactRegionRequest request = RequestConverter.buildCompactRegionRequest(
-                getLocation().getRegionInfo().getRegionName(), true, null);
+                getLocation().getRegionInfo().getRegionName(), true, Optional.empty());
             server.compactRegion(null, request);
             numCompactions.incrementAndGet();
             return null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/28993833/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldClient.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldClient.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldClient.java
index 7aa1b31..a28f8f1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldClient.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoadWithOldClient.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.regionserver;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.logging.Log;
@@ -122,7 +123,7 @@ public class TestHRegionServerBulkLoadWithOldClient extends TestHRegionServerBul
               conn.getAdmin(getLocation().getServerName());
             CompactRegionRequest request =
               RequestConverter.buildCompactRegionRequest(
-                getLocation().getRegionInfo().getRegionName(), true, null);
+                getLocation().getRegionInfo().getRegionName(), true, Optional.empty());
             server.compactRegion(null, request);
             numCompactions.incrementAndGet();
             return null;


Mime
View raw message