-
Notifications
You must be signed in to change notification settings - Fork 169
[storage] make Persistable trait a top-level Storage construct #2567
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
Conversation
b85de91 to
f18e501
Compare
Deploying monorepo with
|
| Latest commit: |
5535035
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8462b60b.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://persistable-trait.monorepo-eu0.pages.dev |
ae7f637 to
45c0852
Compare
45c0852 to
4500ec3
Compare
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.
Pull request overview
This PR refactors the Persistable trait to be a top-level storage construct, replacing the previous StorePersistable trait for key-value stores and PersistableContiguous for journals. The refactoring enables any storage structure to implement persistence capabilities through a unified interface.
Key changes:
- Introduced a new top-level
Persistabletrait inlib.rswith methods:commit,sync,close, anddestroy - Removed
StorePersistablefrom the store module andPersistableContiguousfrom journal contiguous module - Updated all implementations to use the new
Persistabletrait with explicitErrorassociated type
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/src/lib.rs | Defines the new top-level Persistable trait with persistence operations |
| storage/src/store.rs | Removes deprecated StorePersistable trait and updates documentation |
| storage/src/qmdb/store/mod.rs | Implements Persistable for Store, adding sync and close methods |
| storage/src/qmdb/store/batch.rs | Updates test trait bounds from StorePersistable to Persistable<Error = Error> |
| storage/src/qmdb/current/unordered/fixed.rs | Implements Persistable for unordered fixed-size database, moves methods from PersistableContiguous |
| storage/src/qmdb/current/ordered/fixed.rs | Implements Persistable for ordered fixed-size database |
| storage/src/qmdb/any/unordered/mod.rs | Updates trait bounds and qualifies commit calls with CleanAny:: to resolve ambiguity |
| storage/src/qmdb/any/ordered/mod.rs | Updates trait bounds and qualifies commit calls with CleanAny:: |
| storage/src/qmdb/any/mod.rs | Updates CleanAny trait to extend Persistable, removes duplicate method declarations |
| storage/src/qmdb/any/ext.rs | Implements Persistable for AnyExt wrapper with proper method delegation |
| storage/src/qmdb/any/db.rs | Updates trait bounds from PersistableContiguous to composition of MutableContiguous and Persistable |
| storage/src/ordinal/storage.rs | Implements Persistable for Ordinal, reorders methods |
| storage/src/journal/contiguous/variable.rs | Implements Persistable for variable-size journal |
| storage/src/journal/contiguous/tests.rs | Defines local PersistableContiguous trait as composition, updates all test signatures |
| storage/src/journal/contiguous/mod.rs | Removes PersistableContiguous trait (moved to top-level) |
| storage/src/journal/contiguous/fixed.rs | Implements Persistable for fixed-size journal, removes redundant commit method |
| storage/src/journal/authenticated.rs | Updates trait bounds to use Persistable instead of PersistableContiguous |
| storage/src/freezer/storage.rs | Implements Persistable for Freezer, reorders methods |
3e90dc4 to
08b60a1
Compare
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.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
9fbf418 to
9e31eb8
Compare
9e31eb8 to
5535035
Compare
|
Closing this, it makes more sense in the context of #2580 |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #2567 +/- ##
==========================================
- Coverage 92.64% 92.61% -0.04%
==========================================
Files 353 353
Lines 101323 101669 +346
==========================================
+ Hits 93871 94159 +288
- Misses 7452 7510 +58
... and 20 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Persistable is a trait that is useful more generally than for K/V stores and journals. This PR pulls it up a level to replace both
PersistentContiguous(persistent journal) andStorePersistent(k/v stores), allowing it to be implemented by any Storage structure.