Struct garage_rpc::layout::LayoutHistory
source · pub struct LayoutHistory {
pub versions: Vec<LayoutVersion>,
pub old_versions: Vec<LayoutVersion>,
pub update_trackers: UpdateTrackers,
pub staging: Lww<LayoutStaging>,
}
Expand description
The history of cluster layouts, with trackers to keep a record of which nodes are up-to-date to current cluster data
Fields§
§versions: Vec<LayoutVersion>
The versions currently in use in the cluster
old_versions: Vec<LayoutVersion>
At most 5 of the previous versions, not used by the garage_table module, but usefull for the garage_block module to find data blocks that have not yet been moved
update_trackers: UpdateTrackers
Update trackers
staging: Lww<LayoutStaging>
Staged changes for the next version
Implementations§
source§impl LayoutHistory
impl LayoutHistory
pub fn new(replication_factor: ReplicationFactor) -> Self
sourcepub fn current(&self) -> &LayoutVersion
pub fn current(&self) -> &LayoutVersion
Returns the layout version with the highest number
sourcepub fn min_stored(&self) -> u64
pub fn min_stored(&self) -> u64
Returns the version number of the oldest layout version still active
sourcepub fn get_all_nodes(&self) -> Vec<Uuid>
pub fn get_all_nodes(&self) -> Vec<Uuid>
Calculate the set of all nodes that have a role (gateway or storage) in one of the currently active layout versions
pub fn merge(&mut self, other: &LayoutHistory) -> bool
pub fn apply_staged_changes( self, version: Option<u64> ) -> Result<(Self, Message), Error>
pub fn revert_staged_changes(self) -> Result<Self, Error>
pub fn check(&self) -> Result<(), String>
Trait Implementations§
source§impl Clone for LayoutHistory
impl Clone for LayoutHistory
source§fn clone(&self) -> LayoutHistory
fn clone(&self) -> LayoutHistory
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LayoutHistory
impl Debug for LayoutHistory
source§impl<'de> Deserialize<'de> for LayoutHistory
impl<'de> Deserialize<'de> for LayoutHistory
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Migrate for LayoutHistory
impl Migrate for LayoutHistory
source§const VERSION_MARKER: &'static [u8] = b"G010lh"
const VERSION_MARKER: &'static [u8] = b"G010lh"
A sequence of bytes to add at the beginning of the serialized
string, to identify that the data is of this version.
§type Previous = ClusterLayout
type Previous = ClusterLayout
The previous version of this data type, from which items of this version
can be migrated.
source§fn migrate(previous: Self::Previous) -> Self
fn migrate(previous: Self::Previous) -> Self
The migration function that transforms a value decoded in the old format
to an up-to-date value.
source§impl PartialEq for LayoutHistory
impl PartialEq for LayoutHistory
source§fn eq(&self, other: &LayoutHistory) -> bool
fn eq(&self, other: &LayoutHistory) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LayoutHistory
impl Serialize for LayoutHistory
impl StructuralPartialEq for LayoutHistory
Auto Trait Implementations§
impl Freeze for LayoutHistory
impl RefUnwindSafe for LayoutHistory
impl Send for LayoutHistory
impl Sync for LayoutHistory
impl Unpin for LayoutHistory
impl UnwindSafe for LayoutHistory
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more