Class TestCompactionState
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestCompactionState
Unit tests to test retrieving table/region compaction state
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleorg.junit.rules.TestNameprivate static final HBaseTestingUtil
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidcompaction(String tableName, int flushes, org.apache.hadoop.hbase.client.CompactionState expectedState, boolean singleFamily, TestCompactionState.StateSource stateSource) Load data to a table, flush it to disk, trigger compaction, confirm the compaction state is right and wait till it is done.private static intcountStoreFilesInFamilies(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[][] families) private static intcountStoreFilesInFamily(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[] family) private static org.apache.hadoop.hbase.client.CompactionStategetCompactionState(TestCompactionState.StateSource stateSource, org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.TableName table) private static voidloadData(org.apache.hadoop.hbase.client.Table ht, byte[][] families, int rows, int flushes) static voidstatic voidvoidvoidvoidvoidvoidvoidvoidvoidvoid
- 
Field Details- 
CLASS_RULE
- 
TEST_UTIL
- 
name
 
- 
- 
Constructor Details- 
TestCompactionStatepublic TestCompactionState()
 
- 
- 
Method Details- 
setUpBeforeClass- Throws:
- Exception
 
- 
tearDownAfterClass- Throws:
- Exception
 
- 
testMajorCompactionStateFromAdmin- Throws:
- IOException
- InterruptedException
 
- 
testMinorCompactionStateFromAdmin- Throws:
- IOException
- InterruptedException
 
- 
testMajorCompactionOnFamilyStateFromAdmin- Throws:
- IOException
- InterruptedException
 
- 
testMinorCompactionOnFamilyStateFromAdmin- Throws:
- IOException
- InterruptedException
 
- 
testMajorCompactionStateFromMaster- Throws:
- IOException
- InterruptedException
 
- 
testMinorCompactionStateFromMaster- Throws:
- IOException
- InterruptedException
 
- 
testMajorCompactionOnFamilyStateFromMaster- Throws:
- IOException
- InterruptedException
 
- 
testMinorCompactionOnFamilyStateFromMaster- Throws:
- IOException
- InterruptedException
 
- 
testInvalidColumnFamily- Throws:
- IOException
- InterruptedException
 
- 
compactionprivate void compaction(String tableName, int flushes, org.apache.hadoop.hbase.client.CompactionState expectedState, boolean singleFamily, TestCompactionState.StateSource stateSource) throws IOException, InterruptedException Load data to a table, flush it to disk, trigger compaction, confirm the compaction state is right and wait till it is done.- Parameters:
- singleFamily- otherwise, run compaction on all cfs
- stateSource- get the state by Admin or Master
- Throws:
- IOException
- InterruptedException
 
- 
getCompactionStateprivate static org.apache.hadoop.hbase.client.CompactionState getCompactionState(TestCompactionState.StateSource stateSource, org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.TableName table) throws IOException - Throws:
- IOException
 
- 
countStoreFilesInFamilyprivate static int countStoreFilesInFamily(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[] family) 
- 
countStoreFilesInFamiliesprivate static int countStoreFilesInFamilies(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[][] families) 
- 
loadDataprivate static void loadData(org.apache.hadoop.hbase.client.Table ht, byte[][] families, int rows, int flushes) throws IOException - Throws:
- IOException
 
 
-