Class TestCompactionState
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestCompactionState
Unit tests to test retrieving table/region compaction state
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
org.junit.rules.TestName
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
compaction
(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 int
countStoreFilesInFamilies
(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[][] families) private static int
countStoreFilesInFamily
(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[] family) private 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) private static void
loadData
(org.apache.hadoop.hbase.client.Table ht, byte[][] families, int rows, int flushes) static void
static void
void
void
void
void
void
void
void
void
void
-
Field Details
-
CLASS_RULE
-
TEST_UTIL
-
name
-
-
Constructor Details
-
TestCompactionState
public 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
-
compaction
private 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 cfsstateSource
- get the state by Admin or Master- Throws:
IOException
InterruptedException
-
getCompactionState
private 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
-
countStoreFilesInFamily
private static int countStoreFilesInFamily(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[] family) -
countStoreFilesInFamilies
private static int countStoreFilesInFamilies(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[][] families) -
loadData
private static void loadData(org.apache.hadoop.hbase.client.Table ht, byte[][] families, int rows, int flushes) throws IOException - Throws:
IOException
-