garage_db: rename len to approximate_len as it is used for stats only

This commit is contained in:
Alex Auvolat
2025-08-27 21:17:32 +02:00
parent a64b567d43
commit 90bba5889a
15 changed files with 69 additions and 44 deletions
+6 -2
View File
@@ -132,10 +132,14 @@ impl IDb for FjallDb {
}
}
fn len(&self, tree_idx: usize) -> Result<usize> {
fn approximate_len(&self, tree_idx: usize) -> Result<usize> {
let tree = self.get_tree(tree_idx)?;
Ok(tree.approximate_len())
}
fn is_empty(&self, tree_idx: usize) -> Result<bool> {
let tree = self.get_tree(tree_idx)?;
let tx = self.keyspace.read_tx();
Ok(tx.len(&tree)?)
Ok(tx.is_empty(&tree)?)
}
fn insert(&self, tree_idx: usize, key: &[u8], value: &[u8]) -> Result<()> {