public float getBlockLocalityIndex(String host) {
    if (uniqueBlocksTotalWeight == 0) {
      return 0.0f;
    } else {
      return (float) getBlocksLocalityWeightInternal(host, HostAndWeight::getWeight)
        / (float) uniqueBlocksTotalWeight;
    }
  }
Get the block locality index for a given host
@param host the host name
@return the locality index of the given host
hbase-common/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java