public static double getMinSkew(double total, double numServers) {
    if (numServers == 0) {
      return 0;
    }
    double mean = total / numServers;
    // It's possible that there aren't enough regions to go around
    double min;
    if (numServers > total) {
      min = ((numServers - total) * mean * mean + (1 - mean) * (1 - mean) * total);
    } else {
      // Some will have 1 more than everything else.
      int numHigh = (int) (total - (Math.floor(mean) * numServers));
      int numLow = (int) (numServers - numHigh);
      min = numHigh * (Math.ceil(mean) - mean) * (Math.ceil(mean) - mean)
        + numLow * (mean - Math.floor(mean)) * (mean - Math.floor(mean));
    }
    return Math.sqrt(min);
  }
Return the min skew of distribution
@param total is total number of regions
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/DoubleArrayCost.java