[−][src]Struct simpledb::rocksdb::backup::BackupEngine
Implementations
impl BackupEngine
[src]
pub fn open<P>(
opts: &BackupEngineOptions,
path: P
) -> Result<BackupEngine, Error> where
P: AsRef<Path>,
[src]
opts: &BackupEngineOptions,
path: P
) -> Result<BackupEngine, Error> where
P: AsRef<Path>,
Open a backup engine with the specified options.
pub fn create_new_backup(&mut self, db: &DB) -> Result<(), Error>
[src]
pub fn purge_old_backups(
&mut self,
num_backups_to_keep: usize
) -> Result<(), Error>
[src]
&mut self,
num_backups_to_keep: usize
) -> Result<(), Error>
pub fn restore_from_latest_backup<D, W>(
&mut self,
db_dir: D,
wal_dir: W,
opts: &RestoreOptions
) -> Result<(), Error> where
D: AsRef<Path>,
W: AsRef<Path>,
[src]
&mut self,
db_dir: D,
wal_dir: W,
opts: &RestoreOptions
) -> Result<(), Error> where
D: AsRef<Path>,
W: AsRef<Path>,
Restore from the latest backup
Arguments
db_dir
- A path to the database directorywal_dir
- A path to the wal directoryopts
- Restore options
Example
ⓘThis example is not tested
use rocksdb::backup::{BackupEngine, BackupEngineOptions}; let backup_opts = BackupEngineOptions::default(); let mut backup_engine = BackupEngine::open(&backup_opts, &backup_path).unwrap(); let mut restore_option = rocksdb::backup::RestoreOptions::default(); restore_option.set_keep_log_files(true); /// true to keep log files if let Err(e) = backup_engine.restore_from_latest_backup(&db_path, &wal_dir, &restore_option) { error!("Failed to restore from the backup. Error:{:?}", e); return Err(e.to_string()); }
Trait Implementations
impl Drop for BackupEngine
[src]
Auto Trait Implementations
impl RefUnwindSafe for BackupEngine
impl !Send for BackupEngine
impl !Sync for BackupEngine
impl Unpin for BackupEngine
impl UnwindSafe for BackupEngine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,