src/main/java/org/apache/hadoop/hdfs/server/namenode/AbstractQueryEngine.java
@Override // QueryEngine
  public Map<String, List<Long>> removeKeysOnConditional2(
      Map<String, List<Long>> histogram, String histogramConditionsStr) {
    long s1 = System.currentTimeMillis();
    int originalHistSize = histogram.size();

    List<Function<List<Long>, Boolean>> comparisons =
        createIndexedComparisons(histogramConditionsStr);
    Set<String> keys = new HashSet<>();
    for (Map.Entry<String, List<Long>> entry : histogram.entrySet()) {
      boolean columnCheck = check(comparisons, entry.getValue());
      if (!columnCheck) {
        keys.add(entry.getKey());
      }
    }
    keys.forEach(histogram::remove);

    long e1 = System.currentTimeMillis();
    if (LOG.isDebugEnabled()) {
      LOG.debug(
          "Removing {} keys from histogram2 of size {} using conditional String:'{}', took: {} ms.",
          keys.size(),
          originalHistSize,
          histogramConditionsStr,
          (e1 - s1));
    }

    return histogram;
  }
/**
   * Result is a histogram with only entries that satisfy the conditional String. Conditional String
   * ex: 'gte:1000' should create a histogram where all entries have values greater than or equal to
   * 1000L.
   *
   * <p>NOTE: Modifies the parameter histogram.
   *
   * @param histogram data points of histogram
   * @param histogramConditionsStr conditional string to filter out the given histogram
   * @return filtered histogram as per the given conditional string
   */
Result is a histogram with only entries that satisfy the conditional String. Conditional String
ex: 'gte:1000' should create a histogram where all entries have values greater than or equal to
1000L.

NOTE: Modifies the parameter histogram.

@param histogram data points of histogram
@param histogramConditionsStr conditional string to filter out the given histogram
@return filtered histogram as per the given conditional string
Result is a histogram with only entries that satisfy the conditional String . Conditional String ex : ' gte : 1000 ' should create a histogram where all entries have values greater than or equal to 1000L . NOTE : Modifies the parameter histogram . @param histogram data points of histogram @param histogramConditionsStr conditional string to filter out the given histogram @return filtered histogram as per the given conditional string
@Override 
  public Map<String, List<Long>> removeKeysOnConditional2(
      Map<String, List<Long>> histogram, String histogramConditionsStr) {
    long s1 = System.currentTimeMillis();
    int originalHistSize = histogram.size();
    List<Function<List<Long>, Boolean>> comparisons =
        createIndexedComparisons(histogramConditionsStr);
    Set<String> keys = new HashSet<>();
    for (Map.Entry<String, List<Long>> entry : histogram.entrySet()) {
      boolean columnCheck = check(comparisons, entry.getValue());
      if (!columnCheck) {
        keys.add(entry.getKey());
      }
    }
    keys.forEach(histogram::remove);
    long e1 = System.currentTimeMillis();
    if (LOG.isDebugEnabled()) {
      LOG.debug(
          "Removing {} keys from histogram2 of size {} using conditional String:'{}', took: {} ms.",
          keys.size(),
          originalHistSize,
          histogramConditionsStr,
          (e1 - s1));
    }
    return histogram;
  }
@ Override public Map < String , List < Long > > removeKeysOnConditional2 ( Map < String , List < Long > > histogram , String histogramConditionsStr ) { long s1 = System . currentTimeMillis ( ) ; int originalHistSize = histogram . size ( ) ; List < Function < List < Long > , Boolean > > comparisons = createIndexedComparisons ( histogramConditionsStr ) ; Set < String > keys = new HashSet < > ( ) ; for ( Map . Entry < String , List < Long > > entry : histogram . entrySet ( ) ) { boolean columnCheck = check ( comparisons , entry . getValue ( ) ) ; if ( ! columnCheck ) { keys . add ( entry . getKey ( ) ) ; } } keys . forEach ( histogram :: remove ) ; long e1 = System . currentTimeMillis ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Removing {} keys from histogram2 of size {} using conditional String:'{}', took: {} ms." , keys . size ( ) , originalHistSize , histogramConditionsStr , ( e1 - s1 ) ) ; } return histogram ; }
Result is a histogram with only entries that satisfy the conditional String.
Result is a histogram with only entries that satisfy the conditional String .
// QueryEngine