-
Notifications
You must be signed in to change notification settings - Fork 5
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
[WIP] Introduced new Flight File Processing System #82
Open
jkarns275
wants to merge
12
commits into
refactor-staging
Choose a base branch
from
refactor-josh
base: refactor-staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkarns275
changed the title
[WIP] Introduced new Flight File Processing System
Introduced new Flight File Processing System
Apr 10, 2023
jkarns275
changed the title
Introduced new Flight File Processing System
[WIP] Introduced new Flight File Processing System
Apr 10, 2023
* DAT File Processor * csv file processing * JSON Flight processing * GPX File Processing code * Attempt at porting over more DAT processing code * JSON File processing with new code * Part of CSVFileProcessing * Remove connection params from DATFileProcessor * Probably working general csv parsing * CSV File Processor * Remove storing Maps and FlightMeta in JSONFileProcessor instance * GPX processor * Integrate processors into the process upload class * More maintainable way of adding new flight file processors in the future * Fixed some compile errs in procupload. Still need to fix issue with convertAndInsert in dat file * DAT File changes. Modified FlightFileProcessor to do var args to support this * Add todo comment * Procesor docstrings * JavaDocs for FFP * Modify how the processors map is inited * Kotlin moment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new system aims to do a few things:
The basic idea is that we have a set of "steps" that we want to apply to flights during the import process (e.g. AGL calculation, LOCI calculation, AirportProximity, Engine Divergence, TotalFuel). Each of these steps will be factored into its own class that extends the ProcessStep class, which will provide some information about what columns the steps need to be computed and what columns they output after being computed.
This information can be used to construct a DAG, where the nodes are the process steps and an edge exists between from node A to node B if node A outputs a column required by column B. The DAG can then be executed efficiently using a work-stealing thread pool (ForkJoinPool in java) along with a little extra book keeping to avoid creation of redundant jobs. The implementation of this DAG exists in org.ngafid.flights.process.DependencyGraph.
The FlightBuilder class pulls these things together. The (overridable) method gatherSteps() returns a list of ProcessSteps which will be used create a DependencyGraph. The graph is then executed. Rather than modifying the Flight object in-place, the FlightBuilder object as passed around to the ProcessSteps.
To handle different types of Airframes that may require a particular set of ProcessSteps, the FlightBuilder class can be extended and the gatherSteps() method overridden.
Error handling here is a bit more convoluted since (1) the DAG can possibly be executed in parallel and (2) the errors can propagate down the dependency graph. Basically, non-fatal exceptions are accumulated as usual but will lead to all descendant steps being disabled. Fatal exceptions will lead to the flight ultimately not being imported, but won't immediately halt the processing process due to the usage of a thread pool.
There are also a lot of small changes I made along the way here for the sake of speed / efficiency / readability, too many to list here.
TODO:
Also note that this is a PR into our staging branch, not main.