if (m instanceof ScanRequest) {
// This should be small and safe to output. No data.
return TextFormat.shortDebugString(m);
} else if (m instanceof RegionServerReportRequest) {
// Print a short message only, just the servername and the requests, not the full load.
RegionServerReportRequest r = (RegionServerReportRequest)m;
return "server " + TextFormat.shortDebugString(r.getServer()) +
" load { numberOfRequests: " + r.getLoad().getNumberOfRequests() + " }";
} else if (m instanceof RegionServerStartupRequest) {
// Should be small enough.
return TextFormat.shortDebugString(m);
} else if (m instanceof MutationProto) {
return toShortString((MutationProto)m);
} else if (m instanceof GetRequest) {
GetRequest r = (GetRequest) m;
return "region= " + getStringForByteString(r.getRegion().getValue()) +
", row=" + getStringForByteString(r.getGet().getRow());
} else if (m instanceof ClientProtos.MultiRequest) {
ClientProtos.MultiRequest r = (ClientProtos.MultiRequest) m;
// Get first set of Actions.
ClientProtos.RegionAction actions = r.getRegionActionList().get(0);
String row = actions.getActionCount() <= 0? "":
getStringForByteString(actions.getAction(0).hasGet()?
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;
} else if (m instanceof ClientProtos.MutateRequest) {
ClientProtos.MutateRequest r = (ClientProtos.MutateRequest) m;
return "region= " + getStringForByteString(r.getRegion().getValue()) +
", row=" + getStringForByteString(r.getMutation().getRow());
}
return "TODO: " + m.getClass().toString();
}