-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Extend metadata to include targets for route_to_stream #24584
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
Conversation
gally47
left a comment
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.
Tested it, Frontend LGTM.
kodjo-anipah
left a comment
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.
|
|
||
| @JsonProperty(FIELD_ROUTING_RULES) | ||
| // Maps rule ID to IDs of routed stream | ||
| public abstract Map<String, Set<String>> routingRules(); |
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.
I think we should rename both variables so it's clear what they are. e.g. streamsByRuleId and routedStreamTitlesById
| if (args.getPreComputedValue(RouteToStream.ID_ARG) != null) { | ||
| String streamId = args.getPreComputedValue(RouteToStream.ID_ARG).toString(); | ||
| try { | ||
| Stream stream = streamService.load(streamId); |
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.
we can use streamService.streamTitleFromCache()
| schema = @Schema(allowableValues = {"asc", "desc"})) | ||
| @DefaultValue(DEFAULT_SORT_DIRECTION) @QueryParam("order") SortOrder order) { | ||
|
|
||
| // Pagination is primarily for UX purposes - OK to fetch all and then paginate in memory |
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.
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.
Yes, the FE should use pagination. And we want to use the standard paginated entity table, so the response needs to conform to that pattern.
The problem is that the table entities do not correspond to mongo documents. A single entry in the pipeline_processor_rules_meta collection may map to multiple table entries. This is handled in the buildResponse method and is not exactly trivial.
If we want to perform pagination via mongo, I think we would need to modify the pipeline_processor_rules_meta collection so that it maps 1:1 to the UI table. The UI dictating the DB schema feels backward; especially since this collection is used for multiple purposes.
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.
Not sure about copying everything into that collection or if we can extend how the query works in the backend but i think frontend gets no filter and searches if it means doing that in memory. so having a data table that can only filter on one coloumn is what it is , or not?
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.
Yes, it's not pretty. It needs to be paginated because the space in the UI is very limited. But we don't expect to ever have a very large number of entries here, so filtering and searching is not that important.
That said, we already have at least one instance of in-memory pagination (collections). We could re-use that code for filtering and searching if needed.
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.
Pagination is being used in the frontend. In the screenshot there are no entries, so then there is no pagination.
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.
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.
If we want to perform pagination via mongo, I think we would need to modify the pipeline_processor_rules_meta collection so that it maps 1:1 to the UI table. The UI dictating the DB schema feels backward; especially since this collection is used for multiple purposes.
@patrickmann Is this something we could feasibly get done in this cooldown? Would the search bar work differently in this case?
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.
Covered by #24866
kodjo-anipah
left a comment
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.
LGTM





/nocl
Description
See issue for context.
Motivation and Context
Resolves #24516
How Has This Been Tested?
Local testing
Note that no meta-data is generated for rules that are not included in any pipeline!
Screenshots (if appropriate):
Types of changes
Checklist: