pub struct SyncupLogView { /* private fields */ }Expand description
A scanned snapshot of one node’s replicated log, indexed by VLSN.
Built by walking the log and recording, per VLSN, its VlsnEntry
(LSN, fingerprint, sync-flag). Implements SyncupView so the pure
matchpoint search (find_matchpoint) and verify_rollback truth table can
run against a real environment’s log.
Port of the data the JE ReplicaSyncupReader exposes (scanBackwards,
findPrevSyncEntry, plus the MatchpointSearchResults counters). JE walks
strictly backward for efficiency; this snapshot collects the same per-VLSN
facts in one pass (the log is the source of truth either way) and answers
backward queries from the in-memory map. The O(n) one-pass scan is marked
below; a streaming backward reader is the upgrade path if syncup ever runs
on logs too large to snapshot.
Implementations§
Source§impl SyncupLogView
impl SyncupLogView
Sourcepub fn scan(env_home: &Path) -> Option<Self>
pub fn scan(env_home: &Path) -> Option<Self>
Build a view by scanning the log under env_home.
Reads every entry once (forward over files for simplicity), recording
the per-VLSN fingerprint/sync-flag the matchpoint search needs. Returns
None only if a FileManager cannot be opened for env_home.
Sourcepub fn scan_with_manager(fm: &FileManager) -> Self
pub fn scan_with_manager(fm: &FileManager) -> Self
Build a view from an already-open FileManager (used by the live
syncup driver, which already holds one, and by tests).
Sourcepub fn num_passed_commits(&self, matchpoint: Vlsn) -> u64
pub fn num_passed_commits(&self, matchpoint: Vlsn) -> u64
Count the commit/abort records strictly above matchpoint (JE
MatchpointSearchResults.getNumPassedCommits). verify_rollback uses
this to force HardRecovery when the backward scan stepped over a txn
end even if lastTxnEnd <= matchpoint numerically.
Trait Implementations§
Source§impl SyncupView for SyncupLogView
impl SyncupView for SyncupLogView
Source§fn last_sync(&self) -> Vlsn
fn last_sync(&self) -> Vlsn
VLSNRange.getLastSync) — the first
matchpoint candidate.Source§fn last_txn_end(&self) -> Vlsn
fn last_txn_end(&self) -> Vlsn
VLSNRange.getLastTxnEnd) — the rollback
safety boundary.Source§fn first_vlsn(&self) -> Vlsn
fn first_vlsn(&self) -> Vlsn
VLSNRange.getFirst). The search may
not go below this.Auto Trait Implementations§
impl Freeze for SyncupLogView
impl RefUnwindSafe for SyncupLogView
impl Send for SyncupLogView
impl Sync for SyncupLogView
impl Unpin for SyncupLogView
impl UnsafeUnpin for SyncupLogView
impl UnwindSafe for SyncupLogView
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more