Class TestSimpleRegionNormalizerOnCluster
java.lang.Object
org.apache.hadoop.hbase.master.normalizer.TestSimpleRegionNormalizerOnCluster
Testing
SimpleRegionNormalizer on minicluster.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprivate static final byte[]private static final org.slf4j.Loggerprivate static org.apache.hadoop.hbase.master.HMasterorg.junit.rules.TestNameprivate static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidbefore()static voidprivate static org.apache.hadoop.hbase.TableNamebuildTableNameForQuotaTest(String methodName) private static intcreateTableBegsMerge(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 intcreateTableBegsSplit(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 intcreateTableTargetOfSplitAndMerge(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 voiddropIfExists(org.apache.hadoop.hbase.TableName tableName) private static voidgenerateTestData(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 intgetRegionCount(org.apache.hadoop.hbase.TableName tableName) private static intgetRegionCountUnchecked(org.apache.hadoop.hbase.TableName tableName) private static doublegetRegionSizeMB(org.apache.hadoop.hbase.master.MasterServices masterServices, org.apache.hadoop.hbase.client.RegionInfo regionInfo) voidvoidvoidvoidTest that disabling normalizer via table configuration is honored.voidvoid(package private) voidtestRegionNormalizationSplit(boolean limitedByQuota) voidvoidvoidA test for when a region is the target of both a split and a merge plan.private static voidwaitForSkippedSplits(org.apache.hadoop.hbase.master.HMaster master, long existingSkippedSplitCount) private static voidwaitForTableRegionCount(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
-