HBASE-21179 Fix the number of actions in responseTooSlow log

This commit is contained in:
Guangxu Cheng 2018-09-10 20:32:20 +08:00
parent 15842109c0
commit ea4194039e
1 changed files with 8 additions and 2 deletions

View File

@ -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()) +