Class FilterSetPredicate

java.lang.Object
io.confluent.telemetry.config.FilterSetPredicate
All Implemented Interfaces:
Predicate<Keyed>

public class FilterSetPredicate extends Object implements Predicate<Keyed>
A grouping of unique NamedPredicates to be applied to an Exporter. For ease of usage, it provides a Predicate interface, which operates as a logical OR of all filters in this set. It also provides set-like operation to merge FilterSetPredicate and extract a subset of it. For the scope of this class, a NamedPredicate is identified only by its name.
  • Method Details

    • fromNamedFilter

      public static FilterSetPredicate fromNamedFilter(io.confluent.telemetry.config.v2.NamedFilter filter)
    • fromNamedFilter

      public static FilterSetPredicate fromNamedFilter(Set<io.confluent.telemetry.config.v2.NamedFilter> filters)
    • subset

      public FilterSetPredicate subset(Set<String> filterNames)
      Returns a new FilterSetPredicate containing only the NamedFilters with the given names. It throws a NoSuchElementException if the filterNames contains any name that isn't defined in this FilterSetPredicate
    • union

      public FilterSetPredicate union(FilterSetPredicate other)
      Creates a new FilterSetPredicate containing all the NamedFilters from this object, plus any NamedFilters from the other set that is not contained the current NamedFilterSet.
    • test

      public boolean test(Keyed key)
      We avoid the streams abstraction here for performance reasons since this will be called on every metric for every predicate.
      Specified by:
      test in interface Predicate<Keyed>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object