-
Notifications
You must be signed in to change notification settings - Fork 0
67444 Refactor cache boostrapper #61
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
Conversation
| int lookupCounter = 0; | ||
| int rowCounter = 0; | ||
| @Override | ||
| String getQuery() { |
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.
Just moved above and removed the redundant string builder.
The order of methods definition follows the order of steps executed by the processor:
getting query
collecting results
processing them
| resultSet.getString(queryUtils.START_TIME))); | ||
| } | ||
|
|
||
| log.info("[OPTIMIZED] Database query found {} rows", journeyResultItems.size()); |
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 was moved to the main QueryProcessor, both the log line and closing the query
| log.error("Unknown exception during query ", e); | ||
| log.info("All data processed"); | ||
| } catch (SQLException e) { | ||
| throw new RuntimeException(e); |
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.
propagating the error so the job execution would be marked as failed and retried.
|
|
||
| public static void main(String[] args) { | ||
| String connectionString = ""; | ||
| var jobId = randomUUID().toString(); |
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.
so we can correlate in the central logging system all the logs for a given run
| import static fi.hsl.common.transitdata.TransitdataProperties.formatMetroId; | ||
| import static fi.hsl.transitdata.pubtransredisconnect.MetroJourneyResultSetProcessor.MetroJourneyResultItem; | ||
|
|
||
| public class MetroJourneyResultSetProcessor extends AbstractResultSetProcessor<MetroJourneyResultItem> { |
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.
migrating this processor to the same logic of:
executing query
collecting results
closing query
processing items
| public class StopResultSetProcessor extends AbstractResultSetProcessor { | ||
| import static fi.hsl.transitdata.pubtransredisconnect.StopResultSetProcessor.StopResultItem; | ||
|
|
||
| public class StopResultSetProcessor extends AbstractResultSetProcessor<StopResultItem> { |
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.
migrating this processor to the same logic of:
executing query
collecting results
closing query
processing items
haphut
left a comment
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.
Great work! LGTM.
No description provided.