aboutsummaryrefslogtreecommitdiff
path: root/src/db/lmdb_adapter.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-01-02 12:42:24 +0000
committerAlex <alex@adnab.me>2023-01-02 12:42:24 +0000
commit7f7d53cfa991054afcd2940cc43a4d7f1a6668e7 (patch)
tree15c60c9ecf583532eaf62d492beb63bd8ae7e3b2 /src/db/lmdb_adapter.rs
parent1af4a5ed569e42f77dd4ecc9364a27f7ed43df63 (diff)
parentd1279e04f3550eae2eb5e0f25efbdf69b42fbeb9 (diff)
downloadgarage-7f7d53cfa991054afcd2940cc43a4d7f1a6668e7.tar.gz
garage-7f7d53cfa991054afcd2940cc43a4d7f1a6668e7.zip
Merge pull request 'improvements to CLI and new debug features' (#448) from cli-improvements into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/448
Diffstat (limited to 'src/db/lmdb_adapter.rs')
-rw-r--r--src/db/lmdb_adapter.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/db/lmdb_adapter.rs b/src/db/lmdb_adapter.rs
index c036c990..31956612 100644
--- a/src/db/lmdb_adapter.rs
+++ b/src/db/lmdb_adapter.rs
@@ -121,6 +121,10 @@ impl IDb for LmdbDb {
Ok(tree.len(&tx)?.try_into().unwrap())
}
+ fn fast_len(&self, tree: usize) -> Result<Option<usize>> {
+ Ok(Some(self.len(tree)?))
+ }
+
fn insert(&self, tree: usize, key: &[u8], value: &[u8]) -> Result<Option<Value>> {
let tree = self.get_tree(tree)?;
let mut tx = self.db.write_txn()?;