File: filter_policy.pxd

package info (click to toggle)
python-rocksdb 0.8.0~rc3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 480 kB
  • sloc: python: 798; cpp: 408; makefile: 158
file content (39 lines) | stat: -rw-r--r-- 1,100 bytes parent folder | download
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
from libcpp cimport bool as cpp_bool
from libcpp.string cimport string
from libc.string cimport const_char
from .slice_ cimport Slice
from .std_memory cimport shared_ptr
from .logger cimport Logger

cdef extern from "rocksdb/filter_policy.h" namespace "rocksdb":
    cdef cppclass FilterPolicy:
        void CreateFilter(const Slice*, int, string*) nogil except+
        cpp_bool KeyMayMatch(const Slice&, const Slice&) nogil except+
        const_char* Name() nogil except+

    cdef extern const FilterPolicy* NewBloomFilterPolicy(int) nogil except+

ctypedef void (*create_filter_func)(
    void*,
    Logger*,
    string&,
    const Slice*,
    int,
    string*)

ctypedef cpp_bool (*key_may_match_func)(
    void*,
    Logger*,
    string&,
    const Slice&,
    const Slice&)

cdef extern from "cpp/filter_policy_wrapper.hpp" namespace "py_rocks":
    cdef cppclass FilterPolicyWrapper:
        FilterPolicyWrapper(
            string,
            void*,
            create_filter_func,
            key_may_match_func) nogil except+

        void set_info_log(shared_ptr[Logger]) nogil except+