private long getResultSizeForNumberOfCells(int numberOfCells) throws Exception {
    return getCellHeapSize() * numberOfCells;
  }
@return the result size that should be used in {@link Scan#setMaxResultSize(long)} if you want
        the server to return exactly numberOfCells cells
hbase-server/src/test/java/org/apache/hadoop/hbase/TestPartialResultsFromClientSide.java