src/main/java/org/apache/hadoop/hdfs/server/namenode/queries/Histograms.java
public static Map<String, Long> orderByKeyOrder(Map<String, Long> map, List<String> keys) {
    LinkedHashMap<String, Long> orderedMap = new LinkedHashMap<>(map.size());
    for (String key : keys) {
      orderedMap.put(key, map.getOrDefault(key, 0L));
    }
    return orderedMap;
  }
/**
   * Result is a histogram ordered by the key order.
   *
   * @param map the output map
   * @param keys the ordered key list
   * @return histogram with 0s for empty keys and ordered by key list
   */
Result is a histogram ordered by the key order.
@param map the output map
@param keys the ordered key list
@return histogram with 0s for empty keys and ordered by key list
Result is a histogram ordered by the key order . @param map the output map @param keys the ordered key list @return histogram with 0s for empty keys and ordered by key list
public static Map<String, Long> orderByKeyOrder(Map<String, Long> map, List<String> keys) {
    LinkedHashMap<String, Long> orderedMap = new LinkedHashMap<>(map.size());
    for (String key : keys) {
      orderedMap.put(key, map.getOrDefault(key, 0L));
    }
    return orderedMap;
  }
public static Map < String , Long > orderByKeyOrder ( Map < String , Long > map , List < String > keys ) { LinkedHashMap < String , Long > orderedMap = new LinkedHashMap < > ( map . size ( ) ) ; for ( String key : keys ) { orderedMap . put ( key , map . getOrDefault ( key , 0L ) ) ; } return orderedMap ; }
Result is a histogram ordered by the key order.
Result is a histogram ordered by the key order .