Class TestScanner

java.lang.Object
org.apache.hadoop.hbase.regionserver.TestScanner

public class TestScanner extends Object
Test of a long-lived scanner validating as we go.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final HBaseClassTestRule
     
    private final byte[]
     
    private static final byte[][]
     
    private static final byte[][]
     
    private static final byte[]
     
    private byte[]
     
    private static final org.slf4j.Logger
     
    org.junit.rules.TestName
     
    private org.apache.hadoop.hbase.regionserver.HRegion
     
    static final org.apache.hadoop.hbase.client.RegionInfo
    HRegionInfo for root region
    private static final byte[]
     
    private byte[]
     
    private static final long
     
    private static final HBaseTestingUtil
     
    (package private) static final org.apache.hadoop.hbase.client.TableDescriptor
     
    private byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private int
    count(org.apache.hadoop.hbase.client.Table countTable, int flushIndex, boolean concurrent)
    Count table.
    private org.apache.hadoop.hbase.Cell
    getColumn(List<org.apache.hadoop.hbase.Cell> kvs, byte[] family, byte[] qualifier)
     
    private void
    getRegionInfo(org.apache.hadoop.hbase.client.Table table)
    Use get to retrieve the HRegionInfo and validate it
    private boolean
    hasColumn(List<org.apache.hadoop.hbase.Cell> kvs, byte[] family, byte[] qualifier)
     
    (package private) void
    rowInclusiveStopFilter(org.apache.hadoop.hbase.client.Scan scan, byte[] stopRow)
     
    (package private) void
    rowPrefixFilter(org.apache.hadoop.hbase.client.Scan scan)
     
    private void
    scan(boolean validateStartcode, String serverName)
    Use a scanner to get the region info and then validate the results
    void
     
    void
    Test that closing a scanner while a client is using it doesn't throw NPEs but instead a UnknownScannerException.
    void
    Make sure scanner returns correct result when we run a major compaction with deletes.
    void
    Tests to do a concurrent flush (using a 2nd thread) while scanning.
    void
    Tests to do a sync flush during the middle of a scan.
    void
    The test!
    void
    Test basic stop row filter works.
    private void
    validateRegionInfo(byte[] regionBytes)
    Compare the HRegionInfo we read from HBase to what we stored

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • testStopRow

      public void testStopRow() throws Exception
      Test basic stop row filter works.
      Throws:
      Exception
    • rowPrefixFilter

      void rowPrefixFilter(org.apache.hadoop.hbase.client.Scan scan) throws IOException
      Throws:
      IOException
    • rowInclusiveStopFilter

      void rowInclusiveStopFilter(org.apache.hadoop.hbase.client.Scan scan, byte[] stopRow) throws IOException
      Throws:
      IOException
    • testFilters

      public void testFilters() throws IOException
      Throws:
      IOException
    • testRaceBetweenClientAndTimeout

      Test that closing a scanner while a client is using it doesn't throw NPEs but instead a UnknownScannerException. HBASE-2503
      Throws:
      Exception
    • testScanner

      public void testScanner() throws IOException
      The test!
      Throws:
      IOException
    • validateRegionInfo

      private void validateRegionInfo(byte[] regionBytes) throws IOException
      Compare the HRegionInfo we read from HBase to what we stored
      Throws:
      IOException
    • scan

      private void scan(boolean validateStartcode, String serverName) throws IOException
      Use a scanner to get the region info and then validate the results
      Throws:
      IOException
    • hasColumn

      private boolean hasColumn(List<org.apache.hadoop.hbase.Cell> kvs, byte[] family, byte[] qualifier)
    • getColumn

      private org.apache.hadoop.hbase.Cell getColumn(List<org.apache.hadoop.hbase.Cell> kvs, byte[] family, byte[] qualifier)
    • getRegionInfo

      private void getRegionInfo(org.apache.hadoop.hbase.client.Table table) throws IOException
      Use get to retrieve the HRegionInfo and validate it
      Throws:
      IOException
    • testScanAndSyncFlush

      public void testScanAndSyncFlush() throws Exception
      Tests to do a sync flush during the middle of a scan. This is testing the StoreScanner update readers code essentially. This is not highly concurrent, since its all 1 thread. HBase-910.
      Throws:
      Exception
    • testScanAndRealConcurrentFlush

      Tests to do a concurrent flush (using a 2nd thread) while scanning. This tests both the StoreScanner update readers and the transition from memstore -> snapshot -> store file.
      Throws:
      Exception
    • testScanAndConcurrentMajorCompact

      Make sure scanner returns correct result when we run a major compaction with deletes.
      Throws:
      Exception
    • count

      private int count(org.apache.hadoop.hbase.client.Table countTable, int flushIndex, boolean concurrent) throws Exception
      Count table.
      Parameters:
      hri - Region
      flushIndex - At what row we start the flush.
      concurrent - if the flush should be concurrent or sync.
      Returns:
      Count of rows found.
      Throws:
      Exception