Get rid of depricated way to create backupengine.

This commit is contained in:
hofmockel 2015-04-12 14:08:30 +02:00
parent 0c13b55e55
commit 8b26e1e4b0
2 changed files with 9 additions and 4 deletions

View file

@ -1688,13 +1688,17 @@ cdef class BackupEngine(object):
cdef backup.BackupEngine* engine cdef backup.BackupEngine* engine
def __cinit__(self, backup_dir): def __cinit__(self, backup_dir):
cdef Status st
cdef string c_backup_dir cdef string c_backup_dir
self.engine = NULL self.engine = NULL
c_backup_dir = path_to_string(backup_dir) c_backup_dir = path_to_string(backup_dir)
self.engine = backup.NewBackupEngine( st = backup.BackupEngine_Open(
env.Env_Default(), env.Env_Default(),
backup.BackupableDBOptions(c_backup_dir)) backup.BackupableDBOptions(c_backup_dir),
cython.address(self.engine))
check_status(st)
def __dealloc__(self): def __dealloc__(self):
if not self.engine == NULL: if not self.engine == NULL:

View file

@ -29,6 +29,7 @@ cdef extern from "rocksdb/utilities/backupable_db.h" namespace "rocksdb":
Status RestoreDBFromBackup(BackupID, string&, string&) nogil except+ Status RestoreDBFromBackup(BackupID, string&, string&) nogil except+
Status RestoreDBFromLatestBackup(string&, string&) nogil except+ Status RestoreDBFromLatestBackup(string&, string&) nogil except+
cdef BackupEngine* NewBackupEngine "rocksdb::BackupEngine::NewBackupEngine"( cdef Status BackupEngine_Open "rocksdb::BackupEngine::Open"(
Env*, Env*,
BackupableDBOptions&) BackupableDBOptions&,
BackupEngine**)