@Override
  protected double getRegionLoadCost(Collection<BalancerRegionLoad> regionLoadList) {
    Iterator<BalancerRegionLoad> iter = regionLoadList.iterator();
    if (!iter.hasNext()) {
      return 0;
    }
    double previous = getCostFromRl(iter.next());
    if (!iter.hasNext()) {
      return 0;
    }
    double cost = 0;
    do {
      double current = getCostFromRl(iter.next());
      cost += current >= previous ? current - previous : current;
      previous = current;
    } while (iter.hasNext());
    return Math.max(0, cost / (regionLoadList.size() - 1));
  }
Class to be used for the subset of RegionLoad costs that should be treated as rates. We do not
compare about the actual rate in requests per second but rather the rate relative to the rest of
the regions.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/CostFromRegionLoadAsRateFunction.java