private BalancerClusterState createCluster(List<ServerName> servers,
    Collection<RegionInfo> regions) throws HBaseIOException {
    boolean hasRegionReplica = false;
    try {
      if (provider != null) {
        hasRegionReplica = provider.hasRegionReplica(regions);
      }
    } catch (IOException ioe) {
      throw new HBaseIOException(ioe);
    }

    // Get the snapshot of the current assignments for the regions in question, and then create
    // a cluster out of it. Note that we might have replicas already assigned to some servers
    // earlier. So we want to get the snapshot to see those assignments, but this will only contain
    // replicas of the regions that are passed (for performance).
    Map<ServerName, List<RegionInfo>> clusterState = null;
    if (!hasRegionReplica) {
      clusterState = getRegionAssignmentsByServer(regions);
    } else {
      // for the case where we have region replica it is better we get the entire cluster's snapshot
      clusterState = getRegionAssignmentsByServer(null);
    }

    for (ServerName server : servers) {
      if (!clusterState.containsKey(server)) {
        clusterState.put(server, Collections.emptyList());
      }
    }
    return new BalancerClusterState(regions, clusterState, null, this.regionFinder, rackManager,
      null);
  }
Generates a bulk assignment plan to be used on cluster startup using a simple round-robin
assignment.
<p/>
Takes a list of all the regions and all the servers in the cluster and returns a map of each
server to the regions that it should be assigned.
<p/>
Currently implemented as a round-robin assignment. Same invariant as load balancing, all
servers holding floor(avg) or ceiling(avg). TODO: Use block locations from HDFS to place
regions with their blocks
@param regions all regions
@param servers all servers
@return map of server to the regions it should take, or emptyMap if no assignment is possible
        (ie. no servers)
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java