2014-02-02 17:27:34 +01:00
|
|
|
from libcpp cimport bool as cpp_bool
|
|
|
|
from libcpp.string cimport string
|
|
|
|
from libcpp.vector cimport vector
|
|
|
|
from libc.stdint cimport uint32_t
|
|
|
|
from libc.stdint cimport int64_t
|
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
|
|
|
|
from status cimport Status
|
|
|
|
from db cimport DB
|
|
|
|
from env cimport Env
|
|
|
|
|
2014-08-22 20:08:30 +02:00
|
|
|
cdef extern from "rocksdb/utilities/backupable_db.h" namespace "rocksdb":
|
2014-02-02 17:27:34 +01:00
|
|
|
ctypedef uint32_t BackupID
|
|
|
|
|
|
|
|
cdef cppclass BackupableDBOptions:
|
|
|
|
BackupableDBOptions(const string& backup_dir)
|
|
|
|
|
|
|
|
cdef struct BackupInfo:
|
|
|
|
BackupID backup_id
|
|
|
|
int64_t timestamp
|
|
|
|
uint64_t size
|
|
|
|
|
|
|
|
cdef cppclass BackupEngine:
|
|
|
|
Status CreateNewBackup(DB*, cpp_bool) nogil except+
|
|
|
|
Status PurgeOldBackups(uint32_t) nogil except+
|
|
|
|
Status DeleteBackup(BackupID) nogil except+
|
|
|
|
void StopBackup() nogil except+
|
|
|
|
void GetBackupInfo(vector[BackupInfo]*) nogil except+
|
|
|
|
Status RestoreDBFromBackup(BackupID, string&, string&) nogil except+
|
|
|
|
Status RestoreDBFromLatestBackup(string&, string&) nogil except+
|
|
|
|
|
2015-04-12 14:08:30 +02:00
|
|
|
cdef Status BackupEngine_Open "rocksdb::BackupEngine::Open"(
|
2014-02-02 17:27:34 +01:00
|
|
|
Env*,
|
2015-04-12 14:08:30 +02:00
|
|
|
BackupableDBOptions&,
|
|
|
|
BackupEngine**)
|