hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-19837 Flakey TestRegionLoad
Date Mon, 22 Jan 2018 07:25:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 c1470714b -> b44be75bd


HBASE-19837 Flakey TestRegionLoad

Add debug, change name of the rows so readable.


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

Branch: refs/heads/branch-2
Commit: b44be75bd1eea26e66f83f0b56b4115f661dd3a4
Parents: c147071
Author: Michael Stack <stack@apache.org>
Authored: Sun Jan 21 23:03:16 2018 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Sun Jan 21 23:24:58 2018 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/TestRegionLoad.java | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b44be75b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionLoad.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionLoad.java
index c1dab38..9712b9e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionLoad.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestRegionLoad.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.client.Table;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.MiscTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.Threads;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -43,10 +44,12 @@ import org.junit.experimental.categories.Category;
 
 import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
 import org.apache.hbase.thirdparty.com.google.common.collect.Maps;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Category({MiscTests.class, MediumTests.class})
 public class TestRegionLoad {
-
+  private static final Logger LOG = LoggerFactory.getLogger(TestRegionLoad.class);
   private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
   private static Admin admin;
 
@@ -65,18 +68,16 @@ public class TestRegionLoad {
 
   @AfterClass
   public static void afterClass() throws Exception {
-    for (TableName table : tables) {
-      UTIL.deleteTableIfAny(table);
-    }
     UTIL.shutdownMiniCluster();
   }
 
   private static void createTables() throws IOException, InterruptedException {
-    byte[] FAMILY = Bytes.toBytes("f");
+    byte[][] FAMILIES = new byte [][] {Bytes.toBytes("f")};
     for (TableName tableName : tables) {
-      Table table = UTIL.createMultiRegionTable(tableName, FAMILY, 16);
+      Table table =
+          UTIL.createTable(tableName, FAMILIES, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
       UTIL.waitTableAvailable(tableName);
-      UTIL.loadTable(table, FAMILY);
+      UTIL.loadTable(table, FAMILIES[0]);
     }
   }
 
@@ -87,8 +88,13 @@ public class TestRegionLoad {
     for (ServerName serverName : admin
         .getClusterMetrics(EnumSet.of(Option.LIVE_SERVERS)).getLiveServerMetrics().keySet())
{
       List<HRegionInfo> regions = admin.getOnlineRegions(serverName);
+      LOG.info("serverName=" + serverName + ", regions=" +
+          regions.stream().map(r -> r.getRegionNameAsString()).collect(Collectors.toList()));
       Collection<RegionLoad> regionLoads = admin.getRegionMetrics(serverName)
         .stream().map(r -> new RegionLoad(r)).collect(Collectors.toList());
+      LOG.info("serverName=" + serverName + ", regionLoads=" +
+          regionLoads.stream().map(r -> Bytes.toString(r.getRegionName())).
+              collect(Collectors.toList()));
       checkRegionsAndRegionLoads(regions, regionLoads);
     }
 
@@ -115,6 +121,12 @@ public class TestRegionLoad {
           (v1, v2) -> {
             throw new RuntimeException("impossible!!");
           }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR)));
+      LOG.info("serverName=" + serverName + ", getRegionLoads=" +
+          serverLoad.getRegionsLoad().keySet().stream().map(r -> Bytes.toString(r)).
+              collect(Collectors.toList()));
+      LOG.info("serverName=" + serverName + ", regionLoads=" +
+          regionLoads.keySet().stream().map(r -> Bytes.toString(r)).
+              collect(Collectors.toList()));
       compareRegionLoads(serverLoad.getRegionsLoad(), regionLoads);
     }
   }


Mime
View raw message