Skip to content

Remove RouteMatcher#4821

Merged
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
entur:otp2_remove_route_matcher
Feb 21, 2023
Merged

Remove RouteMatcher#4821
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
entur:otp2_remove_route_matcher

Conversation

@hannesj

@hannesj hannesj commented Feb 9, 2023

Copy link
Copy Markdown
Contributor

Summary

We have previously discussed removal of RouteMatcher. This does that. This branch is based on #4820

Breaking change

This is a breaking change for the users of the REST API and legacy GraphQL API, as we remove the possibility of banning/whitelisting of routes by their name, and only allow filtering by ID.

@hannesj hannesj added the !Technical Debt Improve code quality, no functional changes. label Feb 9, 2023
@hannesj hannesj added this to the 2.3 milestone Feb 9, 2023
@hannesj
hannesj force-pushed the otp2_remove_route_matcher branch from 6c18450 to 83957ac Compare February 16, 2023 13:08
@hannesj
hannesj marked this pull request as ready for review February 16, 2023 13:08
@hannesj
hannesj requested a review from a team as a code owner February 16, 2023 13:08
private final AllowTransitModeFilter transportModeFilter;
private final List<FeedScopedId> agencies;
private final RouteMatcher routes;
private final List<FeedScopedId> routes;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the performance implications of using a List rather than a Set, which the original RouteMatcher used?

I think eventually we want to use the same indexing technique that unpreferred routes use, isn't it?

That's out of scope for this PR though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a low number of entries (<~5), the List actually has better performance, since no hashCode needs to be calculated, and the FeedScopedId is easy to compare. We use List here for other things, I'll do some profiling and crate a PR if there is a difference.

@leonardehrenfried leonardehrenfried left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it will make a big difference but I think we should move to a Set for the collection of route ids.

optionsome
optionsome previously approved these changes Feb 21, 2023
@codecov

codecov Bot commented Feb 21, 2023

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (dev-2.x@f508b61). Click here to learn what that means.
Patch coverage: 37.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #4821   +/-   ##
==========================================
  Coverage           ?   62.95%           
  Complexity         ?    13248           
==========================================
  Files              ?     1659           
  Lines              ?    66246           
  Branches           ?     7206           
==========================================
  Hits               ?    41705           
  Misses             ?    22161           
  Partials           ?     2380           
Impacted Files Coverage Δ
...lanner/ext/transmodelapi/mapping/FilterMapper.java 0.00% <0.00%> (ø)
...ext/transmodelapi/mapping/SelectRequestMapper.java 0.00% <0.00%> (ø)
...ting/api/request/request/filter/SelectRequest.java 78.87% <60.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hannesj
hannesj merged commit ba507e2 into opentripplanner:dev-2.x Feb 21, 2023
@hannesj
hannesj deleted the otp2_remove_route_matcher branch February 21, 2023 10:36
t2gran pushed a commit that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Technical Debt Improve code quality, no functional changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants