Skip to content

Commit 6716ac2

Browse files
committed
Add types.pxd to make types available to all modules
1 parent a5c23fa commit 6716ac2

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

rocksdb/db.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from libcpp.vector cimport vector
77
from libcpp.map cimport map
88
from libcpp.unordered_map cimport unordered_map
99
from libcpp.memory cimport shared_ptr
10+
from .types cimport SequenceNumber
1011
from .slice_ cimport Slice
1112
from .snapshot cimport Snapshot
1213
from .iterator cimport Iterator
@@ -46,7 +47,6 @@ cdef extern from "cpp/write_batch_iter_helper.hpp" namespace "py_rocks":
4647

4748

4849
cdef extern from "rocksdb/db.h" namespace "rocksdb":
49-
ctypedef uint64_t SequenceNumber
5050
string kDefaultColumnFamilyName
5151

5252
# todo TableProperties

rocksdb/metadata.pxd

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ from libcpp cimport bool as cpp_bool
22
from libcpp.string cimport string
33
from libcpp.vector cimport vector
44
from libc.stdint cimport uint64_t
5-
from libc.stdint cimport uint32_t
65
from libc.stdint cimport int64_t
7-
from libc.stdint cimport int32_t
86
from .logger cimport Logger
9-
from .slice_ cimport Slice
10-
from .snapshot cimport Snapshot
11-
from .db cimport SequenceNumber
7+
from .types cimport SequenceNumber
128

139
cdef extern from "rocksdb/metadata.h" namespace "rocksdb":
1410
cdef cppclass ColumnFamilyMetaData:

rocksdb/options.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ from . cimport advanced_options
1919
from .advanced_options cimport CompressionOptions
2020
from .advanced_options cimport AdvancedColumnFamilyOptions
2121
from .env cimport Env
22-
from .db cimport SequenceNumber
22+
from .types cimport SequenceNumber
2323

2424
cdef extern from "rocksdb/options.h" namespace "rocksdb":
2525
ctypedef enum CompressionType:

rocksdb/types.pxd

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from libc.stdint cimport uint64_t, uint32_t
2+
from .slice_ cimport Slice
3+
from libcpp.string cimport string
4+
from libcpp cimport bool as cpp_bool
5+
6+
cdef extern from "rocksdb/types.h" namespace "rocksdb":
7+
ctypedef uint64_t SequenceNumber
8+
9+
cdef enum EntryType:
10+
kEntryPut
11+
kEntryDelete
12+
kEntrySingleDelete
13+
kEntryMerge
14+
kEntryRangeDeletion
15+
kEntryBlobIndex
16+
kEntryOther
17+
18+
cdef cppclass FullKey:
19+
Slice user_key
20+
SequenceNumber sequence
21+
EntryType type
22+
23+
FullKey() except+
24+
FullKey(const Slice&, const SequenceNumber&, EntryType) except+
25+
string DebugString(cpp_bool hex) nogil except+
26+
void clear() nogil except+
27+
28+
cpp_bool ParseFullKey(const Slice&, FullKey*)

0 commit comments

Comments
 (0)