public class FilterSetPredicate extends Object implements Predicate<Keyed>
NamedPredicate
s 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.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static FilterSetPredicate |
fromNamedFilter(io.confluent.telemetry.config.NamedFilter filter) |
static FilterSetPredicate |
fromNamedFilter(Set<io.confluent.telemetry.config.NamedFilter> filters) |
int |
hashCode() |
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 NamedFilter s from
this object, plus any NamedFilter s from the other set that is not
contained the current NamedFilterSet . |
public static FilterSetPredicate fromNamedFilter(io.confluent.telemetry.config.NamedFilter filter)
public static FilterSetPredicate fromNamedFilter(Set<io.confluent.telemetry.config.NamedFilter> filters)
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 NamedFilter
s from
this object, plus any NamedFilter
s from the other
set that is not
contained the current NamedFilterSet
.public boolean test(Keyed key)