mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2025-04-05 16:39:34 +00:00
layout: better encapsulation
This commit is contained in:
parent
3b49dd9e63
commit
e83864af24
2 changed files with 4 additions and 7 deletions
|
@ -248,8 +248,8 @@ impl RequestHandler for GetClusterLayoutHistoryRequest {
|
|||
garage: &Arc<Garage>,
|
||||
_admin: &Admin,
|
||||
) -> Result<GetClusterLayoutHistoryResponse, Error> {
|
||||
let layout = garage.system.cluster_layout();
|
||||
let layout = layout.inner();
|
||||
let layout_helper = garage.system.cluster_layout();
|
||||
let layout = layout_helper.inner();
|
||||
let min_stored = layout.min_stored();
|
||||
|
||||
let versions = layout
|
||||
|
@ -289,10 +289,7 @@ impl RequestHandler for GetClusterLayoutHistoryRequest {
|
|||
.collect::<Vec<_>>();
|
||||
|
||||
let all_nodes = layout.get_all_nodes();
|
||||
let min_ack = layout
|
||||
.update_trackers
|
||||
.ack_map
|
||||
.min_among(&all_nodes, layout.min_stored());
|
||||
let min_ack = layout_helper.ack_map_min();
|
||||
|
||||
let update_trackers = if layout.versions.len() > 1 {
|
||||
Some(
|
||||
|
|
|
@ -455,7 +455,7 @@ impl UpdateTracker {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn min_among(&self, storage_nodes: &[Uuid], min_version: u64) -> u64 {
|
||||
fn min_among(&self, storage_nodes: &[Uuid], min_version: u64) -> u64 {
|
||||
storage_nodes
|
||||
.iter()
|
||||
.map(|x| self.get(x, min_version))
|
||||
|
|
Loading…
Reference in a new issue