From f4b1bd357048d34ee42c67982636e75dcb36b3a5 Mon Sep 17 00:00:00 2001 From: minshao Date: Thu, 1 Sep 2022 02:02:13 -0700 Subject: [PATCH] Make `create_new_backup_flush` generic (#677) Co-authored-by: Oleksandr Anyshchenko --- src/backup.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backup.rs b/src/backup.rs index cf1fa42..a146d16 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -13,7 +13,7 @@ // limitations under the License. // -use crate::{db::DBInner, ffi, ffi_util::to_cpath, Error, DB}; +use crate::{db::DBInner, ffi, ffi_util::to_cpath, DBCommon, Error, ThreadMode}; use libc::{c_int, c_uchar}; use std::path::Path; @@ -66,7 +66,10 @@ impl BackupEngine { /// /// Note: no flush before backup is performed. User might want to /// use `create_new_backup_flush` instead. - pub fn create_new_backup(&mut self, db: &DB) -> Result<(), Error> { + pub fn create_new_backup( + &mut self, + db: &DBCommon, + ) -> Result<(), Error> { self.create_new_backup_flush(db, false) } @@ -74,9 +77,9 @@ impl BackupEngine { /// /// Set flush_before_backup=true to avoid losing unflushed key/value /// pairs from the memtable. - pub fn create_new_backup_flush( + pub fn create_new_backup_flush( &mut self, - db: &DB, + db: &DBCommon, flush_before_backup: bool, ) -> Result<(), Error> { unsafe {