private Map<ServerName, List<RegionInfo>> assign(Collection<RegionInfo> regions,
    List<ServerName> servers) {
    // should only have 1 region server in maintenance mode
    assert servers.size() == 1;
    List<RegionInfo> systemRegions =
      regions.stream().filter(r -> r.getTable().isSystemTable()).collect(Collectors.toList());
    if (!systemRegions.isEmpty()) {
      return Collections.singletonMap(servers.get(0), systemRegions);
    } else {
      return Collections.emptyMap();
    }
  }
a balancer which is only used in maintenance mode.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/MaintenanceLoadBalancer.java