forked from twmht/python-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.pxd
205 lines (168 loc) · 6.6 KB
/
db.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
cimport options
from libc.stdint cimport uint64_t, uint32_t
from status cimport Status
from libcpp cimport bool as cpp_bool
from libcpp.string cimport string
from libcpp.vector cimport vector
from slice_ cimport Slice
from snapshot cimport Snapshot
from iterator cimport Iterator
cdef extern from "rocksdb/write_batch.h" namespace "rocksdb":
cdef cppclass WriteBatch:
WriteBatch() nogil except+
WriteBatch(string) nogil except+
void Put(const Slice&, const Slice&) nogil except+
void Put(ColumnFamilyHandle*, const Slice&, const Slice&) nogil except+
void Merge(const Slice&, const Slice&) nogil except+
void Merge(ColumnFamilyHandle*, const Slice&, const Slice&) nogil except+
void Delete(const Slice&) nogil except+
void Delete(ColumnFamilyHandle*, const Slice&) nogil except+
void PutLogData(const Slice&) nogil except+
void Clear() nogil except+
const string& Data() nogil except+
int Count() nogil except+
cdef extern from "cpp/write_batch_iter_helper.hpp" namespace "py_rocks":
cdef enum BatchItemOp "RecordItemsHandler::Optype":
BatchItemOpPut "py_rocks::RecordItemsHandler::Optype::PutRecord"
BatchItemOpMerge "py_rocks::RecordItemsHandler::Optype::MergeRecord"
BatchItemOpDelte "py_rocks::RecordItemsHandler::Optype::DeleteRecord"
cdef cppclass BatchItem "py_rocks::RecordItemsHandler::BatchItem":
BatchItemOp op
uint32_t column_family_id
Slice key
Slice value
Status get_batch_items(WriteBatch* batch, vector[BatchItem]* items)
cdef extern from "rocksdb/db.h" namespace "rocksdb":
ctypedef uint64_t SequenceNumber
string kDefaultColumnFamilyName
cdef struct LiveFileMetaData:
string name
int level
uint64_t size
string smallestkey
string largestkey
SequenceNumber smallest_seqno
SequenceNumber largest_seqno
cdef cppclass Range:
Range(const Slice&, const Slice&)
cdef cppclass DB:
Status Put(
const options.WriteOptions&,
ColumnFamilyHandle*,
const Slice&,
const Slice&) nogil except+
Status Delete(
const options.WriteOptions&,
ColumnFamilyHandle*,
const Slice&) nogil except+
Status Merge(
const options.WriteOptions&,
ColumnFamilyHandle*,
const Slice&,
const Slice&) nogil except+
Status Write(
const options.WriteOptions&,
WriteBatch*) nogil except+
Status Get(
const options.ReadOptions&,
ColumnFamilyHandle*,
const Slice&,
string*) nogil except+
vector[Status] MultiGet(
const options.ReadOptions&,
const vector[ColumnFamilyHandle*]&,
const vector[Slice]&,
vector[string]*) nogil except+
cpp_bool KeyMayExist(
const options.ReadOptions&,
ColumnFamilyHandle*,
Slice&,
string*,
cpp_bool*) nogil except+
cpp_bool KeyMayExist(
const options.ReadOptions&,
ColumnFamilyHandle*,
Slice&,
string*) nogil except+
Iterator* NewIterator(
const options.ReadOptions&,
ColumnFamilyHandle*) nogil except+
void NewIterators(
const options.ReadOptions&,
vector[ColumnFamilyHandle*]&,
vector[Iterator*]*) nogil except+
const Snapshot* GetSnapshot() nogil except+
void ReleaseSnapshot(const Snapshot*) nogil except+
cpp_bool GetProperty(
ColumnFamilyHandle*,
const Slice&,
string*) nogil except+
void GetApproximateSizes(
ColumnFamilyHandle*,
const Range*
int,
uint64_t*) nogil except+
Status CompactRange(
const options.CompactRangeOptions&,
ColumnFamilyHandle*,
const Slice*,
const Slice*) nogil except+
Status CreateColumnFamily(
const options.ColumnFamilyOptions&,
const string&,
ColumnFamilyHandle**) nogil except+
Status DropColumnFamily(
ColumnFamilyHandle*) nogil except+
int NumberLevels(ColumnFamilyHandle*) nogil except+
int MaxMemCompactionLevel(ColumnFamilyHandle*) nogil except+
int Level0StopWriteTrigger(ColumnFamilyHandle*) nogil except+
const string& GetName() nogil except+
const options.Options& GetOptions(ColumnFamilyHandle*) nogil except+
Status Flush(const options.FlushOptions&, ColumnFamilyHandle*) nogil except+
Status DisableFileDeletions() nogil except+
Status EnableFileDeletions() nogil except+
# TODO: Status GetSortedWalFiles(VectorLogPtr& files)
# TODO: SequenceNumber GetLatestSequenceNumber()
# TODO: Status GetUpdatesSince(
# SequenceNumber seq_number,
# unique_ptr[TransactionLogIterator]*)
Status DeleteFile(string) nogil except+
void GetLiveFilesMetaData(vector[LiveFileMetaData]*) nogil except+
ColumnFamilyHandle* DefaultColumnFamily()
cdef Status DB_Open "rocksdb::DB::Open"(
const options.Options&,
const string&,
DB**) nogil except+
cdef Status DB_Open_ColumnFamilies "rocksdb::DB::Open"(
const options.Options&,
const string&,
const vector[ColumnFamilyDescriptor]&,
vector[ColumnFamilyHandle*]*,
DB**) nogil except+
cdef Status DB_OpenForReadOnly "rocksdb::DB::OpenForReadOnly"(
const options.Options&,
const string&,
DB**,
cpp_bool) nogil except+
cdef Status DB_OpenForReadOnly_ColumnFamilies "rocksdb::DB::OpenForReadOnly"(
const options.Options&,
const string&,
const vector[ColumnFamilyDescriptor]&,
vector[ColumnFamilyHandle*]*,
DB**,
cpp_bool) nogil except+
cdef Status RepairDB(const string& dbname, const options.Options&)
cdef Status ListColumnFamilies "rocksdb::DB::ListColumnFamilies" (
const options.Options&,
const string&,
vector[string]*) nogil except+
cdef cppclass ColumnFamilyHandle:
const string& GetName() nogil except+
int GetID() nogil except+
cdef cppclass ColumnFamilyDescriptor:
ColumnFamilyDescriptor() nogil except+
ColumnFamilyDescriptor(
const string&,
const options.ColumnFamilyOptions&) nogil except+
string name
options.ColumnFamilyOptions options