Class TestSimpleRegionNormalizerOnCluster
java.lang.Object
org.apache.hadoop.hbase.master.normalizer.TestSimpleRegionNormalizerOnCluster
Testing
SimpleRegionNormalizer
on minicluster.-
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.hadoop.hbase.client.AsyncAdmin
static final HBaseClassTestRule
private static final byte[]
private static final org.slf4j.Logger
private static org.apache.hadoop.hbase.master.HMaster
org.junit.rules.TestName
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
before()
static void
private static org.apache.hadoop.hbase.TableName
buildTableNameForQuotaTest
(String methodName) private static int
createTableBegsMerge
(org.apache.hadoop.hbase.TableName tableName) create a table with 5 regions, having region sizes so as to provoke a merge of the smallest regions.private static int
createTableBegsSplit
(org.apache.hadoop.hbase.TableName tableName, boolean normalizerEnabled, boolean isMergeEnabled) create a table with 5 regions, having region sizes so as to provoke a split of the largest region.private static int
createTableTargetOfSplitAndMerge
(org.apache.hadoop.hbase.TableName tableName) Create a table with 4 regions, having region sizes so as to provoke a split of the largest region and a merge of an empty region into the largest.private static void
dropIfExists
(org.apache.hadoop.hbase.TableName tableName) private static void
generateTestData
(org.apache.hadoop.hbase.regionserver.Region region, int numRows) private static List<org.apache.hadoop.hbase.regionserver.HRegion>
generateTestData
(org.apache.hadoop.hbase.TableName tableName, int... regionSizesMb) private static int
getRegionCount
(org.apache.hadoop.hbase.TableName tableName) private static int
getRegionCountUnchecked
(org.apache.hadoop.hbase.TableName tableName) private static double
getRegionSizeMB
(org.apache.hadoop.hbase.master.MasterServices masterServices, org.apache.hadoop.hbase.client.RegionInfo regionInfo) void
void
void
void
Test that disabling normalizer via table configuration is honored.void
void
(package private) void
testRegionNormalizationSplit
(boolean limitedByQuota) void
void
void
A test for when a region is the target of both a split and a merge plan.private static void
waitForSkippedSplits
(org.apache.hadoop.hbase.master.HMaster master, long existingSkippedSplitCount) private static void
waitForTableRegionCount
(org.apache.hadoop.hbase.TableName tableName, org.hamcrest.Matcher<? super Integer> matcher)
-
Field Details
-
LOG
-
CLASS_RULE
-
TEST_UTIL
-
FAMILY_NAME
-
admin
-
master
-
name
-
-
Constructor Details
-
TestSimpleRegionNormalizerOnCluster
public TestSimpleRegionNormalizerOnCluster()
-
-
Method Details
-
beforeAllTests
- Throws:
Exception
-
afterAllTests
- Throws:
Exception
-
before
- Throws:
Exception
-
testHonorsNormalizerSwitch
- Throws:
Exception
-
testHonorsNormalizerTableSetting
Test that disabling normalizer via table configuration is honored. There's no side-effect to look for (other than a log message), so normalize two tables, one with the disabled setting, and look for change in one and no change in the other.- Throws:
Exception
-
testRegionNormalizationSplitWithoutQuotaLimit
- Throws:
Exception
-
testRegionNormalizationSplitWithQuotaLimit
- Throws:
Exception
-
testRegionNormalizationSplit
- Throws:
Exception
-
testRegionNormalizationMerge
- Throws:
Exception
-
testHonorsNamespaceFilter
- Throws:
Exception
-
testHonorsPatternFilter
- Throws:
Exception
-
testHonorsNameFilter
- Throws:
Exception
-
testTargetOfSplitAndMerge
A test for when a region is the target of both a split and a merge plan. Does not define expected behavior, only that some change is applied to the table.- Throws:
Exception
-
buildTableNameForQuotaTest
private static org.apache.hadoop.hbase.TableName buildTableNameForQuotaTest(String methodName) throws Exception - Throws:
Exception
-
waitForSkippedSplits
private static void waitForSkippedSplits(org.apache.hadoop.hbase.master.HMaster master, long existingSkippedSplitCount) -
waitForTableRegionCount
private static void waitForTableRegionCount(org.apache.hadoop.hbase.TableName tableName, org.hamcrest.Matcher<? super Integer> matcher) -
generateTestData
private static List<org.apache.hadoop.hbase.regionserver.HRegion> generateTestData(org.apache.hadoop.hbase.TableName tableName, int... regionSizesMb) throws IOException - Throws:
IOException
-
generateTestData
private static void generateTestData(org.apache.hadoop.hbase.regionserver.Region region, int numRows) throws IOException - Throws:
IOException
-
getRegionSizeMB
private static double getRegionSizeMB(org.apache.hadoop.hbase.master.MasterServices masterServices, org.apache.hadoop.hbase.client.RegionInfo regionInfo) -
createTableBegsSplit
private static int createTableBegsSplit(org.apache.hadoop.hbase.TableName tableName, boolean normalizerEnabled, boolean isMergeEnabled) throws Exception create a table with 5 regions, having region sizes so as to provoke a split of the largest region.- total table size: 12
- average region size: 2.4
- split threshold: 2.4 * 2 = 4.8
- Throws:
Exception
-
createTableBegsMerge
private static int createTableBegsMerge(org.apache.hadoop.hbase.TableName tableName) throws Exception create a table with 5 regions, having region sizes so as to provoke a merge of the smallest regions.- total table size: 13
- average region size: 2.6
- sum of sizes of first two regions < average
- Throws:
Exception
-
createTableTargetOfSplitAndMerge
private static int createTableTargetOfSplitAndMerge(org.apache.hadoop.hbase.TableName tableName) throws Exception Create a table with 4 regions, having region sizes so as to provoke a split of the largest region and a merge of an empty region into the largest.- total table size: 14
- average region size: 3.5
- Throws:
Exception
-
dropIfExists
- Throws:
Exception
-
getRegionCount
- Throws:
IOException
-
getRegionCountUnchecked
-