@Override
  public Result next() throws IOException {
    do {
      if (!hasMore) {
        return null;
      }
      values.clear();
      this.hasMore = scanner.nextRaw(values);
    } while (values.isEmpty());

    Result result = Result.create(values);
    if (this.scanMetrics != null) {
      long resultSize = 0;
      for (Cell cell : values) {
        resultSize += PrivateCellUtil.estimatedSerializedSizeOf(cell);
      }
      this.scanMetrics.countOfBytesInResults.addAndGet(resultSize);
      this.scanMetrics.countOfRowsScanned.incrementAndGet();
    }

    return result;
  }
A client scanner for a region opened for read-only on the client side. Assumes region data is not
changing.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientSideRegionScanner.java