-
-
Notifications
You must be signed in to change notification settings - Fork 372
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 database code to support standalone batches, transactions. #861
Conversation
34deb04
to
9d1136f
Compare
Codecov Report
@@ Coverage Diff @@
## master #861 +/- ##
==========================================
+ Coverage 64.06% 64.07% +<.01%
==========================================
Files 51 54 +3
Lines 6565 6588 +23
==========================================
+ Hits 4206 4221 +15
- Misses 1854 1860 +6
- Partials 505 507 +2
Continue to review full report at Codecov.
|
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.
Could you move the changing of mirror into another PR? Otherwise this makes reviewing harder as there are code and test changes which are not relevant to each other.
In terms of database interface - do we want to support another database anytime soon?
In my opinion in golang interface should only be defined if there are actually used as that's the power of golang that those can be define at any time fairly easily. So if we don't implement another database any time soon I would not define interfaces.
These are just some initial comments - I will have to look into the changes when i have some more time at hand.
Yep, makes sense. I will split. I was trying to fix the build in Travis CI, but looks like the failures are still there. Going to add retries to aptly on network errors.
That was the initial plan.
Interface was there since the inception of aptly, I just moved things around so that's it more obvious what is interface, and what is the implementation. I had plans to add other types of databases, in fact it might make sense to support something distributed (Redis?), but this is not my goal for this PR of course. Interface plays another important role here: it abstracts away goleveldb, so we don't end up using features in a random way, it's clear what's being used and what not. |
@smira My quick look over the changes was a bit too quick... 😉 let's leave the interfaces as they were before then. |
703940c
to
9d1136f
Compare
This is spin-off of changes from aptly-dev#459. Transactions are not being used yet, but batches are updated to work with the new API. `database/` package was refactored to split abstract interfaces and implementation via goleveldb. This should make it easier to implement new database types.
9d1136f
to
c5bb143
Compare
@sliverc updated, should be ready for the review now |
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 is spin-off of changes from #459.
Transactions are not being used yet, but batches are updated to work
with the new API.
database/
package was refactored to split abstract interfaces andimplementation via goleveldb. This should make it easier to implement
new database types.
Checklist
AUTHORS