From ea4194039ed2a2b4987eed548edd60a580ea97c0 Mon Sep 17 00:00:00 2001 From: Guangxu Cheng Date: Mon, 10 Sep 2018 20:32:20 +0800 Subject: [PATCH] HBASE-21179 Fix the number of actions in responseTooSlow log --- .../hadoop/hbase/shaded/protobuf/ProtobufUtil.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java index 8163b04cdf8..87eff009ef9 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java @@ -2186,6 +2186,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 = r.getRegionActionList() + .stream() + .mapToInt(ClientProtos.RegionAction::getActionCount) + .sum(); + // Get first set of Actions. ClientProtos.RegionAction actions = r.getRegionActionList().get(0); String row = actions.getActionCount() <= 0? "": @@ -2193,8 +2200,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()) +