public static RowModel createRowModelFromResult(Result r) {
    Cell firstCell = r.rawCells()[0];
    RowModel rowModel =
      new RowModel(firstCell.getRowArray(), firstCell.getRowOffset(), firstCell.getRowLength());
    int cellsLength = r.rawCells().length;
    for (int i = 0; i < cellsLength; i++) {
      rowModel.addCell(new CellModel(r.rawCells()[i]));
    }
    return rowModel;
  }
Speed-optimized method to convert an HBase result to a RowModel. Avoids iterators and uses the
non-cloning constructors to minimize overhead, especially when using protobuf marshalling.
@param r non-empty Result object
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RestUtil.java