-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
Are you sure you want to change the base?
Conversation
@@ -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); |
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.
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?
this.pollIntervalInSeconds = pollIntervalInSeconds; | ||
this.queryAllModifiedAlerts = queryAllModifiedAlerts; |
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.
These values are not used for anything
String queryString; | ||
String queryLinksString; | ||
String timezone; | ||
int pollIntervalInSeconds; | ||
boolean queryAllModifiedAlerts; |
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.
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>(); |
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 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"); |
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.
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); |
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.
dateFrom
is not used for anything
public final String latitude; | ||
public final String longitude; |
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.
double
should be used for coordinates
public final String deviationId; | ||
public final String startStopId; | ||
public final String endStopId; | ||
public final String sequenceNumber; |
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.
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, |
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.
B.bulletins_id
should also be queried so that disruption route can be matched with the corresponding bulletin returned by BulletinDAO
No description provided.