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 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