Class TestStoreFileTableSkewCostFunction
java.lang.Object
org.apache.hadoop.hbase.master.balancer.TestStoreFileTableSkewCostFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
A simplified BalancerClusterState which ensures we provide the intended test RegionMetrics data when balancing this cluster -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final org.apache.hadoop.hbase.TableName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.hadoop.hbase.client.RegionInfo
createMockRegionInfo
(int storeFileSizeMb) Helper method to create a RegionInfo for the default table with the given store file size.private static org.apache.hadoop.hbase.client.RegionInfo
createMockRegionInfo
(org.apache.hadoop.hbase.TableName table, int storeFileSizeMb) Helper method to create a RegionInfo for a specified table with the given store file size.private static org.apache.hadoop.hbase.RegionMetrics
createMockRegionMetrics
(org.apache.hadoop.hbase.client.RegionInfo regionInfo) Creates a mocked RegionMetrics for the given region.private static byte[]
generateRandomByteArray
(int n) void
Tests that an empty cluster (no servers/regions) is handled gracefully.void
Tests that having multiple tables results in a positive cost when each table's regions are not balanced across servers – even if the overall load per server is balanced.void
Tests that a skewed store file distribution (single table) results in a positive cost.void
Tests that a uniform store file distribution (single table) across servers results in zero cost.
-
Field Details
-
CLASS_RULE
-
DEFAULT_TABLE
-
REGION_TO_STORE_FILE_SIZE_MB
-
-
Constructor Details
-
TestStoreFileTableSkewCostFunction
public TestStoreFileTableSkewCostFunction()
-
-
Method Details
-
testUniformDistribution
Tests that a uniform store file distribution (single table) across servers results in zero cost. -
testSkewedDistribution
Tests that a skewed store file distribution (single table) results in a positive cost. -
testEmptyDistribution
Tests that an empty cluster (no servers/regions) is handled gracefully. -
testMultipleTablesDistribution
Tests that having multiple tables results in a positive cost when each table's regions are not balanced across servers – even if the overall load per server is balanced. -
createMockRegionInfo
Helper method to create a RegionInfo for the default table with the given store file size. -
createMockRegionInfo
private static org.apache.hadoop.hbase.client.RegionInfo createMockRegionInfo(org.apache.hadoop.hbase.TableName table, int storeFileSizeMb) Helper method to create a RegionInfo for a specified table with the given store file size. -
generateRandomByteArray
-
createMockRegionMetrics
private static org.apache.hadoop.hbase.RegionMetrics createMockRegionMetrics(org.apache.hadoop.hbase.client.RegionInfo regionInfo) Creates a mocked RegionMetrics for the given region.
-