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

Partition by intersection #50

Merged
merged 17 commits into from
Nov 28, 2023
Merged

Partition by intersection #50

merged 17 commits into from
Nov 28, 2023

Conversation

iyourshaw
Copy link
Collaborator

@iyourshaw iyourshaw commented Nov 22, 2023

Changes the partitioning scheme to use intersection ID (and region) instead of RSU ID.

Uses the IntersectionIdKey interface defined in the Geojson Converter to perform partitioning for MAPs, SPATs, BSMs, and output events. See: Geoson Converter PR #37.

The logic that produces intersection events (in IntersectionEventTopology and related analytics classes) is all updated to perform join operations based on intersection ID instead of RSU IP.

The region is treated as optional. If it is present, it is used in joins, but if it is absent (value -1), or set to the 'test' value of 0, it is ignored in comparisons and joins.

BSM partitioning is performed in several steps:

  • The RepartitionTopology ingests keyless BSMs from topic.OdeBsmJson and writes them to topic.CmBsmJsonRepartition partitioned by RSU IP address, because they have not been joined with an intersection at this point. The Vehicle ID is also included in the key here.
  • The BsmEventTopology reads the RSU-partitioned BSMs from topic.CmBsmJsonRepartition, and categorizes them geographically using the spatial index of MAP bounding boxes to construct BSMEvent paths that are also grouped by vehicle ID and RSU IP address. The BsmEventTopology then outputs the BSMEvents to topic.CMBsmEvents, and also writes the raw BSMs that are within intersection bounding boxes to a new topic, topic.CmBsmIntersection. Both outputs are partitioned by Intersection ID.
  • The MessageIngestTopology reads the Intersection ID-partitioned BSMs from topic.CmBsmIntersection, and stores them in a time-windowed, queryable state store. This state store now only includes BSMs that are within MAP bounding boxes.
  • The IntersectionEventTopology reads in the Intersection ID-partioned BSMEvents and removes duplicates (which are duplicate BSM paths seen by multiple RSUs) before passing them along to join with MAPs and SPATs.

The unit tests were updated, and integration testing was performed using a test script with UTDOT data running with 3 partitions on 3 brokers.

@iyourshaw iyourshaw requested a review from John-Wiens November 22, 2023 19:38
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Conflict Monitor has been using -1 to indicate an unknown intersectionId and Region. Do we want to be using -1 instead of null?

Copy link
Collaborator

@John-Wiens John-Wiens left a comment

Choose a reason for hiding this comment

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

Do we want to use -1 for null intersection / region ID?

@John-Wiens John-Wiens merged commit 26a79dd into develop Nov 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants