hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zg...@apache.org
Subject hbase git commit: HBASE-18343 (addendum) Track the remaining unimplemented methods for async admin
Date Wed, 12 Jul 2017 02:21:27 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 f9f1a3a9f -> 45cabfb40


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/45cabfb4
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/45cabfb4
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/45cabfb4

Branch: refs/heads/branch-2
Commit: 45cabfb406de8eb56593dbde5ca86e214a88bc62
Parents: f9f1a3a
Author: Guanghao Zhang <zghao@apache.org>
Authored: Tue Jul 11 18:00:54 2017 +0800
Committer: Guanghao Zhang <zghao@apache.org>
Committed: Wed Jul 12 09:58:53 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/45cabfb4/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);


Mime
View raw message