public static ScanRequest buildScanRequest(long scannerId, int numberOfRows, boolean closeScanner,
    boolean trackMetrics) {
    ScanRequest.Builder builder = ScanRequest.newBuilder();
    builder.setNumberOfRows(numberOfRows);
    builder.setCloseScanner(closeScanner);
    builder.setScannerId(scannerId);
    builder.setClientHandlesPartials(true);
    builder.setClientHandlesHeartbeats(true);
    builder.setTrackScanMetrics(trackMetrics);
    return builder.build();
  }
Create a protocol buffer ScanRequest for a scanner id
@return a scan request
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java