aboutsummaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
Diffstat (limited to 'src/table')
-rw-r--r--src/table/data.rs6
-rw-r--r--src/table/merkle.rs12
2 files changed, 15 insertions, 3 deletions
diff --git a/src/table/data.rs b/src/table/data.rs
index a491f877..0a7b2cec 100644
--- a/src/table/data.rs
+++ b/src/table/data.rs
@@ -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()
+ }
}
diff --git a/src/table/merkle.rs b/src/table/merkle.rs
index f60be8a8..aefb5169 100644
--- a/src/table/merkle.rs
+++ b/src/table/merkle.rs
@@ -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 {