Class TestHalfStoreFileReader

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

public class TestHalfStoreFileReader extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setupBeforeClass

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

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

      public void testHalfScanAndReseek() throws IOException
      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:
      IOException
    • 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 IOException
      Throws:
      IOException
    • testHalfScanner

      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.Cell 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()