pub struct SnapshotManager {
pub expected: usize,
pub received: Vec<LocalSnapshot>,
pub path: Option<PathBuf>,
pub mode: SnapshotMode,
}
Expand description
Manages the snapshot collection process
Fields§
§expected: usize
Number of snapshots expected to be collected
received: Vec<LocalSnapshot>
Vector of received local snapshots
path: Option<PathBuf>
Path to the last snapshot saved
mode: SnapshotMode
Snapshot mode
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new(expected: usize) -> Self
pub fn new(expected: usize) -> Self
Creates a new snapshot manager expecting the given number of snapshots
Sourcepub fn push(&mut self, resp: SnapshotResponse) -> Option<GlobalSnapshot>
pub fn push(&mut self, resp: SnapshotResponse) -> Option<GlobalSnapshot>
Adds a snapshot response to the collection
Returns a global snapshot if all expected snapshots have been received and they are consistent. If the snapshots are inconsistent, it will attempt to find a consistent subset by backtracking to the minimum vector clock values. all_received is defined by the state of our wave diffusion protocol
Sourcefn build_snapshot(&self, snaps: &[LocalSnapshot]) -> GlobalSnapshot
fn build_snapshot(&self, snaps: &[LocalSnapshot]) -> GlobalSnapshot
Builds a global snapshot from a set of local snapshots
Computes the union of all transactions and identifies missing transactions for each node.
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.