-
Notifications
You must be signed in to change notification settings - Fork 41
RFC: Generic Filters for Subscriptions and FETCH #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
36cedc3
beb7072
455b640
5705af4
bd66412
d5c2340
19e15cd
65a7e24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1633,6 +1633,65 @@ multi-object stream will expire earlier than Objects later in the stream. Once | |
| Objects have expired from cache, their state becomes unknown, and a relay that | ||
| handles a downstream request that includes those Objects re-requests them. | ||
|
|
||
| #### OBJECT FILTER Parameter | ||
|
|
||
| The OBJECT_FILTER parameter(Parameter Type 0x05) MAY appear in SUBSCRIBE, | ||
| SUBSCRIBE_UPDATE, PUBLISH_OK, TRACK_STATUS or FETCH message. It is a structure | ||
| indicating Objects or ranges of Objects that the Publisher will deliver. | ||
afrind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ~~~ | ||
| Object Filter { | ||
| Type (0x5), | ||
| Length (i), | ||
| Operand (7), | ||
| Negation Flag (1), | ||
| [Extension ID (i), | ||
afrind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Values (i) ... | ||
afrind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| ~~~ | ||
|
|
||
| Operand | Meaning | ||
| 0x0 | No Filter | ||
| 0x1 | Group ID | ||
| 0x2 | Subgroup ID | ||
| 0x3 | Object ID | ||
| 0x4 | Extension ID | ||
afrind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 0x5 | Publisher Priority | ||
|
|
||
afrind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| When Negation Flag is 1, the result of the filter is negated to determine which | ||
| Objects pass the filter. | ||
afrind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Extension ID is present only when Operand is Extension ID (value 0x4) and | ||
| indicates the Extension to filter. This MUST indicate an Extension with an | ||
| integer type. Objects without the Extension do not pass the filter. | ||
|
|
||
| Values is an array of integers which encode the values of interest. The | ||
| remainder of the array is a sequence of pairs indicating the start and length of | ||
|
||
| the matching range. The Start is encoded as a delta from the previous End, or | ||
|
||
| from 0 for the first element. The length indicates the number of elements | ||
| including Start to match. An odd number of elements indicates the final range | ||
|
Comment on lines
+1671
to
+1672
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we specify the length field to indicate the number of elements minus 1, then the same number of bits can represent more elements, i.e., the capability or bit efficiency is slightly improved.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It only saves one value though at the expense of some readability?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Just a suggestion for consideration. In some other standards this is always done. |
||
| has no endpoint. For example [ 10, 3, 1, 1, 20 ] would match values 10, 11, 12, | ||
| 14 and 34-max. Only the first value can be 0. If an endpoint receives a 0 | ||
| value anywhere else or length of the Values array exceeds TBD, it MUST reject | ||
| the request with `INVALID_FILTER`. | ||
|
|
||
| All filters can be removed from a Subscription by sending SUBSCRIBE_UPDATE with | ||
| Operand No Filter. | ||
afrind marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| This parameter MAY appear up to TBD2 times in a request, and filters are | ||
| cumulative. If the parameter appears more than TBD2 times, the endpoint MUST | ||
| reject the request with `INVALID_FILTER`. When filters are applied, delivery | ||
| rules regarding FETCH responses are modified (see {{message-fetch}}). In a | ||
| filtered FETCH response, the Subscriber can only infer Objects do not exist from | ||
| their absence if they pass all filters. This is only possible when filtering on | ||
| Group ID and/or Object ID, as the Subscriber lacks other fields needed to | ||
| evaluate the filters. | ||
|
|
||
| Publishers MUST respect Subgroup delivery rules even for filtered responses. If | ||
| an Object in the middle of a Subgroup is filtered out, the Publisher MUST NOT | ||
| place another Object in that Subgroup stream (see {{closing-subgroup-streams}}). | ||
|
|
||
|
|
||
| ## CLIENT_SETUP and SERVER_SETUP {#message-setup} | ||
|
|
||
| The `CLIENT_SETUP` and `SERVER_SETUP` messages are the first messages exchanged | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about adding this to SubscribeNamespace as well ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear what adding a filter to SUBSCRIBE_NAMESPACE would do without #1047? Or you have different use cases in mind? Let's keep this focused on subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding it to namespace will enable object filtering across the tracks, where the base case is a single subscription . I was suggesting it would be nice to think the filter more generically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suhasHere I am amenable to using the same parameter to filter Tracks in response to SUBSCRIBE_NAMESPACE rather than Objects in SUBSCRIBE, but it requires more semantics (for example, most operands defined here don't make any sense). Can you file an issue explaining the requirements for Track filtering first?