Package org.apache.hadoop.hbase.mob
Class TestMobCompactionWithDefaults
java.lang.Object
org.apache.hadoop.hbase.mob.TestMobCompactionWithDefaults
- Direct Known Subclasses:
TestMobCompactionOptMode,TestMobCompactionOptRegionBatchMode,TestMobCompactionRegularRegionBatchMode
@Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestMobCompactionWithDefaults
extends Object
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.Adminprotected 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.TableDescriptorprivate Stringprotected Boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidprotected voidcleanupAndVerifyCounts(org.apache.hadoop.hbase.TableName table, String family, int rows) protected Stringprotected voidprotected voidprotected longgetNumberOfFilesInMobFamilyDir(org.apache.hadoop.hbase.client.TableDescriptor descriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDesc, String family) protected longgetNumberOfStoreFiles(org.apache.hadoop.hbase.client.TableDescriptor descriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDesc, 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.static Stream<org.junit.jupiter.params.provider.Arguments>protected longscanTable(org.apache.hadoop.hbase.TableName tableName) voidsetUp(org.junit.jupiter.api.TestInfo testInfo) voidtearDown()voidvoidprotected voidwaitUntilCompactionIsComplete(org.apache.hadoop.hbase.TableName table)
-
Field Details
-
LOG
-
HTU
-
conf
-
minAgeToArchive
-
famStr
- See Also:
-
fam
-
qualifier
-
mobLen
- See Also:
-
mobVal
-
testMethodName
-
tableDescriptor
-
familyDescriptor
-
admin
-
table
-
numRegions
-
rows
-
useFileBasedSFT
-
-
Constructor Details
-
TestMobCompactionWithDefaults
-
-
Method Details
-
parameters
-
htuStart
- Throws:
Exception
-
additonalConfigSetup
-
setUp
- Throws:
Exception
-
loadData
-
tearDown
- Throws:
Exception
-
baseTestMobFileCompaction
- Throws:
InterruptedExceptionIOException
-
testMobFileCompactionAfterSnapshotClone
@TestTemplate public void testMobFileCompactionAfterSnapshotClone() throws InterruptedException, IOException- Throws:
InterruptedExceptionIOException
-
getNumberOfFilesInMobFamilyDir
protected long getNumberOfFilesInMobFamilyDir(org.apache.hadoop.hbase.client.TableDescriptor descriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDesc, String family) throws IOException - Throws:
IOException
-
testMobFileCompactionAfterSnapshotCloneAndFlush
@TestTemplate 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
-
scanTable
-
getNumberOfStoreFiles
protected long getNumberOfStoreFiles(org.apache.hadoop.hbase.client.TableDescriptor descriptor, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor familyDesc, String family) throws IOException - Throws:
IOException
-