feat: abstract Merk storage#7
Merged
Merged
Conversation
9db17ed to
1abeff9
Compare
1abeff9 to
3a64e74
Compare
QuantumExplorer
approved these changes
Dec 20, 2021
Member
QuantumExplorer
left a comment
There was a problem hiding this comment.
We can create other PRs for the work needed in comments.
| root_leaf_keys: HashMap<Vec<u8>, usize>, | ||
| subtrees: HashMap<Vec<u8>, Merk>, | ||
| db: Rc<rocksdb::DB>, | ||
| subtrees: HashMap<Vec<u8>, Merk<PrefixedRocksDbStorage>>, |
Member
There was a problem hiding this comment.
We don't want to keep all merk subtrees in memory.
| }; | ||
| let create_subtree_merk = | ||
| || -> Result<(Vec<u8>, Merk<PrefixedRocksDbStorage>), Error> { | ||
| let compressed_path_subtree = Self::compress_path(path, Some(&key)); |
Member
There was a problem hiding this comment.
compress path needs to be make sure that ab, a != a, ba
| /// store.apply(batch, &[]).unwrap(); | ||
| /// ``` | ||
| pub fn apply(&mut self, batch: &Batch, aux: &Batch) -> Result<()> { | ||
| pub fn apply(&mut self, batch: &MerkBatch, aux: &MerkBatch) -> Result<()> { |
Member
There was a problem hiding this comment.
We need multiple tree batching.,
antouhou
approved these changes
Dec 20, 2021
this includes abstracting from rocksdb as well as making merk unaware of prefixes and other details
8bc4d27 to
f2f388b
Compare
4 tasks
This file contains hidden or 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
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 PR includes abstracting from RocksDB as well as making Merk unaware of prefixes and other details.
GroveDB chooses the storage, but that could be also moved out to the caller site later if needed.