HBASE-21179 Fix the number of actions in responseTooSlow log

Signed-off-by: Andrew Purtell <apurt...@apache.org>
Signed-off-by: Yu Li <l...@apache.org>


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

Branch: refs/heads/branch-1.3
Commit: 3679b403d6bc4228cddde177a9234325bde96205
Parents: 2dec020
Author: Guangxu Cheng <guangxuch...@gmail.com>
Authored: Wed Sep 12 12:55:47 2018 +0800
Committer: Guangxu Cheng <guangxuch...@gmail.com>
Committed: Thu Sep 13 15:11:54 2018 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/protobuf/ProtobufUtil.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3679b403/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 ed13617..98ee13e 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
@@ -2843,6 +2843,13 @@ public final class ProtobufUtil {
           ", row=" + getStringForByteString(r.getGet().getRow());
     } else if (m instanceof ClientProtos.MultiRequest) {
       ClientProtos.MultiRequest r = (ClientProtos.MultiRequest) m;
+
+      // Get the number of Actions
+      int actionsCount = 0;
+      for (ClientProtos.RegionAction regionAction : r.getRegionActionList()) {
+        actionsCount += regionAction.getActionCount();
+      }
+
       // Get first set of Actions.
       ClientProtos.RegionAction actions = r.getRegionActionList().get(0);
       String row = actions.getActionCount() <= 0? "":
@@ -2850,8 +2857,7 @@ public final class ProtobufUtil {
           actions.getAction(0).getGet().getRow():
           actions.getAction(0).getMutation().getRow());
       return "region= " + 
getStringForByteString(actions.getRegion().getValue()) +
-          ", for " + r.getRegionActionCount() +
-          " actions and 1st row key=" + row;
+          ", for " + actionsCount + " action(s) and 1st row key=" + row;
     } else if (m instanceof ClientProtos.MutateRequest) {
       ClientProtos.MutateRequest r = (ClientProtos.MutateRequest) m;
       return "region= " + getStringForByteString(r.getRegion().getValue()) +

Reply via email to