private long getBlocksLocalityWeightInternal(String host, Visitor visitor) {
    long localityIndex = 0;
    HostAndWeight hostAndWeight = this.hostAndWeights.get(host);
    // Compatible with local mode, see HBASE-24569
    if (hostAndWeight == null) {
      String currentHost = "";
      try {
        currentHost = DNS.getDefaultHost("default", "default");
      } catch (Exception e) {
        // Just ignore, it's ok, avoid too many log info
      }
      if (host.equals(currentHost)) {
        hostAndWeight = this.hostAndWeights.get(HConstants.LOCALHOST);
      }
    }
    if (hostAndWeight != null && uniqueBlocksTotalWeight != 0) {
      localityIndex = visitor.visit(hostAndWeight);
    }
    return localityIndex;
  }
Get the blocks local weight with ssd for a given host
@param host the host name
@return the blocks local with ssd weight of the given host
hbase-common/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java