Class TestHalfStoreFileReader

java.lang.Object
org.apache.hadoop.hbase.io.TestHalfStoreFileReader

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

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
    (package private) static final int
     
    private static HBaseTestingUtil
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static byte[]
     
    private void
    doTestOfScanAndReseek(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.io.Reference bottom, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf)
     
    private org.apache.hadoop.hbase.Cell
    doTestOfSeekBefore(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.io.Reference bottom, org.apache.hadoop.hbase.ExtendedCell seekBefore, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig)
     
    (package private) List<org.apache.hadoop.hbase.KeyValue>
     
    private org.apache.hadoop.hbase.KeyValue
    getLastOnCol(org.apache.hadoop.hbase.Cell curr)
     
    static void
     
    static void
     
    void
    Test the scanner and reseek of a half hfile scanner.
    void
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • setupBeforeClass

      @BeforeAll public static void setupBeforeClass() throws Exception
      Throws:
      Exception
    • tearDownAfterClass

      @AfterAll public static void tearDownAfterClass() throws Exception
      Throws:
      Exception
    • testHalfScanAndReseek

      @Test public void testHalfScanAndReseek() throws Exception
      Test the scanner and reseek of a half hfile scanner. The scanner API demands that seekTo and reseekTo() only return < 0 if the key lies before the start of the file (with no position on the scanner). Returning 0 if perfect match (rare), and return > 1 if we got an imperfect match. The latter case being the most common, we should generally be returning 1, and if we do, there may or may not be a 'next' in the scanner/file. A bug in the half file scanner was returning -1 at the end of the bottom half, and that was causing the infrastructure above to go null causing NPEs and other problems. This test reproduces that failure, and also tests both the bottom and top of the file while we are at it.
      Throws:
      Exception
    • doTestOfScanAndReseek

      private void doTestOfScanAndReseek(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.io.Reference bottom, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf) throws Exception
      Throws:
      Exception
    • testHalfScanner

      @Test public void testHalfScanner() throws IOException
      Throws:
      IOException
    • doTestOfSeekBefore

      private org.apache.hadoop.hbase.Cell doTestOfSeekBefore(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.io.Reference bottom, org.apache.hadoop.hbase.ExtendedCell seekBefore, org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) throws IOException
      Throws:
      IOException
    • getLastOnCol

      private org.apache.hadoop.hbase.KeyValue getLastOnCol(org.apache.hadoop.hbase.Cell curr)
    • _b

      static byte[] _b(String s)
    • genSomeKeys

      List<org.apache.hadoop.hbase.KeyValue> genSomeKeys()