mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-08 13:53:13 +00:00
Small fixes
This commit is contained in:
+5
-1
@@ -18,7 +18,7 @@ pub struct TableData<F: TableSchema> {
|
||||
pub instance: F,
|
||||
|
||||
pub store: sled::Tree,
|
||||
pub gc_todo: sled::Tree,
|
||||
pub(crate) gc_todo: sled::Tree,
|
||||
pub merkle_updater: Arc<MerkleUpdater>,
|
||||
}
|
||||
|
||||
@@ -239,4 +239,8 @@ where
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn gc_todo_len(&self) -> usize {
|
||||
self.gc_todo.len()
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -40,13 +40,13 @@ pub struct MerkleUpdater {
|
||||
// - key = the key of an item in the main table, ie hash(partition_key)+sort_key
|
||||
// - value = the hash of the full serialized item, if present,
|
||||
// or an empty vec if item is absent (deleted)
|
||||
pub todo: sled::Tree,
|
||||
pub(crate) todo: sled::Tree,
|
||||
pub(crate) todo_notify: Notify,
|
||||
|
||||
// Content of the merkle tree: items where
|
||||
// - key = .bytes() for MerkleNodeKey
|
||||
// - value = serialization of a MerkleNode, assumed to be MerkleNode::empty if not found
|
||||
pub merkle_tree: sled::Tree,
|
||||
pub(crate) merkle_tree: sled::Tree,
|
||||
empty_node_hash: Hash,
|
||||
}
|
||||
|
||||
@@ -311,6 +311,14 @@ impl MerkleUpdater {
|
||||
Some(v) => Ok(rmp_serde::decode::from_read_ref::<_, MerkleNode>(&v[..])?),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn merkle_tree_len(&self) -> usize {
|
||||
self.merkle_tree.len()
|
||||
}
|
||||
|
||||
pub fn todo_len(&self) -> usize {
|
||||
self.todo.len()
|
||||
}
|
||||
}
|
||||
|
||||
impl MerkleNodeKey {
|
||||
|
||||
Reference in New Issue
Block a user