public class FilterSetPredicate extends Object implements Predicate<Keyed>
NamedFilterPredicates 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 NamedFilterPredicate is identified only by its name.| Constructor and Description |
|---|
FilterSetPredicate(io.confluent.telemetry.config.NamedFilter filter) |
FilterSetPredicate(Set<io.confluent.telemetry.config.NamedFilter> filters) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
FilterSetPredicate |
subset(Set<String> filterNames)
Returns a new FilterSetPredicate containing only the NamedFilters with the given names.
|
boolean |
test(Keyed key)
We avoid the streams abstraction here for performance reasons since this will be called
on every metric for every predicate.
|
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. |
public FilterSetPredicate(io.confluent.telemetry.config.NamedFilter filter)
public FilterSetPredicate(Set<io.confluent.telemetry.config.NamedFilter> filters)
public boolean isEmpty()
public FilterSetPredicate subset(Set<String> filterNames)
NoSuchElementException if the filterNames contains any name
that isn't defined in this FilterSetPredicatepublic FilterSetPredicate union(FilterSetPredicate other)
FilterSetPredicate containing all the NamedFilters from
this object, plus any NamedFilters from the other set that is not
contained the current NamedFilterSet.public boolean test(Keyed key)