private long getCellHeapSize() throws Exception {
    if (CELL_HEAP_SIZE == -1) {
      // Do a partial scan that will return a single result with a single cell
      Scan scan = new Scan();
      scan.setMaxResultSize(1);
      scan.setAllowPartialResults(true);
      ResultScanner scanner = TABLE.getScanner(scan);

      Result result = scanner.next();

      assertTrue(result != null);
      assertTrue(result.rawCells() != null);
      assertTrue(result.rawCells().length == 1);

      CELL_HEAP_SIZE = result.rawCells()[0].heapSize();
      scanner.close();
    }

    return CELL_HEAP_SIZE;
  }
@return The approximate heap size of a cell in the test table. All cells should have
        approximately the same heap size, so the value is cached to avoid repeating the
        calculation
@throws Exception on unexpected failure
hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerSideScanMetricsFromClientSide.java