Class TestRegionMoverFilterRSGroupServers

java.lang.Object
org.apache.hadoop.hbase.util.TestRegionMoverFilterRSGroupServers

@Tag("org.apache.hadoop.hbase.testclassification.MiscTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestRegionMoverFilterRSGroupServers extends Object
Unit tests for RegionMover.filterRSGroupServers(org.apache.hadoop.hbase.rsgroup.RSGroupInfo, java.util.Collection<org.apache.hadoop.hbase.ServerName>). RSGroups is enabled on the mini cluster and servers are moved between groups via the real moveServersToRSGroup admin call -- no test constructs an RSGroupInfo by hand. Every RSGroupInfo used here is read back from the master via admin.getRSGroup(...), which computes "default" membership as "online servers minus servers claimed by other groups" (see RSGroupInfoManagerImpl#getDefaultServers), so its membership shrinks on its own once a move happens instead of being asserted into existence by the test.
  • Field Details

  • Constructor Details

  • Method Details

    • setUpBeforeClass

      @BeforeAll public static void setUpBeforeClass() throws Exception
      Throws:
      Exception
    • tearDownAfterClass

      @AfterAll public static void tearDownAfterClass() throws Exception
      Throws:
      Exception
    • buildMover

      private org.apache.hadoop.hbase.util.RegionMover buildMover() throws Exception
      Throws:
      Exception
    • addressOf

      private static org.apache.hadoop.hbase.net.Address addressOf(org.apache.hadoop.hbase.ServerName sn)
    • testDefaultGroupFiltersToActualMembers

      Reproduces HBASE-30331: once a server is moved out of "default" into a custom group, the master-computed "default" RSGroupInfo only lists the server that remains. filterRSGroupServers must honor that real membership instead of short-circuiting on the group name and returning every online server.
      Throws:
      Exception
    • testNonDefaultGroupFiltersToMembers

      @Test public void testNonDefaultGroupFiltersToMembers() throws Exception
      A non-default group with one member must return only that member. Same real-cluster approach as above: the group and its membership come from actual moveServersToRSGroup calls, not a hand-built RSGroupInfo.
      Throws:
      Exception
    • testGroupMemberAbsentFromOnlineServersReturnsEmpty

      A group's real member must not be returned as a destination when it is absent from the onlineServers snapshot handed to the filter (e.g. the server is currently offline or was already excluded upstream). Uses a real group/member from moveServersToRSGroup, not a fabricated, never-existed host address.
      Throws:
      Exception