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
Modifier and TypeFieldDescriptionprotected org.apache.hadoop.hbase.client.Admin
static final HBaseClassTestRule
protected static org.apache.hadoop.conf.Configuration
protected static final byte[]
protected org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor
protected static final String
protected static HBaseTestingUtility
private static final org.slf4j.Logger
protected static long
protected static final long
protected static final byte[]
protected int
protected static final byte[]
protected int
protected org.apache.hadoop.hbase.TableName
protected org.apache.hadoop.hbase.client.TableDescriptorBuilder.ModifyableTableDescriptor
org.junit.rules.TestName
protected Boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
protected void
cleanupAndVerifyCounts
(org.apache.hadoop.hbase.TableName table, String family, int rows) static Collection<Boolean>
data()
protected String
protected void
protected void
protected long
getNumberOfMobFiles
(org.apache.hadoop.hbase.TableName tableName, String family) protected void
htuStart()
protected void
loadAndFlushThreeTimes
(int rows, org.apache.hadoop.hbase.TableName table, String family) private void
loadData
(org.apache.hadoop.hbase.TableName tableName, int num) protected void
mobCompact
(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 void
mobCompactImpl
(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 long
scanTable
(org.apache.hadoop.hbase.TableName tableName) void
setUp()
void
tearDown()
void
void
protected void
waitUntilCompactionIsComplete
(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
protected org.apache.hadoop.hbase.client.TableDescriptorBuilder.ModifyableTableDescriptor tableDescriptor -
familyDescriptor
protected org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor 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:
InterruptedException
IOException
-
testMobFileCompactionAfterSnapshotClone
- Throws:
InterruptedException
IOException
-
testMobFileCompactionAfterSnapshotCloneAndFlush
public void testMobFileCompactionAfterSnapshotCloneAndFlush() throws InterruptedException, IOException- Throws:
InterruptedException
IOException
-
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:
IOException
InterruptedException
-
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:
IOException
InterruptedException
-
waitUntilCompactionIsComplete
protected void waitUntilCompactionIsComplete(org.apache.hadoop.hbase.TableName table) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
cleanupAndVerifyCounts
protected void cleanupAndVerifyCounts(org.apache.hadoop.hbase.TableName table, String family, int rows) throws InterruptedException, IOException - Throws:
InterruptedException
IOException
-
getNumberOfMobFiles
protected long getNumberOfMobFiles(org.apache.hadoop.hbase.TableName tableName, String family) throws IOException - Throws:
IOException
-
scanTable
-