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

Logging, Database Locking and some cleanup #53

Closed
wants to merge 26 commits into from

Conversation

mgcuthbert
Copy link
Contributor

The following PR includes various changes in various components to address some specific use cases. The changes are listed below and also included in the changes.txt file.

  • Added new schema changes sql that includes extra tables for locking, state management and logging.
  • Added a new DatabaseLocker class that can be used by the plugins to standardize the way a database is locked. And make sure that all plugins that use a database lock the database correctly when running.
  • Updated plugins pgsnapshot and apidb to use the new DatabaseLocker
  • Added the ability to load a plugin manually so that you can run Osmosis as a library
  • Added an OsmosisRunner and OsmosisTask class to support running Osmosis as a library instead of through a command line
  • Removed the custom GZipInputStream class that was originally developed to address a bug in Java that has long since been fixed.
  • Updated the PBFReader plugin to download a pbf from an http server given a URL, instead of having to download the file manually.
  • Added different kinds of logging that can be used in the pgsnapshot plugin to track specifically what is being put in the database.
  • Added functionality to allow for a custom server state file when using the replication plugin
  • Consolidated the working directory get function that was used across multiple classes.
  • Refactored the XMLReader to share code from a base class, and fix a potential bug with XML reading.

mcuthbert and others added 25 commits December 11, 2018 14:52
…. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.
…. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation. (#1)
…Updated PBFReader plugin to accept a URL for input.
…ks are currently set, or if you have the lockedId or not.
* Added ability in Core to Run Osmosis within a Java application easily. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.

* Added a DatabaseLocker that can be used for any database operations. Updated PBFReader plugin to accept a URL for input.

* Removing unessecary calls to unlock

* Adding method to fully unlock the database regardless of how many locks are currently set, or if you have the lockedId or not.
…ocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.
…ocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.
* Added ability in Core to Run Osmosis within a Java application easily. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.

* Added a DatabaseLocker that can be used for any database operations. Updated PBFReader plugin to accept a URL for input.

* Removing unessecary calls to unlock

* Adding method to fully unlock the database regardless of how many locks are currently set, or if you have the lockedId or not.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* renaming schema changes file to follow convention
* Added ability in Core to Run Osmosis within a Java application easily. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.

* Added a DatabaseLocker that can be used for any database operations. Updated PBFReader plugin to accept a URL for input.

* Removing unessecary calls to unlock

* Adding method to fully unlock the database regardless of how many locks are currently set, or if you have the lockedId or not.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* renaming schema changes file to follow convention

* Needed to unlock the database correctly on exceptions.
…ng a GZip stream directly through a SAX XML parser.
* Added ability in Core to Run Osmosis within a Java application easily. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.

* Added a DatabaseLocker that can be used for any database operations. Updated PBFReader plugin to accept a URL for input.

* Removing unessecary calls to unlock

* Adding method to fully unlock the database regardless of how many locks are currently set, or if you have the lockedId or not.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* renaming schema changes file to follow convention

* Needed to unlock the database correctly on exceptions.

* Refactored the XMLReaders, and fixed exception that occurs when running a GZip stream directly through a SAX XML parser.

* Added read/write functionality into the Osmosis DatabaseLocker.
* Added ability in Core to Run Osmosis within a Java application easily. Updated pgsnapshot module to include some extra logging. A little cleanup in the replication module. Using GzipInputStream implementation.

* Added a DatabaseLocker that can be used for any database operations. Updated PBFReader plugin to accept a URL for input.

* Removing unessecary calls to unlock

* Adding method to fully unlock the database regardless of how many locks are currently set, or if you have the lockedId or not.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* Adding changes sql file to the docker test scripts. Updated DatabaseLocker so that if the unlock function does not exist it will skip attempting to lock, so for older databases things can work as before.

* renaming schema changes file to follow convention

* Needed to unlock the database correctly on exceptions.

* Refactored the XMLReaders, and fixed exception that occurs when running a GZip stream directly through a SAX XML parser.

* Added read/write functionality into the Osmosis DatabaseLocker.

* Adding unlock mechanism in test in a finally block.
@migurski
Copy link
Collaborator

Thanks Michael! There’s quite a bit here. I’m new to helping @brettch with this project so I wonder if we could break this up into a few pieces, or talk through the change as a whole?

@mgcuthbert
Copy link
Contributor Author

Yeah I understand it is large, so I would be happy to take some time to chat about it offline if you wish.

@migurski
Copy link
Collaborator

@mgcuthbert and I connected offline, and we’ll be replacing this PR with a series of pull requests in this order:

  1. GZip library deletion
  2. Reader refactoring
  3. Osmosis as a library
  4. PBF reader to pull from remote files
  5. Sequence file handling
  6. Logging
    1. SQL changes table
    2. Replication changes table
  7. Locking, which introduces the biggest change

@migurski migurski closed this Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants