Ryo Onodera
0b700fe70d
Remove need for &mut self in create_cf and drop_cf (v2) ( #506 )
4 years ago
Linh Tran Tuan
d3d10d54b1
Adding backup engine info ( #454 )
4 years ago
Oleksandr Anyshchenko
334b4652b6
Add some doc-comments and tiny refactoring ( #424 )
5 years ago
Oleksandr Anyshchenko
d4023f2683
Add clippy linter in CI ( #417 )
5 years ago
wqfish
4f9524bd36
Move to Rust 2018 ( #375 )
5 years ago
wqfish
22f36ce97f
Improve ffi_try macro to make trailing comma optional ( #371 )
5 years ago
Oleksandr Anyshchenko
7c4bfb8735
Replace deprecated types
6 years ago
Oleksandr Anyshchenko
54ff3db8ec
Change a column family storing
6 years ago
Rohit Joshi
b0160daaca
fixing cargo fmt --all
6 years ago
Rohit Joshi
a0b707ca30
adding DB::destroy()
6 years ago
Rohit Joshi
dfdabd08e8
cargo fmt check
6 years ago
Rohit Joshi
419084cf0f
adding backup & restore test case
6 years ago
Rohit Joshi
7b7cf00cf6
Updating rust doc
...
```
Restore from the latest backup
Arguments
```
db_dir - A path to the database directory
wal_dir - A path to the wal directory
opts - Restore options
```
Example
```
ⓘ
use rocksdb::backup::{BackupEngine, BackupEngineOptions};
let backup_opts = BackupEngineOptions::default();
let 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());
}
```
6 years ago
Rohit Joshi
f8267c8303
updating rust doc
6 years ago
Rohit Joshi
0a4cedc0a3
Specifying two separate Path
...
Replacing single path `P` with `D: AsRef<Path>, W: AsRef<Path>`
6 years ago
Rohit Joshi
e3aef69f38
issue#135 Expose API to restore database from backups
6 years ago
Jordan Terrell
896dbc6c61
Applying changes from rustfmt...
6 years ago
Jordan Terrell
e565d68852
Fixing rustfmt.toml and applying formatting...
6 years ago
Rick Richardson
8a64585520
changed try_ffi to take trailing comma and updated rustfmt accordingly
7 years ago
Volker Mische
af061fb6db
Make BackupEngine methods public
...
In the `BackupEngine` the `create_new_backup` and `purge_old_backups`
methods were private, leading to those warnings.
warning: method is never used: `create_new_backup`, #[warn(dead_code)] on by default
--> src/backup.rs:61:5
|
61 | fn create_new_backup(&mut self, db: &DB) -> Result<(), Error> {
| _____^ starting here...
62 | | unsafe {
63 | | ffi_try!(ffi::rocksdb_backup_engine_create_new_backup(self.inner, db.inner));
64 | | Ok(())
65 | | }
66 | | }
| |_____^ ...ending here
warning: method is never used: `purge_old_backups`, #[warn(dead_code)] on by default
--> src/backup.rs:68:5
|
68 | fn purge_old_backups(&mut self, num_backups_to_keep: usize) -> Result<(), Error> {
| _____^ starting here...
69 | | unsafe {
70 | | ffi_try!(ffi::rocksdb_backup_engine_purge_old_backups(self.inner,
71 | | num_backups_to_keep as uint32_t));
72 | | Ok(())
73 | | }
74 | | }
| |_____^ ...ending here
Those are now public.
8 years ago
Alexander Regueiro
12d79986b2
Changed rocksdb module name prefix to db.
...
Also rustfmt on source.
8 years ago
Alexander Regueiro
d28eba2ff5
Added basic support for backups.
8 years ago