Class TestCompaction
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestCompaction
- Direct Known Subclasses:
TestCompactionWithCoprocessor
Test compaction framework and common functions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic class(package private) classstatic classSimpleCompactionLifeCycleTrackeron which you can wait until the requested compaction finishes.static classSimpleCompactionLifeCycleTrackeron which you can wait until the requested compaction finishes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static final byte[]private static final byte[]private intprotected org.apache.hadoop.conf.Configurationprivate final byte[]private org.apache.hadoop.hbase.HTableDescriptorprivate static final longorg.junit.rules.TestNameprivate org.apache.hadoop.hbase.regionserver.HRegionprivate byte[]private final byte[]private byte[]private static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcount()private static org.apache.hadoop.hbase.regionserver.HStoreFileprivate voidcreateStoreFile(org.apache.hadoop.hbase.regionserver.HRegion region) private voidcreateStoreFile(org.apache.hadoop.hbase.regionserver.HRegion region, String family) voidsetUp()voidtearDown()voidvoidTest compaction priority management and multiple compactions per store (HBASE-8665).voidFirstly write 10 cells (with different time stamp) to a qualifier and flush to hfile1, then write 10 cells (with different time stamp) to the same qualifier and flush to hfile2.voidvoidVerify that you can stop a long-running compaction (used during RS shutdown)voidvoidvoidHBASE-7947: Regression test to ensure adding to the correct list in theCompactSplitvoidTest no new Compaction requests are generated after calling stop compactionsvoidCreate a custom compaction request and be sure that we can track it through the queue, knowing when the compaction is completed.
-
Field Details
-
CLASS_RULE
-
name
-
UTIL
-
conf
-
r
-
htd
-
COLUMN_FAMILY
-
STARTROW
-
COLUMN_FAMILY_TEXT
-
compactionThreshold
-
secondRowBytes
-
thirdRowBytes
-
MAX_FILES_TO_COMPACT
- See Also:
-
FAMILY
-
-
Constructor Details
-
TestCompaction
public TestCompaction()constructor
-
-
Method Details
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testInterruptCompactionBySize
Verify that you can stop a long-running compaction (used during RS shutdown)- Throws:
Exception
-
testInterruptCompactionByTime
- Throws:
Exception
-
count
- Throws:
IOException
-
createStoreFile
private void createStoreFile(org.apache.hadoop.hbase.regionserver.HRegion region) throws IOException - Throws:
IOException
-
createStoreFile
private void createStoreFile(org.apache.hadoop.hbase.regionserver.HRegion region, String family) throws IOException - Throws:
IOException
-
testCompactionWithCorruptResult
- Throws:
Exception
-
testTrackingCompactionRequest
Create a custom compaction request and be sure that we can track it through the queue, knowing when the compaction is completed.- Throws:
Exception
-
testCompactionFailure
- Throws:
Exception
-
testStopStartCompaction
Test no new Compaction requests are generated after calling stop compactions- Throws:
IOException
-
testInterruptingRunningCompactions
- Throws:
Exception
-
testMultipleCustomCompactionRequests
HBASE-7947: Regression test to ensure adding to the correct list in theCompactSplit- Throws:
Exception- on failure
-
testCompactionQueuePriorities
Test compaction priority management and multiple compactions per store (HBASE-8665).- Throws:
Exception
-
testCompactionSeqId
Firstly write 10 cells (with different time stamp) to a qualifier and flush to hfile1, then write 10 cells (with different time stamp) to the same qualifier and flush to hfile2. The latest cell (cell-A) in hfile1 and the oldest cell (cell-B) in hfile2 are with the same time stamp but different sequence id, and will get scanned successively during compaction. We set compaction.kv.max to 10 so compaction will scan 10 versions each round, meanwhile we set keepSeqIdPeriod=0 inTestCompaction.DummyCompactorso all 10 versions of hfile2 will be written out with seqId cleaned (set to 0) including cell-B, then when scanner goes to cell-A it will cause a scan out-of-order assertion error before HBASE-16931 if error occurs during the test- Throws:
Exception
-
createFile
- Throws:
Exception
-