aboutsummaryrefslogtreecommitdiff
path: root/src/garage/admin/mod.rs
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/garage/admin/mod.rs
parentfe9af1dcaae31a117528a9cfa10c422c9a850201 (diff)
downloadgarage-8dccee3ccfe7793c42203f28c1e91c6f989b6899.tar.gz
garage-8dccee3ccfe7793c42203f28c1e91c6f989b6899.zip
cluster layout: adapt all uses of ClusterLayout to LayoutHistory
Diffstat (limited to 'src/garage/admin/mod.rs')
-rw-r--r--src/garage/admin/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/garage/admin/mod.rs b/src/garage/admin/mod.rs
index c3fa801a..e3ba6d35 100644
--- a/src/garage/admin/mod.rs
+++ b/src/garage/admin/mod.rs
@@ -127,7 +127,7 @@ impl AdminRpcHandler {
let mut failures = vec![];
let layout = self.garage.system.cluster_layout().clone();
- for node in layout.node_ids().iter() {
+ for node in layout.current().node_ids().iter() {
let node = (*node).into();
let resp = self
.endpoint
@@ -165,7 +165,7 @@ impl AdminRpcHandler {
let mut ret = String::new();
let layout = self.garage.system.cluster_layout().clone();
- for node in layout.node_ids().iter() {
+ for node in layout.current().node_ids().iter() {
let mut opt = opt.clone();
opt.all_nodes = false;
opt.skip_global = true;
@@ -277,8 +277,8 @@ impl AdminRpcHandler {
// Gather storage node and free space statistics
let layout = &self.garage.system.cluster_layout();
let mut node_partition_count = HashMap::<Uuid, u64>::new();
- for short_id in layout.ring_assignment_data.iter() {
- let id = layout.node_id_vec[*short_id as usize];
+ for short_id in layout.current().ring_assignment_data.iter() {
+ let id = layout.current().node_id_vec[*short_id as usize];
*node_partition_count.entry(id).or_default() += 1;
}
let node_info = self
@@ -293,7 +293,7 @@ impl AdminRpcHandler {
for (id, parts) in node_partition_count.iter() {
let info = node_info.get(id);
let status = info.map(|x| &x.status);
- let role = layout.roles.get(id).and_then(|x| x.0.as_ref());
+ let role = layout.current().roles.get(id).and_then(|x| x.0.as_ref());
let hostname = status.map(|x| x.hostname.as_str()).unwrap_or("?");
let zone = role.map(|x| x.zone.as_str()).unwrap_or("?");
let capacity = role
@@ -441,7 +441,7 @@ impl AdminRpcHandler {
if all_nodes {
let mut ret = vec![];
let layout = self.garage.system.cluster_layout().clone();
- for node in layout.node_ids().iter() {
+ for node in layout.current().node_ids().iter() {
let node = (*node).into();
match self
.endpoint
@@ -489,7 +489,7 @@ impl AdminRpcHandler {
if all_nodes {
let mut ret = vec![];
let layout = self.garage.system.cluster_layout().clone();
- for node in layout.node_ids().iter() {
+ for node in layout.current().node_ids().iter() {
let node = (*node).into();
match self
.endpoint