Package org.apache.hadoop.hbase.util
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.hadoop.hbase.net.AddressaddressOf(org.apache.hadoop.hbase.ServerName sn) private org.apache.hadoop.hbase.util.RegionMoverstatic voidstatic voidvoidReproduces 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.voidA group's real member must not be returned as a destination when it is absent from theonlineServerssnapshot handed to the filter (e.g.voidA non-default group with one member must return only that member.
-
Field Details
-
TEST_UTIL
-
-
Constructor Details
-
TestRegionMoverFilterRSGroupServers
public TestRegionMoverFilterRSGroupServers()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
buildMover
- Throws:
Exception
-
addressOf
-
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
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 actualmoveServersToRSGroupcalls, not a hand-builtRSGroupInfo.- Throws:
Exception
-
testGroupMemberAbsentFromOnlineServersReturnsEmpty
A group's real member must not be returned as a destination when it is absent from theonlineServerssnapshot handed to the filter (e.g. the server is currently offline or was already excluded upstream). Uses a real group/member frommoveServersToRSGroup, not a fabricated, never-existed host address.- Throws:
Exception
-