87
|
1
|
(in-package :rocksdb) |
93
|
2
|
|
87
|
3
|
;;; DB |
|
4
|
(def-with-errptr rocksdb-open (* rocksdb) |
|
5
|
(opt (* rocksdb-options)) |
|
6
|
(name c-string)) |
|
7
|
|
|
8
|
(define-alien-routine rocksdb-close void |
|
9
|
(db (* rocksdb))) |
|
10
|
|
|
11
|
(define-alien-routine rocksdb-cancel-all-background-work void |
|
12
|
(db (* rocksdb)) |
|
13
|
(wait boolean)) |
|
14
|
|
|
15
|
(def-with-errptr rocksdb-put |
|
16
|
void |
|
17
|
(db (* rocksdb)) |
|
18
|
(options (* rocksdb-writeoptions)) |
|
19
|
(key (* char)) |
|
20
|
(keylen size-t) |
|
21
|
(val (* char)) |
|
22
|
(vallen size-t)) |
|
23
|
|
|
24
|
(def-with-errptr rocksdb-get |
|
25
|
(* char) |
|
26
|
(db (* rocksdb)) |
|
27
|
(options (* rocksdb-readoptions)) |
|
28
|
(key (* char)) |
|
29
|
(keylen size-t) |
|
30
|
(vallen (* size-t))) |
|
31
|
|
|
32
|
(def-with-errptr rocksdb-delete |
|
33
|
void |
|
34
|
(db (* rocksdb)) |
|
35
|
(options (* rocksdb-writeoptions)) |
|
36
|
(key (* char)) |
|
37
|
(keylen size-t)) |
|
38
|
|
|
39
|
(def-with-errptr rocksdb-merge |
|
40
|
void |
|
41
|
(db (* rocksdb)) |
|
42
|
(opt (* rocksdb-writeoptions)) |
|
43
|
(key (* char)) |
|
44
|
(keylen size-t) |
|
45
|
(val (* char)) |
|
46
|
(vallen size-t)) |
|
47
|
|
|
48
|
(def-with-errptr rocksdb-merge-cf |
|
49
|
void |
|
50
|
(db (* rocksdb)) |
|
51
|
(opt (* rocksdb-writeoptions)) |
|
52
|
(cf (* rocksdb-column-family-handle)) |
|
53
|
(key (* char)) |
|
54
|
(keylen size-t) |
|
55
|
(val (* char)) |
|
56
|
(vallen size-t)) |
|
57
|
|
|
58
|
(def-with-errptr rocksdb-write |
|
59
|
void |
|
60
|
(db (* rocksdb)) |
|
61
|
(opt (* rocksdb-writeoptions)) |
|
62
|
(batch (* rocksdb-writebatch))) |
|
63
|
|
|
64
|
(def-with-errptr rocksdb-get-cf |
|
65
|
(* char) |
|
66
|
(db (* rocksdb)) |
|
67
|
(opt (* rocksdb-readoptions)) |
|
68
|
(cf (* rocksdb-column-family-handle)) |
|
69
|
(key (* char)) |
|
70
|
(keylen size-t) |
|
71
|
(vallen (* size-t))) |
|
72
|
|
|
73
|
(define-alien-routine rocksdb-multi-get void |
|
74
|
(db (* rocksdb)) |
|
75
|
(opt (* rocksdb-readoptions)) |
|
76
|
(num-keys size-t) |
|
77
|
(keys-list (array c-string)) |
|
78
|
(keys-list-sizes (array size-t)) |
|
79
|
(values-list (array c-string)) |
|
80
|
(values-list-sizes (array size-t)) |
|
81
|
(errs (array rocksdb-errptr))) |
|
82
|
|
|
83
|
(define-alien-routine rocksdb-multi-get-cf void |
|
84
|
(db (* rocksdb)) |
|
85
|
(opt (* rocksdb-readoptions)) |
|
86
|
(cfs (array rocksdb-column-family-handle)) |
|
87
|
(num-keys size-t) |
|
88
|
(keys-list (array c-string)) |
|
89
|
(keys-list-sizes (array size-t)) |
|
90
|
(values-list (array c-string)) |
|
91
|
(values-list-sizes (array size-t)) |
|
92
|
(errs (array rocksdb-errptr))) |
|
93
|
|
|
94
|
(define-alien-routine rocksdb-cache-create-lru (* rocksdb) (capacity unsigned-int)) |
|
95
|
|
|
96
|
(def-with-errptr rocksdb-flush void |
|
97
|
(db (* rocksdb)) |
|
98
|
(options (* rocksdb-flushoptions))) |
|
99
|
|
|
100
|
;;; CF |
|
101
|
(def-with-errptr rocksdb-create-column-family |
|
102
|
(* rocksdb-column-family-handle) |
|
103
|
(db (* rocksdb)) |
|
104
|
(column-family-options (* rocksdb-options)) |
|
105
|
(column-family-name c-string)) |
|
106
|
|
|
107
|
(def-with-errptr rocksdb-create-column-families |
|
108
|
(array rocksdb-column-family-handle) |
|
109
|
(db (* rocksdb)) |
|
110
|
(column-family-options (* rocksdb-options)) |
|
111
|
(num-column-familes int) |
|
112
|
(column-family-names (array c-string)) |
|
113
|
(lencfs (* size-t))) |
|
114
|
|
|
115
|
(define-alien-routine rocksdb-create-column-families-destroy void |
|
116
|
(list (array rocksdb-column-family-handle))) |
|
117
|
|
|
118
|
(define-alien-routine rocksdb-column-family-handle-destroy void |
|
119
|
(* rocksdb-column-family-handle)) |
|
120
|
|
|
121
|
(define-alien-routine rocksdb-column-family-handle-get-id unsigned-int |
|
122
|
(* rocksdb-column-family-handle)) |
|
123
|
|
|
124
|
(define-alien-routine rocksdb-column-family-handle-get-name c-string |
|
125
|
(handle (* rocksdb-column-family-handle)) |
|
126
|
(name-len (* size-t))) |
|
127
|
|
|
128
|
(def-with-errptr rocksdb-drop-column-family |
|
129
|
void |
|
130
|
(db (* rocksdb)) |
|
131
|
(handle (* rocksdb-column-family-handle))) |
|
132
|
|
|
133
|
(def-with-errptr rocksdb-open-column-families |
|
134
|
(* rocksdb) |
|
135
|
(options (* rocksdb-options)) |
|
136
|
(name c-string) |
|
137
|
(num-column-families int) |
|
138
|
(column-family-names (array c-string)) |
|
139
|
(column-family-options (array rocksdb-options)) |
|
140
|
(column-family-handles (array rocksdb-column-family-handle))) |
|
141
|
|
|
142
|
(def-with-errptr rocksdb-list-column-families |
|
143
|
(array c-string) |
|
144
|
(opt (* rocksdb-options)) |
|
145
|
(name c-string) |
|
146
|
(lencf (* size-t))) |
|
147
|
|
|
148
|
(define-alien-routine rocksdb-list-column-families-destroy void |
|
149
|
(list (array c-string)) |
|
150
|
(len size-t)) |
|
151
|
|
|
152
|
(def-with-errptr rocksdb-put-cf |
|
153
|
void |
|
154
|
(db (* rocksdb)) |
|
155
|
(opt (* rocksdb-writeoptions)) |
|
156
|
(cf (* rocksdb-column-family-handle)) |
|
157
|
(key (* char)) |
|
158
|
(keylen size-t) |
|
159
|
(val (* char)) |
|
160
|
(vallen size-t)) |
|
161
|
|
|
162
|
(def-with-errptr rocksdb-delete-cf |
|
163
|
void |
|
164
|
(db (* rocksdb)) |
|
165
|
(options (* rocksdb-writeoptions)) |
|
166
|
(cf (* rocksdb-column-family-handle)) |
|
167
|
(key (* char)) |
|
168
|
(keylen size-t)) |
|
169
|
|
|
170
|
(def-with-errptr rocksdb-delete-range-cf |
|
171
|
void |
|
172
|
(db (* rocksdb)) |
|
173
|
(options (* rocksdb-writeoptions)) |
|
174
|
(cf (* rocksdb-column-family-handle)) |
|
175
|
(start-key (* char)) |
|
176
|
(start-key-len size-t) |
|
177
|
(end-key (* char)) |
|
178
|
(end-key-len size-t)) |
|
179
|
|
|
180
|
(def-with-errptr rocksdb-destroy-db void |
|
181
|
(opts (* rocksdb-options)) |
|
182
|
(path c-string)) |
|
183
|
|
|
184
|
;;; Iterators |
|
185
|
(define-alien-routine rocksdb-create-iterator (* rocksdb-iterator) |
|
186
|
(db (* rocksdb)) |
|
187
|
(opt (* rocksdb-readoptions))) |
|
188
|
(define-alien-routine rocksdb-iter-destroy void |
|
189
|
(iter (* rocksdb-iterator))) |
|
190
|
(define-alien-routine rocksdb-iter-seek-to-first void |
|
191
|
(iter (* rocksdb-iterator))) |
|
192
|
(define-alien-routine rocksdb-iter-valid boolean |
|
193
|
(iter (* rocksdb-iterator))) |
|
194
|
(define-alien-routine rocksdb-iter-next void |
|
195
|
(iter (* rocksdb-iterator))) |
|
196
|
(define-alien-routine rocksdb-iter-prev void |
|
197
|
(iter (* rocksdb-iterator))) |
|
198
|
(define-alien-routine rocksdb-iter-key (* char) |
|
199
|
(iter (* rocksdb-iterator)) |
|
200
|
(klen-ptr (* size-t))) |
|
201
|
(define-alien-routine rocksdb-iter-value (* char) |
|
202
|
(iter (* rocksdb-iterator)) |
|
203
|
(vlen-ptr (* size-t))) |
|
204
|
|
|
205
|
;;; Backup |
|
206
|
(def-with-errptr rocksdb-backup-engine-open |
|
207
|
(* rocksdb-backup-engine) |
|
208
|
(opts (* rocksdb-options)) |
|
209
|
(path (* char))) |
|
210
|
|
|
211
|
(def-with-errptr rocksdb-backup-engine-create-new-backup |
|
212
|
void |
|
213
|
(be (* rocksdb-backup-engine)) |
|
214
|
(db (* rocksdb))) |
|
215
|
|
|
216
|
(def-with-errptr rocksdb-backup-engine-restore-db-from-latest-backup |
|
217
|
void |
|
218
|
(be (* rocksdb-backup-engine)) |
|
219
|
(db-dir (* char)) |
|
220
|
(wal-dir (* char)) |
|
221
|
(res-opts (* rocksdb-restore-options))) |
|
222
|
|
|
223
|
(def-with-errptr rocksdb-backup-engine-restore-db-from-backup |
|
224
|
void |
|
225
|
(be (* rocksdb-backup-engine)) |
|
226
|
(db-dir (* char)) |
|
227
|
(wal-dir (* char)) |
|
228
|
(res-opts (* rocksdb-restore-options)) |
|
229
|
(backup-id unsigned-int)) |
|
230
|
|
|
231
|
(define-alien-routine rocksdb-backup-engine-close void |
|
232
|
(be (* rocksdb-backup-engine))) |
|
233
|
|
|
234
|
;;; Transactions |
|
235
|
(define-alien-routine rocksdb-transaction-begin (* rocksdb-transaction) |
|
236
|
(wopts (* rocksdb-writeoptions)) |
|
237
|
(topts (* rocksdb-transaction-options)) |
|
238
|
(told (* rocksdb-transaction))) |
|
239
|
|
|
240
|
(def-with-errptr rocksdb-transactiondb-open |
|
241
|
(* rocksdb-transactiondb) |
|
242
|
(opts (* rocksdb-options)) |
|
243
|
(topts (* rocksdb-transactiondb-options)) |
|
244
|
(name (* char))) |
|
245
|
|
|
246
|
(define-alien-routine rocksdb-transactiondb-close void |
|
247
|
(tdb (* rocksdb-transactiondb))) |
|
248
|
|
|
249
|
;;; BlobDB |