Coverage report: /home/ellis/comp/core/ffi/rocksdb/opts.lisp

KindCoveredAll%
expression103249 41.4
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; rocksdb/opts.lisp --- Rocksdb Options FFI
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :rocksdb)
7
 
8
 (define-opt rocksdb-ingestexternalfileoptions)
9
 (defar rocksdb-ingestexternalfileoptions-set-move-files void
10
   (opts (* rocksdb-ingestexternalfileoptions))
11
   (val boolean))
12
 (defar rocksdb-ingestexternalfileoptions-set-snapshot-consistency void
13
   (opts (* rocksdb-ingestexternalfileoptions))
14
   (val boolean))
15
 (defar rocksdb-ingestexternalfileoptions-set-allow-global-seqno void
16
   (opts (* rocksdb-ingestexternalfileoptions))
17
   (val boolean))
18
 (defar rocksdb-ingestexternalfileoptions-set-allow-blocking-flush void
19
   (opts (* rocksdb-ingestexternalfileoptions))
20
   (val boolean))
21
 (defar rocksdb-ingestexternalfileoptions-set-ingest-behind void
22
   (opts (* rocksdb-ingestexternalfileoptions))
23
   (val boolean))
24
 (defar rocksdb-ingestexternalfileoptions-set-fail-if-not-bottommost-level void
25
   (opts (* rocksdb-ingestexternalfileoptions))
26
   (val boolean))
27
 
28
 (export '(rocksdb-ingestexternalfileoptions-set-move-files 
29
           rocksdb-ingestexternalfileoptions-set-snapshot-consistency
30
           rocksdb-ingestexternalfileoptions-set-allow-global-seqno 
31
           rocksdb-ingestexternalfileoptions-set-allow-blocking-flush
32
           rocksdb-ingestexternalfileoptions-set-ingest-behind
33
           rocksdb-ingestexternalfileoptions-set-fail-if-not-bottommost-level))
34
 
35
 (define-opt rocksdb-backup-engine-options)
36
 (defar rocksdb-backup-engine-options-set-backup-dir void
37
   (opts (* rocksdb-backup-engine-options)) (backup-dir c-string))
38
 (defar rocksdb-backup-engine-options-set-env void
39
   (opts (* rocksdb-backup-engine-options)) (val boolean))
40
 (define-opt-accessor rocksdb-backup-engine-options share-table-files)
41
 (define-opt-accessor rocksdb-backup-engine-options sync)
42
 (define-opt-accessor rocksdb-backup-engine-options destroy-old-data)
43
 (define-opt-accessor rocksdb-backup-engine-options backup-log-files)
44
 (define-opt-accessor rocksdb-backup-engine-options backup-rate-limit (unsigned 64))
45
 (define-opt-accessor rocksdb-backup-engine-options restore-rate-limit (unsigned 64))
46
 (define-opt-accessor rocksdb-backup-engine-options callback-trigger-interval-size (unsigned 64))
47
 (define-opt-accessor rocksdb-backup-engine-options max-valid-backups-to-open int)
48
 (define-opt-accessor rocksdb-backup-engine-options shared-files-with-checksum-naming int)
49
 (define-opt rocksdb-restore-options)
50
 (defar rocksdb-restore-options-set-keep-log-files void
51
   (opts (* rocksdb-restore-options))
52
   (v int))
53
 
54
 (define-opt rocksdb-hyper-clock-cache-options)
55
 (defar rocksdb-hyper-clock-cache-options-set-capacity void
56
   (opts (* rocksdb-hyper-clock-cache-options))
57
   (v size-t))
58
 (defar rocksdb-hyper-clock-cache-options-set-estimated-entry-charge void
59
   (opts (* rocksdb-hyper-clock-cache-options))
60
   (v size-t))
61
 (defar rocksdb-hyper-clock-cache-options-set-num-shard-bits void
62
   (opts (* rocksdb-hyper-clock-cache-options))
63
   (v int))
64
 (defar rocksdb-hyper-clock-cache-options-set-memory-allocator void
65
   (opts (* rocksdb-hyper-clock-cache-options))
66
   (malloc (* rocksdb-memory-allocator)))
67
 
68
 (define-opt rocksdb-fifo-compaction-options)
69
 (define-opt rocksdb-transactiondb-options)
70
 (define-opt rocksdb-transaction-options)
71
 (define-opt rocksdb-optimistictransaction-options)
72
 (define-opt rocksdb-envoptions)
73
 (define-opt rocksdb-universal-compaction-options)
74
 
75
 ;;; WAL Read Options
76
 (define-opaque rocksdb-wal-readoptions)
77
 
78
 ;;; Block based Table Options
79
 (define-opaque rocksdb-block-based-table-options)
80
 
81
 (defar rocksdb-block-based-options-create (* rocksdb-block-based-table-options))
82
 (defar rocksdb-block-based-options-destroy void (self (* rocksdb-block-based-table-options)))
83
 (defar rocksdb-block-based-options-set-checksum void
84
   (opt (* rocksdb-block-based-table-options)) (val char))
85
 (defar rocksdb-block-based-options-set-block-size void
86
   (opt (* rocksdb-block-based-table-options)) (block-size size-t))
87
 (defar rocksdb-block-based-options-set-block-size-deviation void
88
   (opt (* rocksdb-block-based-table-options)) (block-size-deviation int))
89
 (defar rocksdb-block-based-options-set-block-restart-interval void
90
   (opt (* rocksdb-block-based-table-options)) (block-restart-interval int))
91
 (defar rocksdb-block-based-options-set-index-block-restart-interval void
92
   (opt (* rocksdb-block-based-table-options)) (index-block-restart-interval char))
93
 (defar rocksdb-block-based-options-set-metadata-block-size void
94
   (opt (* rocksdb-block-based-table-options)) (metadata-block-size unsigned-long))
95
 (defar rocksdb-block-based-options-set-partition-filters void
96
   (opt (* rocksdb-block-based-table-options)) (partition-filters unsigned-char))
97
 (defar rocksdb-block-based-options-set-partition-filters-for-memory void
98
   (opt (* rocksdb-block-based-table-options)) (optimize-filters-for-memory unsigned-char))
99
 (defar rocksdb-block-based-options-set-use-delta-encoding void
100
   (opt (* rocksdb-block-based-table-options)) (use-delta-encoding unsigned-char))
101
 (defar rocksdb-block-based-options-set-no-block-cache void
102
   (opt (* rocksdb-block-based-table-options)) (no-block-cache unsigned-char))
103
 (defar rocksdb-block-based-options-set-block-cache void
104
   (opt (* rocksdb-block-based-table-options)) (block-cache (* rocksdb-cache)))
105
 (defar rocksdb-block-based-options-set-format-version void
106
   (opt (* rocksdb-block-based-table-options)) (val int))
107
 (defar rocksdb-block-based-options-set-index-type void
108
   (opt (* rocksdb-block-based-table-options)) (val int))
109
 (defar rocksdb-block-based-options-set-data-block-index-type void
110
   (opt (* rocksdb-block-based-table-options)) (val int))
111
 (defar rocksdb-block-based-options-set-data-block-hash-ratio void
112
   (opt (* rocksdb-block-based-table-options)) (val double))
113
 (defar rocksdb-block-based-options-set-cache-index-and-filter-blocks void
114
   (opt (* rocksdb-block-based-table-options)) (val unsigned-char))
115
 (defar rocksdb-block-based-options-set-cache-index-and-filter-blocks-with-high-priority void
116
   (opt (* rocksdb-block-based-table-options)) (val unsigned-char))
117
 (defar rocksdb-block-based-options-set-pin-l0-filter-and-index-blocks-in-cache void
118
   (opt (* rocksdb-block-based-table-options)) (val unsigned-char))
119
 (defar rocksdb-block-based-options-set-pin-top-level-index-and-filter void
120
   (opt (* rocksdb-block-based-table-options)) (val unsigned-char))
121
 (defar rocksdb-block-based-options-set-top-level-index-pinning-tier void
122
   (opt (* rocksdb-block-based-table-options))
123
   (i int))
124
 (defar rocksdb-block-based-options-set-partition-pinning-tier void
125
   (opt (* rocksdb-block-based-table-options))
126
   (i int))
127
 (defar rocksdb-block-based-options-set-unpartition-pinning-tier void
128
   (opt (* rocksdb-block-based-table-options))
129
   (i int))
130
 
131
 (export-opt-accessors rocksdb-block-based-options
132
                       checksum
133
                       block-size
134
                       block-size-deviation
135
                       block-restart-interval
136
                       index-block-restart-interval
137
                       metadata-block-size
138
                       partition-filters
139
                       partition-filters-for-memory
140
                       use-delta-encoding
141
                       no-block-cache
142
                       block-cache
143
                       format-version
144
                       index-type
145
                       data-block-index-type
146
                       data-block-hash-ratio
147
                       cache-index-and-filter-blocks
148
                       cache-index-and-filter-blocks-with-high-priority
149
                       pin-l0-filter-and-index-blocks-in-cache
150
                       pin-top-level-index-and-filter)
151
 
152
 ;;; Cuckoo Table Options
153
 (define-opaque rocksdb-cuckoo-table-options)
154
 
155
 ;;; RocksDB Options
156
 (define-opt rocksdb-options)
157
 (define-opt-accessor rocksdb-options create-if-missing)
158
 (define-opt-accessor rocksdb-options create-missing-column-families)
159
 (define-opt-accessor rocksdb-options error-if-exists)
160
 (define-opt-accessor rocksdb-options paranoid-checks)
161
 (define-opt-accessor rocksdb-options compression-options-use-zstd-dict-trainer)
162
 (define-opt-accessor rocksdb-options level-compaction-dynamic-level-bytes (unsigned 8))
163
 (define-opt-accessor rocksdb-options enable-blob-gc)
164
 (define-opt-accessor rocksdb-options allow-ingest-behind)
165
 (define-opt-accessor rocksdb-options skip-stats-update-on-db-open)
166
 (define-opt-accessor rocksdb-options skip-checking-sst-file-sizes-on-db-open)
167
 (define-opt-accessor rocksdb-options enable-blob-files)
168
 (define-opt-accessor rocksdb-options enable-pipelined-write)
169
 (define-opt-accessor rocksdb-options unordered-write)
170
 (define-opt-accessor rocksdb-options allow-mmap-reads)
171
 (define-opt-accessor rocksdb-options allow-mmap-writes)
172
 (define-opt-accessor rocksdb-options use-direct-reads)
173
 (define-opt-accessor rocksdb-options use-direct-io-for-flush-and-compaction)
174
 (define-opt-accessor rocksdb-options is-fd-close-on-exec)
175
 (define-opt-accessor rocksdb-options inplace-update-num-locks size-t)
176
 (define-opt-accessor rocksdb-options inplace-update-support)
177
 (define-opt-accessor rocksdb-options advise-random-on-open)
178
 (define-opt-accessor rocksdb-options atomic-flush)
179
 (define-opt-accessor rocksdb-options manual-wal-flush)
180
 (define-opt-accessor rocksdb-options avoid-unnecessary-blocking-io)
181
 (define-opt-accessor rocksdb-options writable-file-max-buffer-size (unsigned 64))
182
 (define-opt-accessor rocksdb-options info-log-level int)
183
 (define-opt-accessor rocksdb-options write-buffer-size size-t)
184
 (define-opt-accessor rocksdb-options db-write-buffer-size size-t)
185
 (define-opt-accessor rocksdb-options max-open-files int)
186
 (define-opt-accessor rocksdb-options max-file-opening-threads int)
187
 (define-opt-accessor rocksdb-options max-total-wal-size unsigned-long)
188
 (define-opt-accessor rocksdb-options compression-options-zstd-max-train-bytes int)
189
 (define-opt-accessor rocksdb-options compression-options-max-dict-buffer-bytes unsigned-long)
190
 (define-opt-accessor rocksdb-options num-levels int)
191
 (define-opt-accessor rocksdb-options level0-file-num-compaction-trigger int)
192
 (define-opt-accessor rocksdb-options level0-slowdown-writes-trigger int)
193
 (define-opt-accessor rocksdb-options level0-stop-writes-trigger int)
194
 (define-opt-accessor rocksdb-options target-file-size-base unsigned-long)
195
 (define-opt-accessor rocksdb-options target-file-size-multiplier int)
196
 (define-opt-accessor rocksdb-options max-bytes-for-level-base unsigned-long)
197
 (define-opt-accessor rocksdb-options max-bytes-for-level-multiplier double)
198
 (define-opt-accessor rocksdb-options memtable-op-scan-flush-trigger (unsigned 32))
199
 (define-alien-enum (rocksdb-compression-type int)
200
   :none 0
201
   :snappy 1
202
   :zlib 2
203
   :bz2 3
204
   :lz4 4
205
   :lz4hc 5
206
   :xpress 6
207
   :zstd 7)
208
 (defar rocksdb-options-set-compression-options void
209
   (opt (* rocksdb-options))
210
   (a int) (b int) (c int) (d int))
211
 
212
 (defar rocksdb-option-set-block-based-table-factory void
213
   (opt (* rocksdb-options)) (table-opts (* rocksdb-block-based-table-options)))
214
 
215
 (define-opt-accessor rocksdb-options comparator (* rocksdb-comparator))
216
 (defar rocksdb-options-set-merge-operator void
217
   (opt (* rocksdb-options))
218
   (merge-op (* rocksdb-mergeoperator)))
219
 (define-opt-accessor rocksdb-options statistics-level int)
220
 (define-opt-accessor rocksdb-options min-blob-size unsigned-long)
221
 (define-opt-accessor rocksdb-options blob-file-size unsigned-long)
222
 (define-opt-accessor rocksdb-options blob-compression-type int)
223
 
224
 (define-opt-accessor rocksdb-options blob-gc-age-cutoff double)
225
 (define-opt-accessor rocksdb-options blob-gc-force-threshold double)
226
 (define-opt-accessor rocksdb-options blob-compaction-readahead-size unsigned-long)
227
 (define-opt-accessor rocksdb-options blob-file-starting-level int)
228
 (define-opt-accessor rocksdb-options blob-cache (* rocksdb-cache))
229
 (define-opt-accessor rocksdb-options prepopulate-blob-cache int)
230
 (define-opt-accessor rocksdb-options max-write-buffer-number int)
231
 (define-opt-accessor rocksdb-options min-write-buffer-number-to-merge int)
232
 ;; deprecated
233
 ;; (define-opt-accessor rocksdb-options max-write-buffer-number-to-maintain int)
234
 (define-opt-accessor rocksdb-options max-write-buffer-size-to-maintain long)
235
 (define-opt-accessor rocksdb-options max-subcompactions unsigned-int)
236
 (define-opt-accessor rocksdb-options max-background-jobs int)
237
 (define-opt-accessor rocksdb-options max-background-compactions int)
238
 (define-opt-accessor rocksdb-options max-background-flushes int)
239
 (define-opt-accessor rocksdb-options max-log-file-size size-t)
240
 (define-opt-accessor rocksdb-options log-file-time-to-roll size-t)
241
 (define-opt-accessor rocksdb-options keep-log-file-num size-t)
242
 (define-opt-accessor rocksdb-options recycle-log-file-num size-t)
243
 (define-opt-accessor rocksdb-options soft-pending-compaction-bytes-limit size-t)
244
 (define-opt-accessor rocksdb-options hard-pending-compaction-bytes-limit size-t)
245
 (define-opt-accessor rocksdb-options max-manifest-file-size size-t)
246
 (define-opt-accessor rocksdb-options table-cache-numshardbits int)
247
 (define-opt-accessor rocksdb-options arena-block-size size-t)
248
 (define-opt-accessor rocksdb-options use-fsync int)
249
 (defar rocksdb-options-set-db-log-dir void
250
   (opts (* rocksdb-options))
251
   (dir c-string))
252
 (defar rocksdb-options-set-wal-dir void
253
   (opts (* rocksdb-options))
254
   (dir c-string))
255
 (define-opt-accessor rocksdb-options wal-ttl-seconds unsigned-long)
256
 (define-opt-accessor rocksdb-options wal-size-limit-mb unsigned-long)
257
 (define-opt-accessor rocksdb-options manifest-preallocation-size size-t)
258
 (define-opt-accessor rocksdb-options stats-dump-period-sec unsigned-int)
259
 (define-opt-accessor rocksdb-options stats-persist-period-sec unsigned-int)
260
 
261
 (define-opt-accessor rocksdb-options use-adaptive-mutex)
262
 (define-opt-accessor rocksdb-options bytes-per-sync unsigned-long)
263
 (define-opt-accessor rocksdb-options wal-bytes-per-sync unsigned-long)
264
 (define-opt-accessor rocksdb-options file-max-buffer-size unsigned-long)
265
 (define-opt-accessor rocksdb-options allow-concurrent-memtable-write)
266
 (define-opt-accessor rocksdb-options enable-write-thread-adaptive-yield)
267
 (define-opt-accessor rocksdb-options max-sequential-skip-in-iterations unsigned-long)
268
 (define-opt-accessor rocksdb-options disable-auto-compactions)
269
 (define-opt-accessor rocksdb-options optimize-filters-for-hits)
270
 (define-opt-accessor rocksdb-options delete-obsolete-files-period-micros unsigned-long)
271
 (define-opt-accessor rocksdb-options memtable-prefix-bloom-size-ratio double)
272
 (define-opt-accessor rocksdb-options max-compaction-bytes unsigned-long)
273
 (define-opt-accessor rocksdb-options memtable-huge-page-size size-t)
274
 (define-opt-accessor rocksdb-options max-successive-merges size-t)
275
 (define-opt-accessor rocksdb-options bloom-locality unsigned-int)
276
 (define-opt-accessor rocksdb-options report-bg-io-stats)
277
 (define-opt-accessor rocksdb-options experimental-mempurge-threshold double)
278
 (define-opt-accessor rocksdb-options wal-recovery-mode int)
279
 (define-opt-accessor rocksdb-options compression-options-parallel-threads int)
280
 (define-opt-accessor rocksdb-options compression int)
281
 (define-opt-accessor rocksdb-options bottommost-compression int)
282
 (define-opt-accessor rocksdb-options compaction-style int)
283
 (define-opt-accessor rocksdb-options wal-compression int)
284
 #|
285
 rocksdb_k_by_compensated_size_compaction_pri = 0,
286
 rocksdb_k_oldest_largest_seq_first_compaction_pri = 1,
287
 rocksdb_k_oldest_smallest_seq_first_compaction_pri = 2,
288
 rocksdb_k_min_overlapping_ratio_compaction_pri = 3,
289
 rocksdb_k_round_robin_compaction_pri = 4
290
 |#
291
 (define-opt-accessor rocksdb-options compaction-pri int)
292
 ;; (hash-link-list-rep)
293
 ;; (hash-skip-list-rep)
294
 ;; (memtable-vector-rep)
295
 
296
 (defar rocksdb-options-set-row-cache void
297
   (opt (* rocksdb-options))
298
   (cache (* rocksdb-cache)))
299
 
300
 (defar rocksdb-options-set-ratelimiter void
301
   (opt (* rocksdb-options))
302
   (limiter (* rocksdb-ratelimiter)))
303
 
304
 (defar rocksdb-options-set-universal-compaction-options void
305
   (opt (* rocksdb-options))
306
   (opts (* rocksdb-universal-compaction-options)))
307
 
308
 (defar rocksdb-options-set-min-level-to-compress void
309
   (opt (* rocksdb-options))
310
   (level int))
311
 
312
 (defar rocksdb-options-set-plain-table-factory void
313
   (opt (* rocksdb-options))
314
   (i int)
315
   (d double)
316
   (s1 size-t)
317
   (s2 size-t)
318
   (c char)
319
   (f1 unsigned-char)
320
   (f2 unsigned-char))
321
 
322
 (defar rocksdb-options-prepare-for-bulk-load void
323
   (opts (* rocksdb-options)))
324
 
325
 (defar rocksdb-options-increase-parallelism void 
326
   (opt (* rocksdb-options)) (total-threads int))
327
 
328
 (defar rocksdb-options-optimize-level-style-compaction void 
329
   (opt (* rocksdb-options))
330
   (memtable-memory-budget unsigned-long))
331
 
332
 (defar rocksdb-options-enable-statistics void
333
   (opt (* rocksdb-options)))
334
 
335
 (defar rocksdb-options-statistics-get-string c-string
336
   (opt (* rocksdb-options)))
337
 
338
 (defar rocksdb-options-statistics-get-ticker-count unsigned-long
339
   (opt (* rocksdb-options))
340
   (ticker-type unsigned-int))
341
 
342
 (defar rocksdb-options-statistics-get-histogram-data void
343
   (opt (* rocksdb-options))
344
   (histogram-type unsigned-int)
345
   (data (* rocksdb-statistics-histogram-data)))
346
 
347
 (defar rocksdb-options-set-db-paths void
348
   (opt (* rocksdb-options))
349
   (paths (array (* rocksdb-dbpath)))
350
   (num-paths size-t))
351
 
352
 (defar rocksdb-options-set-cf-paths void
353
   (opt (* rocksdb-options))
354
   (paths (array (* rocksdb-dbpath)))
355
   (num-paths size-t))
356
 
357
 (defar rocksdb-options-set-env void
358
   (opts (* rocksdb-options))
359
   (env (* rocksdb-env)))
360
 
361
 (defar rocksdb-options-set-info-log void
362
   (opts (* rocksdb-options))
363
   (logger (* rocksdb-logger)))
364
 
365
 (defar rocksdb-options-set-uint64add-merge-operator void
366
   (opt (* rocksdb-options)))
367
 
368
 (defar rocksdb-options-set-compression-per-level void
369
   (opt (* rocksdb-options))
370
   (levels (array int))
371
   (num-levels size-t))
372
 
373
 (defar rocksdb-options-set-prefix-extractor void
374
   (self (* rocksdb-options))
375
   (val (* rocksdb-slicetransform)))
376
 
377
 ;;; RocksDB Write Options
378
 (define-opt rocksdb-writeoptions)
379
 (define-opt-accessor rocksdb-writeoptions sync)
380
 (define-opt-accessor rocksdb-writeoptions disable-wal)
381
 (define-opt-accessor rocksdb-writeoptions ignore-missing-column-families)
382
 (define-opt-accessor rocksdb-writeoptions no-slowdown)
383
 (define-opt-accessor rocksdb-writeoptions low-pri)
384
 (define-opt-accessor rocksdb-writeoptions memtable-insert-hint-per-batch)
385
 ;;; RocksDB Read Options
386
 (define-opt rocksdb-readoptions)
387
 (define-opt-accessor rocksdb-readoptions verify-checksums)
388
 (define-opt-accessor rocksdb-readoptions fill-cache)
389
 (define-opt-accessor rocksdb-readoptions read-tier int)
390
 (define-opt-accessor rocksdb-readoptions tailing)
391
 (define-opt-accessor rocksdb-readoptions total-order-seek)
392
 (define-opt-accessor rocksdb-readoptions skippable-internal-keys unsigned-long)
393
 (define-opt-accessor rocksdb-readoptions purge-on-iterator-cleanup)
394
 (define-opt-accessor rocksdb-readoptions deadline unsigned-long)
395
 (define-opt-accessor rocksdb-readoptions io-timeout unsigned-long)
396
 (define-opt-accessor rocksdb-readoptions async-io)
397
 (defar rocksdb-readoptions-set-snapshot void
398
   (self (* rocksdb-readoptions))
399
   (val (* rocksdb-snapshot)))
400
 (defar rocksdb-readoptions-set-iterate-upper-bound void
401
   (self (* rocksdb-readoptions))
402
   (key (* char))
403
   (keylen size-t))
404
 (defar rocksdb-readoptions-set-iterate-lower-bound void
405
   (self (* rocksdb-readoptions))
406
   (key (* char))
407
   (keylen size-t))
408
 
409
 (defar rocksdb-readoptions-set-readahead-size void
410
   (self (* rocksdb-readoptions))
411
   (val size-t))
412
 
413
 (defar rocksdb-readoptions-set-prefix-same-as-start void
414
   (self (* rocksdb-readoptions))
415
   (val unsigned-char))
416
 
417
 (defar rocksdb-readoptions-set-ignore-range-deletions void
418
   (self (* rocksdb-readoptions))
419
   (val unsigned-char))
420
 
421
 (defar rocksdb-readoptions-set-timestamp void
422
   (self (* rocksdb-readoptions))
423
   (ts (* char))
424
   (tslen size-t))
425
 
426
 (defar rocksdb-readoptions-set-iter-start-ts void
427
   (self (* rocksdb-readoptions))
428
   (ts (* char))
429
   (tslen size-t))
430
 
431
 (defar rocksdb-readoptions-set-auto-readahead-size void
432
   (self (* rocksdb-readoptions))
433
   (val unsigned-char))
434
 
435
 ;;; RocksDB Flush Options
436
 (define-opt rocksdb-flushoptions)
437
 (define-opt-accessor rocksdb-flushoptions wait)
438
 ;;; RocksDB Compact Options
439
 (define-alien-enum (rocksdb-compaction-type int)
440
   :level 0
441
   :universal 1
442
   :fifo 2)
443
 
444
 (define-alien-enum (rocksdb-compaction-pri int)
445
   :compensated-size 0
446
   :oldest-largest 1
447
   :oldest-smallest 2
448
   :min-overlapping-ratio 3
449
   :round-robin 4)
450
 
451
 (define-opt rocksdb-compactoptions)
452
 (define-opt-accessor rocksdb-compactoptions exclusive-manual-compaction)
453
 (define-opt-accessor rocksdb-compactoptions bottommost-level-compaction)
454
 (define-opt-accessor rocksdb-compactoptions change-level)
455
 (define-opt-accessor rocksdb-compactoptions target-level int)
456
 (define-opt-accessor rocksdb-compactoptions target-path-id int)
457
 (define-opt-accessor rocksdb-compactoptions allow-write-stall unsigned-char)
458
 (define-opt-accessor rocksdb-compactoptions max-subcompactions int)
459
 ;;; RocksDB LRU Cache Options
460
 (define-opt rocksdb-lru-cache-options)
461
 
462
 (defar rocksdb-lru-cache-options-set-capacity void
463
   (self (* rocksdb-lru-cache-options))
464
   (val size-t))
465
 
466
 (defar rocksdb-lru-cache-options-set-num-shard-bits void
467
   (self (* rocksdb-lru-cache-options))
468
   (val int))
469
 
470
 (defar rocksdb-lru-cache-options-set-memory-allocator void
471
   (self (* rocksdb-lru-cache-options))
472
   (val (* rocksdb-memory-allocator)))
473
 
474
 (export-opt-accessors rocksdb-lru-cache-options
475
                       capacity
476
                       num-shard-bits
477
                       memory-allocator)
478
 
479
 #|
480
 Load the latest rocksdb options from the specified db_path.
481
 
482
 On success, num_column_families will be updated with a non-zero
483
 number indicating the number of column families.
484
 The returned db_options, column_family_names, and column_family_options
485
 should be released via rocksdb_load_latest_options_destroy().
486
 
487
 On error, a non-null errptr that includes the error message will be
488
 returned.  db_options, column_family_names, and column_family_options
489
 will be set to NULL.
490
 |#
491
 (def-with-errptr rocksdb-load-latest-options 
492
   void
493
   (db-path c-string)
494
   (env (* rocksdb-env))
495
   (ignore-unknown-options boolean)
496
   (cache (* rocksdb-cache))
497
   (db-options (* (* rocksdb-options)))
498
   (num-column-families (* size-t))
499
   (column-family-names (* (* (* char))))
500
   (column-family-options (* (* (* rocksdb-options)))))
501
 
502
 (defar rocksdb-load-latest-options-destroy void
503
   (db-options (* rocksdb-options))
504
   (list-column-family-names (* c-string))
505
   (list-column-family-options (* (* rocksdb-options)))
506
   (len size-t))
507
 
508
 (def-with-errptr rocksdb-set-options void
509
   (db (* rocksdb))
510
   (count int)
511
   (keys (array c-string))
512
   (values (array c-string)))
513
 
514
 (def-with-errptr rocksdb-set-options-cf 
515
   void
516
   (db (* rocksdb))
517
   (handle (* rocksdb-column-family-handle))
518
   (count int)
519
   (keys (array (array unsigned-char)))
520
   (values (array (array unsigned-char))))
521
 
522
 (defar rocksdb-options-create-copy (* rocksdb-options)
523
   (src (* rocksdb-options)))
524
 
525
 ;;; Aliases
526
 ;; some of the RocksDB options don't follow the standard naming
527
 ;; convention of 'rocksdb-*-set-*' and 'rocksdb-*-get-*'. In order to
528
 ;; remove the need for special-case handling in the high-level
529
 ;; interface we define them as aliases
530
 (setf (symbol-function 'rocksdb-options-set-parallelism) #'rocksdb-options-increase-parallelism)
531
 
532
 (declaim (inline rocksdb-options-set-enable-statistics rocksdb-options-set-prepare-for-bulk-load))
533
 (defun rocksdb-options-set-enable-statistics (opt x)
534
   (when x
535
     (rocksdb-options-enable-statistics opt)))
536
 
537
 (defun rocksdb-options-set-prepare-for-bulk-load (opt x)
538
   (when x
539
     (rocksdb-options-prepare-for-bulk-load opt)))