src/main/java/org/apache/hadoop/hdfs/server/namenode/AbstractQueryEngine.java
@Override // QueryEngine
  public Map<String, Map<String, Long>> genericTwoLevelHistogram(
      Stream<INode> inodes,
      Function<INode, String> namingFunction1,
      Function<INode, String> namingFunction2,
      Function<INode, Long> dataFunction) {
    return inodes.collect(
        Collectors.groupingBy(
            namingFunction1,
            Collectors.groupingBy(
                namingFunction2,
                Collectors.mapping(dataFunction, Collectors.summingLong(i -> i)))));
  }
/**
   * Produces a 2-level gropued Histogram for generic summation.
   *
   * @param inodes inodes
   * @param namingFunction1 function to string for top level grouping
   * @param namingFunction2 function to string for second level grouping
   * @param dataFunction function to long
   * @return histogram of sums
   */
Produces a 2-level gropued Histogram for generic summation.
Produces a 2 - level gropued Histogram for generic summation .
@Override 
  public Map<String, Map<String, Long>> genericTwoLevelHistogram(
      Stream<INode> inodes,
      Function<INode, String> namingFunction1,
      Function<INode, String> namingFunction2,
      Function<INode, Long> dataFunction) {
    return inodes.collect(
        Collectors.groupingBy(
            namingFunction1,
            Collectors.groupingBy(
                namingFunction2,
                Collectors.mapping(dataFunction, Collectors.summingLong(i -> i)))));
  }
@ Override public Map < String , Map < String , Long > > genericTwoLevelHistogram ( Stream < INode > inodes , Function < INode , String > namingFunction1 , Function < INode , String > namingFunction2 , Function < INode , Long > dataFunction ) { return inodes . collect ( Collectors . groupingBy ( namingFunction1 , Collectors . groupingBy ( namingFunction2 , Collectors . mapping ( dataFunction , Collectors . summingLong ( i -> i ) ) ) ) ) ; }
Produces a 2-level gropued Histogram for generic summation.
Produces a 2 - level gropued Histogram for generic summation .
// QueryEngine