public Map<RegionInfo, List<ServerName>> generateFavoredNodesRoundRobin(
    Map<ServerName, List<RegionInfo>> assignmentMap, List<RegionInfo> regions) throws IOException {

    if (regions.size() > 0) {
      if (canPlaceFavoredNodes()) {
        Map<RegionInfo, ServerName> primaryRSMap = new HashMap<>();
        // Lets try to have an equal distribution for primary favored node
        placePrimaryRSAsRoundRobin(assignmentMap, primaryRSMap, regions);
        return generateFavoredNodes(primaryRSMap);

      } else {
        throw new HBaseIOException("Not enough nodes to generate favored nodes");
      }
    }
    return null;
  }
Gets a random server from the specified rack and skips anything specified.
@param rack          rack from a server is needed
@param skipServerSet the server shouldn't belong to this set
hbase-balancer/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java