-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ledger): blockstore database - misc improvements (#264)
## RocksDB upgrade Upgrade dependency to latest version of rocksdb-zig which includes: - increment underlying rocksdb version - add `destroy` method to wipe the entire database from the disk - rename function for consistency with c++ code ## `Database.count` method Add `count` method to Database to return the number of entries in a column family. Previously the cleanup service circumvented the Database interface and directly called the rocksdb live files to count the number of entries. Now it can just call `count`. ## tests Add tests for Database write batches and iterators, which were missing test coverage. This revealed some bugs in HashmapDB and SortedMap which are now fixed. Also added tests to utils/collections.zig to increase test coverage for the bug there. ## `Database.get` allocator parameter Database.get now takes an allocator parameter. this is to improve memory safety. This means the calling scope: - has clear ownership over the returned item - has control over how its own data is allocated - can clean up the data properly with its own allocator
- Loading branch information
Showing
12 changed files
with
586 additions
and
140 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.