private void moveServerRegionsFromGroup(Set<Address> movedServers, Set<Address> srcGrpServers,
    String targetGroupName, String sourceGroupName) throws IOException {
    moveRegionsBetweenGroups(movedServers, srcGrpServers, targetGroupName, sourceGroupName,
      rs -> getRegions(rs), info -> {
        try {
          String groupName = RSGroupUtil.getRSGroupInfo(masterServices, this, info.getTable())
            .map(RSGroupInfo::getName).orElse(RSGroupInfo.DEFAULT_GROUP);
          return groupName.equals(targetGroupName);
        } catch (IOException e) {
          LOG.warn("Failed to test group for region {} and target group {}", info, targetGroupName);
          return false;
        }
      });
  }
Move every region from servers which are currently located on these servers, but should not be
located there.
@param movedServers    the servers that are moved to new group
@param srcGrpServers   all servers in the source group, excluding the movedServers
@param targetGroupName the target group
@param sourceGroupName the source group
@throws IOException if moving the server and tables fail
hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java