private void addResults(ScanResponse.Builder builder, List<Result> results,
    HBaseRpcController controller, boolean isDefaultRegion, boolean clientCellBlockSupported) {
    builder.setStale(!isDefaultRegion);
    if (results.isEmpty()) {
      return;
    }
    if (clientCellBlockSupported) {
      for (Result res : results) {
        builder.addCellsPerResult(res.size());
        builder.addPartialFlagPerResult(res.mayHaveMoreCellsInRow());
      }
      controller.setCellScanner(PrivateCellUtil.createExtendedCellScanner(results));
    } else {
      for (Result res : results) {
        ClientProtos.Result pbr = ProtobufUtil.toResult(res);
        builder.addResults(pbr);
      }
    }
  }
Checks for the following pre-checks in order:
<ol>
<li>RegionServer is running</li>
<li>If authorization is enabled, then RPC caller has ADMIN permissions</li>
</ol>
@param requestName name of rpc request. Used in reporting failures to provide context.
@throws ServiceException If any of the above listed pre-check fails.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java