Package org.apache.hadoop.hbase.mob
Class TestMobCompactionWithDefaults
java.lang.Object
org.apache.hadoop.hbase.mob.TestMobCompactionWithDefaults
- Direct Known Subclasses:
TestMobCompactionOptMode,TestMobCompactionOptRegionBatchMode,TestMobCompactionRegularRegionBatchMode
Mob file compaction base test. 1. Enables batch mode for regular MOB compaction, Sets batch size
to 7 regions. (Optional) 2. Disables periodic MOB compactions, sets minimum age to archive to 10
sec 3. Creates MOB table with 20 regions 4. Loads MOB data (randomized keys, 1000 rows), flushes
data. 5. Repeats 4. two more times 6. Verifies that we have 20 *3 = 60 mob files (equals to
number of regions x 3) 7. Runs major MOB compaction. 8. Verifies that number of MOB files in a
mob directory is 20 x4 = 80 9. Waits for a period of time larger than minimum age to archive 10.
Runs Mob cleaner chore 11 Verifies that number of MOB files in a mob directory is 20. 12 Runs
scanner and checks all 3 * 1000 rows.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprotected static org.apache.hadoop.conf.Configurationprotected static final byte[]private org.apache.hadoop.hbase.client.ColumnFamilyDescriptorprotected static final Stringprotected HBaseTestingUtilprivate static final org.slf4j.Loggerprotected static longprotected static final longprotected static final byte[]protected intprotected static final byte[]protected intprotected org.apache.hadoop.hbase.TableNameprotected org.apache.hadoop.hbase.client.TableDescriptororg.junit.rules.TestNameprotected Boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidprotected voidcleanupAndVerifyCounts(org.apache.hadoop.hbase.TableName table, String family, int rows) static Collection<Boolean>data()protected Stringprotected voidprotected voidprotected longgetNumberOfMobFiles(org.apache.hadoop.hbase.TableName tableName, String family) protected voidhtuStart()protected voidloadAndFlushThreeTimes(int rows, org.apache.hadoop.hbase.TableName table, String family) private voidloadData(org.apache.hadoop.hbase.TableName tableName, int num) protected voidmobCompact(org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDescriptor) compact the given table and return once it is done.protected voidmobCompactImpl(org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDescriptor) Call the API for compaction specific to the test set.protected longscanTable(org.apache.hadoop.hbase.TableName tableName) voidsetUp()voidtearDown()voidvoidprotected voidwaitUntilCompactionIsComplete(org.apache.hadoop.hbase.TableName table)
-
Field Details
-
LOG
-
CLASS_RULE
-
HTU
-
conf
-
minAgeToArchive
-
famStr
- See Also:
-
fam
-
qualifier
-
mobLen
- See Also:
-
mobVal
-
test
-
tableDescriptor
-
familyDescriptor
-
admin
-
table
-
numRegions
-
rows
-
useFileBasedSFT
-
-
Constructor Details
-
TestMobCompactionWithDefaults
-
-
Method Details
-
data
-
htuStart
- Throws:
Exception
-
additonalConfigSetup
-
setUp
- Throws:
Exception
-
loadData
-
tearDown
- Throws:
Exception
-
baseTestMobFileCompaction
- Throws:
InterruptedExceptionIOException
-
testMobFileCompactionAfterSnapshotClone
- Throws:
InterruptedExceptionIOException
-
testMobFileCompactionAfterSnapshotCloneAndFlush
public void testMobFileCompactionAfterSnapshotCloneAndFlush() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
loadAndFlushThreeTimes
protected void loadAndFlushThreeTimes(int rows, org.apache.hadoop.hbase.TableName table, String family) throws IOException - Throws:
IOException
-
description
-
enableCompactions
- Throws:
IOException
-
disableCompactions
- Throws:
IOException
-
mobCompact
protected void mobCompact(org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDescriptor) throws IOException, InterruptedException compact the given table and return once it is done. should presume compactions are disabled when called. should ensure compactions are disabled before returning.- Throws:
IOExceptionInterruptedException
-
mobCompactImpl
protected void mobCompactImpl(org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDescriptor) throws IOException, InterruptedException Call the API for compaction specific to the test set. should not wait for compactions to finish. may assume compactions are enabled when called.- Throws:
IOExceptionInterruptedException
-
waitUntilCompactionIsComplete
protected void waitUntilCompactionIsComplete(org.apache.hadoop.hbase.TableName table) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
cleanupAndVerifyCounts
protected void cleanupAndVerifyCounts(org.apache.hadoop.hbase.TableName table, String family, int rows) throws InterruptedException, IOException - Throws:
InterruptedExceptionIOException
-
getNumberOfMobFiles
protected long getNumberOfMobFiles(org.apache.hadoop.hbase.TableName tableName, String family) throws IOException - Throws:
IOException
-
scanTable
-