-
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
Clear added patterns in TimetableSnapshot #6141
Conversation
2491e22
to
8c4f01e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6141 +/- ##
=============================================
- Coverage 69.90% 69.89% -0.01%
- Complexity 17708 17711 +3
=============================================
Files 1996 1996
Lines 75334 75348 +14
Branches 7713 7713
=============================================
+ Hits 52660 52668 +8
- Misses 19997 20000 +3
- Partials 2677 2680 +3 ☔ View full report in Codecov by Sentry. |
8c4f01e
to
11f0123
Compare
.keySet() | ||
.removeIf(route -> feedId.equals(route.getId().getFeedId())); | ||
realtimeAddedRoutes.keySet().removeIf(id -> feedId.equals(id.getFeedId())); | ||
return removedEntry; |
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.
This removedEntry
parameter is only set if trips were removed, not the other entries. If that is on purpose it would be nice with a comment explaining why that is valid.
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.
Indeed this is on purpose. Comment added.
* Clear all realtime added routes, trip patterns and trips matching the provided feed id. | ||
* | ||
* */ | ||
private boolean clearRealtimeAddedTripPatterns(String feedId) { |
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.
Maybe a better name would be clearEntriesForRealtimeAddedTrips()
?
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.
Done.
# Conflicts: # application/src/test/java/org/opentripplanner/model/TimetableSnapshotTest.java
Summary
#6007 moved the indexes for real-time added trips from the transit model index to the timetable snapshot.
However the code for clearing these indexes, which is required when the feed uses the incrementality mode FULL_DATASET, was missing.
This PR adds the logic for clearing these indexes.
Issue
No
Unit tests
Added unit test.
Documentation
No