You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vi...@apache.org on 2018/08/14 03:08:48 UTC

hbase git commit: HBASE-21028 Backport HBASE-18633 to branch-1.3

Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 68981ee72 -> fe55991b8


HBASE-21028 Backport HBASE-18633 to branch-1.3


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

Branch: refs/heads/branch-1.3
Commit: fe55991b8ea242bc9a460f83602753d63c8e33df
Parents: 68981ee
Author: Vikas Vishwakarma <vi...@apache.org>
Authored: Tue Aug 14 08:37:59 2018 +0530
Committer: Vikas Vishwakarma <vi...@apache.org>
Committed: Tue Aug 14 08:37:59 2018 +0530

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/RSRpcServices.java       | 13 +++++++++----
 .../hbase/regionserver/TestMultiLogThreshold.java      | 12 ++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fe55991b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 0037f5f..151a864 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1008,16 +1008,17 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
 
   // Exposed for testing
   static interface LogDelegate {
-    void logBatchWarning(int sum, int rowSizeWarnThreshold);
+    void logBatchWarning(String firstRegionName, int sum, int rowSizeWarnThreshold);
   }
 
   private static LogDelegate DEFAULT_LOG_DELEGATE = new LogDelegate() {
     @Override
-    public void logBatchWarning(int sum, int rowSizeWarnThreshold) {
+    public void logBatchWarning(String firstRegionName, int sum, int rowSizeWarnThreshold) {
       if (LOG.isWarnEnabled()) {
         LOG.warn("Large batch operation detected (greater than " + rowSizeWarnThreshold
             + ") (HBASE-18023)." + " Requested Number of Rows: " + sum + " Client: "
-            + RpcServer.getRequestUserName() + "/" + RpcServer.getRemoteAddress());
+            + RpcServer.getRequestUserName() + "/" + RpcServer.getRemoteAddress()
+            + " first region in multi=" + firstRegionName);
       }
     }
   };
@@ -2241,11 +2242,15 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
 
   private void checkBatchSizeAndLogLargeSize(MultiRequest request) {
     int sum = 0;
+    String firstRegionName = null;
     for (RegionAction regionAction : request.getRegionActionList()) {
+      if (sum == 0) {
+        firstRegionName = Bytes.toStringBinary(regionAction.getRegion().getValue().toByteArray());
+      }
       sum += regionAction.getActionCount();
     }
     if (sum > rowSizeWarnThreshold) {
-      ld.logBatchWarning(sum, rowSizeWarnThreshold);
+      ld.logBatchWarning(firstRegionName, sum, rowSizeWarnThreshold);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/fe55991b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java
index 23ab1ff..955b613 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiLogThreshold.java
@@ -119,25 +119,29 @@ public class TestMultiLogThreshold {
   @Test
   public void testMultiLogThresholdRegionActions() throws ServiceException, IOException {
     sendMultiRequest(THRESHOLD + 1, ActionType.REGION_ACTIONS);
-    verify(LD, Mockito.times(1)).logBatchWarning(Mockito.anyInt(), Mockito.anyInt());
+    verify(LD, Mockito.times(1)).logBatchWarning(Mockito.anyString(), Mockito.anyInt(),
+      Mockito.anyInt());
   }
 
   @Test
   public void testMultiNoLogThresholdRegionActions() throws ServiceException, IOException {
     sendMultiRequest(THRESHOLD, ActionType.REGION_ACTIONS);
-    verify(LD, Mockito.never()).logBatchWarning(Mockito.anyInt(), Mockito.anyInt());
+    verify(LD, Mockito.never()).logBatchWarning(Mockito.anyString(), Mockito.anyInt(),
+      Mockito.anyInt());
   }
 
   @Test
   public void testMultiLogThresholdActions() throws ServiceException, IOException {
     sendMultiRequest(THRESHOLD + 1, ActionType.ACTIONS);
-    verify(LD, Mockito.times(1)).logBatchWarning(Mockito.anyInt(), Mockito.anyInt());
+    verify(LD, Mockito.times(1)).logBatchWarning(Mockito.anyString(), Mockito.anyInt(),
+      Mockito.anyInt());
   }
 
   @Test
   public void testMultiNoLogThresholdAction() throws ServiceException, IOException {
     sendMultiRequest(THRESHOLD, ActionType.ACTIONS);
-    verify(LD, Mockito.never()).logBatchWarning(Mockito.anyInt(), Mockito.anyInt());
+    verify(LD, Mockito.never()).logBatchWarning(Mockito.anyString(), Mockito.anyInt(),
+      Mockito.anyInt());
   }
 
 }