diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index f62a218b741..cf33d7cdc01 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -2501,12 +2501,15 @@ public class RpcServer implements RpcServerInterface, ConfigurationObserver { responseInfo.put("param", stringifiedParam); if (param instanceof ClientProtos.ScanRequest && rsRpcServices != null) { ClientProtos.ScanRequest request = ((ClientProtos.ScanRequest) param); + String scanDetails; if (request.hasScannerId()) { long scannerId = request.getScannerId(); - String scanDetails = rsRpcServices.getScanDetailsWithId(scannerId); - if (scanDetails != null) { - responseInfo.put("scandetails", scanDetails); - } + scanDetails = rsRpcServices.getScanDetailsWithId(scannerId); + } else { + scanDetails = rsRpcServices.getScanDetailsWithRequest(request); + } + if (scanDetails != null) { + responseInfo.put("scandetails", scanDetails); } } if (param instanceof ClientProtos.MultiRequest) { 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 985168e2fc8..34f322c9ba4 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 @@ -1260,6 +1260,21 @@ public class RSRpcServices implements HBaseRPCErrorHandler, return builder.toString(); } + public String getScanDetailsWithRequest(ScanRequest request) { + try { + if (!request.hasRegion()) { + return null; + } + Region region = getRegion(request.getRegion()); + StringBuilder builder = new StringBuilder(); + builder.append("table: ").append(region.getRegionInfo().getTable().getNameAsString()); + builder.append(" region: ").append(region.getRegionInfo().getRegionNameAsString()); + return builder.toString(); + } catch (IOException ignored) { + return null; + } + } + /** * Get the vtime associated with the scanner. * Currently the vtime is the number of "next" calls.