This repository was archived by the owner on Sep 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ from . cimport snapshot
2525from . cimport db
2626from . cimport iterator
2727from . cimport backup
28+ from . cimport checkpoint
2829from . cimport env
2930from . cimport table_factory
3031from . cimport memtablerep
@@ -2861,6 +2862,34 @@ cdef class ReversedIterator(object):
28612862 check_status(self .it.ptr.status())
28622863 return ret
28632864
2865+
2866+ cdef class Checkpoint(object ):
2867+ cdef checkpoint.Checkpoint* checkpoint
2868+
2869+ def __cinit__ (self , DB db ):
2870+ cdef Status st
2871+ self .checkpoint = NULL
2872+ st = checkpoint.Checkpoint_Create(
2873+ db.wrapped_db,
2874+ cython.address(self .checkpoint))
2875+
2876+ check_status(st)
2877+
2878+ def __dealloc__ (self ):
2879+ if not self .checkpoint == NULL :
2880+ with nogil:
2881+ del self .checkpoint
2882+
2883+ def create_checkpoint (self , checkpoint_dir ):
2884+ cdef Status st
2885+ cdef string c_checkpoint_dir
2886+ c_checkpoint_dir = path_to_string(checkpoint_dir)
2887+
2888+ with nogil:
2889+ st = self .checkpoint.CreateCheckpoint(c_checkpoint_dir)
2890+ check_status(st)
2891+
2892+
28642893cdef class BackupEngine(object ):
28652894 cdef backup.BackupEngine* engine
28662895
Original file line number Diff line number Diff line change 1+ from libcpp.string cimport string
2+ from .db cimport DB
3+ from .status cimport Status
4+
5+ cdef extern from " rocksdb/utilities/checkpoint.h" namespace " rocksdb" :
6+ cdef cppclass Checkpoint:
7+ Status CreateCheckpoint(const string& ) nogil except +
8+
9+ cdef Status Checkpoint_Create " rocksdb::Checkpoint::Create" (
10+ DB* ,
11+ Checkpoint** ) nogil except +
You can’t perform that action at this time.
0 commit comments