hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vik...@apache.org
Subject hbase git commit: HBASE-18633 Add more info to understand the source/scenario of large batch requests exceeding threshold
Date Mon, 28 Aug 2017 10:01:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 dbe60e385 -> f071e56a9


HBASE-18633 Add more info to understand the source/scenario of large batch requests exceeding
threshold


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

Branch: refs/heads/branch-1
Commit: f071e56a9e9c231b7e834c26835db9f472dc824f
Parents: dbe60e3
Author: Vikas Vishwakarma <vvishwakarma@salesforce.com>
Authored: Wed Aug 23 16:48:17 2017 +0530
Committer: Vikas Vishwakarma <vikasv@apache.org>
Committed: Mon Aug 28 15:30:40 2017 +0530

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/f071e56a/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 cd73e32..d3c8772 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
@@ -1026,16 +1026,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);
       }
     }
   };
@@ -2268,11 +2269,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/f071e56a/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..9e0c687 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,25 @@ 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());
   }
 
 }


Mime
View raw message