rdbpython 0.2.1__cp313-cp313-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rdbpy/.dylibs/libbz2.1.0.8.dylib +0 -0
- rdbpy/.dylibs/liblz4.1.9.4.dylib +0 -0
- rdbpy/.dylibs/libsnappy.1.2.1.dylib +0 -0
- rdbpy/.dylibs/libz.1.3.1.dylib +0 -0
- rdbpy/.dylibs/libzstd.1.5.6.dylib +0 -0
- rdbpy/__init__.py +1 -0
- rdbpy/backup.pxd +35 -0
- rdbpy/cache.pxd +8 -0
- rdbpy/comparator.pxd +23 -0
- rdbpy/db.pxd +230 -0
- rdbpy/env.pxd +5 -0
- rdbpy/errors.py +26 -0
- rdbpy/filter_policy.pxd +39 -0
- rdbpy/include/rdb_include/comparator_wrapper.hpp +63 -0
- rdbpy/include/rdb_include/filter_policy_wrapper.hpp +89 -0
- rdbpy/include/rdb_include/memtable_factories.hpp +15 -0
- rdbpy/include/rdb_include/merge_operator_wrapper.hpp +132 -0
- rdbpy/include/rdb_include/slice_transform_wrapper.hpp +109 -0
- rdbpy/include/rdb_include/utils.hpp +8 -0
- rdbpy/include/rdb_include/write_batch_iter_helper.hpp +65 -0
- rdbpy/interfaces.py +77 -0
- rdbpy/iterator.pxd +16 -0
- rdbpy/lib_rocksdb.cpython-313-darwin.so +0 -0
- rdbpy/lib_rocksdb.pxd +768 -0
- rdbpy/lib_rocksdb.pyi +1465 -0
- rdbpy/lib_rocksdb.pyx +3221 -0
- rdbpy/lib_utils.py +52 -0
- rdbpy/logger.pxd +5 -0
- rdbpy/memtablerep.pxd +12 -0
- rdbpy/merge_operator.pxd +46 -0
- rdbpy/merge_operators.py +25 -0
- rdbpy/options.pxd +179 -0
- rdbpy/slice_.pxd +20 -0
- rdbpy/slice_transform.pxd +37 -0
- rdbpy/snapshot.pxd +3 -0
- rdbpy/status.pxd +15 -0
- rdbpy/std_memory.pxd +7 -0
- rdbpy/table_factory.pxd +50 -0
- rdbpy/transaction.pxd +154 -0
- rdbpy/universal_compaction.pxd +15 -0
- rdbpython-0.2.1.dist-info/METADATA +104 -0
- rdbpython-0.2.1.dist-info/RECORD +45 -0
- rdbpython-0.2.1.dist-info/WHEEL +5 -0
- rdbpython-0.2.1.dist-info/licenses/LICENSE.md +21 -0
- rdbpython-0.2.1.dist-info/top_level.txt +1 -0
rdbpy/lib_rocksdb.pxd
ADDED
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
# distutils: language = c++
|
|
2
|
+
|
|
3
|
+
import cython
|
|
4
|
+
from libcpp.string cimport string
|
|
5
|
+
from libcpp.deque cimport deque
|
|
6
|
+
from libcpp.vector cimport vector
|
|
7
|
+
from cpython cimport bool as py_bool
|
|
8
|
+
from libcpp cimport bool as cpp_bool
|
|
9
|
+
from libc.stdint cimport uint32_t
|
|
10
|
+
from cython.operator cimport dereference as deref
|
|
11
|
+
from cpython.bytes cimport PyBytes_AsString
|
|
12
|
+
from cpython.bytes cimport PyBytes_Size
|
|
13
|
+
from cpython.bytes cimport PyBytes_FromString
|
|
14
|
+
from cpython.bytes cimport PyBytes_FromStringAndSize
|
|
15
|
+
from cpython.unicode cimport PyUnicode_Decode
|
|
16
|
+
|
|
17
|
+
from rdbpy.std_memory cimport shared_ptr
|
|
18
|
+
cimport rdbpy.options as options
|
|
19
|
+
cimport rdbpy.merge_operator as merge_operator
|
|
20
|
+
cimport rdbpy.filter_policy as filter_policy
|
|
21
|
+
cimport rdbpy.comparator as comparator
|
|
22
|
+
cimport rdbpy.slice_transform as slice_transform
|
|
23
|
+
cimport rdbpy.cache as cache
|
|
24
|
+
cimport rdbpy.logger as logger
|
|
25
|
+
cimport rdbpy.snapshot as snapshot
|
|
26
|
+
cimport rdbpy.db as db
|
|
27
|
+
cimport rdbpy.iterator as iterator
|
|
28
|
+
cimport rdbpy.backup as backup
|
|
29
|
+
cimport rdbpy.env as env
|
|
30
|
+
cimport rdbpy.transaction as transaction
|
|
31
|
+
cimport rdbpy.table_factory as table_factory
|
|
32
|
+
cimport rdbpy.memtablerep as memtablerep
|
|
33
|
+
cimport rdbpy.universal_compaction as universal_compaction
|
|
34
|
+
|
|
35
|
+
# Enums are the only exception for direct imports
|
|
36
|
+
# Their name als already unique enough
|
|
37
|
+
from rdbpy.universal_compaction cimport kCompactionStopStyleSimilarSize
|
|
38
|
+
from rdbpy.universal_compaction cimport kCompactionStopStyleTotalSize
|
|
39
|
+
|
|
40
|
+
from rdbpy.options cimport FlushOptions
|
|
41
|
+
from rdbpy.options cimport kCompactionStyleLevel
|
|
42
|
+
from rdbpy.options cimport kCompactionStyleUniversal
|
|
43
|
+
from rdbpy.options cimport kCompactionStyleFIFO
|
|
44
|
+
from rdbpy.options cimport kCompactionStyleNone
|
|
45
|
+
|
|
46
|
+
from rdbpy.slice_ cimport Slice
|
|
47
|
+
from rdbpy.status cimport Status
|
|
48
|
+
|
|
49
|
+
ctypedef const filter_policy.FilterPolicy ConstFilterPolicy
|
|
50
|
+
|
|
51
|
+
cdef extern from "rdb_include/utils.hpp" namespace "py_rocks":
|
|
52
|
+
cdef const Slice* vector_data(vector[Slice]&)
|
|
53
|
+
|
|
54
|
+
cdef extern from "Python.h":
|
|
55
|
+
void PyEval_InitThreads()
|
|
56
|
+
|
|
57
|
+
cdef check_status(const Status& st)
|
|
58
|
+
|
|
59
|
+
cdef string bytes_to_string(path) except *
|
|
60
|
+
|
|
61
|
+
cdef string_to_bytes(string ob)
|
|
62
|
+
|
|
63
|
+
cdef Slice bytes_to_slice(ob) except *
|
|
64
|
+
|
|
65
|
+
cdef slice_to_bytes(Slice sl)
|
|
66
|
+
|
|
67
|
+
cdef string path_to_string(object path) except *
|
|
68
|
+
|
|
69
|
+
cdef object string_to_path(string path)
|
|
70
|
+
|
|
71
|
+
cdef class PyComparator(object):
|
|
72
|
+
cdef object get_ob(self)
|
|
73
|
+
|
|
74
|
+
cdef const comparator.Comparator* get_comparator(self)
|
|
75
|
+
|
|
76
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
77
|
+
|
|
78
|
+
cdef class PyGenericComparator(PyComparator):
|
|
79
|
+
cdef comparator.ComparatorWrapper* comparator_ptr
|
|
80
|
+
cdef object ob
|
|
81
|
+
# def __cinit__(self, object ob)
|
|
82
|
+
# def __dealloc__(self)
|
|
83
|
+
cdef object get_ob(self)
|
|
84
|
+
cdef const comparator.Comparator* get_comparator(self)
|
|
85
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
86
|
+
|
|
87
|
+
cdef class PyBytewiseComparator(PyComparator):
|
|
88
|
+
cdef const comparator.Comparator* comparator_ptr
|
|
89
|
+
# def __cinit__(self)
|
|
90
|
+
cpdef name(self)
|
|
91
|
+
cpdef compare(self, a, b)
|
|
92
|
+
cdef object get_ob(self)
|
|
93
|
+
cdef const comparator.Comparator* get_comparator(self)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
cdef int compare_callback(
|
|
97
|
+
void* ctx,
|
|
98
|
+
logger.Logger* log,
|
|
99
|
+
string& error_msg,
|
|
100
|
+
const Slice& a,
|
|
101
|
+
const Slice& b) with gil
|
|
102
|
+
|
|
103
|
+
# BytewiseComparator = PyBytewiseComparator
|
|
104
|
+
#########################################
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## Here comes the stuff for the filter policy
|
|
109
|
+
cdef class PyFilterPolicy(object):
|
|
110
|
+
cdef object get_ob(self)
|
|
111
|
+
cdef shared_ptr[ConstFilterPolicy] get_policy(self)
|
|
112
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
113
|
+
|
|
114
|
+
cdef class PyGenericFilterPolicy(PyFilterPolicy):
|
|
115
|
+
cdef shared_ptr[filter_policy.FilterPolicyWrapper] policy
|
|
116
|
+
cdef object ob
|
|
117
|
+
# def __cinit__(self, object ob)
|
|
118
|
+
cdef object get_ob(self)
|
|
119
|
+
cdef shared_ptr[ConstFilterPolicy] get_policy(self)
|
|
120
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
cdef void create_filter_callback(
|
|
124
|
+
void* ctx,
|
|
125
|
+
logger.Logger* log,
|
|
126
|
+
string& error_msg,
|
|
127
|
+
const Slice* keys,
|
|
128
|
+
int n,
|
|
129
|
+
string* dst) with gil
|
|
130
|
+
|
|
131
|
+
cdef cpp_bool key_may_match_callback(
|
|
132
|
+
void* ctx,
|
|
133
|
+
logger.Logger* log,
|
|
134
|
+
string& error_msg,
|
|
135
|
+
const Slice& key,
|
|
136
|
+
const Slice& filt) with gil
|
|
137
|
+
|
|
138
|
+
cdef class PyBloomFilterPolicy(PyFilterPolicy):
|
|
139
|
+
cdef shared_ptr[ConstFilterPolicy] policy
|
|
140
|
+
# def __cinit__(self, int bits_per_key)
|
|
141
|
+
cpdef name(self)
|
|
142
|
+
cpdef create_filter(self, keys)
|
|
143
|
+
cpdef key_may_match(self, key, filter_)
|
|
144
|
+
cdef object get_ob(self)
|
|
145
|
+
cdef shared_ptr[ConstFilterPolicy] get_policy(self)
|
|
146
|
+
|
|
147
|
+
# BloomFilterPolicy = PyBloomFilterPolicy
|
|
148
|
+
# #############################################
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Here comes the stuff for the merge operator
|
|
153
|
+
cdef class PyMergeOperator(object):
|
|
154
|
+
cdef shared_ptr[merge_operator.MergeOperator] merge_op
|
|
155
|
+
cdef object ob
|
|
156
|
+
# def __cinit__(self, object ob)
|
|
157
|
+
cdef object get_ob(self)
|
|
158
|
+
cdef shared_ptr[merge_operator.MergeOperator] get_operator(self)
|
|
159
|
+
|
|
160
|
+
cdef cpp_bool merge_callback(
|
|
161
|
+
void* ctx,
|
|
162
|
+
const Slice& key,
|
|
163
|
+
const Slice* existing_value,
|
|
164
|
+
const Slice& value,
|
|
165
|
+
string* new_value,
|
|
166
|
+
logger.Logger* log) with gil
|
|
167
|
+
|
|
168
|
+
cdef cpp_bool full_merge_callback(
|
|
169
|
+
void* ctx,
|
|
170
|
+
const Slice& key,
|
|
171
|
+
const Slice* existing_value,
|
|
172
|
+
const deque[string]& op_list,
|
|
173
|
+
string* new_value,
|
|
174
|
+
logger.Logger* log) with gil
|
|
175
|
+
|
|
176
|
+
cdef cpp_bool partial_merge_callback(
|
|
177
|
+
void* ctx,
|
|
178
|
+
const Slice& key,
|
|
179
|
+
const Slice& left_op,
|
|
180
|
+
const Slice& right_op,
|
|
181
|
+
string* new_value,
|
|
182
|
+
logger.Logger* log) with gil
|
|
183
|
+
|
|
184
|
+
cdef class PyCache(object):
|
|
185
|
+
cdef shared_ptr[cache.Cache] get_cache(self)
|
|
186
|
+
|
|
187
|
+
cdef class PyLRUCache(PyCache):
|
|
188
|
+
cdef shared_ptr[cache.Cache] cache_ob
|
|
189
|
+
# def __cinit__(self, capacity, shard_bits = *)
|
|
190
|
+
cdef shared_ptr[cache.Cache] get_cache(self)
|
|
191
|
+
|
|
192
|
+
LRUCache = PyLRUCache
|
|
193
|
+
###############################
|
|
194
|
+
|
|
195
|
+
### Here comes the stuff for SliceTransform
|
|
196
|
+
cdef class PySliceTransform(object):
|
|
197
|
+
cdef shared_ptr[slice_transform.SliceTransform] transfomer
|
|
198
|
+
cdef object ob
|
|
199
|
+
# def __cinit__(self, object ob)
|
|
200
|
+
cdef object get_ob(self)
|
|
201
|
+
cdef shared_ptr[slice_transform.SliceTransform] get_transformer(self)
|
|
202
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
cdef Slice slice_transform_callback(
|
|
206
|
+
void* ctx,
|
|
207
|
+
logger.Logger* log,
|
|
208
|
+
string& error_msg,
|
|
209
|
+
const Slice& src) with gil
|
|
210
|
+
|
|
211
|
+
cdef cpp_bool slice_in_domain_callback(
|
|
212
|
+
void* ctx,
|
|
213
|
+
logger.Logger* log,
|
|
214
|
+
string& error_msg,
|
|
215
|
+
const Slice& src) with gil
|
|
216
|
+
|
|
217
|
+
cdef cpp_bool slice_in_range_callback(
|
|
218
|
+
void* ctx,
|
|
219
|
+
logger.Logger* log,
|
|
220
|
+
string& error_msg,
|
|
221
|
+
const Slice& src) with gil
|
|
222
|
+
|
|
223
|
+
## Here are the TableFactories
|
|
224
|
+
cdef class PyTableFactory(object):
|
|
225
|
+
cdef shared_ptr[table_factory.TableFactory] factory
|
|
226
|
+
cdef shared_ptr[table_factory.TableFactory] get_table_factory(self)
|
|
227
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
228
|
+
|
|
229
|
+
cdef class BlockBasedTableFactory(PyTableFactory):
|
|
230
|
+
cdef PyFilterPolicy py_filter_policy
|
|
231
|
+
# def __init__(self,
|
|
232
|
+
# index_type='binary_search',
|
|
233
|
+
# py_bool hash_index_allow_collision=True,
|
|
234
|
+
# checksum='crc32',
|
|
235
|
+
# PyCache block_cache = *,
|
|
236
|
+
# PyCache block_cache_compressed = *,
|
|
237
|
+
# filter_policy = *,
|
|
238
|
+
# no_block_cache=False,
|
|
239
|
+
# block_size = *,
|
|
240
|
+
# block_size_deviation = *,
|
|
241
|
+
# block_restart_interval = *,
|
|
242
|
+
# whole_key_filtering = *)
|
|
243
|
+
cdef set_info_log(self, shared_ptr[logger.Logger] info_log)
|
|
244
|
+
|
|
245
|
+
cdef class PlainTableFactory(PyTableFactory):
|
|
246
|
+
pass
|
|
247
|
+
# def __init__(
|
|
248
|
+
# self,
|
|
249
|
+
# user_key_len=0,
|
|
250
|
+
# bloom_bits_per_key=10,
|
|
251
|
+
# hash_table_ratio=0.75,
|
|
252
|
+
# index_sparseness=10,
|
|
253
|
+
# huge_page_tlb_size=0,
|
|
254
|
+
# encoding_type='plain',
|
|
255
|
+
# py_bool full_scan_mode=False)
|
|
256
|
+
#############################################
|
|
257
|
+
|
|
258
|
+
### Here are the MemtableFactories
|
|
259
|
+
cdef class PyMemtableFactory(object):
|
|
260
|
+
cdef shared_ptr[memtablerep.MemTableRepFactory] factory
|
|
261
|
+
cdef shared_ptr[memtablerep.MemTableRepFactory] get_memtable_factory(self)
|
|
262
|
+
|
|
263
|
+
cdef class SkipListMemtableFactory(PyMemtableFactory):
|
|
264
|
+
pass
|
|
265
|
+
# def __init__(self)
|
|
266
|
+
|
|
267
|
+
cdef class VectorMemtableFactory(PyMemtableFactory):
|
|
268
|
+
pass
|
|
269
|
+
# def __init__(self, count=0)
|
|
270
|
+
|
|
271
|
+
cdef class HashSkipListMemtableFactory(PyMemtableFactory):
|
|
272
|
+
pass
|
|
273
|
+
# def __init__(
|
|
274
|
+
# self,
|
|
275
|
+
# bucket_count=1000000,
|
|
276
|
+
# skiplist_height=4,
|
|
277
|
+
# skiplist_branching_factor=4)
|
|
278
|
+
|
|
279
|
+
cdef class HashLinkListMemtableFactory(PyMemtableFactory):
|
|
280
|
+
pass
|
|
281
|
+
# def __init__(self, bucket_count=50000)
|
|
282
|
+
##################################
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
cdef class CompressionType(object):
|
|
286
|
+
pass
|
|
287
|
+
# no_compression = u'no_compression'
|
|
288
|
+
# snappy_compression = u'snappy_compression'
|
|
289
|
+
# zlib_compression = u'zlib_compression'
|
|
290
|
+
# bzip2_compression = u'bzip2_compression'
|
|
291
|
+
# lz4_compression = u'lz4_compression'
|
|
292
|
+
# lz4hc_compression = u'lz4hc_compression'
|
|
293
|
+
# xpress_compression = u'xpress_compression'
|
|
294
|
+
# zstd_compression = u'zstd_compression'
|
|
295
|
+
# zstdnotfinal_compression = u'zstdnotfinal_compression'
|
|
296
|
+
# disable_compression = u'disable_compression'
|
|
297
|
+
|
|
298
|
+
cdef class CompactionPri(object):
|
|
299
|
+
pass
|
|
300
|
+
# by_compensated_size = u'by_compensated_size'
|
|
301
|
+
# oldest_largest_seq_first = u'oldest_largest_seq_first'
|
|
302
|
+
# oldest_smallest_seq_first = u'oldest_smallest_seq_first'
|
|
303
|
+
# min_overlapping_ratio = u'min_overlapping_ratio'
|
|
304
|
+
|
|
305
|
+
cdef class _ColumnFamilyHandle:
|
|
306
|
+
""" This is an internal class that we will weakref for safety """
|
|
307
|
+
cdef db.ColumnFamilyHandle* handle
|
|
308
|
+
cdef object __weakref__
|
|
309
|
+
cdef object weak_handle
|
|
310
|
+
# def __cinit__(self)
|
|
311
|
+
# def __dealloc__(self)
|
|
312
|
+
@staticmethod
|
|
313
|
+
cdef from_handle_ptr(db.ColumnFamilyHandle* handle)
|
|
314
|
+
# @property
|
|
315
|
+
# def name(self)
|
|
316
|
+
# @property
|
|
317
|
+
# def id(self)
|
|
318
|
+
# @property
|
|
319
|
+
# def weakref(self)
|
|
320
|
+
|
|
321
|
+
cdef class ColumnFamilyHandle:
|
|
322
|
+
""" This represents a ColumnFamilyHandle """
|
|
323
|
+
cdef object _ref
|
|
324
|
+
cdef readonly bytes name
|
|
325
|
+
cdef readonly int id
|
|
326
|
+
# def __cinit__(self, weakhandle)
|
|
327
|
+
# def __init__(self, *)
|
|
328
|
+
@staticmethod
|
|
329
|
+
cdef object from_wrapper(_ColumnFamilyHandle real_handle)
|
|
330
|
+
# @property
|
|
331
|
+
# cpdef is_valid(self)
|
|
332
|
+
# def __repr__(self)
|
|
333
|
+
cdef db.ColumnFamilyHandle* get_handle(self) except NULL
|
|
334
|
+
# def __eq__(self, other)
|
|
335
|
+
# def __lt__(self, other)
|
|
336
|
+
# Since @total_ordering isn't a thing for cython
|
|
337
|
+
# def __ne__(self, other)
|
|
338
|
+
# def __gt__(self, other)
|
|
339
|
+
# def __le__(self, other)
|
|
340
|
+
# def __ge__(self, other)
|
|
341
|
+
# def __hash__(self)
|
|
342
|
+
|
|
343
|
+
cdef class ColumnFamilyOptions(object):
|
|
344
|
+
cdef options.ColumnFamilyOptions* copts
|
|
345
|
+
cdef PyComparator py_comparator
|
|
346
|
+
cdef PyMergeOperator py_merge_operator
|
|
347
|
+
cdef PySliceTransform py_prefix_extractor
|
|
348
|
+
cdef PyTableFactory py_table_factory
|
|
349
|
+
cdef PyMemtableFactory py_memtable_factory
|
|
350
|
+
|
|
351
|
+
# Used to protect sharing of Options with many DB-objects
|
|
352
|
+
cdef cpp_bool in_use
|
|
353
|
+
# def __cinit__(self)
|
|
354
|
+
# def __dealloc__(self)
|
|
355
|
+
# def __init__(self, **kwargs)
|
|
356
|
+
# property write_buffer_size:
|
|
357
|
+
# def __get__(self)
|
|
358
|
+
# def __set__(self, value)
|
|
359
|
+
# property max_write_buffer_number:
|
|
360
|
+
# def __get__(self)
|
|
361
|
+
# def __set__(self, value)
|
|
362
|
+
# property min_write_buffer_number_to_merge:
|
|
363
|
+
# def __get__(self)
|
|
364
|
+
# def __set__(self, value)
|
|
365
|
+
# property compression_opts:
|
|
366
|
+
# def __get__(self)
|
|
367
|
+
# def __set__(self, dict value)
|
|
368
|
+
# property compaction_pri:
|
|
369
|
+
# def __get__(self)
|
|
370
|
+
# def __set__(self, value)
|
|
371
|
+
# property compression:
|
|
372
|
+
# def __get__(self)
|
|
373
|
+
# def __set__(self, value)
|
|
374
|
+
# property max_compaction_bytes:
|
|
375
|
+
# def __get__(self)
|
|
376
|
+
# def __set__(self, value)
|
|
377
|
+
# property num_levels:
|
|
378
|
+
# def __get__(self)
|
|
379
|
+
# def __set__(self, value)
|
|
380
|
+
# property level0_file_num_compaction_trigger:
|
|
381
|
+
# def __get__(self)
|
|
382
|
+
# def __set__(self, value)
|
|
383
|
+
# property level0_slowdown_writes_trigger:
|
|
384
|
+
# def __get__(self)
|
|
385
|
+
# def __set__(self, value)
|
|
386
|
+
# property level0_stop_writes_trigger:
|
|
387
|
+
# def __get__(self)
|
|
388
|
+
# def __set__(self, value)
|
|
389
|
+
# property max_mem_compaction_level:
|
|
390
|
+
# def __get__(self)
|
|
391
|
+
# def __set__(self, value)
|
|
392
|
+
# property target_file_size_base:
|
|
393
|
+
# def __get__(self)
|
|
394
|
+
# def __set__(self, value)
|
|
395
|
+
# property target_file_size_multiplier:
|
|
396
|
+
# def __get__(self)
|
|
397
|
+
# def __set__(self, value)
|
|
398
|
+
# property max_bytes_for_level_base:
|
|
399
|
+
# def __get__(self)
|
|
400
|
+
# def __set__(self, value)
|
|
401
|
+
# property max_bytes_for_level_multiplier:
|
|
402
|
+
# def __get__(self)
|
|
403
|
+
# def __set__(self, value)
|
|
404
|
+
# property max_bytes_for_level_multiplier_additional:
|
|
405
|
+
# def __get__(self)
|
|
406
|
+
# def __set__(self, value)
|
|
407
|
+
# property arena_block_size:
|
|
408
|
+
# def __get__(self)
|
|
409
|
+
# def __set__(self, value)
|
|
410
|
+
# property disable_auto_compactions:
|
|
411
|
+
# def __get__(self)
|
|
412
|
+
# def __set__(self, value)
|
|
413
|
+
# # FIXME: remove to util/options_helper.h
|
|
414
|
+
# # property allow_os_buffer:
|
|
415
|
+
# # def __get__(self):
|
|
416
|
+
# # return self.copts.allow_os_buffer
|
|
417
|
+
# # def __set__(self, value):
|
|
418
|
+
# # self.copts.allow_os_buffer = value
|
|
419
|
+
# property compaction_style:
|
|
420
|
+
# def __get__(self)
|
|
421
|
+
# def __set__(self, str value)
|
|
422
|
+
# property compaction_options_universal:
|
|
423
|
+
# def __get__(self)
|
|
424
|
+
# def __set__(self, dict value)
|
|
425
|
+
# # Deprecate
|
|
426
|
+
# # property filter_deletes:
|
|
427
|
+
# # def __get__(self):
|
|
428
|
+
# # return self.copts.filter_deletes
|
|
429
|
+
# # def __set__(self, value):
|
|
430
|
+
# # self.copts.filter_deletes = value
|
|
431
|
+
# property max_sequential_skip_in_iterations:
|
|
432
|
+
# def __get__(self)
|
|
433
|
+
# def __set__(self, value)
|
|
434
|
+
# property inplace_update_support:
|
|
435
|
+
# def __get__(self)
|
|
436
|
+
# def __set__(self, value)
|
|
437
|
+
# property table_factory:
|
|
438
|
+
# def __get__(self)
|
|
439
|
+
# def __set__(self, PyTableFactory value)
|
|
440
|
+
# property memtable_factory:
|
|
441
|
+
# def __get__(self)
|
|
442
|
+
# def __set__(self, PyMemtableFactory value)
|
|
443
|
+
# property inplace_update_num_locks:
|
|
444
|
+
# def __get__(self)
|
|
445
|
+
# def __set__(self, value)
|
|
446
|
+
# property comparator:
|
|
447
|
+
# def __get__(self)
|
|
448
|
+
# def __set__(self, value)
|
|
449
|
+
# property merge_operator:
|
|
450
|
+
# def __get__(self)
|
|
451
|
+
# def __set__(self, value)
|
|
452
|
+
# property prefix_extractor:
|
|
453
|
+
# def __get__(self)
|
|
454
|
+
# def __set__(self, value)
|
|
455
|
+
|
|
456
|
+
cdef class Options(ColumnFamilyOptions):
|
|
457
|
+
cdef options.Options* opts
|
|
458
|
+
cdef PyCache py_row_cache
|
|
459
|
+
# def __cinit__(self)
|
|
460
|
+
# def __dealloc__(self)
|
|
461
|
+
# def __init__(self, **kwargs)
|
|
462
|
+
# property create_if_missing:
|
|
463
|
+
# def __get__(self)
|
|
464
|
+
# def __set__(self, value)
|
|
465
|
+
# property error_if_exists:
|
|
466
|
+
# def __get__(self)
|
|
467
|
+
# def __set__(self, value)
|
|
468
|
+
# property paranoid_checks:
|
|
469
|
+
# def __get__(self)
|
|
470
|
+
# def __set__(self, value)
|
|
471
|
+
# property max_open_files:
|
|
472
|
+
# def __get__(self)
|
|
473
|
+
# def __set__(self, value)
|
|
474
|
+
# property use_fsync:
|
|
475
|
+
# def __get__(self)
|
|
476
|
+
# def __set__(self, value)
|
|
477
|
+
# property db_log_dir:
|
|
478
|
+
# def __get__(self)
|
|
479
|
+
# def __set__(self, value)
|
|
480
|
+
# property wal_dir:
|
|
481
|
+
# def __get__(self)
|
|
482
|
+
# def __set__(self, value)
|
|
483
|
+
# property delete_obsolete_files_period_micros:
|
|
484
|
+
# def __get__(self)
|
|
485
|
+
# def __set__(self, value)
|
|
486
|
+
# property max_background_compactions:
|
|
487
|
+
# def __get__(self)
|
|
488
|
+
# def __set__(self, value)
|
|
489
|
+
# property max_background_flushes:
|
|
490
|
+
# def __get__(self)
|
|
491
|
+
# def __set__(self, value)
|
|
492
|
+
# property max_log_file_size:
|
|
493
|
+
# def __get__(self)
|
|
494
|
+
# def __set__(self, value)
|
|
495
|
+
# property db_write_buffer_size:
|
|
496
|
+
# def __get__(self)
|
|
497
|
+
# def __set__(self, value)
|
|
498
|
+
# property log_file_time_to_roll:
|
|
499
|
+
# def __get__(self)
|
|
500
|
+
# def __set__(self, value)
|
|
501
|
+
# property keep_log_file_num:
|
|
502
|
+
# def __get__(self)
|
|
503
|
+
# def __set__(self, value)
|
|
504
|
+
# property max_manifest_file_size:
|
|
505
|
+
# def __get__(self)
|
|
506
|
+
# def __set__(self, value)
|
|
507
|
+
# property table_cache_numshardbits:
|
|
508
|
+
# def __get__(self)
|
|
509
|
+
# def __set__(self, value)
|
|
510
|
+
# property wal_ttl_seconds:
|
|
511
|
+
# def __get__(self)
|
|
512
|
+
# def __set__(self, value)
|
|
513
|
+
# property wal_size_limit_mb:
|
|
514
|
+
# def __get__(self)
|
|
515
|
+
# def __set__(self, value)
|
|
516
|
+
# property manifest_preallocation_size:
|
|
517
|
+
# def __get__(self)
|
|
518
|
+
# def __set__(self, value)
|
|
519
|
+
# property enable_write_thread_adaptive_yield:
|
|
520
|
+
# def __get__(self)
|
|
521
|
+
# def __set__(self, value)
|
|
522
|
+
# property allow_concurrent_memtable_write:
|
|
523
|
+
# def __get__(self)
|
|
524
|
+
# def __set__(self, value)
|
|
525
|
+
# property allow_mmap_reads:
|
|
526
|
+
# def __get__(self)
|
|
527
|
+
# def __set__(self, value)
|
|
528
|
+
# property allow_mmap_writes:
|
|
529
|
+
# def __get__(self)
|
|
530
|
+
# def __set__(self, value)
|
|
531
|
+
# property is_fd_close_on_exec:
|
|
532
|
+
# def __get__(self)
|
|
533
|
+
# def __set__(self, value)
|
|
534
|
+
# property stats_dump_period_sec:
|
|
535
|
+
# def __get__(self)
|
|
536
|
+
# def __set__(self, value)
|
|
537
|
+
# property advise_random_on_open:
|
|
538
|
+
# def __get__(self)
|
|
539
|
+
# def __set__(self, value)
|
|
540
|
+
# # TODO: need to remove -Wconversion to make this work
|
|
541
|
+
# # property access_hint_on_compaction_start:
|
|
542
|
+
# # def __get__(sel
|
|
543
|
+
# # def __set__(self, AccessHint valu
|
|
544
|
+
# property use_adaptive_mutex:
|
|
545
|
+
# def __get__(self)
|
|
546
|
+
# def __set__(self, value)
|
|
547
|
+
# property bytes_per_sync:
|
|
548
|
+
# def __get__(self)
|
|
549
|
+
# def __set__(self, value)
|
|
550
|
+
# property row_cache:
|
|
551
|
+
# def __get__(self)
|
|
552
|
+
# def __set__(self, value)
|
|
553
|
+
# # cpp_bool skip_checking_sst_file_sizes_on_db_open
|
|
554
|
+
# property skip_checking_sst_file_sizes_on_db_open:
|
|
555
|
+
# def __get__(self)
|
|
556
|
+
# def __set__(self, value)
|
|
557
|
+
# # cpp_bool skip_stats_update_on_db_open
|
|
558
|
+
# property skip_stats_update_on_db_open:
|
|
559
|
+
# def __get__(self)
|
|
560
|
+
# def __set__(self, value)
|
|
561
|
+
|
|
562
|
+
# Forward declaration
|
|
563
|
+
# cdef class Snapshot
|
|
564
|
+
|
|
565
|
+
# cdef class KeysIterator
|
|
566
|
+
# cdef class ValuesIterator
|
|
567
|
+
# cdef class ItemsIterator
|
|
568
|
+
# cdef class ReversedIterator
|
|
569
|
+
|
|
570
|
+
cdef class TransactionDBOptions(object):
|
|
571
|
+
cdef transaction.TransactionDBOptions* opts
|
|
572
|
+
cdef bint in_use
|
|
573
|
+
|
|
574
|
+
cdef class TransactionOptions(object):
|
|
575
|
+
cdef transaction.TransactionOptions* opts
|
|
576
|
+
|
|
577
|
+
# # Forward declaration
|
|
578
|
+
# cdef class WriteBatchIterator
|
|
579
|
+
|
|
580
|
+
cdef class WriteBatch(object):
|
|
581
|
+
cdef db.WriteBatch* batch
|
|
582
|
+
|
|
583
|
+
# def __cinit__(self, data = *)
|
|
584
|
+
# def __dealloc__(self)
|
|
585
|
+
cpdef void put(self, bytes key, bytes value, ColumnFamilyHandle column_family = *)
|
|
586
|
+
cpdef void merge(self, bytes key, bytes value, ColumnFamilyHandle column_family = *)
|
|
587
|
+
cpdef void delete_single(self, bytes key, ColumnFamilyHandle column_family = *)
|
|
588
|
+
cpdef void delete_range(self, bytes begin_key, bytes end_key, ColumnFamilyHandle column_family = *)
|
|
589
|
+
cpdef void clear(self)
|
|
590
|
+
cpdef data(self)
|
|
591
|
+
cpdef int count(self)
|
|
592
|
+
# def __iter__(self)
|
|
593
|
+
|
|
594
|
+
cdef class WriteBatchIterator(object):
|
|
595
|
+
# Need a reference to the WriteBatch.
|
|
596
|
+
# The BatchItems are only pointers to the memory in WriteBatch.
|
|
597
|
+
cdef WriteBatch batch
|
|
598
|
+
cdef vector[db.BatchItem] items
|
|
599
|
+
cdef size_t pos
|
|
600
|
+
# def __init__(self, WriteBatch batch)
|
|
601
|
+
# def __iter__(self)
|
|
602
|
+
# def __next__(self)
|
|
603
|
+
|
|
604
|
+
cdef class IDB(object):
|
|
605
|
+
cpdef void put(self, bytes key, bytes value, cpp_bool sync = *, cpp_bool disable_wal = *, ColumnFamilyHandle column_family = *)
|
|
606
|
+
cpdef void delete_single(self, bytes key, cpp_bool sync = *, cpp_bool disable_wal = *, ColumnFamilyHandle column_family = *)
|
|
607
|
+
cpdef void delete_range(self, bytes begin_key, bytes end_key, cpp_bool sync = *, cpp_bool disable_wal = *, ColumnFamilyHandle column_family = *)
|
|
608
|
+
cpdef void flush(self)
|
|
609
|
+
cpdef void flush_wal(self, cpp_bool sync = *)
|
|
610
|
+
cpdef void merge(self, bytes key, bytes value, cpp_bool sync = *, cpp_bool disable_wal = *, ColumnFamilyHandle column_family = *)
|
|
611
|
+
cpdef void write(self, WriteBatch batch, cpp_bool sync = *, cpp_bool disable_wal = *)
|
|
612
|
+
cpdef get(self, bytes key, ColumnFamilyHandle column_family = *)
|
|
613
|
+
cpdef multi_get(self, keys)
|
|
614
|
+
cpdef key_may_exist(self, bytes key, cpp_bool fetch = *, ColumnFamilyHandle column_family = *)
|
|
615
|
+
cpdef Iterator iterkeys(self, ColumnFamilyHandle column_family = *)
|
|
616
|
+
cpdef Iterator itervalues(self, ColumnFamilyHandle column_family = *)
|
|
617
|
+
cpdef Iterator iteritems(self, ColumnFamilyHandle column_family = *)
|
|
618
|
+
|
|
619
|
+
@cython.no_gc_clear
|
|
620
|
+
cdef class DB(IDB):
|
|
621
|
+
cdef Options opts
|
|
622
|
+
cdef db.DB* db
|
|
623
|
+
cdef list cf_handles
|
|
624
|
+
cdef list cf_options
|
|
625
|
+
# def __cinit__(self, db_name, Options opts, dict column_families = *, read_only=False)
|
|
626
|
+
# def __dealloc__(self)
|
|
627
|
+
cpdef void close(self)
|
|
628
|
+
# @property
|
|
629
|
+
# cpdef column_families(self)
|
|
630
|
+
cpdef get_column_family(self, bytes name)
|
|
631
|
+
cpdef iterskeys(self, column_families)
|
|
632
|
+
cpdef itersvalues(self, column_families)
|
|
633
|
+
cpdef itersitems(self, column_families)
|
|
634
|
+
cpdef snapshot(self)
|
|
635
|
+
cpdef get_property(self, prop, ColumnFamilyHandle column_family = *)
|
|
636
|
+
cpdef try_catch_up_with_primary(self)
|
|
637
|
+
cpdef get_live_files_metadata(self)
|
|
638
|
+
cpdef void compact_range(
|
|
639
|
+
self,
|
|
640
|
+
bytes begin = *,
|
|
641
|
+
bytes end = *,
|
|
642
|
+
cpp_bool change_level = *,
|
|
643
|
+
int target_level = *,
|
|
644
|
+
str bottommost_level_compaction = *,
|
|
645
|
+
ColumnFamilyHandle column_family = *
|
|
646
|
+
)
|
|
647
|
+
# @staticmethod
|
|
648
|
+
# def __parse_read_opts(
|
|
649
|
+
# verify_checksums = *,
|
|
650
|
+
# fill_cache = *,
|
|
651
|
+
# snapshot = *,
|
|
652
|
+
# read_tier = *)
|
|
653
|
+
cdef options.ReadOptions build_read_opts(self, dict py_opts)
|
|
654
|
+
# property options:
|
|
655
|
+
# def __get__(self)
|
|
656
|
+
cpdef create_column_family(self, bytes name, ColumnFamilyOptions copts)
|
|
657
|
+
cpdef void drop_column_family(self, ColumnFamilyHandle weak_handle)
|
|
658
|
+
|
|
659
|
+
cpdef repair_db(db_name, Options opts)
|
|
660
|
+
|
|
661
|
+
cpdef list_column_families(db_name, Options opts)
|
|
662
|
+
|
|
663
|
+
@cython.no_gc_clear
|
|
664
|
+
cdef class TransactionDB(DB):
|
|
665
|
+
cdef transaction.CppTransactionDB* txn_db
|
|
666
|
+
cdef TransactionDBOptions txn_opts
|
|
667
|
+
cpdef begin_transaction(self, TransactionOptions txn_options = *, dict write_options = *, Transaction reuse = *)
|
|
668
|
+
cpdef void close(self)
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
cdef class Transaction(object):
|
|
672
|
+
cdef transaction.Transaction* txn
|
|
673
|
+
cdef TransactionDB db
|
|
674
|
+
cdef bint closed
|
|
675
|
+
|
|
676
|
+
cdef void _ensure_open(self)
|
|
677
|
+
cpdef void close(self)
|
|
678
|
+
cpdef void commit(self)
|
|
679
|
+
cpdef void rollback(self)
|
|
680
|
+
cpdef void prepare(self)
|
|
681
|
+
cpdef void set_snapshot(self)
|
|
682
|
+
cpdef void clear_snapshot(self)
|
|
683
|
+
cpdef snapshot(self)
|
|
684
|
+
cpdef void save_point(self)
|
|
685
|
+
cpdef void rollback_to_save_point(self)
|
|
686
|
+
cpdef void pop_save_point(self)
|
|
687
|
+
cpdef set_name(self, name)
|
|
688
|
+
cpdef get_name(self)
|
|
689
|
+
cpdef get_id(self)
|
|
690
|
+
cpdef void put(self, bytes key, bytes value, ColumnFamilyHandle column_family = *, cpp_bool assume_tracked = *)
|
|
691
|
+
cpdef void merge(self, bytes key, bytes value, ColumnFamilyHandle column_family = *, cpp_bool assume_tracked = *)
|
|
692
|
+
cpdef void delete_single(self, bytes key, ColumnFamilyHandle column_family = *, cpp_bool assume_tracked = *)
|
|
693
|
+
cpdef get(self, bytes key, ColumnFamilyHandle column_family = *)
|
|
694
|
+
cpdef multi_get(self, keys)
|
|
695
|
+
cpdef Iterator iterkeys(self, ColumnFamilyHandle column_family = *)
|
|
696
|
+
cpdef Iterator itervalues(self, ColumnFamilyHandle column_family = *)
|
|
697
|
+
cpdef Iterator iteritems(self, ColumnFamilyHandle column_family = *)
|
|
698
|
+
cpdef void disable_indexing(self)
|
|
699
|
+
cpdef void enable_indexing(self)
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
@cython.no_gc_clear
|
|
703
|
+
cdef class Snapshot(object):
|
|
704
|
+
cdef const snapshot.Snapshot* ptr
|
|
705
|
+
cdef DB db
|
|
706
|
+
|
|
707
|
+
# def __cinit__(self, DB db)
|
|
708
|
+
# def __dealloc__(self)
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
cdef class Iterator:
|
|
712
|
+
cdef object _current_value
|
|
713
|
+
|
|
714
|
+
cpdef object next(self)
|
|
715
|
+
cpdef object get(self)
|
|
716
|
+
cpdef void skip(self)
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
cdef class BaseIterator(Iterator):
|
|
720
|
+
cdef iterator.Iterator* ptr
|
|
721
|
+
cdef DB db
|
|
722
|
+
cdef ColumnFamilyHandle handle
|
|
723
|
+
cdef object owner
|
|
724
|
+
|
|
725
|
+
# def __cinit__(self, DB db, ColumnFamilyHandle handle = None)
|
|
726
|
+
# def __dealloc__(self)
|
|
727
|
+
# def __iter__(self)
|
|
728
|
+
# def __next__(self)
|
|
729
|
+
# def __reversed__(self)
|
|
730
|
+
cpdef void seek_to_first(self)
|
|
731
|
+
cpdef void seek_to_last(self)
|
|
732
|
+
cpdef void seek(self, bytes key)
|
|
733
|
+
cpdef void seek_for_prev(self, bytes key)
|
|
734
|
+
cdef object get_ob(self)
|
|
735
|
+
|
|
736
|
+
cdef class KeysIterator(BaseIterator):
|
|
737
|
+
cdef object get_ob(self)
|
|
738
|
+
|
|
739
|
+
cdef class ValuesIterator(BaseIterator):
|
|
740
|
+
cdef object get_ob(self)
|
|
741
|
+
|
|
742
|
+
cdef class ItemsIterator(BaseIterator):
|
|
743
|
+
cdef object get_ob(self)
|
|
744
|
+
|
|
745
|
+
cdef class ReversedIterator(Iterator):
|
|
746
|
+
cdef BaseIterator it
|
|
747
|
+
|
|
748
|
+
# def __cinit__(self, BaseIterator it)
|
|
749
|
+
cpdef void seek_to_first(self)
|
|
750
|
+
cpdef void seek_to_last(self)
|
|
751
|
+
cpdef void seek(self, bytes key)
|
|
752
|
+
cpdef void seek_for_prev(self, bytes key)
|
|
753
|
+
# def __iter__(self)
|
|
754
|
+
# def __reversed__(self)
|
|
755
|
+
# def __next__(self)
|
|
756
|
+
|
|
757
|
+
cdef class BackupEngine(object):
|
|
758
|
+
cdef backup.BackupEngine* engine
|
|
759
|
+
|
|
760
|
+
# def __cinit__(self, backup_dir)s
|
|
761
|
+
# def __dealloc__(self)
|
|
762
|
+
cpdef create_backup(self, DB db, flush_before_backup = *)
|
|
763
|
+
cpdef restore_backup(self, backup_id, db_dir, wal_dir)
|
|
764
|
+
cpdef restore_latest_backup(self, db_dir, wal_dir)
|
|
765
|
+
cpdef stop_backup(self)
|
|
766
|
+
cpdef purge_old_backups(self, num_backups_to_keep)
|
|
767
|
+
cpdef delete_backup(self, backup_id)
|
|
768
|
+
cpdef get_backup_info(self)
|