Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-25115

HFilePrettyPrinter can't seek to the row which is the first row of a hfile

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      This issue can be reproduced by below steps:

      • make a hfile contains two rows '000' and '001';
      D:\bin>hbase hfile -p -f /hbase/data/default/test2/df76e4acab5398e70be332f6807ec3ba/f1/fda213c556d540a58d29d6bd85931dcd
      K: 000/f1:a/1601282789548/Put/vlen=4/seqid=4 V: aaaa
      K: 001/f1:a/1601282792779/Put/vlen=4/seqid=5 V: aaaa
      Scanned kv count -> 2
      • '001' can be seeked to;
      D:\bin>hbase hfile -e -w 001 -f /hbase/data/default/test2/df76e4acab5398e70be332f6807ec3ba/f1/fda213c556d540a58d29d6bd85931dcd
      K: 001/f1:a/1601282792779/Put/vlen=4/seqid=5
      Scanned kv count -> 1
      • but '000' can't be seeked to;
      D:\bin>hbase hfile -e -w 000 -f /hbase/data/default/test2/df76e4acab5398e70be332f6807ec3ba/f1/fda213c556d540a58d29d6bd85931dcd
      Scanned kv count -> 0

       In HFilePrettyPrinter we use "scanner.seekTo(PrivateCellUtil.createFirstOnRow(this.row))" to seek to row.But this method will retrurn -1 when the row is the first row of hfile.

      Attachments

        1. HBASE-25115.patch
          1 kB
          Chaoqiang Zhong

        Activity

          People

            niuyulin Yulin Niu
            zcq_rambo Chaoqiang Zhong
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: