@Override
  protected double cost() {
    // Try and size the max number of Moves, but always be prepared to move some.
    int maxMoves = Math.max((int) (cluster.numRegions * maxMovesPercent), DEFAULT_MAX_MOVES);

    double moveCost = cluster.numMovedRegions;

    // Don't let this single balance move more than the max moves.
    // This allows better scaling to accurately represent the actual cost of a move.
    if (moveCost > maxMoves) {
      return 1000000; // return a number much greater than any of the other cost
    }

    return scale(0, Math.min(cluster.numRegions, maxMoves), moveCost);
  }
Given the starting state of the regions and a potential ending state compute cost based upon the
number of regions that have moved.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/MoveCostFunction.java