stoty commented on code in PR #5870:
URL: https://github.com/apache/hbase/pull/5870#discussion_r1590665528


##########
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/ProtobufStreamingOutput.java:
##########
@@ -91,15 +89,18 @@ private void writeToStream(CellSetModel model, String 
contentType, OutputStream
 
   private CellSetModel createModelFromResults(Result[] results) {
     CellSetModel cellSetModel = new CellSetModel();
-    for (Result rs : results) {
-      byte[] rowKey = rs.getRow();
-      RowModel rModel = new RowModel(rowKey);
-      List<Cell> kvs = rs.listCells();
-      for (Cell kv : kvs) {
-        rModel.addCell(new CellModel(CellUtil.cloneFamily(kv), 
CellUtil.cloneQualifier(kv),
-          kv.getTimestamp(), CellUtil.cloneValue(kv)));
+    for (Result r : results) {
+      if (r.isEmpty()) {
+        continue;
       }
-      cellSetModel.addRow(rModel);
+      Cell firstCell = r.rawCells()[0];

Review Comment:
   Pushed the refactor



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to