saintstack commented on a change in pull request #975: HBASE-23624 Add a tool 
to dump the procedure info in HFile
URL: https://github.com/apache/hbase/pull/975#discussion_r362261050
 
 

 ##########
 File path: hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java
 ##########
 @@ -598,19 +598,28 @@ public static void setTimestamp(Cell cell, byte[] ts, 
int tsOffset) throws IOExc
   }
 
   /**
-   * @param cell
    * @return The Key portion of the passed <code>cell</code> as a String.
    */
   public static String getCellKeyAsString(Cell cell) {
-    StringBuilder sb = new StringBuilder(Bytes.toStringBinary(
-      cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));
+    return getCellKeyAsString(cell,
+      c -> Bytes.toStringBinary(c.getRowArray(), c.getRowOffset(), 
c.getRowLength()));
+  }
+
+  /**
+   * @param cell the cell to convert
+   * @param rowConverter used to convert the row of the cell to a string
+   * @return The Key portion of the passed <code>cell</code> as a String.
+   */
+  public static String getCellKeyAsString(Cell cell, Function<Cell, String> 
rowConverter) {
 
 Review comment:
   Nice.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to