]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. |
2 | // This source code is licensed under both the GPLv2 (found in the | |
3 | // COPYING file in the root directory) and Apache 2.0 License | |
4 | // (found in the LICENSE.Apache file in the root directory). | |
5 | ||
6 | /* Copyright (c) 2011 The LevelDB Authors. All rights reserved. | |
7c673cae FG |
7 | Use of this source code is governed by a BSD-style license that can be |
8 | found in the LICENSE file. See the AUTHORS file for names of contributors. | |
9 | ||
10 | C bindings for rocksdb. May be useful as a stable ABI that can be | |
11 | used by programs that keep rocksdb in a shared library, or for | |
12 | a JNI api. | |
13 | ||
14 | Does not support: | |
15 | . getters for the option types | |
16 | . custom comparators that implement key shortening | |
17 | . capturing post-write-snapshot | |
18 | . custom iter, db, env, cache implementations using just the C bindings | |
19 | ||
20 | Some conventions: | |
21 | ||
22 | (1) We expose just opaque struct pointers and functions to clients. | |
23 | This allows us to change internal representations without having to | |
24 | recompile clients. | |
25 | ||
26 | (2) For simplicity, there is no equivalent to the Slice type. Instead, | |
27 | the caller has to pass the pointer and length as separate | |
28 | arguments. | |
29 | ||
30 | (3) Errors are represented by a null-terminated c string. NULL | |
31 | means no error. All operations that can raise an error are passed | |
32 | a "char** errptr" as the last argument. One of the following must | |
33 | be true on entry: | |
34 | *errptr == NULL | |
35 | *errptr points to a malloc()ed null-terminated error message | |
36 | On success, a leveldb routine leaves *errptr unchanged. | |
37 | On failure, leveldb frees the old value of *errptr and | |
38 | set *errptr to a malloc()ed error message. | |
39 | ||
40 | (4) Bools have the type unsigned char (0 == false; rest == true) | |
41 | ||
42 | (5) All of the pointer arguments must be non-NULL. | |
43 | */ | |
44 | ||
7c673cae FG |
45 | #pragma once |
46 | ||
47 | #ifdef _WIN32 | |
48 | #ifdef ROCKSDB_DLL | |
49 | #ifdef ROCKSDB_LIBRARY_EXPORTS | |
50 | #define ROCKSDB_LIBRARY_API __declspec(dllexport) | |
51 | #else | |
52 | #define ROCKSDB_LIBRARY_API __declspec(dllimport) | |
53 | #endif | |
54 | #else | |
55 | #define ROCKSDB_LIBRARY_API | |
56 | #endif | |
57 | #else | |
58 | #define ROCKSDB_LIBRARY_API | |
59 | #endif | |
60 | ||
61 | #ifdef __cplusplus | |
62 | extern "C" { | |
63 | #endif | |
64 | ||
65 | #include <stdarg.h> | |
66 | #include <stddef.h> | |
67 | #include <stdint.h> | |
68 | ||
69 | /* Exported types */ | |
70 | ||
71 | typedef struct rocksdb_t rocksdb_t; | |
72 | typedef struct rocksdb_backup_engine_t rocksdb_backup_engine_t; | |
73 | typedef struct rocksdb_backup_engine_info_t rocksdb_backup_engine_info_t; | |
74 | typedef struct rocksdb_restore_options_t rocksdb_restore_options_t; | |
75 | typedef struct rocksdb_cache_t rocksdb_cache_t; | |
76 | typedef struct rocksdb_compactionfilter_t rocksdb_compactionfilter_t; | |
77 | typedef struct rocksdb_compactionfiltercontext_t | |
78 | rocksdb_compactionfiltercontext_t; | |
79 | typedef struct rocksdb_compactionfilterfactory_t | |
80 | rocksdb_compactionfilterfactory_t; | |
81 | typedef struct rocksdb_comparator_t rocksdb_comparator_t; | |
11fdf7f2 | 82 | typedef struct rocksdb_dbpath_t rocksdb_dbpath_t; |
7c673cae FG |
83 | typedef struct rocksdb_env_t rocksdb_env_t; |
84 | typedef struct rocksdb_fifo_compaction_options_t rocksdb_fifo_compaction_options_t; | |
85 | typedef struct rocksdb_filelock_t rocksdb_filelock_t; | |
86 | typedef struct rocksdb_filterpolicy_t rocksdb_filterpolicy_t; | |
87 | typedef struct rocksdb_flushoptions_t rocksdb_flushoptions_t; | |
88 | typedef struct rocksdb_iterator_t rocksdb_iterator_t; | |
89 | typedef struct rocksdb_logger_t rocksdb_logger_t; | |
90 | typedef struct rocksdb_mergeoperator_t rocksdb_mergeoperator_t; | |
91 | typedef struct rocksdb_options_t rocksdb_options_t; | |
92 | typedef struct rocksdb_compactoptions_t rocksdb_compactoptions_t; | |
93 | typedef struct rocksdb_block_based_table_options_t | |
94 | rocksdb_block_based_table_options_t; | |
95 | typedef struct rocksdb_cuckoo_table_options_t | |
96 | rocksdb_cuckoo_table_options_t; | |
97 | typedef struct rocksdb_randomfile_t rocksdb_randomfile_t; | |
98 | typedef struct rocksdb_readoptions_t rocksdb_readoptions_t; | |
99 | typedef struct rocksdb_seqfile_t rocksdb_seqfile_t; | |
100 | typedef struct rocksdb_slicetransform_t rocksdb_slicetransform_t; | |
101 | typedef struct rocksdb_snapshot_t rocksdb_snapshot_t; | |
102 | typedef struct rocksdb_writablefile_t rocksdb_writablefile_t; | |
103 | typedef struct rocksdb_writebatch_t rocksdb_writebatch_t; | |
104 | typedef struct rocksdb_writebatch_wi_t rocksdb_writebatch_wi_t; | |
105 | typedef struct rocksdb_writeoptions_t rocksdb_writeoptions_t; | |
106 | typedef struct rocksdb_universal_compaction_options_t rocksdb_universal_compaction_options_t; | |
107 | typedef struct rocksdb_livefiles_t rocksdb_livefiles_t; | |
108 | typedef struct rocksdb_column_family_handle_t rocksdb_column_family_handle_t; | |
109 | typedef struct rocksdb_envoptions_t rocksdb_envoptions_t; | |
110 | typedef struct rocksdb_ingestexternalfileoptions_t rocksdb_ingestexternalfileoptions_t; | |
111 | typedef struct rocksdb_sstfilewriter_t rocksdb_sstfilewriter_t; | |
112 | typedef struct rocksdb_ratelimiter_t rocksdb_ratelimiter_t; | |
11fdf7f2 TL |
113 | typedef struct rocksdb_perfcontext_t rocksdb_perfcontext_t; |
114 | typedef struct rocksdb_pinnableslice_t rocksdb_pinnableslice_t; | |
115 | typedef struct rocksdb_transactiondb_options_t rocksdb_transactiondb_options_t; | |
116 | typedef struct rocksdb_transactiondb_t rocksdb_transactiondb_t; | |
117 | typedef struct rocksdb_transaction_options_t rocksdb_transaction_options_t; | |
118 | typedef struct rocksdb_optimistictransactiondb_t | |
119 | rocksdb_optimistictransactiondb_t; | |
120 | typedef struct rocksdb_optimistictransaction_options_t | |
121 | rocksdb_optimistictransaction_options_t; | |
122 | typedef struct rocksdb_transaction_t rocksdb_transaction_t; | |
123 | typedef struct rocksdb_checkpoint_t rocksdb_checkpoint_t; | |
124 | typedef struct rocksdb_wal_iterator_t rocksdb_wal_iterator_t; | |
125 | typedef struct rocksdb_wal_readoptions_t rocksdb_wal_readoptions_t; | |
126 | typedef struct rocksdb_memory_consumers_t rocksdb_memory_consumers_t; | |
127 | typedef struct rocksdb_memory_usage_t rocksdb_memory_usage_t; | |
7c673cae FG |
128 | |
129 | /* DB operations */ | |
130 | ||
131 | extern ROCKSDB_LIBRARY_API rocksdb_t* rocksdb_open( | |
132 | const rocksdb_options_t* options, const char* name, char** errptr); | |
133 | ||
11fdf7f2 TL |
134 | extern ROCKSDB_LIBRARY_API rocksdb_t* rocksdb_open_with_ttl( |
135 | const rocksdb_options_t* options, const char* name, int ttl, char** errptr); | |
136 | ||
7c673cae FG |
137 | extern ROCKSDB_LIBRARY_API rocksdb_t* rocksdb_open_for_read_only( |
138 | const rocksdb_options_t* options, const char* name, | |
139 | unsigned char error_if_log_file_exist, char** errptr); | |
140 | ||
141 | extern ROCKSDB_LIBRARY_API rocksdb_backup_engine_t* rocksdb_backup_engine_open( | |
142 | const rocksdb_options_t* options, const char* path, char** errptr); | |
143 | ||
144 | extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_create_new_backup( | |
145 | rocksdb_backup_engine_t* be, rocksdb_t* db, char** errptr); | |
146 | ||
11fdf7f2 TL |
147 | extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_create_new_backup_flush( |
148 | rocksdb_backup_engine_t* be, rocksdb_t* db, unsigned char flush_before_backup, | |
149 | char** errptr); | |
150 | ||
7c673cae FG |
151 | extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_purge_old_backups( |
152 | rocksdb_backup_engine_t* be, uint32_t num_backups_to_keep, char** errptr); | |
153 | ||
154 | extern ROCKSDB_LIBRARY_API rocksdb_restore_options_t* | |
155 | rocksdb_restore_options_create(); | |
156 | extern ROCKSDB_LIBRARY_API void rocksdb_restore_options_destroy( | |
157 | rocksdb_restore_options_t* opt); | |
158 | extern ROCKSDB_LIBRARY_API void rocksdb_restore_options_set_keep_log_files( | |
159 | rocksdb_restore_options_t* opt, int v); | |
160 | ||
11fdf7f2 TL |
161 | extern ROCKSDB_LIBRARY_API void |
162 | rocksdb_backup_engine_verify_backup(rocksdb_backup_engine_t* be, | |
163 | uint32_t backup_id, char** errptr); | |
164 | ||
7c673cae FG |
165 | extern ROCKSDB_LIBRARY_API void |
166 | rocksdb_backup_engine_restore_db_from_latest_backup( | |
167 | rocksdb_backup_engine_t* be, const char* db_dir, const char* wal_dir, | |
168 | const rocksdb_restore_options_t* restore_options, char** errptr); | |
169 | ||
170 | extern ROCKSDB_LIBRARY_API const rocksdb_backup_engine_info_t* | |
171 | rocksdb_backup_engine_get_backup_info(rocksdb_backup_engine_t* be); | |
172 | ||
173 | extern ROCKSDB_LIBRARY_API int rocksdb_backup_engine_info_count( | |
174 | const rocksdb_backup_engine_info_t* info); | |
175 | ||
176 | extern ROCKSDB_LIBRARY_API int64_t | |
177 | rocksdb_backup_engine_info_timestamp(const rocksdb_backup_engine_info_t* info, | |
178 | int index); | |
179 | ||
180 | extern ROCKSDB_LIBRARY_API uint32_t | |
181 | rocksdb_backup_engine_info_backup_id(const rocksdb_backup_engine_info_t* info, | |
182 | int index); | |
183 | ||
184 | extern ROCKSDB_LIBRARY_API uint64_t | |
185 | rocksdb_backup_engine_info_size(const rocksdb_backup_engine_info_t* info, | |
186 | int index); | |
187 | ||
188 | extern ROCKSDB_LIBRARY_API uint32_t rocksdb_backup_engine_info_number_files( | |
189 | const rocksdb_backup_engine_info_t* info, int index); | |
190 | ||
191 | extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_info_destroy( | |
192 | const rocksdb_backup_engine_info_t* info); | |
193 | ||
194 | extern ROCKSDB_LIBRARY_API void rocksdb_backup_engine_close( | |
195 | rocksdb_backup_engine_t* be); | |
196 | ||
11fdf7f2 TL |
197 | extern ROCKSDB_LIBRARY_API rocksdb_checkpoint_t* |
198 | rocksdb_checkpoint_object_create(rocksdb_t* db, char** errptr); | |
199 | ||
200 | extern ROCKSDB_LIBRARY_API void rocksdb_checkpoint_create( | |
201 | rocksdb_checkpoint_t* checkpoint, const char* checkpoint_dir, | |
202 | uint64_t log_size_for_flush, char** errptr); | |
203 | ||
204 | extern ROCKSDB_LIBRARY_API void rocksdb_checkpoint_object_destroy( | |
205 | rocksdb_checkpoint_t* checkpoint); | |
206 | ||
7c673cae FG |
207 | extern ROCKSDB_LIBRARY_API rocksdb_t* rocksdb_open_column_families( |
208 | const rocksdb_options_t* options, const char* name, int num_column_families, | |
209 | const char** column_family_names, | |
210 | const rocksdb_options_t** column_family_options, | |
211 | rocksdb_column_family_handle_t** column_family_handles, char** errptr); | |
212 | ||
213 | extern ROCKSDB_LIBRARY_API rocksdb_t* | |
214 | rocksdb_open_for_read_only_column_families( | |
215 | const rocksdb_options_t* options, const char* name, int num_column_families, | |
216 | const char** column_family_names, | |
217 | const rocksdb_options_t** column_family_options, | |
218 | rocksdb_column_family_handle_t** column_family_handles, | |
219 | unsigned char error_if_log_file_exist, char** errptr); | |
220 | ||
221 | extern ROCKSDB_LIBRARY_API char** rocksdb_list_column_families( | |
222 | const rocksdb_options_t* options, const char* name, size_t* lencf, | |
223 | char** errptr); | |
224 | ||
225 | extern ROCKSDB_LIBRARY_API void rocksdb_list_column_families_destroy( | |
226 | char** list, size_t len); | |
227 | ||
228 | extern ROCKSDB_LIBRARY_API rocksdb_column_family_handle_t* | |
229 | rocksdb_create_column_family(rocksdb_t* db, | |
230 | const rocksdb_options_t* column_family_options, | |
231 | const char* column_family_name, char** errptr); | |
232 | ||
233 | extern ROCKSDB_LIBRARY_API void rocksdb_drop_column_family( | |
234 | rocksdb_t* db, rocksdb_column_family_handle_t* handle, char** errptr); | |
235 | ||
236 | extern ROCKSDB_LIBRARY_API void rocksdb_column_family_handle_destroy( | |
237 | rocksdb_column_family_handle_t*); | |
238 | ||
239 | extern ROCKSDB_LIBRARY_API void rocksdb_close(rocksdb_t* db); | |
240 | ||
241 | extern ROCKSDB_LIBRARY_API void rocksdb_put( | |
242 | rocksdb_t* db, const rocksdb_writeoptions_t* options, const char* key, | |
243 | size_t keylen, const char* val, size_t vallen, char** errptr); | |
244 | ||
245 | extern ROCKSDB_LIBRARY_API void rocksdb_put_cf( | |
246 | rocksdb_t* db, const rocksdb_writeoptions_t* options, | |
247 | rocksdb_column_family_handle_t* column_family, const char* key, | |
248 | size_t keylen, const char* val, size_t vallen, char** errptr); | |
249 | ||
250 | extern ROCKSDB_LIBRARY_API void rocksdb_delete( | |
251 | rocksdb_t* db, const rocksdb_writeoptions_t* options, const char* key, | |
252 | size_t keylen, char** errptr); | |
253 | ||
254 | extern ROCKSDB_LIBRARY_API void rocksdb_delete_cf( | |
255 | rocksdb_t* db, const rocksdb_writeoptions_t* options, | |
256 | rocksdb_column_family_handle_t* column_family, const char* key, | |
257 | size_t keylen, char** errptr); | |
258 | ||
259 | extern ROCKSDB_LIBRARY_API void rocksdb_merge( | |
260 | rocksdb_t* db, const rocksdb_writeoptions_t* options, const char* key, | |
261 | size_t keylen, const char* val, size_t vallen, char** errptr); | |
262 | ||
263 | extern ROCKSDB_LIBRARY_API void rocksdb_merge_cf( | |
264 | rocksdb_t* db, const rocksdb_writeoptions_t* options, | |
265 | rocksdb_column_family_handle_t* column_family, const char* key, | |
266 | size_t keylen, const char* val, size_t vallen, char** errptr); | |
267 | ||
268 | extern ROCKSDB_LIBRARY_API void rocksdb_write( | |
269 | rocksdb_t* db, const rocksdb_writeoptions_t* options, | |
270 | rocksdb_writebatch_t* batch, char** errptr); | |
271 | ||
272 | /* Returns NULL if not found. A malloc()ed array otherwise. | |
273 | Stores the length of the array in *vallen. */ | |
274 | extern ROCKSDB_LIBRARY_API char* rocksdb_get( | |
275 | rocksdb_t* db, const rocksdb_readoptions_t* options, const char* key, | |
276 | size_t keylen, size_t* vallen, char** errptr); | |
277 | ||
278 | extern ROCKSDB_LIBRARY_API char* rocksdb_get_cf( | |
279 | rocksdb_t* db, const rocksdb_readoptions_t* options, | |
280 | rocksdb_column_family_handle_t* column_family, const char* key, | |
281 | size_t keylen, size_t* vallen, char** errptr); | |
282 | ||
283 | // if values_list[i] == NULL and errs[i] == NULL, | |
284 | // then we got status.IsNotFound(), which we will not return. | |
285 | // all errors except status status.ok() and status.IsNotFound() are returned. | |
286 | // | |
287 | // errs, values_list and values_list_sizes must be num_keys in length, | |
288 | // allocated by the caller. | |
289 | // errs is a list of strings as opposed to the conventional one error, | |
290 | // where errs[i] is the status for retrieval of keys_list[i]. | |
291 | // each non-NULL errs entry is a malloc()ed, null terminated string. | |
292 | // each non-NULL values_list entry is a malloc()ed array, with | |
293 | // the length for each stored in values_list_sizes[i]. | |
294 | extern ROCKSDB_LIBRARY_API void rocksdb_multi_get( | |
295 | rocksdb_t* db, const rocksdb_readoptions_t* options, size_t num_keys, | |
296 | const char* const* keys_list, const size_t* keys_list_sizes, | |
297 | char** values_list, size_t* values_list_sizes, char** errs); | |
298 | ||
299 | extern ROCKSDB_LIBRARY_API void rocksdb_multi_get_cf( | |
300 | rocksdb_t* db, const rocksdb_readoptions_t* options, | |
301 | const rocksdb_column_family_handle_t* const* column_families, | |
302 | size_t num_keys, const char* const* keys_list, | |
303 | const size_t* keys_list_sizes, char** values_list, | |
304 | size_t* values_list_sizes, char** errs); | |
305 | ||
306 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* rocksdb_create_iterator( | |
307 | rocksdb_t* db, const rocksdb_readoptions_t* options); | |
308 | ||
11fdf7f2 TL |
309 | extern ROCKSDB_LIBRARY_API rocksdb_wal_iterator_t* rocksdb_get_updates_since( |
310 | rocksdb_t* db, uint64_t seq_number, | |
311 | const rocksdb_wal_readoptions_t* options, | |
312 | char** errptr | |
313 | ); | |
314 | ||
7c673cae FG |
315 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* rocksdb_create_iterator_cf( |
316 | rocksdb_t* db, const rocksdb_readoptions_t* options, | |
317 | rocksdb_column_family_handle_t* column_family); | |
318 | ||
319 | extern ROCKSDB_LIBRARY_API void rocksdb_create_iterators( | |
320 | rocksdb_t *db, rocksdb_readoptions_t* opts, | |
321 | rocksdb_column_family_handle_t** column_families, | |
322 | rocksdb_iterator_t** iterators, size_t size, char** errptr); | |
323 | ||
324 | extern ROCKSDB_LIBRARY_API const rocksdb_snapshot_t* rocksdb_create_snapshot( | |
325 | rocksdb_t* db); | |
326 | ||
327 | extern ROCKSDB_LIBRARY_API void rocksdb_release_snapshot( | |
328 | rocksdb_t* db, const rocksdb_snapshot_t* snapshot); | |
329 | ||
330 | /* Returns NULL if property name is unknown. | |
331 | Else returns a pointer to a malloc()-ed null-terminated value. */ | |
332 | extern ROCKSDB_LIBRARY_API char* rocksdb_property_value(rocksdb_t* db, | |
333 | const char* propname); | |
334 | /* returns 0 on success, -1 otherwise */ | |
335 | int rocksdb_property_int( | |
336 | rocksdb_t* db, | |
337 | const char* propname, uint64_t *out_val); | |
338 | ||
339 | extern ROCKSDB_LIBRARY_API char* rocksdb_property_value_cf( | |
340 | rocksdb_t* db, rocksdb_column_family_handle_t* column_family, | |
341 | const char* propname); | |
342 | ||
343 | extern ROCKSDB_LIBRARY_API void rocksdb_approximate_sizes( | |
344 | rocksdb_t* db, int num_ranges, const char* const* range_start_key, | |
345 | const size_t* range_start_key_len, const char* const* range_limit_key, | |
346 | const size_t* range_limit_key_len, uint64_t* sizes); | |
347 | ||
348 | extern ROCKSDB_LIBRARY_API void rocksdb_approximate_sizes_cf( | |
349 | rocksdb_t* db, rocksdb_column_family_handle_t* column_family, | |
350 | int num_ranges, const char* const* range_start_key, | |
351 | const size_t* range_start_key_len, const char* const* range_limit_key, | |
352 | const size_t* range_limit_key_len, uint64_t* sizes); | |
353 | ||
354 | extern ROCKSDB_LIBRARY_API void rocksdb_compact_range(rocksdb_t* db, | |
355 | const char* start_key, | |
356 | size_t start_key_len, | |
357 | const char* limit_key, | |
358 | size_t limit_key_len); | |
359 | ||
360 | extern ROCKSDB_LIBRARY_API void rocksdb_compact_range_cf( | |
361 | rocksdb_t* db, rocksdb_column_family_handle_t* column_family, | |
362 | const char* start_key, size_t start_key_len, const char* limit_key, | |
363 | size_t limit_key_len); | |
364 | ||
365 | extern ROCKSDB_LIBRARY_API void rocksdb_compact_range_opt( | |
366 | rocksdb_t* db, rocksdb_compactoptions_t* opt, const char* start_key, | |
367 | size_t start_key_len, const char* limit_key, size_t limit_key_len); | |
368 | ||
369 | extern ROCKSDB_LIBRARY_API void rocksdb_compact_range_cf_opt( | |
370 | rocksdb_t* db, rocksdb_column_family_handle_t* column_family, | |
371 | rocksdb_compactoptions_t* opt, const char* start_key, size_t start_key_len, | |
372 | const char* limit_key, size_t limit_key_len); | |
373 | ||
374 | extern ROCKSDB_LIBRARY_API void rocksdb_delete_file(rocksdb_t* db, | |
375 | const char* name); | |
376 | ||
377 | extern ROCKSDB_LIBRARY_API const rocksdb_livefiles_t* rocksdb_livefiles( | |
378 | rocksdb_t* db); | |
379 | ||
380 | extern ROCKSDB_LIBRARY_API void rocksdb_flush( | |
381 | rocksdb_t* db, const rocksdb_flushoptions_t* options, char** errptr); | |
382 | ||
383 | extern ROCKSDB_LIBRARY_API void rocksdb_disable_file_deletions(rocksdb_t* db, | |
384 | char** errptr); | |
385 | ||
386 | extern ROCKSDB_LIBRARY_API void rocksdb_enable_file_deletions( | |
387 | rocksdb_t* db, unsigned char force, char** errptr); | |
388 | ||
389 | /* Management operations */ | |
390 | ||
391 | extern ROCKSDB_LIBRARY_API void rocksdb_destroy_db( | |
392 | const rocksdb_options_t* options, const char* name, char** errptr); | |
393 | ||
394 | extern ROCKSDB_LIBRARY_API void rocksdb_repair_db( | |
395 | const rocksdb_options_t* options, const char* name, char** errptr); | |
396 | ||
397 | /* Iterator */ | |
398 | ||
399 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_destroy(rocksdb_iterator_t*); | |
400 | extern ROCKSDB_LIBRARY_API unsigned char rocksdb_iter_valid( | |
401 | const rocksdb_iterator_t*); | |
402 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek_to_first(rocksdb_iterator_t*); | |
403 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek_to_last(rocksdb_iterator_t*); | |
404 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek(rocksdb_iterator_t*, | |
405 | const char* k, size_t klen); | |
406 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_seek_for_prev(rocksdb_iterator_t*, | |
407 | const char* k, | |
408 | size_t klen); | |
409 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_next(rocksdb_iterator_t*); | |
410 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_prev(rocksdb_iterator_t*); | |
411 | extern ROCKSDB_LIBRARY_API const char* rocksdb_iter_key( | |
412 | const rocksdb_iterator_t*, size_t* klen); | |
413 | extern ROCKSDB_LIBRARY_API const char* rocksdb_iter_value( | |
414 | const rocksdb_iterator_t*, size_t* vlen); | |
415 | extern ROCKSDB_LIBRARY_API void rocksdb_iter_get_error( | |
416 | const rocksdb_iterator_t*, char** errptr); | |
417 | ||
11fdf7f2 TL |
418 | extern ROCKSDB_LIBRARY_API void rocksdb_wal_iter_next(rocksdb_wal_iterator_t* iter); |
419 | extern ROCKSDB_LIBRARY_API unsigned char rocksdb_wal_iter_valid( | |
420 | const rocksdb_wal_iterator_t*); | |
421 | extern ROCKSDB_LIBRARY_API void rocksdb_wal_iter_status (const rocksdb_wal_iterator_t* iter, char** errptr) ; | |
422 | extern ROCKSDB_LIBRARY_API rocksdb_writebatch_t* rocksdb_wal_iter_get_batch (const rocksdb_wal_iterator_t* iter, uint64_t* seq) ; | |
423 | extern ROCKSDB_LIBRARY_API uint64_t rocksdb_get_latest_sequence_number (rocksdb_t *db); | |
424 | extern ROCKSDB_LIBRARY_API void rocksdb_wal_iter_destroy (const rocksdb_wal_iterator_t* iter) ; | |
425 | ||
7c673cae FG |
426 | /* Write batch */ |
427 | ||
428 | extern ROCKSDB_LIBRARY_API rocksdb_writebatch_t* rocksdb_writebatch_create(); | |
429 | extern ROCKSDB_LIBRARY_API rocksdb_writebatch_t* rocksdb_writebatch_create_from( | |
430 | const char* rep, size_t size); | |
431 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_destroy( | |
432 | rocksdb_writebatch_t*); | |
433 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_clear(rocksdb_writebatch_t*); | |
434 | extern ROCKSDB_LIBRARY_API int rocksdb_writebatch_count(rocksdb_writebatch_t*); | |
435 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_put(rocksdb_writebatch_t*, | |
436 | const char* key, | |
437 | size_t klen, | |
438 | const char* val, | |
439 | size_t vlen); | |
440 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_put_cf( | |
441 | rocksdb_writebatch_t*, rocksdb_column_family_handle_t* column_family, | |
442 | const char* key, size_t klen, const char* val, size_t vlen); | |
443 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_putv( | |
444 | rocksdb_writebatch_t* b, int num_keys, const char* const* keys_list, | |
445 | const size_t* keys_list_sizes, int num_values, | |
446 | const char* const* values_list, const size_t* values_list_sizes); | |
447 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_putv_cf( | |
448 | rocksdb_writebatch_t* b, rocksdb_column_family_handle_t* column_family, | |
449 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes, | |
450 | int num_values, const char* const* values_list, | |
451 | const size_t* values_list_sizes); | |
452 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_merge(rocksdb_writebatch_t*, | |
453 | const char* key, | |
454 | size_t klen, | |
455 | const char* val, | |
456 | size_t vlen); | |
457 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_merge_cf( | |
458 | rocksdb_writebatch_t*, rocksdb_column_family_handle_t* column_family, | |
459 | const char* key, size_t klen, const char* val, size_t vlen); | |
460 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_mergev( | |
461 | rocksdb_writebatch_t* b, int num_keys, const char* const* keys_list, | |
462 | const size_t* keys_list_sizes, int num_values, | |
463 | const char* const* values_list, const size_t* values_list_sizes); | |
464 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_mergev_cf( | |
465 | rocksdb_writebatch_t* b, rocksdb_column_family_handle_t* column_family, | |
466 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes, | |
467 | int num_values, const char* const* values_list, | |
468 | const size_t* values_list_sizes); | |
469 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete(rocksdb_writebatch_t*, | |
470 | const char* key, | |
471 | size_t klen); | |
472 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete_cf( | |
473 | rocksdb_writebatch_t*, rocksdb_column_family_handle_t* column_family, | |
474 | const char* key, size_t klen); | |
475 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_deletev( | |
476 | rocksdb_writebatch_t* b, int num_keys, const char* const* keys_list, | |
477 | const size_t* keys_list_sizes); | |
478 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_deletev_cf( | |
479 | rocksdb_writebatch_t* b, rocksdb_column_family_handle_t* column_family, | |
480 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes); | |
481 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete_range( | |
482 | rocksdb_writebatch_t* b, const char* start_key, size_t start_key_len, | |
483 | const char* end_key, size_t end_key_len); | |
484 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete_range_cf( | |
485 | rocksdb_writebatch_t* b, rocksdb_column_family_handle_t* column_family, | |
486 | const char* start_key, size_t start_key_len, const char* end_key, | |
487 | size_t end_key_len); | |
488 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete_rangev( | |
489 | rocksdb_writebatch_t* b, int num_keys, const char* const* start_keys_list, | |
490 | const size_t* start_keys_list_sizes, const char* const* end_keys_list, | |
491 | const size_t* end_keys_list_sizes); | |
492 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_delete_rangev_cf( | |
493 | rocksdb_writebatch_t* b, rocksdb_column_family_handle_t* column_family, | |
494 | int num_keys, const char* const* start_keys_list, | |
495 | const size_t* start_keys_list_sizes, const char* const* end_keys_list, | |
496 | const size_t* end_keys_list_sizes); | |
497 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_put_log_data( | |
498 | rocksdb_writebatch_t*, const char* blob, size_t len); | |
499 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_iterate( | |
500 | rocksdb_writebatch_t*, void* state, | |
501 | void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen), | |
502 | void (*deleted)(void*, const char* k, size_t klen)); | |
503 | extern ROCKSDB_LIBRARY_API const char* rocksdb_writebatch_data( | |
504 | rocksdb_writebatch_t*, size_t* size); | |
505 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_set_save_point( | |
506 | rocksdb_writebatch_t*); | |
507 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_rollback_to_save_point( | |
508 | rocksdb_writebatch_t*, char** errptr); | |
11fdf7f2 TL |
509 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_pop_save_point( |
510 | rocksdb_writebatch_t*, char** errptr); | |
7c673cae FG |
511 | |
512 | /* Write batch with index */ | |
513 | ||
514 | extern ROCKSDB_LIBRARY_API rocksdb_writebatch_wi_t* rocksdb_writebatch_wi_create( | |
515 | size_t reserved_bytes, | |
516 | unsigned char overwrite_keys); | |
517 | extern ROCKSDB_LIBRARY_API rocksdb_writebatch_wi_t* rocksdb_writebatch_wi_create_from( | |
518 | const char* rep, size_t size); | |
519 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_destroy( | |
520 | rocksdb_writebatch_wi_t*); | |
521 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_clear(rocksdb_writebatch_wi_t*); | |
522 | extern ROCKSDB_LIBRARY_API int rocksdb_writebatch_wi_count(rocksdb_writebatch_wi_t* b); | |
523 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_put(rocksdb_writebatch_wi_t*, | |
524 | const char* key, | |
525 | size_t klen, | |
526 | const char* val, | |
527 | size_t vlen); | |
528 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_put_cf( | |
529 | rocksdb_writebatch_wi_t*, rocksdb_column_family_handle_t* column_family, | |
530 | const char* key, size_t klen, const char* val, size_t vlen); | |
531 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_putv( | |
532 | rocksdb_writebatch_wi_t* b, int num_keys, const char* const* keys_list, | |
533 | const size_t* keys_list_sizes, int num_values, | |
534 | const char* const* values_list, const size_t* values_list_sizes); | |
535 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_putv_cf( | |
536 | rocksdb_writebatch_wi_t* b, rocksdb_column_family_handle_t* column_family, | |
537 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes, | |
538 | int num_values, const char* const* values_list, | |
539 | const size_t* values_list_sizes); | |
540 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_merge(rocksdb_writebatch_wi_t*, | |
541 | const char* key, | |
542 | size_t klen, | |
543 | const char* val, | |
544 | size_t vlen); | |
545 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_merge_cf( | |
546 | rocksdb_writebatch_wi_t*, rocksdb_column_family_handle_t* column_family, | |
547 | const char* key, size_t klen, const char* val, size_t vlen); | |
548 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_mergev( | |
549 | rocksdb_writebatch_wi_t* b, int num_keys, const char* const* keys_list, | |
550 | const size_t* keys_list_sizes, int num_values, | |
551 | const char* const* values_list, const size_t* values_list_sizes); | |
552 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_mergev_cf( | |
553 | rocksdb_writebatch_wi_t* b, rocksdb_column_family_handle_t* column_family, | |
554 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes, | |
555 | int num_values, const char* const* values_list, | |
556 | const size_t* values_list_sizes); | |
557 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete(rocksdb_writebatch_wi_t*, | |
558 | const char* key, | |
559 | size_t klen); | |
560 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete_cf( | |
561 | rocksdb_writebatch_wi_t*, rocksdb_column_family_handle_t* column_family, | |
562 | const char* key, size_t klen); | |
563 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_deletev( | |
564 | rocksdb_writebatch_wi_t* b, int num_keys, const char* const* keys_list, | |
565 | const size_t* keys_list_sizes); | |
566 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_deletev_cf( | |
567 | rocksdb_writebatch_wi_t* b, rocksdb_column_family_handle_t* column_family, | |
568 | int num_keys, const char* const* keys_list, const size_t* keys_list_sizes); | |
569 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete_range( | |
570 | rocksdb_writebatch_wi_t* b, const char* start_key, size_t start_key_len, | |
571 | const char* end_key, size_t end_key_len); | |
572 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete_range_cf( | |
573 | rocksdb_writebatch_wi_t* b, rocksdb_column_family_handle_t* column_family, | |
574 | const char* start_key, size_t start_key_len, const char* end_key, | |
575 | size_t end_key_len); | |
576 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete_rangev( | |
577 | rocksdb_writebatch_wi_t* b, int num_keys, const char* const* start_keys_list, | |
578 | const size_t* start_keys_list_sizes, const char* const* end_keys_list, | |
579 | const size_t* end_keys_list_sizes); | |
580 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_delete_rangev_cf( | |
581 | rocksdb_writebatch_wi_t* b, rocksdb_column_family_handle_t* column_family, | |
582 | int num_keys, const char* const* start_keys_list, | |
583 | const size_t* start_keys_list_sizes, const char* const* end_keys_list, | |
584 | const size_t* end_keys_list_sizes); | |
585 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_put_log_data( | |
586 | rocksdb_writebatch_wi_t*, const char* blob, size_t len); | |
587 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_iterate( | |
588 | rocksdb_writebatch_wi_t* b, | |
589 | void* state, | |
590 | void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen), | |
591 | void (*deleted)(void*, const char* k, size_t klen)); | |
592 | extern ROCKSDB_LIBRARY_API const char* rocksdb_writebatch_wi_data( | |
593 | rocksdb_writebatch_wi_t* b, | |
594 | size_t* size); | |
595 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_set_save_point( | |
596 | rocksdb_writebatch_wi_t*); | |
597 | extern ROCKSDB_LIBRARY_API void rocksdb_writebatch_wi_rollback_to_save_point( | |
598 | rocksdb_writebatch_wi_t*, char** errptr); | |
599 | extern ROCKSDB_LIBRARY_API char* rocksdb_writebatch_wi_get_from_batch( | |
600 | rocksdb_writebatch_wi_t* wbwi, | |
601 | const rocksdb_options_t* options, | |
602 | const char* key, size_t keylen, | |
603 | size_t* vallen, | |
604 | char** errptr); | |
605 | extern ROCKSDB_LIBRARY_API char* rocksdb_writebatch_wi_get_from_batch_cf( | |
606 | rocksdb_writebatch_wi_t* wbwi, | |
607 | const rocksdb_options_t* options, | |
608 | rocksdb_column_family_handle_t* column_family, | |
609 | const char* key, size_t keylen, | |
610 | size_t* vallen, | |
611 | char** errptr); | |
612 | extern ROCKSDB_LIBRARY_API char* rocksdb_writebatch_wi_get_from_batch_and_db( | |
613 | rocksdb_writebatch_wi_t* wbwi, | |
614 | rocksdb_t* db, | |
615 | const rocksdb_readoptions_t* options, | |
616 | const char* key, size_t keylen, | |
617 | size_t* vallen, | |
618 | char** errptr); | |
619 | extern ROCKSDB_LIBRARY_API char* rocksdb_writebatch_wi_get_from_batch_and_db_cf( | |
620 | rocksdb_writebatch_wi_t* wbwi, | |
621 | rocksdb_t* db, | |
622 | const rocksdb_readoptions_t* options, | |
623 | rocksdb_column_family_handle_t* column_family, | |
624 | const char* key, size_t keylen, | |
625 | size_t* vallen, | |
626 | char** errptr); | |
627 | extern ROCKSDB_LIBRARY_API void rocksdb_write_writebatch_wi( | |
628 | rocksdb_t* db, | |
629 | const rocksdb_writeoptions_t* options, | |
630 | rocksdb_writebatch_wi_t* wbwi, | |
631 | char** errptr); | |
632 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* rocksdb_writebatch_wi_create_iterator_with_base( | |
633 | rocksdb_writebatch_wi_t* wbwi, | |
634 | rocksdb_iterator_t* base_iterator); | |
635 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* rocksdb_writebatch_wi_create_iterator_with_base_cf( | |
636 | rocksdb_writebatch_wi_t* wbwi, | |
637 | rocksdb_iterator_t* base_iterator, | |
638 | rocksdb_column_family_handle_t* cf); | |
639 | ||
7c673cae FG |
640 | /* Block based table options */ |
641 | ||
642 | extern ROCKSDB_LIBRARY_API rocksdb_block_based_table_options_t* | |
643 | rocksdb_block_based_options_create(); | |
644 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_destroy( | |
645 | rocksdb_block_based_table_options_t* options); | |
646 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_block_size( | |
647 | rocksdb_block_based_table_options_t* options, size_t block_size); | |
648 | extern ROCKSDB_LIBRARY_API void | |
649 | rocksdb_block_based_options_set_block_size_deviation( | |
650 | rocksdb_block_based_table_options_t* options, int block_size_deviation); | |
651 | extern ROCKSDB_LIBRARY_API void | |
652 | rocksdb_block_based_options_set_block_restart_interval( | |
653 | rocksdb_block_based_table_options_t* options, int block_restart_interval); | |
11fdf7f2 TL |
654 | extern ROCKSDB_LIBRARY_API void |
655 | rocksdb_block_based_options_set_index_block_restart_interval( | |
656 | rocksdb_block_based_table_options_t* options, int index_block_restart_interval); | |
657 | extern ROCKSDB_LIBRARY_API void | |
658 | rocksdb_block_based_options_set_metadata_block_size( | |
659 | rocksdb_block_based_table_options_t* options, uint64_t metadata_block_size); | |
660 | extern ROCKSDB_LIBRARY_API void | |
661 | rocksdb_block_based_options_set_partition_filters( | |
662 | rocksdb_block_based_table_options_t* options, unsigned char partition_filters); | |
663 | extern ROCKSDB_LIBRARY_API void | |
664 | rocksdb_block_based_options_set_use_delta_encoding( | |
665 | rocksdb_block_based_table_options_t* options, unsigned char use_delta_encoding); | |
7c673cae FG |
666 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_filter_policy( |
667 | rocksdb_block_based_table_options_t* options, | |
668 | rocksdb_filterpolicy_t* filter_policy); | |
669 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_no_block_cache( | |
670 | rocksdb_block_based_table_options_t* options, unsigned char no_block_cache); | |
671 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_block_cache( | |
672 | rocksdb_block_based_table_options_t* options, rocksdb_cache_t* block_cache); | |
673 | extern ROCKSDB_LIBRARY_API void | |
674 | rocksdb_block_based_options_set_block_cache_compressed( | |
675 | rocksdb_block_based_table_options_t* options, | |
676 | rocksdb_cache_t* block_cache_compressed); | |
677 | extern ROCKSDB_LIBRARY_API void | |
678 | rocksdb_block_based_options_set_whole_key_filtering( | |
679 | rocksdb_block_based_table_options_t*, unsigned char); | |
680 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_format_version( | |
681 | rocksdb_block_based_table_options_t*, int); | |
682 | enum { | |
683 | rocksdb_block_based_table_index_type_binary_search = 0, | |
684 | rocksdb_block_based_table_index_type_hash_search = 1, | |
11fdf7f2 | 685 | rocksdb_block_based_table_index_type_two_level_index_search = 2, |
7c673cae FG |
686 | }; |
687 | extern ROCKSDB_LIBRARY_API void rocksdb_block_based_options_set_index_type( | |
688 | rocksdb_block_based_table_options_t*, int); // uses one of the above enums | |
689 | extern ROCKSDB_LIBRARY_API void | |
690 | rocksdb_block_based_options_set_hash_index_allow_collision( | |
691 | rocksdb_block_based_table_options_t*, unsigned char); | |
692 | extern ROCKSDB_LIBRARY_API void | |
693 | rocksdb_block_based_options_set_cache_index_and_filter_blocks( | |
694 | rocksdb_block_based_table_options_t*, unsigned char); | |
695 | extern ROCKSDB_LIBRARY_API void | |
11fdf7f2 TL |
696 | rocksdb_block_based_options_set_cache_index_and_filter_blocks_with_high_priority( |
697 | rocksdb_block_based_table_options_t*, unsigned char); | |
698 | extern ROCKSDB_LIBRARY_API void | |
7c673cae FG |
699 | rocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache( |
700 | rocksdb_block_based_table_options_t*, unsigned char); | |
11fdf7f2 TL |
701 | extern ROCKSDB_LIBRARY_API void |
702 | rocksdb_block_based_options_set_pin_top_level_index_and_filter( | |
703 | rocksdb_block_based_table_options_t*, unsigned char); | |
7c673cae FG |
704 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_block_based_table_factory( |
705 | rocksdb_options_t* opt, rocksdb_block_based_table_options_t* table_options); | |
706 | ||
707 | /* Cuckoo table options */ | |
708 | ||
709 | extern ROCKSDB_LIBRARY_API rocksdb_cuckoo_table_options_t* | |
710 | rocksdb_cuckoo_options_create(); | |
711 | extern ROCKSDB_LIBRARY_API void rocksdb_cuckoo_options_destroy( | |
712 | rocksdb_cuckoo_table_options_t* options); | |
713 | extern ROCKSDB_LIBRARY_API void rocksdb_cuckoo_options_set_hash_ratio( | |
714 | rocksdb_cuckoo_table_options_t* options, double v); | |
715 | extern ROCKSDB_LIBRARY_API void rocksdb_cuckoo_options_set_max_search_depth( | |
716 | rocksdb_cuckoo_table_options_t* options, uint32_t v); | |
717 | extern ROCKSDB_LIBRARY_API void rocksdb_cuckoo_options_set_cuckoo_block_size( | |
718 | rocksdb_cuckoo_table_options_t* options, uint32_t v); | |
719 | extern ROCKSDB_LIBRARY_API void | |
720 | rocksdb_cuckoo_options_set_identity_as_first_hash( | |
721 | rocksdb_cuckoo_table_options_t* options, unsigned char v); | |
722 | extern ROCKSDB_LIBRARY_API void rocksdb_cuckoo_options_set_use_module_hash( | |
723 | rocksdb_cuckoo_table_options_t* options, unsigned char v); | |
724 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_cuckoo_table_factory( | |
725 | rocksdb_options_t* opt, rocksdb_cuckoo_table_options_t* table_options); | |
726 | ||
727 | /* Options */ | |
728 | extern ROCKSDB_LIBRARY_API void rocksdb_set_options( | |
729 | rocksdb_t* db, int count, const char* const keys[], const char* const values[], char** errptr); | |
730 | ||
494da23a TL |
731 | extern ROCKSDB_LIBRARY_API void rocksdb_set_options_cf( |
732 | rocksdb_t* db, rocksdb_column_family_handle_t* handle, int count, const char* const keys[], const char* const values[], char** errptr); | |
733 | ||
7c673cae FG |
734 | extern ROCKSDB_LIBRARY_API rocksdb_options_t* rocksdb_options_create(); |
735 | extern ROCKSDB_LIBRARY_API void rocksdb_options_destroy(rocksdb_options_t*); | |
736 | extern ROCKSDB_LIBRARY_API void rocksdb_options_increase_parallelism( | |
737 | rocksdb_options_t* opt, int total_threads); | |
738 | extern ROCKSDB_LIBRARY_API void rocksdb_options_optimize_for_point_lookup( | |
739 | rocksdb_options_t* opt, uint64_t block_cache_size_mb); | |
740 | extern ROCKSDB_LIBRARY_API void rocksdb_options_optimize_level_style_compaction( | |
741 | rocksdb_options_t* opt, uint64_t memtable_memory_budget); | |
742 | extern ROCKSDB_LIBRARY_API void | |
743 | rocksdb_options_optimize_universal_style_compaction( | |
744 | rocksdb_options_t* opt, uint64_t memtable_memory_budget); | |
11fdf7f2 TL |
745 | extern ROCKSDB_LIBRARY_API void |
746 | rocksdb_options_set_allow_ingest_behind(rocksdb_options_t*, | |
747 | unsigned char); | |
7c673cae FG |
748 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compaction_filter( |
749 | rocksdb_options_t*, rocksdb_compactionfilter_t*); | |
750 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compaction_filter_factory( | |
751 | rocksdb_options_t*, rocksdb_compactionfilterfactory_t*); | |
752 | extern ROCKSDB_LIBRARY_API void rocksdb_options_compaction_readahead_size( | |
753 | rocksdb_options_t*, size_t); | |
754 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_comparator( | |
755 | rocksdb_options_t*, rocksdb_comparator_t*); | |
756 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_merge_operator( | |
757 | rocksdb_options_t*, rocksdb_mergeoperator_t*); | |
758 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_uint64add_merge_operator( | |
759 | rocksdb_options_t*); | |
760 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression_per_level( | |
761 | rocksdb_options_t* opt, int* level_values, size_t num_levels); | |
762 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_create_if_missing( | |
763 | rocksdb_options_t*, unsigned char); | |
764 | extern ROCKSDB_LIBRARY_API void | |
765 | rocksdb_options_set_create_missing_column_families(rocksdb_options_t*, | |
766 | unsigned char); | |
767 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_error_if_exists( | |
768 | rocksdb_options_t*, unsigned char); | |
769 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_paranoid_checks( | |
770 | rocksdb_options_t*, unsigned char); | |
11fdf7f2 TL |
771 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_db_paths(rocksdb_options_t*, |
772 | const rocksdb_dbpath_t** path_values, | |
773 | size_t num_paths); | |
7c673cae FG |
774 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_env(rocksdb_options_t*, |
775 | rocksdb_env_t*); | |
776 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_info_log(rocksdb_options_t*, | |
777 | rocksdb_logger_t*); | |
778 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_info_log_level( | |
779 | rocksdb_options_t*, int); | |
780 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_write_buffer_size( | |
781 | rocksdb_options_t*, size_t); | |
782 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_db_write_buffer_size( | |
783 | rocksdb_options_t*, size_t); | |
784 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_open_files( | |
785 | rocksdb_options_t*, int); | |
11fdf7f2 TL |
786 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_file_opening_threads( |
787 | rocksdb_options_t*, int); | |
7c673cae FG |
788 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_total_wal_size( |
789 | rocksdb_options_t* opt, uint64_t n); | |
790 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression_options( | |
791 | rocksdb_options_t*, int, int, int, int); | |
792 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_prefix_extractor( | |
793 | rocksdb_options_t*, rocksdb_slicetransform_t*); | |
794 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_num_levels( | |
795 | rocksdb_options_t*, int); | |
796 | extern ROCKSDB_LIBRARY_API void | |
797 | rocksdb_options_set_level0_file_num_compaction_trigger(rocksdb_options_t*, int); | |
798 | extern ROCKSDB_LIBRARY_API void | |
799 | rocksdb_options_set_level0_slowdown_writes_trigger(rocksdb_options_t*, int); | |
800 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_level0_stop_writes_trigger( | |
801 | rocksdb_options_t*, int); | |
802 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_mem_compaction_level( | |
803 | rocksdb_options_t*, int); | |
804 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_target_file_size_base( | |
805 | rocksdb_options_t*, uint64_t); | |
806 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_target_file_size_multiplier( | |
807 | rocksdb_options_t*, int); | |
808 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_bytes_for_level_base( | |
809 | rocksdb_options_t*, uint64_t); | |
810 | extern ROCKSDB_LIBRARY_API void | |
811 | rocksdb_options_set_level_compaction_dynamic_level_bytes(rocksdb_options_t*, | |
812 | unsigned char); | |
813 | extern ROCKSDB_LIBRARY_API void | |
814 | rocksdb_options_set_max_bytes_for_level_multiplier(rocksdb_options_t*, double); | |
815 | extern ROCKSDB_LIBRARY_API void | |
816 | rocksdb_options_set_max_bytes_for_level_multiplier_additional( | |
817 | rocksdb_options_t*, int* level_values, size_t num_levels); | |
818 | extern ROCKSDB_LIBRARY_API void rocksdb_options_enable_statistics( | |
819 | rocksdb_options_t*); | |
11fdf7f2 TL |
820 | extern ROCKSDB_LIBRARY_API void |
821 | rocksdb_options_set_skip_stats_update_on_db_open(rocksdb_options_t* opt, | |
822 | unsigned char val); | |
7c673cae FG |
823 | |
824 | /* returns a pointer to a malloc()-ed, null terminated string */ | |
825 | extern ROCKSDB_LIBRARY_API char* rocksdb_options_statistics_get_string( | |
826 | rocksdb_options_t* opt); | |
827 | ||
828 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_write_buffer_number( | |
829 | rocksdb_options_t*, int); | |
830 | extern ROCKSDB_LIBRARY_API void | |
831 | rocksdb_options_set_min_write_buffer_number_to_merge(rocksdb_options_t*, int); | |
832 | extern ROCKSDB_LIBRARY_API void | |
833 | rocksdb_options_set_max_write_buffer_number_to_maintain(rocksdb_options_t*, | |
834 | int); | |
11fdf7f2 TL |
835 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_enable_pipelined_write( |
836 | rocksdb_options_t*, unsigned char); | |
837 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_subcompactions( | |
838 | rocksdb_options_t*, uint32_t); | |
839 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_jobs( | |
840 | rocksdb_options_t*, int); | |
7c673cae FG |
841 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_compactions( |
842 | rocksdb_options_t*, int); | |
843 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_base_background_compactions( | |
844 | rocksdb_options_t*, int); | |
845 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_background_flushes( | |
846 | rocksdb_options_t*, int); | |
847 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_log_file_size( | |
848 | rocksdb_options_t*, size_t); | |
849 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_log_file_time_to_roll( | |
850 | rocksdb_options_t*, size_t); | |
851 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_keep_log_file_num( | |
852 | rocksdb_options_t*, size_t); | |
853 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_recycle_log_file_num( | |
854 | rocksdb_options_t*, size_t); | |
855 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_soft_rate_limit( | |
856 | rocksdb_options_t*, double); | |
857 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hard_rate_limit( | |
858 | rocksdb_options_t*, double); | |
859 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_soft_pending_compaction_bytes_limit( | |
860 | rocksdb_options_t* opt, size_t v); | |
861 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hard_pending_compaction_bytes_limit( | |
862 | rocksdb_options_t* opt, size_t v); | |
863 | extern ROCKSDB_LIBRARY_API void | |
864 | rocksdb_options_set_rate_limit_delay_max_milliseconds(rocksdb_options_t*, | |
865 | unsigned int); | |
866 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_manifest_file_size( | |
867 | rocksdb_options_t*, size_t); | |
868 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_table_cache_numshardbits( | |
869 | rocksdb_options_t*, int); | |
870 | extern ROCKSDB_LIBRARY_API void | |
871 | rocksdb_options_set_table_cache_remove_scan_count_limit(rocksdb_options_t*, | |
872 | int); | |
873 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_arena_block_size( | |
874 | rocksdb_options_t*, size_t); | |
875 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_use_fsync( | |
876 | rocksdb_options_t*, int); | |
877 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_db_log_dir( | |
878 | rocksdb_options_t*, const char*); | |
879 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_wal_dir(rocksdb_options_t*, | |
880 | const char*); | |
881 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_WAL_ttl_seconds( | |
882 | rocksdb_options_t*, uint64_t); | |
883 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_WAL_size_limit_MB( | |
884 | rocksdb_options_t*, uint64_t); | |
885 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_manifest_preallocation_size( | |
886 | rocksdb_options_t*, size_t); | |
887 | extern ROCKSDB_LIBRARY_API void | |
888 | rocksdb_options_set_purge_redundant_kvs_while_flush(rocksdb_options_t*, | |
889 | unsigned char); | |
890 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_allow_mmap_reads( | |
891 | rocksdb_options_t*, unsigned char); | |
892 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_allow_mmap_writes( | |
893 | rocksdb_options_t*, unsigned char); | |
894 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_use_direct_reads( | |
895 | rocksdb_options_t*, unsigned char); | |
896 | extern ROCKSDB_LIBRARY_API void | |
897 | rocksdb_options_set_use_direct_io_for_flush_and_compaction(rocksdb_options_t*, | |
898 | unsigned char); | |
899 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_is_fd_close_on_exec( | |
900 | rocksdb_options_t*, unsigned char); | |
901 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_skip_log_error_on_recovery( | |
902 | rocksdb_options_t*, unsigned char); | |
903 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_stats_dump_period_sec( | |
904 | rocksdb_options_t*, unsigned int); | |
905 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_advise_random_on_open( | |
906 | rocksdb_options_t*, unsigned char); | |
907 | extern ROCKSDB_LIBRARY_API void | |
908 | rocksdb_options_set_access_hint_on_compaction_start(rocksdb_options_t*, int); | |
909 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_use_adaptive_mutex( | |
910 | rocksdb_options_t*, unsigned char); | |
911 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_bytes_per_sync( | |
912 | rocksdb_options_t*, uint64_t); | |
11fdf7f2 TL |
913 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_wal_bytes_per_sync( |
914 | rocksdb_options_t*, uint64_t); | |
915 | extern ROCKSDB_LIBRARY_API void | |
916 | rocksdb_options_set_writable_file_max_buffer_size(rocksdb_options_t*, uint64_t); | |
7c673cae FG |
917 | extern ROCKSDB_LIBRARY_API void |
918 | rocksdb_options_set_allow_concurrent_memtable_write(rocksdb_options_t*, | |
919 | unsigned char); | |
920 | extern ROCKSDB_LIBRARY_API void | |
921 | rocksdb_options_set_enable_write_thread_adaptive_yield(rocksdb_options_t*, | |
922 | unsigned char); | |
923 | extern ROCKSDB_LIBRARY_API void | |
924 | rocksdb_options_set_max_sequential_skip_in_iterations(rocksdb_options_t*, | |
925 | uint64_t); | |
926 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_disable_auto_compactions( | |
927 | rocksdb_options_t*, int); | |
928 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_optimize_filters_for_hits( | |
929 | rocksdb_options_t*, int); | |
930 | extern ROCKSDB_LIBRARY_API void | |
931 | rocksdb_options_set_delete_obsolete_files_period_micros(rocksdb_options_t*, | |
932 | uint64_t); | |
933 | extern ROCKSDB_LIBRARY_API void rocksdb_options_prepare_for_bulk_load( | |
934 | rocksdb_options_t*); | |
935 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_memtable_vector_rep( | |
936 | rocksdb_options_t*); | |
937 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_memtable_prefix_bloom_size_ratio( | |
938 | rocksdb_options_t*, double); | |
939 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_compaction_bytes( | |
940 | rocksdb_options_t*, uint64_t); | |
941 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hash_skip_list_rep( | |
942 | rocksdb_options_t*, size_t, int32_t, int32_t); | |
943 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_hash_link_list_rep( | |
944 | rocksdb_options_t*, size_t); | |
945 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_plain_table_factory( | |
946 | rocksdb_options_t*, uint32_t, int, double, size_t); | |
947 | ||
948 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_min_level_to_compress( | |
949 | rocksdb_options_t* opt, int level); | |
950 | ||
951 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_memtable_huge_page_size( | |
952 | rocksdb_options_t*, size_t); | |
953 | ||
954 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_max_successive_merges( | |
955 | rocksdb_options_t*, size_t); | |
956 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_bloom_locality( | |
957 | rocksdb_options_t*, uint32_t); | |
958 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_inplace_update_support( | |
959 | rocksdb_options_t*, unsigned char); | |
960 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_inplace_update_num_locks( | |
961 | rocksdb_options_t*, size_t); | |
962 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_report_bg_io_stats( | |
963 | rocksdb_options_t*, int); | |
964 | ||
965 | enum { | |
966 | rocksdb_tolerate_corrupted_tail_records_recovery = 0, | |
967 | rocksdb_absolute_consistency_recovery = 1, | |
968 | rocksdb_point_in_time_recovery = 2, | |
969 | rocksdb_skip_any_corrupted_records_recovery = 3 | |
970 | }; | |
971 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_wal_recovery_mode( | |
972 | rocksdb_options_t*, int); | |
973 | ||
974 | enum { | |
975 | rocksdb_no_compression = 0, | |
976 | rocksdb_snappy_compression = 1, | |
977 | rocksdb_zlib_compression = 2, | |
978 | rocksdb_bz2_compression = 3, | |
979 | rocksdb_lz4_compression = 4, | |
980 | rocksdb_lz4hc_compression = 5, | |
981 | rocksdb_xpress_compression = 6, | |
982 | rocksdb_zstd_compression = 7 | |
983 | }; | |
984 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compression( | |
985 | rocksdb_options_t*, int); | |
986 | ||
987 | enum { | |
988 | rocksdb_level_compaction = 0, | |
989 | rocksdb_universal_compaction = 1, | |
990 | rocksdb_fifo_compaction = 2 | |
991 | }; | |
992 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_compaction_style( | |
993 | rocksdb_options_t*, int); | |
994 | extern ROCKSDB_LIBRARY_API void | |
995 | rocksdb_options_set_universal_compaction_options( | |
996 | rocksdb_options_t*, rocksdb_universal_compaction_options_t*); | |
997 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_fifo_compaction_options( | |
998 | rocksdb_options_t* opt, rocksdb_fifo_compaction_options_t* fifo); | |
999 | extern ROCKSDB_LIBRARY_API void rocksdb_options_set_ratelimiter( | |
1000 | rocksdb_options_t* opt, rocksdb_ratelimiter_t* limiter); | |
1001 | ||
1002 | /* RateLimiter */ | |
1003 | extern ROCKSDB_LIBRARY_API rocksdb_ratelimiter_t* rocksdb_ratelimiter_create( | |
1004 | int64_t rate_bytes_per_sec, int64_t refill_period_us, int32_t fairness); | |
1005 | extern ROCKSDB_LIBRARY_API void rocksdb_ratelimiter_destroy(rocksdb_ratelimiter_t*); | |
1006 | ||
11fdf7f2 TL |
1007 | /* PerfContext */ |
1008 | enum { | |
1009 | rocksdb_uninitialized = 0, | |
1010 | rocksdb_disable = 1, | |
1011 | rocksdb_enable_count = 2, | |
1012 | rocksdb_enable_time_except_for_mutex = 3, | |
1013 | rocksdb_enable_time = 4, | |
1014 | rocksdb_out_of_bounds = 5 | |
1015 | }; | |
1016 | ||
1017 | enum { | |
1018 | rocksdb_user_key_comparison_count = 0, | |
1019 | rocksdb_block_cache_hit_count, | |
1020 | rocksdb_block_read_count, | |
1021 | rocksdb_block_read_byte, | |
1022 | rocksdb_block_read_time, | |
1023 | rocksdb_block_checksum_time, | |
1024 | rocksdb_block_decompress_time, | |
1025 | rocksdb_get_read_bytes, | |
1026 | rocksdb_multiget_read_bytes, | |
1027 | rocksdb_iter_read_bytes, | |
1028 | rocksdb_internal_key_skipped_count, | |
1029 | rocksdb_internal_delete_skipped_count, | |
1030 | rocksdb_internal_recent_skipped_count, | |
1031 | rocksdb_internal_merge_count, | |
1032 | rocksdb_get_snapshot_time, | |
1033 | rocksdb_get_from_memtable_time, | |
1034 | rocksdb_get_from_memtable_count, | |
1035 | rocksdb_get_post_process_time, | |
1036 | rocksdb_get_from_output_files_time, | |
1037 | rocksdb_seek_on_memtable_time, | |
1038 | rocksdb_seek_on_memtable_count, | |
1039 | rocksdb_next_on_memtable_count, | |
1040 | rocksdb_prev_on_memtable_count, | |
1041 | rocksdb_seek_child_seek_time, | |
1042 | rocksdb_seek_child_seek_count, | |
1043 | rocksdb_seek_min_heap_time, | |
1044 | rocksdb_seek_max_heap_time, | |
1045 | rocksdb_seek_internal_seek_time, | |
1046 | rocksdb_find_next_user_entry_time, | |
1047 | rocksdb_write_wal_time, | |
1048 | rocksdb_write_memtable_time, | |
1049 | rocksdb_write_delay_time, | |
1050 | rocksdb_write_pre_and_post_process_time, | |
1051 | rocksdb_db_mutex_lock_nanos, | |
1052 | rocksdb_db_condition_wait_nanos, | |
1053 | rocksdb_merge_operator_time_nanos, | |
1054 | rocksdb_read_index_block_nanos, | |
1055 | rocksdb_read_filter_block_nanos, | |
1056 | rocksdb_new_table_block_iter_nanos, | |
1057 | rocksdb_new_table_iterator_nanos, | |
1058 | rocksdb_block_seek_nanos, | |
1059 | rocksdb_find_table_nanos, | |
1060 | rocksdb_bloom_memtable_hit_count, | |
1061 | rocksdb_bloom_memtable_miss_count, | |
1062 | rocksdb_bloom_sst_hit_count, | |
1063 | rocksdb_bloom_sst_miss_count, | |
1064 | rocksdb_key_lock_wait_time, | |
1065 | rocksdb_key_lock_wait_count, | |
1066 | rocksdb_env_new_sequential_file_nanos, | |
1067 | rocksdb_env_new_random_access_file_nanos, | |
1068 | rocksdb_env_new_writable_file_nanos, | |
1069 | rocksdb_env_reuse_writable_file_nanos, | |
1070 | rocksdb_env_new_random_rw_file_nanos, | |
1071 | rocksdb_env_new_directory_nanos, | |
1072 | rocksdb_env_file_exists_nanos, | |
1073 | rocksdb_env_get_children_nanos, | |
1074 | rocksdb_env_get_children_file_attributes_nanos, | |
1075 | rocksdb_env_delete_file_nanos, | |
1076 | rocksdb_env_create_dir_nanos, | |
1077 | rocksdb_env_create_dir_if_missing_nanos, | |
1078 | rocksdb_env_delete_dir_nanos, | |
1079 | rocksdb_env_get_file_size_nanos, | |
1080 | rocksdb_env_get_file_modification_time_nanos, | |
1081 | rocksdb_env_rename_file_nanos, | |
1082 | rocksdb_env_link_file_nanos, | |
1083 | rocksdb_env_lock_file_nanos, | |
1084 | rocksdb_env_unlock_file_nanos, | |
1085 | rocksdb_env_new_logger_nanos, | |
1086 | rocksdb_total_metric_count = 68 | |
1087 | }; | |
1088 | ||
1089 | extern ROCKSDB_LIBRARY_API void rocksdb_set_perf_level(int); | |
1090 | extern ROCKSDB_LIBRARY_API rocksdb_perfcontext_t* rocksdb_perfcontext_create(); | |
1091 | extern ROCKSDB_LIBRARY_API void rocksdb_perfcontext_reset( | |
1092 | rocksdb_perfcontext_t* context); | |
1093 | extern ROCKSDB_LIBRARY_API char* rocksdb_perfcontext_report( | |
1094 | rocksdb_perfcontext_t* context, unsigned char exclude_zero_counters); | |
1095 | extern ROCKSDB_LIBRARY_API uint64_t rocksdb_perfcontext_metric( | |
1096 | rocksdb_perfcontext_t* context, int metric); | |
1097 | extern ROCKSDB_LIBRARY_API void rocksdb_perfcontext_destroy( | |
1098 | rocksdb_perfcontext_t* context); | |
1099 | ||
7c673cae FG |
1100 | /* Compaction Filter */ |
1101 | ||
1102 | extern ROCKSDB_LIBRARY_API rocksdb_compactionfilter_t* | |
1103 | rocksdb_compactionfilter_create( | |
1104 | void* state, void (*destructor)(void*), | |
1105 | unsigned char (*filter)(void*, int level, const char* key, | |
1106 | size_t key_length, const char* existing_value, | |
1107 | size_t value_length, char** new_value, | |
1108 | size_t* new_value_length, | |
1109 | unsigned char* value_changed), | |
1110 | const char* (*name)(void*)); | |
1111 | extern ROCKSDB_LIBRARY_API void rocksdb_compactionfilter_set_ignore_snapshots( | |
1112 | rocksdb_compactionfilter_t*, unsigned char); | |
1113 | extern ROCKSDB_LIBRARY_API void rocksdb_compactionfilter_destroy( | |
1114 | rocksdb_compactionfilter_t*); | |
1115 | ||
1116 | /* Compaction Filter Context */ | |
1117 | ||
1118 | extern ROCKSDB_LIBRARY_API unsigned char | |
1119 | rocksdb_compactionfiltercontext_is_full_compaction( | |
1120 | rocksdb_compactionfiltercontext_t* context); | |
1121 | ||
1122 | extern ROCKSDB_LIBRARY_API unsigned char | |
1123 | rocksdb_compactionfiltercontext_is_manual_compaction( | |
1124 | rocksdb_compactionfiltercontext_t* context); | |
1125 | ||
1126 | /* Compaction Filter Factory */ | |
1127 | ||
1128 | extern ROCKSDB_LIBRARY_API rocksdb_compactionfilterfactory_t* | |
1129 | rocksdb_compactionfilterfactory_create( | |
1130 | void* state, void (*destructor)(void*), | |
1131 | rocksdb_compactionfilter_t* (*create_compaction_filter)( | |
1132 | void*, rocksdb_compactionfiltercontext_t* context), | |
1133 | const char* (*name)(void*)); | |
1134 | extern ROCKSDB_LIBRARY_API void rocksdb_compactionfilterfactory_destroy( | |
1135 | rocksdb_compactionfilterfactory_t*); | |
1136 | ||
1137 | /* Comparator */ | |
1138 | ||
1139 | extern ROCKSDB_LIBRARY_API rocksdb_comparator_t* rocksdb_comparator_create( | |
1140 | void* state, void (*destructor)(void*), | |
1141 | int (*compare)(void*, const char* a, size_t alen, const char* b, | |
1142 | size_t blen), | |
1143 | const char* (*name)(void*)); | |
1144 | extern ROCKSDB_LIBRARY_API void rocksdb_comparator_destroy( | |
1145 | rocksdb_comparator_t*); | |
1146 | ||
1147 | /* Filter policy */ | |
1148 | ||
1149 | extern ROCKSDB_LIBRARY_API rocksdb_filterpolicy_t* rocksdb_filterpolicy_create( | |
1150 | void* state, void (*destructor)(void*), | |
1151 | char* (*create_filter)(void*, const char* const* key_array, | |
1152 | const size_t* key_length_array, int num_keys, | |
1153 | size_t* filter_length), | |
1154 | unsigned char (*key_may_match)(void*, const char* key, size_t length, | |
1155 | const char* filter, size_t filter_length), | |
1156 | void (*delete_filter)(void*, const char* filter, size_t filter_length), | |
1157 | const char* (*name)(void*)); | |
1158 | extern ROCKSDB_LIBRARY_API void rocksdb_filterpolicy_destroy( | |
1159 | rocksdb_filterpolicy_t*); | |
1160 | ||
1161 | extern ROCKSDB_LIBRARY_API rocksdb_filterpolicy_t* | |
1162 | rocksdb_filterpolicy_create_bloom(int bits_per_key); | |
1163 | extern ROCKSDB_LIBRARY_API rocksdb_filterpolicy_t* | |
1164 | rocksdb_filterpolicy_create_bloom_full(int bits_per_key); | |
1165 | ||
1166 | /* Merge Operator */ | |
1167 | ||
1168 | extern ROCKSDB_LIBRARY_API rocksdb_mergeoperator_t* | |
1169 | rocksdb_mergeoperator_create( | |
1170 | void* state, void (*destructor)(void*), | |
1171 | char* (*full_merge)(void*, const char* key, size_t key_length, | |
1172 | const char* existing_value, | |
1173 | size_t existing_value_length, | |
1174 | const char* const* operands_list, | |
1175 | const size_t* operands_list_length, int num_operands, | |
1176 | unsigned char* success, size_t* new_value_length), | |
1177 | char* (*partial_merge)(void*, const char* key, size_t key_length, | |
1178 | const char* const* operands_list, | |
1179 | const size_t* operands_list_length, int num_operands, | |
1180 | unsigned char* success, size_t* new_value_length), | |
1181 | void (*delete_value)(void*, const char* value, size_t value_length), | |
1182 | const char* (*name)(void*)); | |
1183 | extern ROCKSDB_LIBRARY_API void rocksdb_mergeoperator_destroy( | |
1184 | rocksdb_mergeoperator_t*); | |
1185 | ||
1186 | /* Read options */ | |
1187 | ||
1188 | extern ROCKSDB_LIBRARY_API rocksdb_readoptions_t* rocksdb_readoptions_create(); | |
1189 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_destroy( | |
1190 | rocksdb_readoptions_t*); | |
1191 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_verify_checksums( | |
1192 | rocksdb_readoptions_t*, unsigned char); | |
1193 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_fill_cache( | |
1194 | rocksdb_readoptions_t*, unsigned char); | |
1195 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_snapshot( | |
1196 | rocksdb_readoptions_t*, const rocksdb_snapshot_t*); | |
1197 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_iterate_upper_bound( | |
1198 | rocksdb_readoptions_t*, const char* key, size_t keylen); | |
11fdf7f2 TL |
1199 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_iterate_lower_bound( |
1200 | rocksdb_readoptions_t*, const char* key, size_t keylen); | |
7c673cae FG |
1201 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_read_tier( |
1202 | rocksdb_readoptions_t*, int); | |
1203 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_tailing( | |
1204 | rocksdb_readoptions_t*, unsigned char); | |
11fdf7f2 TL |
1205 | // The functionality that this option controlled has been removed. |
1206 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_managed( | |
1207 | rocksdb_readoptions_t*, unsigned char); | |
7c673cae FG |
1208 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_readahead_size( |
1209 | rocksdb_readoptions_t*, size_t); | |
11fdf7f2 TL |
1210 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_prefix_same_as_start( |
1211 | rocksdb_readoptions_t*, unsigned char); | |
7c673cae FG |
1212 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_pin_data( |
1213 | rocksdb_readoptions_t*, unsigned char); | |
1214 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_total_order_seek( | |
1215 | rocksdb_readoptions_t*, unsigned char); | |
11fdf7f2 TL |
1216 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_max_skippable_internal_keys( |
1217 | rocksdb_readoptions_t*, uint64_t); | |
1218 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_background_purge_on_iterator_cleanup( | |
1219 | rocksdb_readoptions_t*, unsigned char); | |
1220 | extern ROCKSDB_LIBRARY_API void rocksdb_readoptions_set_ignore_range_deletions( | |
1221 | rocksdb_readoptions_t*, unsigned char); | |
7c673cae FG |
1222 | |
1223 | /* Write options */ | |
1224 | ||
1225 | extern ROCKSDB_LIBRARY_API rocksdb_writeoptions_t* | |
1226 | rocksdb_writeoptions_create(); | |
1227 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_destroy( | |
1228 | rocksdb_writeoptions_t*); | |
1229 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_set_sync( | |
1230 | rocksdb_writeoptions_t*, unsigned char); | |
1231 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_disable_WAL( | |
1232 | rocksdb_writeoptions_t* opt, int disable); | |
11fdf7f2 TL |
1233 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_set_ignore_missing_column_families( |
1234 | rocksdb_writeoptions_t*, unsigned char); | |
1235 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_set_no_slowdown( | |
1236 | rocksdb_writeoptions_t*, unsigned char); | |
1237 | extern ROCKSDB_LIBRARY_API void rocksdb_writeoptions_set_low_pri( | |
1238 | rocksdb_writeoptions_t*, unsigned char); | |
7c673cae FG |
1239 | |
1240 | /* Compact range options */ | |
1241 | ||
1242 | extern ROCKSDB_LIBRARY_API rocksdb_compactoptions_t* | |
1243 | rocksdb_compactoptions_create(); | |
1244 | extern ROCKSDB_LIBRARY_API void rocksdb_compactoptions_destroy( | |
1245 | rocksdb_compactoptions_t*); | |
1246 | extern ROCKSDB_LIBRARY_API void | |
1247 | rocksdb_compactoptions_set_exclusive_manual_compaction( | |
1248 | rocksdb_compactoptions_t*, unsigned char); | |
11fdf7f2 TL |
1249 | extern ROCKSDB_LIBRARY_API void |
1250 | rocksdb_compactoptions_set_bottommost_level_compaction( | |
1251 | rocksdb_compactoptions_t*, unsigned char); | |
7c673cae FG |
1252 | extern ROCKSDB_LIBRARY_API void rocksdb_compactoptions_set_change_level( |
1253 | rocksdb_compactoptions_t*, unsigned char); | |
1254 | extern ROCKSDB_LIBRARY_API void rocksdb_compactoptions_set_target_level( | |
1255 | rocksdb_compactoptions_t*, int); | |
1256 | ||
1257 | /* Flush options */ | |
1258 | ||
1259 | extern ROCKSDB_LIBRARY_API rocksdb_flushoptions_t* | |
1260 | rocksdb_flushoptions_create(); | |
1261 | extern ROCKSDB_LIBRARY_API void rocksdb_flushoptions_destroy( | |
1262 | rocksdb_flushoptions_t*); | |
1263 | extern ROCKSDB_LIBRARY_API void rocksdb_flushoptions_set_wait( | |
1264 | rocksdb_flushoptions_t*, unsigned char); | |
1265 | ||
1266 | /* Cache */ | |
1267 | ||
1268 | extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru( | |
1269 | size_t capacity); | |
1270 | extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache); | |
1271 | extern ROCKSDB_LIBRARY_API void rocksdb_cache_set_capacity( | |
1272 | rocksdb_cache_t* cache, size_t capacity); | |
1273 | extern ROCKSDB_LIBRARY_API size_t | |
1274 | rocksdb_cache_get_usage(rocksdb_cache_t* cache); | |
1275 | extern ROCKSDB_LIBRARY_API size_t | |
1276 | rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache); | |
1277 | ||
11fdf7f2 TL |
1278 | /* DBPath */ |
1279 | ||
1280 | extern ROCKSDB_LIBRARY_API rocksdb_dbpath_t* rocksdb_dbpath_create(const char* path, uint64_t target_size); | |
1281 | extern ROCKSDB_LIBRARY_API void rocksdb_dbpath_destroy(rocksdb_dbpath_t*); | |
1282 | ||
7c673cae FG |
1283 | /* Env */ |
1284 | ||
1285 | extern ROCKSDB_LIBRARY_API rocksdb_env_t* rocksdb_create_default_env(); | |
1286 | extern ROCKSDB_LIBRARY_API rocksdb_env_t* rocksdb_create_mem_env(); | |
1287 | extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads( | |
1288 | rocksdb_env_t* env, int n); | |
1289 | extern ROCKSDB_LIBRARY_API void | |
1290 | rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n); | |
1291 | extern ROCKSDB_LIBRARY_API void rocksdb_env_join_all_threads( | |
1292 | rocksdb_env_t* env); | |
1293 | extern ROCKSDB_LIBRARY_API void rocksdb_env_destroy(rocksdb_env_t*); | |
1294 | ||
1295 | extern ROCKSDB_LIBRARY_API rocksdb_envoptions_t* rocksdb_envoptions_create(); | |
1296 | extern ROCKSDB_LIBRARY_API void rocksdb_envoptions_destroy( | |
1297 | rocksdb_envoptions_t* opt); | |
1298 | ||
1299 | /* SstFile */ | |
1300 | ||
1301 | extern ROCKSDB_LIBRARY_API rocksdb_sstfilewriter_t* | |
1302 | rocksdb_sstfilewriter_create(const rocksdb_envoptions_t* env, | |
1303 | const rocksdb_options_t* io_options); | |
1304 | extern ROCKSDB_LIBRARY_API rocksdb_sstfilewriter_t* | |
1305 | rocksdb_sstfilewriter_create_with_comparator( | |
1306 | const rocksdb_envoptions_t* env, const rocksdb_options_t* io_options, | |
1307 | const rocksdb_comparator_t* comparator); | |
1308 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_open( | |
1309 | rocksdb_sstfilewriter_t* writer, const char* name, char** errptr); | |
1310 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_add( | |
1311 | rocksdb_sstfilewriter_t* writer, const char* key, size_t keylen, | |
1312 | const char* val, size_t vallen, char** errptr); | |
11fdf7f2 TL |
1313 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_put( |
1314 | rocksdb_sstfilewriter_t* writer, const char* key, size_t keylen, | |
1315 | const char* val, size_t vallen, char** errptr); | |
1316 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_merge( | |
1317 | rocksdb_sstfilewriter_t* writer, const char* key, size_t keylen, | |
1318 | const char* val, size_t vallen, char** errptr); | |
1319 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_delete( | |
1320 | rocksdb_sstfilewriter_t* writer, const char* key, size_t keylen, | |
1321 | char** errptr); | |
7c673cae FG |
1322 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_finish( |
1323 | rocksdb_sstfilewriter_t* writer, char** errptr); | |
11fdf7f2 TL |
1324 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_file_size( |
1325 | rocksdb_sstfilewriter_t* writer, uint64_t* file_size); | |
7c673cae FG |
1326 | extern ROCKSDB_LIBRARY_API void rocksdb_sstfilewriter_destroy( |
1327 | rocksdb_sstfilewriter_t* writer); | |
1328 | ||
1329 | extern ROCKSDB_LIBRARY_API rocksdb_ingestexternalfileoptions_t* | |
1330 | rocksdb_ingestexternalfileoptions_create(); | |
1331 | extern ROCKSDB_LIBRARY_API void | |
1332 | rocksdb_ingestexternalfileoptions_set_move_files( | |
1333 | rocksdb_ingestexternalfileoptions_t* opt, unsigned char move_files); | |
1334 | extern ROCKSDB_LIBRARY_API void | |
1335 | rocksdb_ingestexternalfileoptions_set_snapshot_consistency( | |
1336 | rocksdb_ingestexternalfileoptions_t* opt, | |
1337 | unsigned char snapshot_consistency); | |
1338 | extern ROCKSDB_LIBRARY_API void | |
1339 | rocksdb_ingestexternalfileoptions_set_allow_global_seqno( | |
1340 | rocksdb_ingestexternalfileoptions_t* opt, unsigned char allow_global_seqno); | |
1341 | extern ROCKSDB_LIBRARY_API void | |
1342 | rocksdb_ingestexternalfileoptions_set_allow_blocking_flush( | |
1343 | rocksdb_ingestexternalfileoptions_t* opt, | |
1344 | unsigned char allow_blocking_flush); | |
11fdf7f2 TL |
1345 | extern ROCKSDB_LIBRARY_API void |
1346 | rocksdb_ingestexternalfileoptions_set_ingest_behind( | |
1347 | rocksdb_ingestexternalfileoptions_t* opt, | |
1348 | unsigned char ingest_behind); | |
7c673cae FG |
1349 | extern ROCKSDB_LIBRARY_API void rocksdb_ingestexternalfileoptions_destroy( |
1350 | rocksdb_ingestexternalfileoptions_t* opt); | |
1351 | ||
1352 | extern ROCKSDB_LIBRARY_API void rocksdb_ingest_external_file( | |
1353 | rocksdb_t* db, const char* const* file_list, const size_t list_len, | |
1354 | const rocksdb_ingestexternalfileoptions_t* opt, char** errptr); | |
1355 | extern ROCKSDB_LIBRARY_API void rocksdb_ingest_external_file_cf( | |
1356 | rocksdb_t* db, rocksdb_column_family_handle_t* handle, | |
1357 | const char* const* file_list, const size_t list_len, | |
1358 | const rocksdb_ingestexternalfileoptions_t* opt, char** errptr); | |
1359 | ||
1360 | /* SliceTransform */ | |
1361 | ||
1362 | extern ROCKSDB_LIBRARY_API rocksdb_slicetransform_t* | |
1363 | rocksdb_slicetransform_create( | |
1364 | void* state, void (*destructor)(void*), | |
1365 | char* (*transform)(void*, const char* key, size_t length, | |
1366 | size_t* dst_length), | |
1367 | unsigned char (*in_domain)(void*, const char* key, size_t length), | |
1368 | unsigned char (*in_range)(void*, const char* key, size_t length), | |
1369 | const char* (*name)(void*)); | |
1370 | extern ROCKSDB_LIBRARY_API rocksdb_slicetransform_t* | |
1371 | rocksdb_slicetransform_create_fixed_prefix(size_t); | |
1372 | extern ROCKSDB_LIBRARY_API rocksdb_slicetransform_t* | |
1373 | rocksdb_slicetransform_create_noop(); | |
1374 | extern ROCKSDB_LIBRARY_API void rocksdb_slicetransform_destroy( | |
1375 | rocksdb_slicetransform_t*); | |
1376 | ||
1377 | /* Universal Compaction options */ | |
1378 | ||
1379 | enum { | |
1380 | rocksdb_similar_size_compaction_stop_style = 0, | |
1381 | rocksdb_total_size_compaction_stop_style = 1 | |
1382 | }; | |
1383 | ||
1384 | extern ROCKSDB_LIBRARY_API rocksdb_universal_compaction_options_t* | |
1385 | rocksdb_universal_compaction_options_create(); | |
1386 | extern ROCKSDB_LIBRARY_API void | |
1387 | rocksdb_universal_compaction_options_set_size_ratio( | |
1388 | rocksdb_universal_compaction_options_t*, int); | |
1389 | extern ROCKSDB_LIBRARY_API void | |
1390 | rocksdb_universal_compaction_options_set_min_merge_width( | |
1391 | rocksdb_universal_compaction_options_t*, int); | |
1392 | extern ROCKSDB_LIBRARY_API void | |
1393 | rocksdb_universal_compaction_options_set_max_merge_width( | |
1394 | rocksdb_universal_compaction_options_t*, int); | |
1395 | extern ROCKSDB_LIBRARY_API void | |
1396 | rocksdb_universal_compaction_options_set_max_size_amplification_percent( | |
1397 | rocksdb_universal_compaction_options_t*, int); | |
1398 | extern ROCKSDB_LIBRARY_API void | |
1399 | rocksdb_universal_compaction_options_set_compression_size_percent( | |
1400 | rocksdb_universal_compaction_options_t*, int); | |
1401 | extern ROCKSDB_LIBRARY_API void | |
1402 | rocksdb_universal_compaction_options_set_stop_style( | |
1403 | rocksdb_universal_compaction_options_t*, int); | |
1404 | extern ROCKSDB_LIBRARY_API void rocksdb_universal_compaction_options_destroy( | |
1405 | rocksdb_universal_compaction_options_t*); | |
1406 | ||
1407 | extern ROCKSDB_LIBRARY_API rocksdb_fifo_compaction_options_t* | |
1408 | rocksdb_fifo_compaction_options_create(); | |
1409 | extern ROCKSDB_LIBRARY_API void | |
1410 | rocksdb_fifo_compaction_options_set_max_table_files_size( | |
1411 | rocksdb_fifo_compaction_options_t* fifo_opts, uint64_t size); | |
1412 | extern ROCKSDB_LIBRARY_API void rocksdb_fifo_compaction_options_destroy( | |
1413 | rocksdb_fifo_compaction_options_t* fifo_opts); | |
1414 | ||
1415 | extern ROCKSDB_LIBRARY_API int rocksdb_livefiles_count( | |
1416 | const rocksdb_livefiles_t*); | |
1417 | extern ROCKSDB_LIBRARY_API const char* rocksdb_livefiles_name( | |
1418 | const rocksdb_livefiles_t*, int index); | |
1419 | extern ROCKSDB_LIBRARY_API int rocksdb_livefiles_level( | |
1420 | const rocksdb_livefiles_t*, int index); | |
1421 | extern ROCKSDB_LIBRARY_API size_t | |
1422 | rocksdb_livefiles_size(const rocksdb_livefiles_t*, int index); | |
1423 | extern ROCKSDB_LIBRARY_API const char* rocksdb_livefiles_smallestkey( | |
1424 | const rocksdb_livefiles_t*, int index, size_t* size); | |
1425 | extern ROCKSDB_LIBRARY_API const char* rocksdb_livefiles_largestkey( | |
1426 | const rocksdb_livefiles_t*, int index, size_t* size); | |
494da23a TL |
1427 | extern ROCKSDB_LIBRARY_API uint64_t rocksdb_livefiles_entries( |
1428 | const rocksdb_livefiles_t*, int index); | |
1429 | extern ROCKSDB_LIBRARY_API uint64_t rocksdb_livefiles_deletions( | |
1430 | const rocksdb_livefiles_t*, int index); | |
7c673cae FG |
1431 | extern ROCKSDB_LIBRARY_API void rocksdb_livefiles_destroy( |
1432 | const rocksdb_livefiles_t*); | |
1433 | ||
1434 | /* Utility Helpers */ | |
1435 | ||
1436 | extern ROCKSDB_LIBRARY_API void rocksdb_get_options_from_string( | |
1437 | const rocksdb_options_t* base_options, const char* opts_str, | |
1438 | rocksdb_options_t* new_options, char** errptr); | |
1439 | ||
1440 | extern ROCKSDB_LIBRARY_API void rocksdb_delete_file_in_range( | |
1441 | rocksdb_t* db, const char* start_key, size_t start_key_len, | |
1442 | const char* limit_key, size_t limit_key_len, char** errptr); | |
1443 | ||
1444 | extern ROCKSDB_LIBRARY_API void rocksdb_delete_file_in_range_cf( | |
1445 | rocksdb_t* db, rocksdb_column_family_handle_t* column_family, | |
1446 | const char* start_key, size_t start_key_len, const char* limit_key, | |
1447 | size_t limit_key_len, char** errptr); | |
1448 | ||
11fdf7f2 TL |
1449 | /* Transactions */ |
1450 | ||
1451 | extern ROCKSDB_LIBRARY_API rocksdb_column_family_handle_t* | |
1452 | rocksdb_transactiondb_create_column_family( | |
1453 | rocksdb_transactiondb_t* txn_db, | |
1454 | const rocksdb_options_t* column_family_options, | |
1455 | const char* column_family_name, char** errptr); | |
1456 | ||
1457 | extern ROCKSDB_LIBRARY_API rocksdb_transactiondb_t* rocksdb_transactiondb_open( | |
1458 | const rocksdb_options_t* options, | |
1459 | const rocksdb_transactiondb_options_t* txn_db_options, const char* name, | |
1460 | char** errptr); | |
1461 | ||
494da23a TL |
1462 | rocksdb_transactiondb_t* rocksdb_transactiondb_open_column_families( |
1463 | const rocksdb_options_t* options, | |
1464 | const rocksdb_transactiondb_options_t* txn_db_options, const char* name, | |
1465 | int num_column_families, const char** column_family_names, | |
1466 | const rocksdb_options_t** column_family_options, | |
1467 | rocksdb_column_family_handle_t** column_family_handles, char** errptr); | |
1468 | ||
11fdf7f2 TL |
1469 | extern ROCKSDB_LIBRARY_API const rocksdb_snapshot_t* |
1470 | rocksdb_transactiondb_create_snapshot(rocksdb_transactiondb_t* txn_db); | |
1471 | ||
1472 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_release_snapshot( | |
1473 | rocksdb_transactiondb_t* txn_db, const rocksdb_snapshot_t* snapshot); | |
1474 | ||
1475 | extern ROCKSDB_LIBRARY_API rocksdb_transaction_t* rocksdb_transaction_begin( | |
1476 | rocksdb_transactiondb_t* txn_db, | |
1477 | const rocksdb_writeoptions_t* write_options, | |
1478 | const rocksdb_transaction_options_t* txn_options, | |
1479 | rocksdb_transaction_t* old_txn); | |
1480 | ||
1481 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_commit( | |
1482 | rocksdb_transaction_t* txn, char** errptr); | |
1483 | ||
1484 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_rollback( | |
1485 | rocksdb_transaction_t* txn, char** errptr); | |
1486 | ||
1487 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_set_savepoint( | |
1488 | rocksdb_transaction_t* txn); | |
1489 | ||
1490 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_rollback_to_savepoint( | |
1491 | rocksdb_transaction_t* txn, char** errptr); | |
1492 | ||
1493 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_destroy( | |
1494 | rocksdb_transaction_t* txn); | |
1495 | ||
1496 | // This snapshot should be freed using rocksdb_free | |
1497 | extern ROCKSDB_LIBRARY_API const rocksdb_snapshot_t* | |
1498 | rocksdb_transaction_get_snapshot(rocksdb_transaction_t* txn); | |
1499 | ||
1500 | extern ROCKSDB_LIBRARY_API char* rocksdb_transaction_get( | |
1501 | rocksdb_transaction_t* txn, const rocksdb_readoptions_t* options, | |
1502 | const char* key, size_t klen, size_t* vlen, char** errptr); | |
1503 | ||
1504 | extern ROCKSDB_LIBRARY_API char* rocksdb_transaction_get_cf( | |
1505 | rocksdb_transaction_t* txn, const rocksdb_readoptions_t* options, | |
1506 | rocksdb_column_family_handle_t* column_family, const char* key, size_t klen, | |
1507 | size_t* vlen, char** errptr); | |
1508 | ||
1509 | extern ROCKSDB_LIBRARY_API char* rocksdb_transaction_get_for_update( | |
1510 | rocksdb_transaction_t* txn, const rocksdb_readoptions_t* options, | |
1511 | const char* key, size_t klen, size_t* vlen, unsigned char exclusive, | |
1512 | char** errptr); | |
1513 | ||
494da23a TL |
1514 | char* rocksdb_transaction_get_for_update_cf( |
1515 | rocksdb_transaction_t* txn, const rocksdb_readoptions_t* options, | |
1516 | rocksdb_column_family_handle_t* column_family, const char* key, size_t klen, | |
1517 | size_t* vlen, unsigned char exclusive, char** errptr); | |
1518 | ||
11fdf7f2 TL |
1519 | extern ROCKSDB_LIBRARY_API char* rocksdb_transactiondb_get( |
1520 | rocksdb_transactiondb_t* txn_db, const rocksdb_readoptions_t* options, | |
1521 | const char* key, size_t klen, size_t* vlen, char** errptr); | |
1522 | ||
1523 | extern ROCKSDB_LIBRARY_API char* rocksdb_transactiondb_get_cf( | |
1524 | rocksdb_transactiondb_t* txn_db, const rocksdb_readoptions_t* options, | |
1525 | rocksdb_column_family_handle_t* column_family, const char* key, | |
1526 | size_t keylen, size_t* vallen, char** errptr); | |
1527 | ||
1528 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_put( | |
1529 | rocksdb_transaction_t* txn, const char* key, size_t klen, const char* val, | |
1530 | size_t vlen, char** errptr); | |
1531 | ||
1532 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_put_cf( | |
1533 | rocksdb_transaction_t* txn, rocksdb_column_family_handle_t* column_family, | |
1534 | const char* key, size_t klen, const char* val, size_t vlen, char** errptr); | |
1535 | ||
1536 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_put( | |
1537 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1538 | const char* key, size_t klen, const char* val, size_t vlen, char** errptr); | |
1539 | ||
1540 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_put_cf( | |
1541 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1542 | rocksdb_column_family_handle_t* column_family, const char* key, | |
1543 | size_t keylen, const char* val, size_t vallen, char** errptr); | |
1544 | ||
1545 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_write( | |
1546 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1547 | rocksdb_writebatch_t *batch, char** errptr); | |
1548 | ||
1549 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_merge( | |
1550 | rocksdb_transaction_t* txn, const char* key, size_t klen, const char* val, | |
1551 | size_t vlen, char** errptr); | |
1552 | ||
494da23a TL |
1553 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_merge_cf( |
1554 | rocksdb_transaction_t* txn, rocksdb_column_family_handle_t* column_family, | |
1555 | const char* key, size_t klen, const char* val, size_t vlen, char** errptr); | |
1556 | ||
11fdf7f2 TL |
1557 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_merge( |
1558 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1559 | const char* key, size_t klen, const char* val, size_t vlen, char** errptr); | |
1560 | ||
494da23a TL |
1561 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_merge_cf( |
1562 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1563 | rocksdb_column_family_handle_t* column_family, const char* key, size_t klen, | |
1564 | const char* val, size_t vlen, char** errptr); | |
1565 | ||
11fdf7f2 TL |
1566 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_delete( |
1567 | rocksdb_transaction_t* txn, const char* key, size_t klen, char** errptr); | |
1568 | ||
1569 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_delete_cf( | |
1570 | rocksdb_transaction_t* txn, rocksdb_column_family_handle_t* column_family, | |
1571 | const char* key, size_t klen, char** errptr); | |
1572 | ||
1573 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_delete( | |
1574 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1575 | const char* key, size_t klen, char** errptr); | |
1576 | ||
1577 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_delete_cf( | |
1578 | rocksdb_transactiondb_t* txn_db, const rocksdb_writeoptions_t* options, | |
1579 | rocksdb_column_family_handle_t* column_family, const char* key, | |
1580 | size_t keylen, char** errptr); | |
1581 | ||
1582 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* | |
1583 | rocksdb_transaction_create_iterator(rocksdb_transaction_t* txn, | |
1584 | const rocksdb_readoptions_t* options); | |
1585 | ||
1586 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* | |
1587 | rocksdb_transaction_create_iterator_cf( | |
1588 | rocksdb_transaction_t* txn, const rocksdb_readoptions_t* options, | |
1589 | rocksdb_column_family_handle_t* column_family); | |
1590 | ||
1591 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* | |
1592 | rocksdb_transactiondb_create_iterator(rocksdb_transactiondb_t* txn_db, | |
1593 | const rocksdb_readoptions_t* options); | |
1594 | ||
494da23a TL |
1595 | extern ROCKSDB_LIBRARY_API rocksdb_iterator_t* |
1596 | rocksdb_transactiondb_create_iterator_cf( | |
1597 | rocksdb_transactiondb_t* txn_db, const rocksdb_readoptions_t* options, | |
1598 | rocksdb_column_family_handle_t* column_family); | |
1599 | ||
11fdf7f2 TL |
1600 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_close( |
1601 | rocksdb_transactiondb_t* txn_db); | |
1602 | ||
1603 | extern ROCKSDB_LIBRARY_API rocksdb_checkpoint_t* | |
1604 | rocksdb_transactiondb_checkpoint_object_create(rocksdb_transactiondb_t* txn_db, | |
1605 | char** errptr); | |
1606 | ||
1607 | extern ROCKSDB_LIBRARY_API rocksdb_optimistictransactiondb_t* | |
1608 | rocksdb_optimistictransactiondb_open(const rocksdb_options_t* options, | |
1609 | const char* name, char** errptr); | |
1610 | ||
1611 | extern ROCKSDB_LIBRARY_API rocksdb_optimistictransactiondb_t* | |
1612 | rocksdb_optimistictransactiondb_open_column_families( | |
1613 | const rocksdb_options_t* options, const char* name, int num_column_families, | |
1614 | const char** column_family_names, | |
1615 | const rocksdb_options_t** column_family_options, | |
1616 | rocksdb_column_family_handle_t** column_family_handles, char** errptr); | |
1617 | ||
1618 | extern ROCKSDB_LIBRARY_API rocksdb_t* | |
1619 | rocksdb_optimistictransactiondb_get_base_db( | |
1620 | rocksdb_optimistictransactiondb_t* otxn_db); | |
1621 | ||
1622 | extern ROCKSDB_LIBRARY_API void rocksdb_optimistictransactiondb_close_base_db( | |
1623 | rocksdb_t* base_db); | |
1624 | ||
1625 | extern ROCKSDB_LIBRARY_API rocksdb_transaction_t* | |
1626 | rocksdb_optimistictransaction_begin( | |
1627 | rocksdb_optimistictransactiondb_t* otxn_db, | |
1628 | const rocksdb_writeoptions_t* write_options, | |
1629 | const rocksdb_optimistictransaction_options_t* otxn_options, | |
1630 | rocksdb_transaction_t* old_txn); | |
1631 | ||
1632 | extern ROCKSDB_LIBRARY_API void rocksdb_optimistictransactiondb_close( | |
1633 | rocksdb_optimistictransactiondb_t* otxn_db); | |
1634 | ||
1635 | /* Transaction Options */ | |
1636 | ||
1637 | extern ROCKSDB_LIBRARY_API rocksdb_transactiondb_options_t* | |
1638 | rocksdb_transactiondb_options_create(); | |
1639 | ||
1640 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_options_destroy( | |
1641 | rocksdb_transactiondb_options_t* opt); | |
1642 | ||
1643 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_options_set_max_num_locks( | |
1644 | rocksdb_transactiondb_options_t* opt, int64_t max_num_locks); | |
1645 | ||
1646 | extern ROCKSDB_LIBRARY_API void rocksdb_transactiondb_options_set_num_stripes( | |
1647 | rocksdb_transactiondb_options_t* opt, size_t num_stripes); | |
1648 | ||
1649 | extern ROCKSDB_LIBRARY_API void | |
1650 | rocksdb_transactiondb_options_set_transaction_lock_timeout( | |
1651 | rocksdb_transactiondb_options_t* opt, int64_t txn_lock_timeout); | |
1652 | ||
1653 | extern ROCKSDB_LIBRARY_API void | |
1654 | rocksdb_transactiondb_options_set_default_lock_timeout( | |
1655 | rocksdb_transactiondb_options_t* opt, int64_t default_lock_timeout); | |
1656 | ||
1657 | extern ROCKSDB_LIBRARY_API rocksdb_transaction_options_t* | |
1658 | rocksdb_transaction_options_create(); | |
1659 | ||
1660 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_options_destroy( | |
1661 | rocksdb_transaction_options_t* opt); | |
1662 | ||
1663 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_options_set_set_snapshot( | |
1664 | rocksdb_transaction_options_t* opt, unsigned char v); | |
1665 | ||
1666 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_options_set_deadlock_detect( | |
1667 | rocksdb_transaction_options_t* opt, unsigned char v); | |
1668 | ||
1669 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_options_set_lock_timeout( | |
1670 | rocksdb_transaction_options_t* opt, int64_t lock_timeout); | |
1671 | ||
1672 | extern ROCKSDB_LIBRARY_API void rocksdb_transaction_options_set_expiration( | |
1673 | rocksdb_transaction_options_t* opt, int64_t expiration); | |
1674 | ||
1675 | extern ROCKSDB_LIBRARY_API void | |
1676 | rocksdb_transaction_options_set_deadlock_detect_depth( | |
1677 | rocksdb_transaction_options_t* opt, int64_t depth); | |
1678 | ||
1679 | extern ROCKSDB_LIBRARY_API void | |
1680 | rocksdb_transaction_options_set_max_write_batch_size( | |
1681 | rocksdb_transaction_options_t* opt, size_t size); | |
1682 | ||
1683 | extern ROCKSDB_LIBRARY_API rocksdb_optimistictransaction_options_t* | |
1684 | rocksdb_optimistictransaction_options_create(); | |
1685 | ||
1686 | extern ROCKSDB_LIBRARY_API void rocksdb_optimistictransaction_options_destroy( | |
1687 | rocksdb_optimistictransaction_options_t* opt); | |
1688 | ||
1689 | extern ROCKSDB_LIBRARY_API void | |
1690 | rocksdb_optimistictransaction_options_set_set_snapshot( | |
1691 | rocksdb_optimistictransaction_options_t* opt, unsigned char v); | |
1692 | ||
7c673cae FG |
1693 | // referring to convention (3), this should be used by client |
1694 | // to free memory that was malloc()ed | |
1695 | extern ROCKSDB_LIBRARY_API void rocksdb_free(void* ptr); | |
1696 | ||
11fdf7f2 TL |
1697 | extern ROCKSDB_LIBRARY_API rocksdb_pinnableslice_t* rocksdb_get_pinned( |
1698 | rocksdb_t* db, const rocksdb_readoptions_t* options, const char* key, | |
1699 | size_t keylen, char** errptr); | |
1700 | extern ROCKSDB_LIBRARY_API rocksdb_pinnableslice_t* rocksdb_get_pinned_cf( | |
1701 | rocksdb_t* db, const rocksdb_readoptions_t* options, | |
1702 | rocksdb_column_family_handle_t* column_family, const char* key, | |
1703 | size_t keylen, char** errptr); | |
1704 | extern ROCKSDB_LIBRARY_API void rocksdb_pinnableslice_destroy( | |
1705 | rocksdb_pinnableslice_t* v); | |
1706 | extern ROCKSDB_LIBRARY_API const char* rocksdb_pinnableslice_value( | |
1707 | const rocksdb_pinnableslice_t* t, size_t* vlen); | |
1708 | ||
1709 | extern ROCKSDB_LIBRARY_API rocksdb_memory_consumers_t* | |
1710 | rocksdb_memory_consumers_create(); | |
1711 | extern ROCKSDB_LIBRARY_API void rocksdb_memory_consumers_add_db( | |
1712 | rocksdb_memory_consumers_t* consumers, rocksdb_t* db); | |
1713 | extern ROCKSDB_LIBRARY_API void rocksdb_memory_consumers_add_cache( | |
1714 | rocksdb_memory_consumers_t* consumers, rocksdb_cache_t* cache); | |
1715 | extern ROCKSDB_LIBRARY_API void rocksdb_memory_consumers_destroy( | |
1716 | rocksdb_memory_consumers_t* consumers); | |
1717 | extern ROCKSDB_LIBRARY_API rocksdb_memory_usage_t* | |
1718 | rocksdb_approximate_memory_usage_create(rocksdb_memory_consumers_t* consumers, | |
1719 | char** errptr); | |
1720 | extern ROCKSDB_LIBRARY_API void rocksdb_approximate_memory_usage_destroy( | |
1721 | rocksdb_memory_usage_t* usage); | |
1722 | ||
1723 | extern ROCKSDB_LIBRARY_API uint64_t | |
1724 | rocksdb_approximate_memory_usage_get_mem_table_total( | |
1725 | rocksdb_memory_usage_t* memory_usage); | |
1726 | extern ROCKSDB_LIBRARY_API uint64_t | |
1727 | rocksdb_approximate_memory_usage_get_mem_table_unflushed( | |
1728 | rocksdb_memory_usage_t* memory_usage); | |
1729 | extern ROCKSDB_LIBRARY_API uint64_t | |
1730 | rocksdb_approximate_memory_usage_get_mem_table_readers_total( | |
1731 | rocksdb_memory_usage_t* memory_usage); | |
1732 | extern ROCKSDB_LIBRARY_API uint64_t | |
1733 | rocksdb_approximate_memory_usage_get_cache_total( | |
1734 | rocksdb_memory_usage_t* memory_usage); | |
1735 | ||
7c673cae FG |
1736 | #ifdef __cplusplus |
1737 | } /* end extern "C" */ | |
1738 | #endif |