public class TestCompactionState extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
TestCompactionState.StateSource |
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private static Random |
random |
private static HBaseTestingUtility |
TEST_UTIL |
| Constructor and Description |
|---|
TestCompactionState() |
| Modifier and Type | Method and Description |
|---|---|
private 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 |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
void |
testInvalidColumnFamily() |
void |
testMajorCompactionOnFamilyStateFromAdmin() |
void |
testMajorCompactionOnFamilyStateFromMaster() |
void |
testMajorCompactionStateFromAdmin() |
void |
testMajorCompactionStateFromMaster() |
void |
testMinorCompactionOnFamilyStateFromAdmin() |
void |
testMinorCompactionOnFamilyStateFromMaster() |
void |
testMinorCompactionStateFromAdmin() |
void |
testMinorCompactionStateFromMaster() |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility TEST_UTIL
public org.junit.rules.TestName name
public TestCompactionState()
public static void setUpBeforeClass() throws Exception
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void testMajorCompactionStateFromAdmin() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMinorCompactionStateFromAdmin() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMajorCompactionOnFamilyStateFromAdmin() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMinorCompactionOnFamilyStateFromAdmin() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMajorCompactionStateFromMaster() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMinorCompactionStateFromMaster() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMajorCompactionOnFamilyStateFromMaster() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testMinorCompactionOnFamilyStateFromMaster() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testInvalidColumnFamily() throws IOException, InterruptedException
IOExceptionInterruptedExceptionprivate void compaction(String tableName, int flushes, org.apache.hadoop.hbase.client.CompactionState expectedState, boolean singleFamily, TestCompactionState.StateSource stateSource) throws IOException, InterruptedException
tableName - flushes - expectedState - singleFamily - otherwise, run compaction on all cfsstateSource - get the state by Admin or MasterIOExceptionInterruptedExceptionprivate 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
IOExceptionprivate static int countStoreFilesInFamily(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[] family)
private static int countStoreFilesInFamilies(List<org.apache.hadoop.hbase.regionserver.HRegion> regions, byte[][] families)
private static void loadData(org.apache.hadoop.hbase.client.Table ht, byte[][] families, int rows, int flushes) throws IOException
IOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.