-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Create the NumItinerariesFilter and the associated NumItinerariesFilterResults to limit itineraries based on the numItineraries parameter. #5450
Conversation
…terResults to limit itineraries based on the numItineraries parameter. Pulling this functionality into a separate filter from the MaxLimitFilter because of the need to keep more information about the filtered itineraries than just the first one that is removed. The NumItinerariesFilterResults contains information used in the page cursors currently as well as information that will be used in the future deduplication feature.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5450 +/- ##
=============================================
+ Coverage 66.79% 66.80% +0.01%
- Complexity 15463 15556 +93
=============================================
Files 1798 1806 +8
Lines 69795 69821 +26
Branches 7357 7357
=============================================
+ Hits 46619 46644 +25
+ Misses 20720 20719 -1
- Partials 2456 2458 +2
☔ View full report in Codecov by Sentry. |
src/main/java/org/opentripplanner/routing/algorithm/mapping/RoutingResponseMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/routing/algorithm/mapping/RoutingResponseMapper.java
Outdated
Show resolved
Hide resolved
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 must admit that I don't fully understand the logic here so I would appreciate some context in a dev meeting.
Besides I picked up on a small thing.
The idea is to capture more information about the result of applying the numItineraries condition and using it in the pageCursor for more accurate paging. I'll use it next in order to get rid of potential duplicates when paging. I'll happily explain more in today's meeting.
Taking a look at the timestamp addition suggestions and the question you had now. |
…terResults to limit itineraries based on the numItineraries parameter. Pulling this functionality into a separate filter from the MaxLimitFilter because of the need to keep more information about the filtered itineraries than just the first one that is removed. The NumItinerariesFilterResults contains information used in the page cursors currently as well as information that will be used in the future deduplication feature.
…terResults to limit itineraries based on the numItineraries parameter. Pulling this functionality into a separate filter from the MaxLimitFilter because of the need to keep more information about the filtered itineraries than just the first one that is removed. The NumItinerariesFilterResults contains information used in the page cursors currently as well as information that will be used in the future deduplication feature.
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.
Looks good to me.
src/main/java/org/opentripplanner/model/plan/pagecursor/PageCursorFactory.java
Outdated
Show resolved
Hide resolved
…FactoryParameters.
src/main/java/org/opentripplanner/model/plan/pagecursor/PageCursorFactoryParameters.java
Show resolved
Hide resolved
...entripplanner/routing/algorithm/filterchain/deletionflagger/NumItinerariesFilterResults.java
Outdated
Show resolved
Hide resolved
...entripplanner/routing/algorithm/filterchain/deletionflagger/NumItinerariesFilterResults.java
Outdated
Show resolved
Hide resolved
…FactoryParameters.
Summary
This PR pulls functionality to limit the number of itineraries to the numItineraries parameter into a separate filter from the MaxLimitFilter because of the need to keep more information about the filtered itineraries than just the first one that is removed. The NumItinerariesFilterResults contains information used in the creation of page cursors currently, as well as information that will be used in the future deduplication feature.
Issue
N/A
Unit tests
Updated relevant unit tests and added a unittest for the new filter.
Documentation
Added JavaDoc.
Changelog
N/A
Bumping the serialization version id
N/A