layout: add helper for cached/external values to centralize recomputation

This commit is contained in:
Alex Auvolat
2023-11-15 14:20:50 +01:00
parent 65066c7064
commit 393c4d4515
10 changed files with 230 additions and 189 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ use crate::consul::ConsulDiscovery;
#[cfg(feature = "kubernetes-discovery")]
use crate::kubernetes::*;
use crate::layout::manager::{LayoutManager, LayoutStatus};
use crate::layout::{self, LayoutHistory, NodeRoleV};
use crate::layout::{self, LayoutHelper, LayoutHistory, NodeRoleV};
use crate::replication_mode::*;
use crate::rpc_helper::*;
@@ -350,7 +350,7 @@ impl System {
// ---- Public utilities / accessors ----
pub fn cluster_layout(&self) -> RwLockReadGuard<'_, LayoutHistory> {
pub fn cluster_layout(&self) -> RwLockReadGuard<'_, LayoutHelper> {
self.layout_manager.layout()
}