Interface SubscriptionFilterMatcher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Evaluates the
repeated SubscriptionFilter filters field of a
SubscribeRequest against a Persistent Query (PQ).
An empty filter list matches every PQ. A non-empty filter list is OR-combined: a PQ matches iff at least one filter
element matches it, either by serial or by (owner, name) pair.
The same logic is used on the server (to decide what to emit) and on the client (to defend against an older server
that ignored the filter field). See the proto comment on SubscribeRequest.filters for the full
backwards-compatibility contract.
This is a FunctionalInterface: the sole abstract method is matches(long, java.lang.String, java.lang.String). Instances are obtained from
fromProto(java.util.List<io.deephaven.proto.controller.SubscriptionFilter>) (or the MATCH_ALL constant), never constructed directly.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SubscriptionFilterMatcherMatcher that returns true for every PQ (i.e. -
Method Summary
Modifier and TypeMethodDescriptionstatic SubscriptionFilterMatcherfromProto(@Nullable List<SubscriptionFilter> filters) Build a matcher from a list ofSubscriptionFilterproto messages.static booleanisMatchAll(@NotNull SubscriptionFilterMatcher matcher) booleanTest whether a PQ identified by its serial, owner and name matches this filter.
-
Field Details
-
MATCH_ALL
Matcher that returns true for every PQ (i.e. "no filter").
-
-
Method Details
-
matches
Test whether a PQ identified by its serial, owner and name matches this filter. -
isMatchAll
- Parameters:
matcher- the matcher to test- Returns:
- true if the matcher accepts every PQ (i.e. was built from an empty filter list).
-
fromProto
Build a matcher from a list ofSubscriptionFilterproto messages.- Parameters:
filters- the filter list fromSubscribeRequest.getFiltersList(); may be null or empty- Returns:
- a matcher;
MATCH_ALLif the list is null or empty - Throws:
IllegalArgumentException- if any element is malformed (no oneof variant set, orOwnerAndNamewith empty owner or empty name). Callers handling a gRPC request should translate this toStatus.INVALID_ARGUMENT.
-