diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-10 11:27:58 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-10 11:27:58 +0200 |
commit | 180e7fef0a1bdd396865eff92ec6f1d7f0e7511e (patch) | |
tree | 46c5c358b12e2c86d56ad92a4a51640c428d93dd /src/garage/admin.rs | |
parent | c054de43dd3ccbf6a884f73a474b423bbab41d08 (diff) | |
download | garage-180e7fef0a1bdd396865eff92ec6f1d7f0e7511e.tar.gz garage-180e7fef0a1bdd396865eff92ec6f1d7f0e7511e.zip |
Actually distribute counters over nodes
Diffstat (limited to 'src/garage/admin.rs')
-rw-r--r-- | src/garage/admin.rs | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/src/garage/admin.rs b/src/garage/admin.rs index 6630ae16..48914655 100644 --- a/src/garage/admin.rs +++ b/src/garage/admin.rs @@ -39,10 +39,7 @@ pub enum AdminRpc { // Replies Ok(String), - BucketList { - buckets: Vec<Bucket>, - counters: HashMap<Uuid, HashMap<String, i64>>, - }, + BucketList(Vec<Bucket>), BucketInfo { bucket: Bucket, relevant_keys: HashMap<String, Key>, @@ -97,24 +94,7 @@ impl AdminRpcHandler { ) .await?; - let ring = self.garage.system.ring.borrow().clone(); - let counters = self - .garage - .object_counter_table - .table - .get_range( - &EmptyKey, - None, - Some((DeletedFilter::NotDeleted, ring.layout.node_id_vec.clone())), - 15000, - EnumerationOrder::Forward, - ) - .await? - .iter() - .map(|x| (x.sk, x.filtered_values(&ring))) - .collect::<HashMap<_, _>>(); - - Ok(AdminRpc::BucketList { buckets, counters }) + Ok(AdminRpc::BucketList(buckets)) } async fn handle_bucket_info(&self, query: &BucketOpt) -> Result<AdminRpc, Error> { @@ -135,7 +115,7 @@ impl AdminRpcHandler { .garage .object_counter_table .table - .get(&EmptyKey, &bucket_id) + .get(&bucket_id, &EmptyKey) .await? .map(|x| x.filtered_values(&self.garage.system.ring.borrow())) .unwrap_or_default(); |