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

Refactor: Remove deprecated / unused regional analysis fields #956

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

trevorgerhardt
Copy link
Member

@trevorgerhardt trevorgerhardt commented Feb 18, 2025

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

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);
Copy link
Member

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) {
Copy link
Member

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants