Class TestBaseLoadBalancer

java.lang.Object
org.apache.hadoop.hbase.master.balancer.BalancerTestBase
org.apache.hadoop.hbase.master.balancer.TestBaseLoadBalancer

@Tag("org.apache.hadoop.hbase.testclassification.MasterTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestBaseLoadBalancer extends BalancerTestBase
  • Field Details

    • loadBalancer

      private static org.apache.hadoop.hbase.master.LoadBalancer loadBalancer
    • LOG

      private static final org.slf4j.Logger LOG
    • master

      private static final org.apache.hadoop.hbase.ServerName master
    • rackManager

      private static org.apache.hadoop.hbase.master.RackManager rackManager
    • NUM_SERVERS

      private static final int NUM_SERVERS
      See Also:
    • servers

      private static final org.apache.hadoop.hbase.ServerName[] servers
    • regionsAndServersMocks

    • methodName

      private String methodName
  • Constructor Details

  • Method Details

    • beforeAllTests

      @BeforeAll public static void beforeAllTests() throws Exception
      Throws:
      Exception
    • setUpBeforeEach

      @BeforeEach public void setUpBeforeEach(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • testBulkAssignment

      @Test public void testBulkAssignment() throws Exception
      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 public void testRetainAssignment() throws Exception
      Test the cluster startup bulk assignment which attempts to retain assignment info.
      Throws:
      Exception
    • testRandomAssignment

      @Test public void testRandomAssignment() throws Exception
      Throws:
      Exception
    • testRandomAssignment

      private void testRandomAssignment(int numberOfIdleServers) throws Exception
      Throws:
      Exception
    • testRegionAvailability

      @Test public void testRegionAvailability() throws Exception
      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

      @Test public void testClusterRegionLocations()