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


##########
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGetAndPutResource.java:
##########
@@ -167,6 +170,39 @@ public void testMultipleCellCheckPutPB() throws 
IOException {
     assertEquals(200, response.getCode());
   }
 
+  @Test
+  public void testMultipleCellPutPBEntity() throws IOException {
+    Response response = getValuePB(TABLE, ROW_1, COLUMN_1);
+    assertEquals(404, response.getCode());
+
+    CellSetModel model = new CellSetModel();
+    RowModel row1 = new RowModel(ROW_1);
+    row1.addCell(new CellModel(Bytes.toBytes(COLUMN_1), 
Bytes.toBytes(VALUE_1)));
+    row1.addCell(new CellModel(Bytes.toBytes(COLUMN_2), 
Bytes.toBytes(VALUE_2)));
+    row1.addCell(new CellModel(Bytes.toBytes(COLUMN_3), 
Bytes.toBytes(VALUE_3)));
+    model.addRow(row1);
+
+    // This illustrates how to use the lower level API to more efficiently 
marshall cells
+    // to Protobuf for mutations
+    StringBuilder path = new StringBuilder();
+    path.append('/');
+    path.append(TABLE);
+    path.append('/');
+    path.append("dummy_row");
+    HttpPut httpPut = new HttpPut(path.toString());
+    httpPut.setEntity(new ProtobufHttpEntity(model));

Review Comment:
   This is how a normal client can use ProtobufHttpEntity, @Apache9 .



-- 
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