pub struct Replayer<'a> { /* private fields */ }Expand description
Plays a trace file back against a DB.
The replayer keeps raw pointers to the DB and to the column family handles
it was built from and executes operations through them, so 'a ties it to
the DB it came from.
prepare must succeed before replay,
which otherwise fails with Result incomplete. Preparing again rewinds the
trace, which is also how to replay a second time after a run has consumed
it.
Implementations§
Source§impl Replayer<'_>
impl Replayer<'_>
Sourcepub fn prepare(&mut self) -> Result<(), Error>
pub fn prepare(&mut self) -> Result<(), Error>
Reads the trace header and positions the replayer at the first record.
Required before replay. Calling it again rewinds the
trace and clears the end-of-trace state.
Sourcepub fn replay(&mut self, options: &ReplayOptions) -> Result<(), Error>
pub fn replay(&mut self, options: &ReplayOptions) -> Result<(), Error>
Replays every remaining record against the DB, honouring the recorded
delay between them as scaled by options.
Blocks until the trace is exhausted, then returns Ok. Per-operation
results are discarded: db/c.cc passes no result callback, so only an
overall status comes back. A record whose type this RocksDB build cannot
execute is skipped rather than failing the run. Once the run reaches the
end of the trace, further calls fail with Result incomplete until
prepare rewinds it.
Fails with Result incomplete if prepare has not succeeded, and with
Invalid argument if ReplayOptions::set_fast_forward was given a
value at or below 0.0.
Sourcepub fn header_timestamp(&self) -> u64
pub fn header_timestamp(&self) -> u64
The timestamp recorded in the trace header, in microseconds, which is when tracing started.
Returns 0 until prepare has succeeded, since that is
what reads the header.