Class TestScanner
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestScanner
Test of a long-lived scanner validating as we go.
-
Field Summary
Modifier and TypeFieldDescriptionstatic 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.HRegionInfo
HRegionInfo for root regionprivate static final byte[]
private byte[]
private static final long
private static final HBaseTestingUtility
(package private) static final org.apache.hadoop.hbase.HTableDescriptor
private byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate int
count
(org.apache.hadoop.hbase.client.Table countTable, int flushIndex, boolean concurrent) Count table.private org.apache.hadoop.hbase.Cell
private void
getRegionInfo
(org.apache.hadoop.hbase.client.Table table) Use get to retrieve the HRegionInfo and validate itprivate boolean
(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
Use a scanner to get the region info and then validate the resultsvoid
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
-
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
-