#[repr(i32)]pub enum RestoreMode {
KKeepLatestDbSessionIdFiles = 1,
KVerifyChecksum = 2,
KPurgeAllFiles = 65_535,
}Expand description
How much of the destination database a restore may reuse.
Mirrors RestoreOptions::Mode in
include/rocksdb/utilities/backup_engine.h. The values look like flags but
RocksDB only ever compares the field for equality, so the modes are
exclusive and must not be combined.
Variants§
KKeepLatestDbSessionIdFiles = 1
Cheapest way to restore a healthy database. Files whose names already
encode the DB session id are kept, so an interrupted or partial copy
can be completed instead of recopied. This mode also cooperates with
CreateBackupOptions::set_exclude_files_callback by looking for
excluded files in the existing database directory.
Only effective for files using a modern share files naming scheme, see
ShareFilesNaming.
KVerifyChecksum = 2
For a database suspected to be corrupt. Each existing file is checksummed against the checksum recorded in the backup metadata, and only files that fail the comparison are replaced.
KPurgeAllFiles = 65_535
Zero trust and least efficient. Deletes every file in the destination and copies everything from the backup. This is the default.
Trait Implementations§
Source§impl Clone for RestoreMode
impl Clone for RestoreMode
Source§fn clone(&self) -> RestoreMode
fn clone(&self) -> RestoreMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RestoreMode
Source§impl Debug for RestoreMode
impl Debug for RestoreMode
impl Eq for RestoreMode
Source§impl From<i32> for RestoreMode
impl From<i32> for RestoreMode
Source§fn from(value: i32) -> Self
fn from(value: i32) -> Self
Values RocksDB does not define map to RestoreMode::KPurgeAllFiles,
the upstream default and the only mode that makes no assumptions about
the destination directory.