@Override
  protected void regionMoved(int region, int oldServer, int newServer) {
    cost.applyCostsChange(costs -> {
      costs[oldServer] = cluster.regionsPerServer[oldServer].length;
      costs[newServer] = cluster.regionsPerServer[newServer].length;
    });
  }
Compute the cost of a potential cluster state from skew in number of regions on a cluster.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionCountSkewCostFunction.java