aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-08 19:28:36 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-08 19:28:36 +0100
commit8dccee3ccfe7793c42203f28c1e91c6f989b6899 (patch)
tree0a3fdb60229d9e3c9d61c7f01d40ed74159f1b2c /src/model
parentfe9af1dcaae31a117528a9cfa10c422c9a850201 (diff)
downloadgarage-8dccee3ccfe7793c42203f28c1e91c6f989b6899.tar.gz
garage-8dccee3ccfe7793c42203f28c1e91c6f989b6899.zip
cluster layout: adapt all uses of ClusterLayout to LayoutHistory
Diffstat (limited to 'src/model')
-rw-r--r--src/model/helper/bucket.rs9
-rw-r--r--src/model/index_counter.rs6
2 files changed, 9 insertions, 6 deletions
diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs
index 8cd5b27b..18904c8d 100644
--- a/src/model/helper/bucket.rs
+++ b/src/model/helper/bucket.rs
@@ -450,10 +450,10 @@ impl<'a> BucketHelper<'a> {
#[cfg(feature = "k2v")]
{
- use garage_rpc::layout::ClusterLayout;
+ use garage_rpc::layout::LayoutHistory;
use std::sync::Arc;
- let layout: Arc<ClusterLayout> = self.0.system.cluster_layout().clone();
+ let layout: Arc<LayoutHistory> = self.0.system.cluster_layout().clone();
let k2vindexes = self
.0
.k2v
@@ -462,7 +462,10 @@ impl<'a> BucketHelper<'a> {
.get_range(
&bucket_id,
None,
- Some((DeletedFilter::NotDeleted, layout.node_id_vec.clone())),
+ Some((
+ DeletedFilter::NotDeleted,
+ layout.current().node_id_vec.clone(),
+ )),
10,
EnumerationOrder::Forward,
)
diff --git a/src/model/index_counter.rs b/src/model/index_counter.rs
index d514cb06..9637cc4c 100644
--- a/src/model/index_counter.rs
+++ b/src/model/index_counter.rs
@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
use garage_db as db;
-use garage_rpc::layout::ClusterLayout;
+use garage_rpc::layout::LayoutHistory;
use garage_rpc::system::System;
use garage_util::background::BackgroundRunner;
use garage_util::data::*;
@@ -83,8 +83,8 @@ impl<T: CountedItem> Entry<T::CP, T::CS> for CounterEntry<T> {
}
impl<T: CountedItem> CounterEntry<T> {
- pub fn filtered_values(&self, layout: &ClusterLayout) -> HashMap<String, i64> {
- let nodes = &layout.node_id_vec[..];
+ pub fn filtered_values(&self, layout: &LayoutHistory) -> HashMap<String, i64> {
+ let nodes = &layout.current().node_id_vec[..];
self.filtered_values_with_nodes(nodes)
}