Class TestBaseLoadBalancer
java.lang.Object
org.apache.hadoop.hbase.master.balancer.BalancerTestBase
org.apache.hadoop.hbase.master.balancer.TestBaseLoadBalancer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
BalancerTestBase.MockMapping
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static TestBaseLoadBalancer.MockBalancer
private static final org.slf4j.Logger
private static final org.apache.hadoop.hbase.ServerName
org.junit.rules.TestName
private static final int
private static org.apache.hadoop.hbase.master.RackManager
(package private) int[][]
private static org.apache.hadoop.hbase.ServerName[]
Fields inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
clusterStateMocks, clusterStateMocksWithNoSlop, clusterStateMocksWithSlop, conf, dummyMetricsStochasticBalancer, largeCluster, regionId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertRetainedAssignment
(Map<org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.hbase.ServerName> existing, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> assignment) Asserts a valid retained assignment plan.private void
assignRegions
(List<org.apache.hadoop.hbase.client.RegionInfo> regions, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> clusterState) static void
private List<org.apache.hadoop.hbase.ServerName>
getListOfServerNames
(List<org.apache.hadoop.hbase.master.balancer.ServerAndLoad> sals) void
Tests the bulk assignment used during cluster startup.void
void
void
private void
testRandomAssignment
(int numberOfIdleServers) void
void
void
Test the cluster startup bulk assignment which attempts to retain assignment info.Methods inherited from class org.apache.hadoop.hbase.master.balancer.BalancerTestBase
assertClusterAsBalanced, assertClusterOverallAsBalanced, assertRegionReplicaPlacement, convertToList, createRegions, createServerMap, mockCluster, mockClusterServers, mockClusterServers, mockClusterServers, mockClusterServersUnsorted, mockClusterServersWithTables, mockUniformClusterServers, printMock, printStats, randomRegions, randomRegions, randomServer, randomServers, reconcile, returnRegions, returnServer, returnServers, testWithCluster, testWithCluster, testWithClusterWithIteration, testWithClusterWithIteration, uniformRegions, updateLoad
-
Field Details
-
CLASS_RULE
-
loadBalancer
-
LOG
-
master
-
rackManager
-
NUM_SERVERS
- See Also:
-
servers
-
regionsAndServersMocks
int[][] regionsAndServersMocks -
name
-
-
Constructor Details
-
TestBaseLoadBalancer
public TestBaseLoadBalancer()
-
-
Method Details
-
beforeAllTests
- Throws:
Exception
-
testBulkAssignment
Tests the bulk assignment used during cluster startup. Round-robin. Should yield a balanced cluster so same invariant as the load balancer holds, all servers holding either floor(avg) or ceiling(avg).- Throws:
Exception
-
testRetainAssignment
Test the cluster startup bulk assignment which attempts to retain assignment info.- Throws:
Exception
-
testRandomAssignment
- Throws:
Exception
-
testRandomAssignment
- Throws:
Exception
-
testRegionAvailability
- Throws:
Exception
-
testRegionAvailabilityWithRegionMoves
- Throws:
Exception
-
getListOfServerNames
private List<org.apache.hadoop.hbase.ServerName> getListOfServerNames(List<org.apache.hadoop.hbase.master.balancer.ServerAndLoad> sals) -
assertRetainedAssignment
private void assertRetainedAssignment(Map<org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.hbase.ServerName> existing, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> assignment) Asserts a valid retained assignment plan.Must meet the following conditions:
- Every input region has an assignment, and to an online server
- If a region had an existing assignment to a server with the same address a a currently online server, it will be assigned to it
-
testClusterServersWithSameHostPort
-
assignRegions
private void assignRegions(List<org.apache.hadoop.hbase.client.RegionInfo> regions, List<org.apache.hadoop.hbase.ServerName> servers, Map<org.apache.hadoop.hbase.ServerName, List<org.apache.hadoop.hbase.client.RegionInfo>> clusterState) -
testClusterRegionLocations
-