2014-01-13 19:52:22 +01:00
|
|
|
from libcpp cimport bool as cpp_bool
|
|
|
|
from libcpp.string cimport string
|
2014-01-17 20:06:17 +01:00
|
|
|
from libc.string cimport const_char
|
2014-01-13 19:52:22 +01:00
|
|
|
from slice_ cimport Slice
|
|
|
|
|
|
|
|
cdef extern from "rocksdb/filter_policy.h" namespace "rocksdb":
|
|
|
|
cdef cppclass FilterPolicy:
|
2014-01-17 20:06:17 +01:00
|
|
|
void CreateFilter(const Slice*, int, string*) nogil except+
|
|
|
|
cpp_bool KeyMayMatch(const Slice&, const Slice&) nogil except+
|
|
|
|
const_char* Name() nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
cdef extern const FilterPolicy* NewBloomFilterPolicy(int) nogil except+
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
ctypedef void (*create_filter_func)(void*, const Slice*, int, string*)
|
|
|
|
ctypedef cpp_bool (*key_may_match_func)(void*, const Slice&, const Slice&)
|
|
|
|
|
|
|
|
cdef extern from "cpp/filter_policy_wrapper.hpp" namespace "py_rocks":
|
|
|
|
cdef cppclass FilterPolicyWrapper:
|
|
|
|
FilterPolicyWrapper(
|
|
|
|
string,
|
|
|
|
void*,
|
|
|
|
void*,
|
|
|
|
create_filter_func,
|
2014-01-17 20:06:17 +01:00
|
|
|
key_may_match_func) nogil except+
|