public class TestCompactionState extends Object
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)
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 void |
loadData(org.apache.hadoop.hbase.client.Table ht,
byte[][] families,
int rows,
int flushes) |
static void |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
void |
testInvalidColumnFamily() |
void |
testMajorCompaction() |
void |
testMajorCompactionOnFamily() |
void |
testMinorCompaction() |
void |
testMinorCompactionOnFamily() |
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
Exception
public static void tearDownAfterClass() throws Exception
Exception
public void testMajorCompaction() throws IOException, InterruptedException
IOException
InterruptedException
public void testMinorCompaction() throws IOException, InterruptedException
IOException
InterruptedException
public void testMajorCompactionOnFamily() throws IOException, InterruptedException
IOException
InterruptedException
public void testMinorCompactionOnFamily() throws IOException, InterruptedException
IOException
InterruptedException
public void testInvalidColumnFamily() throws IOException, InterruptedException
IOException
InterruptedException
private void compaction(String tableName, int flushes, org.apache.hadoop.hbase.client.CompactionState expectedState, boolean singleFamily) throws IOException, InterruptedException
tableName
- flushes
- expectedState
- singleFamily
- otherwise, run compaction on all cfsIOException
InterruptedException
private 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
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.