float getLocalityOfRegion(int region, int server) {
    if (regionFinder != null) {
      HDFSBlocksDistribution distribution = regionFinder.getBlockDistribution(regions[region]);
      return distribution.getBlockLocalityIndex(servers[server].getHostname());
    } else {
      return 0f;
    }
  }
Common method for per host and per Location region index updates when a region is moved.
@param serverIndexToLocation             serverIndexToHostIndex or serverIndexToLocationIndex
@param regionsPerLocation                regionsPerHost or regionsPerLocation
@param colocatedReplicaCountsPerLocation colocatedReplicaCountsPerHost or
                                         colocatedReplicaCountsPerRack
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BalancerClusterState.java