diff options
author | Alex Auvolat <alex@adnab.me> | 2022-02-24 14:59:49 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-03-14 10:54:25 +0100 |
commit | 2377a92f6b64165be84f53722f30c21e9c8a0b3e (patch) | |
tree | 4a45feb7bd73bd541cc5f8552423cb9d46c8e26d /src/table/data.rs | |
parent | 203e8d2c345dabee56e31aebf88b706df5aa72e5 (diff) | |
download | garage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.tar.gz garage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.zip |
Add wrapper over sled tree to count items (used for big queues)
Diffstat (limited to 'src/table/data.rs')
-rw-r--r-- | src/table/data.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/table/data.rs b/src/table/data.rs index 4293e395..ff7965f5 100644 --- a/src/table/data.rs +++ b/src/table/data.rs @@ -7,6 +7,7 @@ use tokio::sync::Notify; use garage_util::data::*; use garage_util::error::*; +use garage_util::sled_counter::SledCountedTree; use garage_rpc::system::System; @@ -27,7 +28,7 @@ pub struct TableData<F: TableSchema, R: TableReplication> { pub(crate) merkle_tree: sled::Tree, pub(crate) merkle_todo: sled::Tree, pub(crate) merkle_todo_notify: Notify, - pub(crate) gc_todo: sled::Tree, + pub(crate) gc_todo: SledCountedTree, pub(crate) metrics: TableMetrics, } @@ -52,6 +53,7 @@ where let gc_todo = db .open_tree(&format!("{}:gc_todo_v2", F::TABLE_NAME)) .expect("Unable to open DB tree"); + let gc_todo = SledCountedTree::new(gc_todo); let metrics = TableMetrics::new(F::TABLE_NAME, merkle_todo.clone(), gc_todo.clone()); |