Skip to content
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

Restructure relationships in street model #6605

Draft
wants to merge 14 commits into
base: dev-2.x
Choose a base branch
from

Conversation

leonardehrenfried
Copy link
Member

@leonardehrenfried leonardehrenfried commented Apr 7, 2025

Summary

This PR restructured the relationships between the following classes in the street model:

  • Graph
  • StreetIndex
  • VertexLinker
  • TemporaryVerticesContainer

Before this PR their responsibilities were very unclear with many cyclic relationships. I've tried to split up the responsibilities this way:

  • Graph: top level mutable repository of street entities
  • StreetIndex: package-private index of street entities for fast access, only accessible by Graph
  • VertexLinker: stateless and only responsible for linking, nothing else
  • TemporaryVerticesContainer: request-scoped helper object that orchestrates linking tasks and cleanup

Improvements

The Graph, index or VertexLinker don't require a site repository anymore.

Unit tests

Updated, but no new ones.

Documentation

JavaDoc

Bumping the serialization version id

Yes, because the graph has changed.

@leonardehrenfried leonardehrenfried added Technical Debt bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Skip Changelog labels Apr 7, 2025
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 83.18966% with 39 lines in your changes missing coverage. Please review.

Project coverage is 70.96%. Comparing base (a50b595) to head (b4520ad).
Report is 1 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...org/opentripplanner/routing/graph/StreetIndex.java 91.02% 5 Missing and 2 partials ⚠️
.../inspector/vector/vertex/VertexPropertyMapper.java 0.00% 5 Missing ⚠️
...nner/street/search/TemporaryVerticesContainer.java 91.22% 1 Missing and 4 partials ⚠️
...r/ext/debugrastertiles/EdgeVertexTileRenderer.java 0.00% 4 Missing ⚠️
...lanner/inspector/vector/edge/EdgeLayerBuilder.java 0.00% 3 Missing ⚠️
...vector/geofencing/GeofencingZonesLayerBuilder.java 0.00% 3 Missing ⚠️
...er/inspector/vector/vertex/VertexLayerBuilder.java 0.00% 3 Missing ⚠️
...pentripplanner/routing/graph/EdgeSpatialIndex.java 76.92% 1 Missing and 2 partials ⚠️
...aph_builder/module/OsmBoardingLocationsModule.java 85.71% 0 Missing and 1 partial ⚠️
...aph_builder/module/islandpruning/PruneIslands.java 66.66% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6605      +/-   ##
=============================================
- Coverage      70.98%   70.96%   -0.02%     
- Complexity     18272    18277       +5     
=============================================
  Files           2000     1999       -1     
  Lines          75871    75833      -38     
  Branches        7785     7778       -7     
=============================================
- Hits           53856    53818      -38     
+ Misses         19268    19267       -1     
- Partials        2747     2748       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leonardehrenfried leonardehrenfried force-pushed the graph-index branch 3 times, most recently from a80961f to 6f39c2c Compare April 8, 2025 07:35
@leonardehrenfried leonardehrenfried marked this pull request as ready for review April 8, 2025 08:10
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner April 8, 2025 08:10
@optionsome optionsome marked this pull request as draft April 8, 2025 09:24
@vesameskanen vesameskanen self-requested a review April 8, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Skip Changelog Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant