forked from twmht/python-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
merge_operator.pxd
46 lines (40 loc) · 1.17 KB
/
merge_operator.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
from libcpp.string cimport string
from libcpp cimport bool as cpp_bool
from libcpp.deque cimport deque
from slice_ cimport Slice
from logger cimport Logger
from std_memory cimport shared_ptr
cdef extern from "rocksdb/merge_operator.h" namespace "rocksdb":
cdef cppclass MergeOperator:
pass
ctypedef cpp_bool (*merge_func)(
void*,
const Slice&,
const Slice*,
const Slice&,
string*,
Logger*)
ctypedef cpp_bool (*full_merge_func)(
void* ctx,
const Slice& key,
const Slice* existing_value,
const deque[string]& operand_list,
string* new_value,
Logger* logger)
ctypedef cpp_bool (*partial_merge_func)(
void* ctx,
const Slice& key,
const Slice& left_op,
const Slice& right_op,
string* new_value,
Logger* logger)
cdef extern from "cpp/merge_operator_wrapper.hpp" namespace "py_rocks":
cdef cppclass AssociativeMergeOperatorWrapper:
AssociativeMergeOperatorWrapper(string, void*, merge_func) nogil except+
cdef cppclass MergeOperatorWrapper:
MergeOperatorWrapper(
string,
void*,
void*,
full_merge_func,
partial_merge_func) nogil except+