Class TestScanner
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestScanner
Test of a long-lived scanner validating as we go.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate final byte[]private static final byte[][]private static final byte[][]private static final byte[]private byte[]private static final org.slf4j.Loggerorg.junit.rules.TestNameprivate org.apache.hadoop.hbase.regionserver.HRegionstatic final org.apache.hadoop.hbase.client.RegionInfoHRegionInfo for root regionprivate static final byte[]private byte[]private static final longprivate static final HBaseTestingUtil(package private) static final org.apache.hadoop.hbase.client.TableDescriptorprivate byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcount(org.apache.hadoop.hbase.client.Table countTable, int flushIndex, boolean concurrent) Count table.private org.apache.hadoop.hbase.Cellprivate voidgetRegionInfo(org.apache.hadoop.hbase.client.Table table) Use get to retrieve the HRegionInfo and validate itprivate boolean(package private) voidrowInclusiveStopFilter(org.apache.hadoop.hbase.client.Scan scan, byte[] stopRow) (package private) voidrowPrefixFilter(org.apache.hadoop.hbase.client.Scan scan) private voidUse a scanner to get the region info and then validate the resultsvoidvoidTest that closing a scanner while a client is using it doesn't throw NPEs but instead a UnknownScannerException.voidMake sure scanner returns correct result when we run a major compaction with deletes.voidTests to do a concurrent flush (using a 2nd thread) while scanning.voidTests to do a sync flush during the middle of a scan.voidThe test!voidTest basic stop row filter works.private voidvalidateRegionInfo(byte[] regionBytes) Compare the HRegionInfo we read from HBase to what we stored
-
Field Details
-
CLASS_RULE
-
name
-
LOG
-
TEST_UTIL
-
FIRST_ROW
-
COLS
-
EXPLICIT_COLS
-
TESTTABLEDESC
-
REGION_INFO
HRegionInfo for root region -
ROW_KEY
-
START_CODE
- See Also:
-
region
-
firstRowBytes
-
secondRowBytes
-
thirdRowBytes
-
col1
-
-
Constructor Details
-
TestScanner
public TestScanner()
-
-
Method Details
-
testStopRow
Test basic stop row filter works.- Throws:
Exception
-
rowPrefixFilter
- Throws:
IOException
-
rowInclusiveStopFilter
void rowInclusiveStopFilter(org.apache.hadoop.hbase.client.Scan scan, byte[] stopRow) throws IOException - Throws:
IOException
-
testFilters
- 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
The test!- Throws:
IOException
-
validateRegionInfo
Compare the HRegionInfo we read from HBase to what we stored- Throws:
IOException
-
scan
Use a scanner to get the region info and then validate the results- Throws:
IOException
-
hasColumn
-
getColumn
-
getRegionInfo
Use get to retrieve the HRegionInfo and validate it- Throws:
IOException
-
testScanAndSyncFlush
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- RegionflushIndex- At what row we start the flush.concurrent- if the flush should be concurrent or sync.- Returns:
- Count of rows found.
- Throws:
Exception
-