You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2018/01/22 07:24:30 UTC

hbase git commit: HBASE-19837 Flakey TestRegionLoad

Repository: hbase
Updated Branches:
  refs/heads/master 27d00f586 -> f3c563fc0


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

Branch: refs/heads/master
Commit: f3c563fc004b9a373716e7c6159327925ce84c8c
Parents: 27d00f5
Author: Michael Stack <st...@apache.org>
Authored: Sun Jan 21 23:03:16 2018 -0800
Committer: Michael Stack <st...@apache.org>
Committed: Sun Jan 21 23:24:23 2018 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/protobuf/ProtobufUtil.java     |  2 +-
 .../org/apache/hadoop/hbase/TestRegionLoad.java | 26 ++++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f3c563fc/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
index fd263b0..eed911a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
@@ -260,7 +260,7 @@ public final class ProtobufUtil {
    * Return the Exception thrown by the remote server wrapped in
    * ServiceException as cause. RemoteException are left untouched.
    *
-   * @param se ServiceException that wraps IO exception thrown by the server
+   * @param e ServiceException that wraps IO exception thrown by the server
    * @return Exception wrapped in ServiceException.
    */
   public static IOException getServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/f3c563fc/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);
     }
   }