pub struct TimedLog<L, M> { /* private fields */ }Expand description
Keeps revision|unix milliseconds in a second log for every record appended to
inner. Records and their format are unchanged, so an engine or a backup never
needs to know this decorator exists, and the cost is one more append and flush.
The record is written and flushed first, so a crash can lose a timestamp but never leave one for a record that is not there. A commit without a timestamp makes a restore pick an earlier revision. Time never runs backwards in a timeline: a clock that steps back repeats the latest time instead.
Implementations§
Source§impl<L: TransitionLogStore, M: TransitionLogStore> TimedLog<L, M>
impl<L: TransitionLogStore, M: TransitionLogStore> TimedLog<L, M>
Trait Implementations§
Source§impl<L: ReplaceableTransitionLogStore, M: TransitionLogStore> ReplaceableTransitionLogStore for TimedLog<L, M>
Compaction does not touch the timeline: its checkpoint repeats a revision the
timeline already holds, and revisions it dropped are then refused by a restore.
impl<L: ReplaceableTransitionLogStore, M: TransitionLogStore> ReplaceableTransitionLogStore for TimedLog<L, M>
Compaction does not touch the timeline: its checkpoint repeats a revision the timeline already holds, and revisions it dropped are then refused by a restore.
Source§fn supports_replacement(&self) -> bool
fn supports_replacement(&self) -> bool
Dynamic adapters can expose the capability only when their inner log can.
Source§impl<L: TransitionLogStore, M: TransitionLogStore> TransitionLogStore for TimedLog<L, M>
impl<L: TransitionLogStore, M: TransitionLogStore> TransitionLogStore for TimedLog<L, M>
Source§fn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>
fn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>
Appends one entry. Entries never contain newlines.
Source§fn read_log_entries(&mut self) -> Result<Vec<String>, LinkError>
fn read_log_entries(&mut self) -> Result<Vec<String>, LinkError>
Reads every entry back, oldest first.
Source§fn supports_durable_flush(&self) -> bool
fn supports_durable_flush(&self) -> bool
Whether flush requests persistent storage. Custom/volatile logs default
to false; this describes an adapter, not the reliability of its hardware.
Source§fn supports_compaction(&self) -> bool
fn supports_compaction(&self) -> bool
Whether
compact_log_entries can rewrite
the durable journal. Retention uses it to bound the journal on disk;
logs without it keep every entry, as before.Source§fn compact_log_entries(&mut self, entries: &[String]) -> Result<(), LinkError>
fn compact_log_entries(&mut self, entries: &[String]) -> Result<(), LinkError>
Atomically and durably replaces every entry with
entries, the
retained journal. After a crash the log holds either the old or the
new journal, never a mixture. Called only between transactions and
only when supports_compaction is true.Auto Trait Implementations§
impl<L, M> !RefUnwindSafe for TimedLog<L, M>
impl<L, M> !Sync for TimedLog<L, M>
impl<L, M> !UnwindSafe for TimedLog<L, M>
impl<L, M> Freeze for TimedLog<L, M>
impl<L, M> Send for TimedLog<L, M>
impl<L, M> Unpin for TimedLog<L, M>
impl<L, M> UnsafeUnpin for TimedLog<L, M>where
L: UnsafeUnpin,
M: UnsafeUnpin,
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