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

654 disruption routes #35

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

654 disruption routes #35

wants to merge 12 commits into from

Conversation

ahjyrkia
Copy link
Contributor

No description provided.

@@ -144,7 +149,7 @@ private static long toUtcEpochMs(final LocalDateTime localTimestamp, final Strin
builder.addAllTitles(bulletin.titles);
builder.addAllDescriptions(bulletin.descriptions);
builder.addAllUrls(bulletin.urls);

builder.addAllAffectedDisruptionRoutes(disruptionRoutes);
Copy link
Contributor

Choose a reason for hiding this comment

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

builder.addAllAffectedDisruptionRoutes takes a list of strings as argument. Maybe there should be DisruptionRoute message in the protobuf? What are we trying to do here?

Comment on lines +34 to +35
this.pollIntervalInSeconds = pollIntervalInSeconds;
this.queryAllModifiedAlerts = queryAllModifiedAlerts;
Copy link
Contributor

Choose a reason for hiding this comment

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

These values are not used for anything

Comment on lines +25 to +29
String queryString;
String queryLinksString;
String timezone;
int pollIntervalInSeconds;
boolean queryAllModifiedAlerts;
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be private final

String preparedString = queryString.replace("VAR_DATE_FROM", "1970-03-07");
try (PreparedStatement statement = connection.prepareStatement(preparedString)) {
ResultSet resultSet = statement.executeQuery();
HashMap<String, Stop> stopsByGid = new HashMap<String, Stop>();
Copy link
Contributor

Choose a reason for hiding this comment

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

This HashMap is empty, so stop IDs in DisruptionRoute will be null. Is this a problem?

public List<DisruptionRoute> getActiveDisruptions() throws SQLException {
log.info("Querying disruption route links from database");
String dateFrom = localDateAsString(Instant.now(), timezone);
String preparedString = queryString.replace("VAR_DATE_FROM", "1970-03-07");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the date intentionally hardcoded here?

@Override
public List<DisruptionRoute> getActiveDisruptions() throws SQLException {
log.info("Querying disruption route links from database");
String dateFrom = localDateAsString(Instant.now(), timezone);
Copy link
Contributor

Choose a reason for hiding this comment

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

dateFrom is not used for anything

Comment on lines +9 to +10
public final String latitude;
public final String longitude;
Copy link
Contributor

Choose a reason for hiding this comment

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

double should be used for coordinates

public final String deviationId;
public final String startStopId;
public final String endStopId;
public final String sequenceNumber;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sequence number should be int

DC.last_modified,
DC.valid_from AS DC_VALID_FROM,
DC.valid_to AS DC_VALID_TO,
B.valid_from AS B_VALID_FROM,
Copy link
Contributor

Choose a reason for hiding this comment

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

B.bulletins_id should also be queried so that disruption route can be matched with the corresponding bulletin returned by BulletinDAO

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.

Transitdata-omm-alert-source: Disruption routes data to existing bulletins
5 participants