pub struct EnvironmentLogScanner { /* private fields */ }Expand description
LogScanner implementation backed by the live EnvironmentImpl.
Scans the log forward from an LSN cursor, returning entries that carry a
VLSN >= from_vlsn. On each call to next_entry the scanner advances
its internal file/offset position one entry at a time; when it reaches
the current end of the log it returns None (the FeederRunner will
call again after a brief poll interval).
Implementations§
Source§impl EnvironmentLogScanner
impl EnvironmentLogScanner
Sourcepub fn new(env: &EnvironmentImpl, start_lsn: Option<Lsn>) -> Option<Self>
pub fn new(env: &EnvironmentImpl, start_lsn: Option<Lsn>) -> Option<Self>
Create a scanner that starts at start_lsn.
If start_lsn is NULL_LSN the scanner begins at the very first log
entry in file 0. The correct first-entry offset is resolved from
file 0’s log_version (32 for v2, 36 for v3). If file 0 does not
exist yet (empty log) the current-version default (36) is used.
Obtain the FileManager from EnvironmentImpl::get_log_manager() →
LogManager is not directly accessible, but EnvironmentImpl exposes
a get_log_manager() returning Option<Arc<LogManager>>. For the
scanner we need the FileManager underneath it; the simplest approach
is to construct the scanner directly from a FileManager Arc.
Trait Implementations§
Source§impl LogScanner for EnvironmentLogScanner
impl LogScanner for EnvironmentLogScanner
Source§fn next_entry(&mut self, from_vlsn: u64) -> Option<(u64, u8, Vec<u8>)>
fn next_entry(&mut self, from_vlsn: u64) -> Option<(u64, u8, Vec<u8>)>
Return the next entry with VLSN >= from_vlsn, advancing the cursor.
Scans forward one entry at a time. Returns None when the cursor
reaches the end of the currently-written log. The feeder will sleep
briefly and call again.
Auto Trait Implementations§
impl !RefUnwindSafe for EnvironmentLogScanner
impl !UnwindSafe for EnvironmentLogScanner
impl Freeze for EnvironmentLogScanner
impl Send for EnvironmentLogScanner
impl Sync for EnvironmentLogScanner
impl Unpin for EnvironmentLogScanner
impl UnsafeUnpin for EnvironmentLogScanner
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