@Override
  protected final double cost() {
    return 1 - locality;
  }
Maps region to the current entity (server or rack) on which it is stored
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/LocalityBasedCostFunction.java