HBASE-18343 (addendum) Track the remaining unimplemented methods for async admin


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/22dce22e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/22dce22e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/22dce22e

Branch: refs/heads/HBASE-18147
Commit: 22dce22e068a541a8436ea27712004b02f8ff84a
Parents: c0f743e
Author: Guanghao Zhang <zg...@apache.org>
Authored: Tue Jul 11 18:00:54 2017 +0800
Committer: Guanghao Zhang <zg...@apache.org>
Committed: Wed Jul 12 09:32:00 2017 +0800

----------------------------------------------------------------------
 .../hadoop/hbase/client/TestAsyncRegionAdminApi.java    | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/22dce22e/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 fcd3d01..2d64afc 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
@@ -27,7 +27,6 @@ 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;
 import java.util.stream.Collectors;
@@ -66,8 +65,6 @@ import org.junit.runners.Parameterized;
 @Category({ LargeTests.class, ClientTests.class })
 public class TestAsyncRegionAdminApi extends TestAsyncAdminBase {
 
-  public static Random RANDOM = new Random(System.currentTimeMillis());
-
   @Test
   public void testCloseRegion() throws Exception {
     createTableWithDefaultConf(tableName);
@@ -358,7 +355,8 @@ public class TestAsyncRegionAdminApi extends 
TestAsyncAdminBase {
   public void testSplitSwitch() throws Exception {
     createTableWithDefaultConf(tableName);
     byte[][] families = { FAMILY };
-    loadData(tableName, families, 1000);
+    final int rows = 10000;
+    loadData(tableName, families, rows);
 
     RawAsyncTable metaTable = ASYNC_CONN.getRawTable(META_TABLE_NAME);
     List<HRegionLocation> regionLocations =
@@ -367,12 +365,12 @@ public class TestAsyncRegionAdminApi extends 
TestAsyncAdminBase {
 
     initSplitMergeSwitch();
     assertTrue(admin.setSplitOn(false).get());
-    admin.split(tableName).join();
+    admin.split(tableName, Bytes.toBytes(rows / 2)).join();
     int count = admin.getTableRegions(tableName).get().size();
     assertTrue(originalCount == count);
 
     assertFalse(admin.setSplitOn(true).get());
-    admin.split(tableName).join();
+    admin.split(tableName, Bytes.toBytes(rows / 2)).join();
     while ((count = admin.getTableRegions(tableName).get().size()) == 
originalCount) {
       Threads.sleep(100);
     }
@@ -654,7 +652,7 @@ public class TestAsyncRegionAdminApi extends 
TestAsyncAdminBase {
     byte[] qualifier = Bytes.toBytes("val");
     for (int i = 0; i < flushes; i++) {
       for (int k = 0; k < rows; k++) {
-        byte[] row = Bytes.toBytes(RANDOM.nextLong());
+        byte[] row = Bytes.add(Bytes.toBytes(k), Bytes.toBytes(i));
         Put p = new Put(row);
         for (int j = 0; j < families.length; ++j) {
           p.addColumn(families[j], qualifier, row);

Reply via email to