Class TestSeekBeforeWithInlineBlocks

java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestSeekBeforeWithInlineBlocks

@Tag("org.apache.hadoop.hbase.testclassification.IOTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestSeekBeforeWithInlineBlocks extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
    private org.apache.hadoop.conf.Configuration
     
    private static final int
     
    private static final int[]
     
    private static final byte[]
     
    private org.apache.hadoop.fs.FileSystem
     
    private static final int[]
     
    private static final org.slf4j.Logger
     
    private static final int
     
    private static final Random
     
    private static final HBaseTestingUtil
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    checkCell(org.apache.hadoop.hbase.ExtendedCell expected, org.apache.hadoop.hbase.ExtendedCell actual)
    Check a key/value pair after it was read by the reader
    private void
    checkNoSeekBefore(org.apache.hadoop.hbase.ExtendedCell[] cells, org.apache.hadoop.hbase.io.hfile.HFileScanner scanner, int i)
     
    private void
    checkSeekBefore(org.apache.hadoop.hbase.ExtendedCell[] cells, org.apache.hadoop.hbase.io.hfile.HFileScanner scanner, int i)
     
    void
    Scanner.seekBefore() could fail because when seeking to a previous HFile data block, it needs to know the size of that data block, which it calculates using current data block offset and the previous data block offset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • testMultiIndexLevelRandomHFileWithBlooms

      Scanner.seekBefore() could fail because when seeking to a previous HFile data block, it needs to know the size of that data block, which it calculates using current data block offset and the previous data block offset. This fails to work when there are leaf-level index blocks in the scannable section of the HFile, i.e. starting in HFileV2. This test will try seekBefore() on a flat (single-level) and multi-level (2,3) HFile and confirm this bug is now fixed. This bug also happens for inline Bloom blocks for the same reasons.
      Throws:
      IOException
    • checkSeekBefore

      private void checkSeekBefore(org.apache.hadoop.hbase.ExtendedCell[] cells, org.apache.hadoop.hbase.io.hfile.HFileScanner scanner, int i) throws IOException
      Throws:
      IOException
    • checkNoSeekBefore

      private void checkNoSeekBefore(org.apache.hadoop.hbase.ExtendedCell[] cells, org.apache.hadoop.hbase.io.hfile.HFileScanner scanner, int i) throws IOException
      Throws:
      IOException
    • checkCell

      private void checkCell(org.apache.hadoop.hbase.ExtendedCell expected, org.apache.hadoop.hbase.ExtendedCell actual)
      Check a key/value pair after it was read by the reader