-
Notifications
You must be signed in to change notification settings - Fork 77
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
Refactor: Remove deprecated / unused regional analysis fields #956
base: dev
Are you sure you want to change the base?
Conversation
Remove old fields that are no longer used. Should be accompanied by a MongoDB migration to clean up old regional analyses. We recently removed a similar worker version related flag from the UI here: conveyal/ui#2064
This will require an additional migration which processes all old regional analyses.
Grid grid = new SelectingGridReducer(cutoffIndex).compute(multiCutoffInputStream); | ||
|
||
File localFile = FileUtils.createScratchFile(fileFormat.toString()); | ||
FileOutputStream fos = new FileOutputStream(localFile); | ||
OutputStream fos = FileUtils.getOutputStream(localFile); |
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.
Looks like some of the methods that take fos
as a parameter (at least Grid.write) don't use buffered output streams, so using this utlity method that buffers the output should greatly improve write speeds.
Grid grid = new SelectingGridReducer(cutoffIndex).compute(multiCutoffInputStream); | ||
|
||
File localFile = FileUtils.createScratchFile(fileFormat.toString()); | ||
FileOutputStream fos = new FileOutputStream(localFile); | ||
OutputStream fos = FileUtils.getOutputStream(localFile); | ||
|
||
switch (fileFormat) { |
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 switch is not exhaustive, and when it receives an unexpected value it just falls through without writing anything to the file (or closing it). We should probably convert this to the new exhaustive switch syntax with a default block and no "break".
Remove old fields in regional analysis that haven't been used in many years.
#957, which contains a MongoDB migration to clean up old regional analyses, should be merged and ideally run first.
We recently removed a similar worker version related flag from the UI here: https://github.com/conveyal/ui/pull/2064