diff options
author | Alex Auvolat <alex@adnab.me> | 2024-03-27 10:44:03 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-03-27 10:44:03 +0100 |
commit | c0eeb0b0f32ed0a27cfdf9297d0e71e1b9948b73 (patch) | |
tree | 5b2c7c31ce02f78727f0ea9a90ec89b274f21c01 /src/rpc/layout/history.rs | |
parent | 51d11b4b269dbe0dd207a307ddac3811a4cd5079 (diff) | |
download | garage-c0eeb0b0f32ed0a27cfdf9297d0e71e1b9948b73.tar.gz garage-c0eeb0b0f32ed0a27cfdf9297d0e71e1b9948b73.zip |
[next-0.10] fixes to k2v rpc + comment fixes
Diffstat (limited to 'src/rpc/layout/history.rs')
-rw-r--r-- | src/rpc/layout/history.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs index 290f058d..af2cbc63 100644 --- a/src/rpc/layout/history.rs +++ b/src/rpc/layout/history.rs @@ -27,14 +27,18 @@ impl LayoutHistory { // ------------------ who stores what now? --------------- + /// Returns the layout version with the highest number pub fn current(&self) -> &LayoutVersion { self.versions.last().as_ref().unwrap() } + /// Returns the version number of the oldest layout version still active pub fn min_stored(&self) -> u64 { self.versions.first().as_ref().unwrap().version } + /// Calculate the set of all nodes that have a role (gateway or storage) + /// in one of the currently active layout versions pub fn get_all_nodes(&self) -> Vec<Uuid> { if self.versions.len() == 1 { self.versions[0].all_nodes().to_vec() @@ -48,6 +52,8 @@ impl LayoutHistory { } } + /// Calculate the set of all nodes that are configured to store data + /// in one of the currently active layout versions pub(crate) fn get_all_nongateway_nodes(&self) -> Vec<Uuid> { if self.versions.len() == 1 { self.versions[0].nongateway_nodes().to_vec() |