virajjasani commented on a change in pull request #2556:
URL: https://github.com/apache/hbase/pull/2556#discussion_r507652390
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALPrettyPrinter.java
##########
@@ -356,11 +361,18 @@ public static void printCell(PrintStream out, Map<String,
Object> op, boolean ou
out.println("cell total size sum: " + op.get("total_size_sum"));
}
- public static Map<String, Object> toStringMap(Cell cell, boolean
printRowKeyOnly) {
+ public static Map<String, Object> toStringMap(Cell cell,
+ boolean printRowKeyOnly, String rowPrefix, boolean outputValues) {
Map<String, Object> stringMap = new HashMap<>();
- stringMap.put("row",
- Bytes.toStringBinary(cell.getRowArray(), cell.getRowOffset(),
cell.getRowLength()));
+ String rowKey = Bytes.toStringBinary(cell.getRowArray(),
+ cell.getRowOffset(), cell.getRowLength());
+ // If the row prefix is provided and the current row doesn't satisfy
+ // the prefix requirement return empty map
+ if (!Strings.isNullOrEmpty(rowPrefix) && !rowKey.startsWith(rowPrefix)) {
+ return stringMap;
Review comment:
This is better
----------------------------------------------------------------
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:
[email protected]