You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/09/30 11:39:53 UTC

[GitHub] [hbase] nyl3532016 commented on a change in pull request #2473: HBASE-25115 HFilePrettyPrinter can't seek to the row which is the first row of a hfile

nyl3532016 commented on a change in pull request #2473:
URL: https://github.com/apache/hbase/pull/2473#discussion_r497395411



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
##########
@@ -323,15 +323,20 @@ public int processFile(Path file, boolean checkRootDir) throws IOException {
       HFileScanner scanner = reader.getScanner(false, false, false);
       fileStats = new KeyValueStatsCollector();
       boolean shouldScanKeysValues = false;
+      boolean needSeekToBegin = true;
       if (this.isSeekToRow) {
         // seek to the first kv on this row
-        shouldScanKeysValues =
-          (scanner.seekTo(PrivateCellUtil.createFirstOnRow(this.row)) != -1);
-      } else {
+        if (scanner.seekTo(PrivateCellUtil.createFirstOnRow(this.row)) != -1) {
+          needSeekToBegin = false;
+          shouldScanKeysValues = true;
+        }
+      }
+      if (needSeekToBegin) {

Review comment:
       Yes, but only when the row is the first row in hfile, `scanner.seekTo(PrivateCellUtil.createFirstOnRow(this.row))` return -1 




----------------------------------------------------------------
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:
users@infra.apache.org