Add definitions to wrap BackupEngine
This commit is contained in:
parent
81833395f5
commit
f0e0512a5f
2 changed files with 40 additions and 0 deletions
35
rocksdb/backup.pxd
Normal file
35
rocksdb/backup.pxd
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
cdef extern from "utilities/backupable_db.h" namespace "rocksdb":
|
||||||
|
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+
|
||||||
|
void DeleteBackupsNewerThan(uint64_t) nogil except+
|
||||||
|
|
||||||
|
cdef BackupEngine* NewBackupEngine "rocksdb::BackupEngine::NewBackupEngine"(
|
||||||
|
Env*,
|
||||||
|
BackupableDBOptions&)
|
5
rocksdb/env.pxd
Normal file
5
rocksdb/env.pxd
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
cdef extern from "rocksdb/env.h" namespace "rocksdb":
|
||||||
|
cdef cppclass Env:
|
||||||
|
Env()
|
||||||
|
|
||||||
|
cdef Env* Env_Default "rocksdb::Env::Default"()
|
Loading…
Reference in a new issue