@nxtedition/rocksdb 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1088) hide show
  1. package/CHANGELOG.md +294 -0
  2. package/LICENSE +21 -0
  3. package/README.md +102 -0
  4. package/UPGRADING.md +91 -0
  5. package/binding.cc +1276 -0
  6. package/binding.gyp +73 -0
  7. package/binding.js +1 -0
  8. package/chained-batch.js +44 -0
  9. package/deps/rocksdb/build_version.cc +4 -0
  10. package/deps/rocksdb/rocksdb/CMakeLists.txt +1356 -0
  11. package/deps/rocksdb/rocksdb/COPYING +339 -0
  12. package/deps/rocksdb/rocksdb/LICENSE.Apache +202 -0
  13. package/deps/rocksdb/rocksdb/LICENSE.leveldb +29 -0
  14. package/deps/rocksdb/rocksdb/Makefile +2521 -0
  15. package/deps/rocksdb/rocksdb/TARGETS +2100 -0
  16. package/deps/rocksdb/rocksdb/cache/cache.cc +63 -0
  17. package/deps/rocksdb/rocksdb/cache/cache_bench.cc +381 -0
  18. package/deps/rocksdb/rocksdb/cache/cache_helpers.h +114 -0
  19. package/deps/rocksdb/rocksdb/cache/cache_test.cc +775 -0
  20. package/deps/rocksdb/rocksdb/cache/clock_cache.cc +769 -0
  21. package/deps/rocksdb/rocksdb/cache/clock_cache.h +16 -0
  22. package/deps/rocksdb/rocksdb/cache/lru_cache.cc +574 -0
  23. package/deps/rocksdb/rocksdb/cache/lru_cache.h +339 -0
  24. package/deps/rocksdb/rocksdb/cache/lru_cache_test.cc +199 -0
  25. package/deps/rocksdb/rocksdb/cache/sharded_cache.cc +162 -0
  26. package/deps/rocksdb/rocksdb/cache/sharded_cache.h +111 -0
  27. package/deps/rocksdb/rocksdb/cmake/RocksDBConfig.cmake.in +54 -0
  28. package/deps/rocksdb/rocksdb/cmake/modules/CxxFlags.cmake +7 -0
  29. package/deps/rocksdb/rocksdb/cmake/modules/FindJeMalloc.cmake +29 -0
  30. package/deps/rocksdb/rocksdb/cmake/modules/FindNUMA.cmake +29 -0
  31. package/deps/rocksdb/rocksdb/cmake/modules/FindSnappy.cmake +29 -0
  32. package/deps/rocksdb/rocksdb/cmake/modules/FindTBB.cmake +33 -0
  33. package/deps/rocksdb/rocksdb/cmake/modules/Findgflags.cmake +29 -0
  34. package/deps/rocksdb/rocksdb/cmake/modules/Findlz4.cmake +29 -0
  35. package/deps/rocksdb/rocksdb/cmake/modules/Findzstd.cmake +29 -0
  36. package/deps/rocksdb/rocksdb/cmake/modules/ReadVersion.cmake +10 -0
  37. package/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.cc +108 -0
  38. package/deps/rocksdb/rocksdb/db/arena_wrapped_db_iter.h +115 -0
  39. package/deps/rocksdb/rocksdb/db/blob/blob_constants.h +16 -0
  40. package/deps/rocksdb/rocksdb/db/blob/blob_file_addition.cc +154 -0
  41. package/deps/rocksdb/rocksdb/db/blob/blob_file_addition.h +67 -0
  42. package/deps/rocksdb/rocksdb/db/blob/blob_file_addition_test.cc +206 -0
  43. package/deps/rocksdb/rocksdb/db/blob/blob_file_builder.cc +316 -0
  44. package/deps/rocksdb/rocksdb/db/blob/blob_file_builder.h +91 -0
  45. package/deps/rocksdb/rocksdb/db/blob/blob_file_builder_test.cc +660 -0
  46. package/deps/rocksdb/rocksdb/db/blob/blob_file_cache.cc +99 -0
  47. package/deps/rocksdb/rocksdb/db/blob/blob_file_cache.h +49 -0
  48. package/deps/rocksdb/rocksdb/db/blob/blob_file_cache_test.cc +268 -0
  49. package/deps/rocksdb/rocksdb/db/blob/blob_file_garbage.cc +134 -0
  50. package/deps/rocksdb/rocksdb/db/blob/blob_file_garbage.h +57 -0
  51. package/deps/rocksdb/rocksdb/db/blob/blob_file_garbage_test.cc +173 -0
  52. package/deps/rocksdb/rocksdb/db/blob/blob_file_meta.cc +55 -0
  53. package/deps/rocksdb/rocksdb/db/blob/blob_file_meta.h +164 -0
  54. package/deps/rocksdb/rocksdb/db/blob/blob_file_reader.cc +423 -0
  55. package/deps/rocksdb/rocksdb/db/blob/blob_file_reader.h +81 -0
  56. package/deps/rocksdb/rocksdb/db/blob/blob_file_reader_test.cc +771 -0
  57. package/deps/rocksdb/rocksdb/db/blob/blob_index.h +184 -0
  58. package/deps/rocksdb/rocksdb/db/blob/blob_log_format.cc +145 -0
  59. package/deps/rocksdb/rocksdb/db/blob/blob_log_format.h +148 -0
  60. package/deps/rocksdb/rocksdb/db/blob/blob_log_sequential_reader.cc +132 -0
  61. package/deps/rocksdb/rocksdb/db/blob/blob_log_sequential_reader.h +76 -0
  62. package/deps/rocksdb/rocksdb/db/blob/blob_log_writer.cc +168 -0
  63. package/deps/rocksdb/rocksdb/db/blob/blob_log_writer.h +83 -0
  64. package/deps/rocksdb/rocksdb/db/blob/db_blob_basic_test.cc +307 -0
  65. package/deps/rocksdb/rocksdb/db/blob/db_blob_index_test.cc +464 -0
  66. package/deps/rocksdb/rocksdb/db/builder.cc +358 -0
  67. package/deps/rocksdb/rocksdb/db/builder.h +95 -0
  68. package/deps/rocksdb/rocksdb/db/c.cc +5281 -0
  69. package/deps/rocksdb/rocksdb/db/c_test.c +2883 -0
  70. package/deps/rocksdb/rocksdb/db/column_family.cc +1602 -0
  71. package/deps/rocksdb/rocksdb/db/column_family.h +787 -0
  72. package/deps/rocksdb/rocksdb/db/column_family_test.cc +3427 -0
  73. package/deps/rocksdb/rocksdb/db/compact_files_test.cc +425 -0
  74. package/deps/rocksdb/rocksdb/db/compacted_db_impl.cc +169 -0
  75. package/deps/rocksdb/rocksdb/db/compacted_db_impl.h +118 -0
  76. package/deps/rocksdb/rocksdb/db/compaction/compaction.cc +591 -0
  77. package/deps/rocksdb/rocksdb/db/compaction/compaction.h +389 -0
  78. package/deps/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h +37 -0
  79. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.cc +1023 -0
  80. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator.h +353 -0
  81. package/deps/rocksdb/rocksdb/db/compaction/compaction_iterator_test.cc +1254 -0
  82. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.cc +1917 -0
  83. package/deps/rocksdb/rocksdb/db/compaction/compaction_job.h +208 -0
  84. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_stats_test.cc +1037 -0
  85. package/deps/rocksdb/rocksdb/db/compaction/compaction_job_test.cc +1224 -0
  86. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.cc +1135 -0
  87. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker.h +318 -0
  88. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.cc +255 -0
  89. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_fifo.h +57 -0
  90. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.cc +510 -0
  91. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_level.h +33 -0
  92. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_test.cc +2190 -0
  93. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.cc +1103 -0
  94. package/deps/rocksdb/rocksdb/db/compaction/compaction_picker_universal.h +32 -0
  95. package/deps/rocksdb/rocksdb/db/compaction/sst_partitioner.cc +44 -0
  96. package/deps/rocksdb/rocksdb/db/comparator_db_test.cc +660 -0
  97. package/deps/rocksdb/rocksdb/db/convenience.cc +78 -0
  98. package/deps/rocksdb/rocksdb/db/corruption_test.cc +921 -0
  99. package/deps/rocksdb/rocksdb/db/cuckoo_table_db_test.cc +359 -0
  100. package/deps/rocksdb/rocksdb/db/db_basic_test.cc +3820 -0
  101. package/deps/rocksdb/rocksdb/db/db_block_cache_test.cc +1058 -0
  102. package/deps/rocksdb/rocksdb/db/db_bloom_filter_test.cc +2128 -0
  103. package/deps/rocksdb/rocksdb/db/db_compaction_filter_test.cc +851 -0
  104. package/deps/rocksdb/rocksdb/db/db_compaction_test.cc +6292 -0
  105. package/deps/rocksdb/rocksdb/db/db_dynamic_level_test.cc +509 -0
  106. package/deps/rocksdb/rocksdb/db/db_encryption_test.cc +130 -0
  107. package/deps/rocksdb/rocksdb/db/db_filesnapshot.cc +137 -0
  108. package/deps/rocksdb/rocksdb/db/db_flush_test.cc +1119 -0
  109. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.cc +5057 -0
  110. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +2274 -0
  111. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_compaction_flush.cc +3421 -0
  112. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_debug.cc +298 -0
  113. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_experimental.cc +151 -0
  114. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +967 -0
  115. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +1806 -0
  116. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.cc +270 -0
  117. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_readonly.h +146 -0
  118. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +683 -0
  119. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.h +333 -0
  120. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_write.cc +2024 -0
  121. package/deps/rocksdb/rocksdb/db/db_impl/db_secondary_test.cc +932 -0
  122. package/deps/rocksdb/rocksdb/db/db_info_dumper.cc +137 -0
  123. package/deps/rocksdb/rocksdb/db/db_info_dumper.h +15 -0
  124. package/deps/rocksdb/rocksdb/db/db_inplace_update_test.cc +178 -0
  125. package/deps/rocksdb/rocksdb/db/db_io_failure_test.cc +592 -0
  126. package/deps/rocksdb/rocksdb/db/db_iter.cc +1493 -0
  127. package/deps/rocksdb/rocksdb/db/db_iter.h +390 -0
  128. package/deps/rocksdb/rocksdb/db/db_iter_stress_test.cc +657 -0
  129. package/deps/rocksdb/rocksdb/db/db_iter_test.cc +3268 -0
  130. package/deps/rocksdb/rocksdb/db/db_iterator_test.cc +3197 -0
  131. package/deps/rocksdb/rocksdb/db/db_log_iter_test.cc +299 -0
  132. package/deps/rocksdb/rocksdb/db/db_logical_block_size_cache_test.cc +513 -0
  133. package/deps/rocksdb/rocksdb/db/db_memtable_test.cc +329 -0
  134. package/deps/rocksdb/rocksdb/db/db_merge_operand_test.cc +241 -0
  135. package/deps/rocksdb/rocksdb/db/db_merge_operator_test.cc +671 -0
  136. package/deps/rocksdb/rocksdb/db/db_options_test.cc +1022 -0
  137. package/deps/rocksdb/rocksdb/db/db_properties_test.cc +1723 -0
  138. package/deps/rocksdb/rocksdb/db/db_range_del_test.cc +1694 -0
  139. package/deps/rocksdb/rocksdb/db/db_sst_test.cc +1261 -0
  140. package/deps/rocksdb/rocksdb/db/db_statistics_test.cc +164 -0
  141. package/deps/rocksdb/rocksdb/db/db_table_properties_test.cc +488 -0
  142. package/deps/rocksdb/rocksdb/db/db_tailing_iter_test.cc +567 -0
  143. package/deps/rocksdb/rocksdb/db/db_test.cc +6736 -0
  144. package/deps/rocksdb/rocksdb/db/db_test2.cc +5408 -0
  145. package/deps/rocksdb/rocksdb/db/db_test_util.cc +1633 -0
  146. package/deps/rocksdb/rocksdb/db/db_test_util.h +1194 -0
  147. package/deps/rocksdb/rocksdb/db/db_universal_compaction_test.cc +2235 -0
  148. package/deps/rocksdb/rocksdb/db/db_wal_test.cc +1780 -0
  149. package/deps/rocksdb/rocksdb/db/db_with_timestamp_basic_test.cc +2520 -0
  150. package/deps/rocksdb/rocksdb/db/db_with_timestamp_compaction_test.cc +119 -0
  151. package/deps/rocksdb/rocksdb/db/db_write_test.cc +465 -0
  152. package/deps/rocksdb/rocksdb/db/dbformat.cc +222 -0
  153. package/deps/rocksdb/rocksdb/db/dbformat.h +786 -0
  154. package/deps/rocksdb/rocksdb/db/dbformat_test.cc +206 -0
  155. package/deps/rocksdb/rocksdb/db/deletefile_test.cc +580 -0
  156. package/deps/rocksdb/rocksdb/db/error_handler.cc +726 -0
  157. package/deps/rocksdb/rocksdb/db/error_handler.h +117 -0
  158. package/deps/rocksdb/rocksdb/db/error_handler_fs_test.cc +2598 -0
  159. package/deps/rocksdb/rocksdb/db/event_helpers.cc +233 -0
  160. package/deps/rocksdb/rocksdb/db/event_helpers.h +57 -0
  161. package/deps/rocksdb/rocksdb/db/experimental.cc +50 -0
  162. package/deps/rocksdb/rocksdb/db/external_sst_file_basic_test.cc +1559 -0
  163. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.cc +910 -0
  164. package/deps/rocksdb/rocksdb/db/external_sst_file_ingestion_job.h +195 -0
  165. package/deps/rocksdb/rocksdb/db/external_sst_file_test.cc +2936 -0
  166. package/deps/rocksdb/rocksdb/db/fault_injection_test.cc +556 -0
  167. package/deps/rocksdb/rocksdb/db/file_indexer.cc +216 -0
  168. package/deps/rocksdb/rocksdb/db/file_indexer.h +142 -0
  169. package/deps/rocksdb/rocksdb/db/file_indexer_test.cc +350 -0
  170. package/deps/rocksdb/rocksdb/db/filename_test.cc +179 -0
  171. package/deps/rocksdb/rocksdb/db/flush_job.cc +514 -0
  172. package/deps/rocksdb/rocksdb/db/flush_job.h +169 -0
  173. package/deps/rocksdb/rocksdb/db/flush_job_test.cc +647 -0
  174. package/deps/rocksdb/rocksdb/db/flush_scheduler.cc +86 -0
  175. package/deps/rocksdb/rocksdb/db/flush_scheduler.h +54 -0
  176. package/deps/rocksdb/rocksdb/db/forward_iterator.cc +1023 -0
  177. package/deps/rocksdb/rocksdb/db/forward_iterator.h +163 -0
  178. package/deps/rocksdb/rocksdb/db/forward_iterator_bench.cc +377 -0
  179. package/deps/rocksdb/rocksdb/db/import_column_family_job.cc +282 -0
  180. package/deps/rocksdb/rocksdb/db/import_column_family_job.h +75 -0
  181. package/deps/rocksdb/rocksdb/db/import_column_family_test.cc +632 -0
  182. package/deps/rocksdb/rocksdb/db/internal_stats.cc +1461 -0
  183. package/deps/rocksdb/rocksdb/db/internal_stats.h +712 -0
  184. package/deps/rocksdb/rocksdb/db/job_context.h +226 -0
  185. package/deps/rocksdb/rocksdb/db/listener_test.cc +1118 -0
  186. package/deps/rocksdb/rocksdb/db/log_format.h +48 -0
  187. package/deps/rocksdb/rocksdb/db/log_reader.cc +654 -0
  188. package/deps/rocksdb/rocksdb/db/log_reader.h +192 -0
  189. package/deps/rocksdb/rocksdb/db/log_test.cc +901 -0
  190. package/deps/rocksdb/rocksdb/db/log_writer.cc +164 -0
  191. package/deps/rocksdb/rocksdb/db/log_writer.h +115 -0
  192. package/deps/rocksdb/rocksdb/db/logs_with_prep_tracker.cc +67 -0
  193. package/deps/rocksdb/rocksdb/db/logs_with_prep_tracker.h +63 -0
  194. package/deps/rocksdb/rocksdb/db/lookup_key.h +66 -0
  195. package/deps/rocksdb/rocksdb/db/malloc_stats.cc +54 -0
  196. package/deps/rocksdb/rocksdb/db/malloc_stats.h +24 -0
  197. package/deps/rocksdb/rocksdb/db/manual_compaction_test.cc +296 -0
  198. package/deps/rocksdb/rocksdb/db/memtable.cc +1169 -0
  199. package/deps/rocksdb/rocksdb/db/memtable.h +554 -0
  200. package/deps/rocksdb/rocksdb/db/memtable_list.cc +888 -0
  201. package/deps/rocksdb/rocksdb/db/memtable_list.h +438 -0
  202. package/deps/rocksdb/rocksdb/db/memtable_list_test.cc +935 -0
  203. package/deps/rocksdb/rocksdb/db/merge_context.h +134 -0
  204. package/deps/rocksdb/rocksdb/db/merge_helper.cc +421 -0
  205. package/deps/rocksdb/rocksdb/db/merge_helper.h +197 -0
  206. package/deps/rocksdb/rocksdb/db/merge_helper_test.cc +290 -0
  207. package/deps/rocksdb/rocksdb/db/merge_operator.cc +86 -0
  208. package/deps/rocksdb/rocksdb/db/merge_test.cc +608 -0
  209. package/deps/rocksdb/rocksdb/db/obsolete_files_test.cc +338 -0
  210. package/deps/rocksdb/rocksdb/db/options_file_test.cc +119 -0
  211. package/deps/rocksdb/rocksdb/db/output_validator.cc +30 -0
  212. package/deps/rocksdb/rocksdb/db/output_validator.h +47 -0
  213. package/deps/rocksdb/rocksdb/db/perf_context_test.cc +993 -0
  214. package/deps/rocksdb/rocksdb/db/periodic_work_scheduler.cc +113 -0
  215. package/deps/rocksdb/rocksdb/db/periodic_work_scheduler.h +76 -0
  216. package/deps/rocksdb/rocksdb/db/periodic_work_scheduler_test.cc +231 -0
  217. package/deps/rocksdb/rocksdb/db/pinned_iterators_manager.h +87 -0
  218. package/deps/rocksdb/rocksdb/db/plain_table_db_test.cc +1374 -0
  219. package/deps/rocksdb/rocksdb/db/pre_release_callback.h +38 -0
  220. package/deps/rocksdb/rocksdb/db/prefix_test.cc +910 -0
  221. package/deps/rocksdb/rocksdb/db/range_del_aggregator.cc +489 -0
  222. package/deps/rocksdb/rocksdb/db/range_del_aggregator.h +446 -0
  223. package/deps/rocksdb/rocksdb/db/range_del_aggregator_bench.cc +260 -0
  224. package/deps/rocksdb/rocksdb/db/range_del_aggregator_test.cc +709 -0
  225. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter.cc +439 -0
  226. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter.h +256 -0
  227. package/deps/rocksdb/rocksdb/db/range_tombstone_fragmenter_test.cc +552 -0
  228. package/deps/rocksdb/rocksdb/db/read_callback.h +53 -0
  229. package/deps/rocksdb/rocksdb/db/repair.cc +722 -0
  230. package/deps/rocksdb/rocksdb/db/repair_test.cc +390 -0
  231. package/deps/rocksdb/rocksdb/db/snapshot_checker.h +61 -0
  232. package/deps/rocksdb/rocksdb/db/snapshot_impl.cc +26 -0
  233. package/deps/rocksdb/rocksdb/db/snapshot_impl.h +167 -0
  234. package/deps/rocksdb/rocksdb/db/table_cache.cc +704 -0
  235. package/deps/rocksdb/rocksdb/db/table_cache.h +233 -0
  236. package/deps/rocksdb/rocksdb/db/table_properties_collector.cc +75 -0
  237. package/deps/rocksdb/rocksdb/db/table_properties_collector.h +107 -0
  238. package/deps/rocksdb/rocksdb/db/table_properties_collector_test.cc +517 -0
  239. package/deps/rocksdb/rocksdb/db/transaction_log_impl.cc +318 -0
  240. package/deps/rocksdb/rocksdb/db/transaction_log_impl.h +128 -0
  241. package/deps/rocksdb/rocksdb/db/trim_history_scheduler.cc +54 -0
  242. package/deps/rocksdb/rocksdb/db/trim_history_scheduler.h +44 -0
  243. package/deps/rocksdb/rocksdb/db/version_builder.cc +1078 -0
  244. package/deps/rocksdb/rocksdb/db/version_builder.h +69 -0
  245. package/deps/rocksdb/rocksdb/db/version_builder_test.cc +1551 -0
  246. package/deps/rocksdb/rocksdb/db/version_edit.cc +955 -0
  247. package/deps/rocksdb/rocksdb/db/version_edit.h +609 -0
  248. package/deps/rocksdb/rocksdb/db/version_edit_handler.cc +699 -0
  249. package/deps/rocksdb/rocksdb/db/version_edit_handler.h +252 -0
  250. package/deps/rocksdb/rocksdb/db/version_edit_test.cc +597 -0
  251. package/deps/rocksdb/rocksdb/db/version_set.cc +6333 -0
  252. package/deps/rocksdb/rocksdb/db/version_set.h +1485 -0
  253. package/deps/rocksdb/rocksdb/db/version_set_test.cc +3035 -0
  254. package/deps/rocksdb/rocksdb/db/wal_edit.cc +204 -0
  255. package/deps/rocksdb/rocksdb/db/wal_edit.h +166 -0
  256. package/deps/rocksdb/rocksdb/db/wal_edit_test.cc +214 -0
  257. package/deps/rocksdb/rocksdb/db/wal_manager.cc +517 -0
  258. package/deps/rocksdb/rocksdb/db/wal_manager.h +119 -0
  259. package/deps/rocksdb/rocksdb/db/wal_manager_test.cc +340 -0
  260. package/deps/rocksdb/rocksdb/db/write_batch.cc +2174 -0
  261. package/deps/rocksdb/rocksdb/db/write_batch_base.cc +94 -0
  262. package/deps/rocksdb/rocksdb/db/write_batch_internal.h +250 -0
  263. package/deps/rocksdb/rocksdb/db/write_batch_test.cc +907 -0
  264. package/deps/rocksdb/rocksdb/db/write_callback.h +27 -0
  265. package/deps/rocksdb/rocksdb/db/write_callback_test.cc +457 -0
  266. package/deps/rocksdb/rocksdb/db/write_controller.cc +128 -0
  267. package/deps/rocksdb/rocksdb/db/write_controller.h +144 -0
  268. package/deps/rocksdb/rocksdb/db/write_controller_test.cc +135 -0
  269. package/deps/rocksdb/rocksdb/db/write_thread.cc +796 -0
  270. package/deps/rocksdb/rocksdb/db/write_thread.h +433 -0
  271. package/deps/rocksdb/rocksdb/db_stress_tool/CMakeLists.txt +14 -0
  272. package/deps/rocksdb/rocksdb/db_stress_tool/batched_ops_stress.cc +341 -0
  273. package/deps/rocksdb/rocksdb/db_stress_tool/cf_consistency_stress.cc +520 -0
  274. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress.cc +23 -0
  275. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.cc +337 -0
  276. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_common.h +554 -0
  277. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_compaction_filter.h +79 -0
  278. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_driver.cc +173 -0
  279. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_driver.h +17 -0
  280. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_env_wrapper.h +38 -0
  281. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_gflags.cc +763 -0
  282. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_listener.h +222 -0
  283. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_shared_state.cc +27 -0
  284. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_shared_state.h +428 -0
  285. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_stat.h +218 -0
  286. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_table_properties_collector.h +64 -0
  287. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.cc +2430 -0
  288. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_test_base.h +237 -0
  289. package/deps/rocksdb/rocksdb/db_stress_tool/db_stress_tool.cc +343 -0
  290. package/deps/rocksdb/rocksdb/db_stress_tool/no_batched_ops_stress.cc +800 -0
  291. package/deps/rocksdb/rocksdb/env/composite_env_wrapper.h +920 -0
  292. package/deps/rocksdb/rocksdb/env/env.cc +733 -0
  293. package/deps/rocksdb/rocksdb/env/env_basic_test.cc +352 -0
  294. package/deps/rocksdb/rocksdb/env/env_chroot.cc +346 -0
  295. package/deps/rocksdb/rocksdb/env/env_chroot.h +22 -0
  296. package/deps/rocksdb/rocksdb/env/env_encryption.cc +1148 -0
  297. package/deps/rocksdb/rocksdb/env/env_encryption_ctr.h +137 -0
  298. package/deps/rocksdb/rocksdb/env/env_hdfs.cc +648 -0
  299. package/deps/rocksdb/rocksdb/env/env_posix.cc +514 -0
  300. package/deps/rocksdb/rocksdb/env/env_test.cc +2230 -0
  301. package/deps/rocksdb/rocksdb/env/file_system.cc +132 -0
  302. package/deps/rocksdb/rocksdb/env/file_system_tracer.cc +448 -0
  303. package/deps/rocksdb/rocksdb/env/file_system_tracer.h +415 -0
  304. package/deps/rocksdb/rocksdb/env/fs_posix.cc +1086 -0
  305. package/deps/rocksdb/rocksdb/env/io_posix.cc +1499 -0
  306. package/deps/rocksdb/rocksdb/env/io_posix.h +402 -0
  307. package/deps/rocksdb/rocksdb/env/io_posix_test.cc +140 -0
  308. package/deps/rocksdb/rocksdb/env/mock_env.cc +1066 -0
  309. package/deps/rocksdb/rocksdb/env/mock_env.h +41 -0
  310. package/deps/rocksdb/rocksdb/env/mock_env_test.cc +85 -0
  311. package/deps/rocksdb/rocksdb/file/delete_scheduler.cc +402 -0
  312. package/deps/rocksdb/rocksdb/file/delete_scheduler.h +150 -0
  313. package/deps/rocksdb/rocksdb/file/delete_scheduler_test.cc +717 -0
  314. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +156 -0
  315. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +99 -0
  316. package/deps/rocksdb/rocksdb/file/file_util.cc +268 -0
  317. package/deps/rocksdb/rocksdb/file/file_util.h +96 -0
  318. package/deps/rocksdb/rocksdb/file/filename.cc +473 -0
  319. package/deps/rocksdb/rocksdb/file/filename.h +182 -0
  320. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +188 -0
  321. package/deps/rocksdb/rocksdb/file/random_access_file_reader.cc +315 -0
  322. package/deps/rocksdb/rocksdb/file/random_access_file_reader.h +142 -0
  323. package/deps/rocksdb/rocksdb/file/random_access_file_reader_test.cc +482 -0
  324. package/deps/rocksdb/rocksdb/file/read_write_util.cc +67 -0
  325. package/deps/rocksdb/rocksdb/file/read_write_util.h +34 -0
  326. package/deps/rocksdb/rocksdb/file/readahead_raf.cc +169 -0
  327. package/deps/rocksdb/rocksdb/file/readahead_raf.h +29 -0
  328. package/deps/rocksdb/rocksdb/file/sequence_file_reader.cc +237 -0
  329. package/deps/rocksdb/rocksdb/file/sequence_file_reader.h +63 -0
  330. package/deps/rocksdb/rocksdb/file/sst_file_manager_impl.cc +552 -0
  331. package/deps/rocksdb/rocksdb/file/sst_file_manager_impl.h +203 -0
  332. package/deps/rocksdb/rocksdb/file/writable_file_writer.cc +523 -0
  333. package/deps/rocksdb/rocksdb/file/writable_file_writer.h +251 -0
  334. package/deps/rocksdb/rocksdb/hdfs/env_hdfs.h +386 -0
  335. package/deps/rocksdb/rocksdb/include/rocksdb/advanced_options.h +839 -0
  336. package/deps/rocksdb/rocksdb/include/rocksdb/c.h +2218 -0
  337. package/deps/rocksdb/rocksdb/include/rocksdb/cache.h +294 -0
  338. package/deps/rocksdb/rocksdb/include/rocksdb/cleanable.h +71 -0
  339. package/deps/rocksdb/rocksdb/include/rocksdb/compaction_filter.h +214 -0
  340. package/deps/rocksdb/rocksdb/include/rocksdb/compaction_job_stats.h +98 -0
  341. package/deps/rocksdb/rocksdb/include/rocksdb/comparator.h +137 -0
  342. package/deps/rocksdb/rocksdb/include/rocksdb/compression_type.h +40 -0
  343. package/deps/rocksdb/rocksdb/include/rocksdb/concurrent_task_limiter.h +46 -0
  344. package/deps/rocksdb/rocksdb/include/rocksdb/configurable.h +359 -0
  345. package/deps/rocksdb/rocksdb/include/rocksdb/convenience.h +499 -0
  346. package/deps/rocksdb/rocksdb/include/rocksdb/customizable.h +138 -0
  347. package/deps/rocksdb/rocksdb/include/rocksdb/db.h +1697 -0
  348. package/deps/rocksdb/rocksdb/include/rocksdb/db_bench_tool.h +11 -0
  349. package/deps/rocksdb/rocksdb/include/rocksdb/db_dump_tool.h +45 -0
  350. package/deps/rocksdb/rocksdb/include/rocksdb/db_stress_tool.h +11 -0
  351. package/deps/rocksdb/rocksdb/include/rocksdb/env.h +1671 -0
  352. package/deps/rocksdb/rocksdb/include/rocksdb/env_encryption.h +405 -0
  353. package/deps/rocksdb/rocksdb/include/rocksdb/experimental.h +29 -0
  354. package/deps/rocksdb/rocksdb/include/rocksdb/file_checksum.h +129 -0
  355. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +1472 -0
  356. package/deps/rocksdb/rocksdb/include/rocksdb/filter_policy.h +238 -0
  357. package/deps/rocksdb/rocksdb/include/rocksdb/flush_block_policy.h +61 -0
  358. package/deps/rocksdb/rocksdb/include/rocksdb/io_status.h +269 -0
  359. package/deps/rocksdb/rocksdb/include/rocksdb/iostats_context.h +56 -0
  360. package/deps/rocksdb/rocksdb/include/rocksdb/iterator.h +128 -0
  361. package/deps/rocksdb/rocksdb/include/rocksdb/ldb_tool.h +43 -0
  362. package/deps/rocksdb/rocksdb/include/rocksdb/listener.h +556 -0
  363. package/deps/rocksdb/rocksdb/include/rocksdb/memory_allocator.h +77 -0
  364. package/deps/rocksdb/rocksdb/include/rocksdb/memtablerep.h +385 -0
  365. package/deps/rocksdb/rocksdb/include/rocksdb/merge_operator.h +257 -0
  366. package/deps/rocksdb/rocksdb/include/rocksdb/metadata.h +155 -0
  367. package/deps/rocksdb/rocksdb/include/rocksdb/options.h +1702 -0
  368. package/deps/rocksdb/rocksdb/include/rocksdb/perf_context.h +237 -0
  369. package/deps/rocksdb/rocksdb/include/rocksdb/perf_level.h +35 -0
  370. package/deps/rocksdb/rocksdb/include/rocksdb/persistent_cache.h +73 -0
  371. package/deps/rocksdb/rocksdb/include/rocksdb/rate_limiter.h +139 -0
  372. package/deps/rocksdb/rocksdb/include/rocksdb/rocksdb_namespace.h +10 -0
  373. package/deps/rocksdb/rocksdb/include/rocksdb/slice.h +269 -0
  374. package/deps/rocksdb/rocksdb/include/rocksdb/slice_transform.h +103 -0
  375. package/deps/rocksdb/rocksdb/include/rocksdb/snapshot.h +48 -0
  376. package/deps/rocksdb/rocksdb/include/rocksdb/sst_dump_tool.h +19 -0
  377. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_manager.h +136 -0
  378. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_reader.h +47 -0
  379. package/deps/rocksdb/rocksdb/include/rocksdb/sst_file_writer.h +145 -0
  380. package/deps/rocksdb/rocksdb/include/rocksdb/sst_partitioner.h +135 -0
  381. package/deps/rocksdb/rocksdb/include/rocksdb/statistics.h +592 -0
  382. package/deps/rocksdb/rocksdb/include/rocksdb/stats_history.h +69 -0
  383. package/deps/rocksdb/rocksdb/include/rocksdb/status.h +608 -0
  384. package/deps/rocksdb/rocksdb/include/rocksdb/table.h +711 -0
  385. package/deps/rocksdb/rocksdb/include/rocksdb/table_properties.h +280 -0
  386. package/deps/rocksdb/rocksdb/include/rocksdb/thread_status.h +188 -0
  387. package/deps/rocksdb/rocksdb/include/rocksdb/threadpool.h +58 -0
  388. package/deps/rocksdb/rocksdb/include/rocksdb/trace_reader_writer.h +48 -0
  389. package/deps/rocksdb/rocksdb/include/rocksdb/transaction_log.h +121 -0
  390. package/deps/rocksdb/rocksdb/include/rocksdb/types.h +74 -0
  391. package/deps/rocksdb/rocksdb/include/rocksdb/universal_compaction.h +86 -0
  392. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/backupable_db.h +535 -0
  393. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h +61 -0
  394. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/convenience.h +10 -0
  395. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/db_ttl.h +72 -0
  396. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/debug.h +49 -0
  397. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/env_librados.h +175 -0
  398. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/env_mirror.h +180 -0
  399. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/info_log_finder.h +19 -0
  400. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/ldb_cmd.h +288 -0
  401. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/ldb_cmd_execute_result.h +71 -0
  402. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/leveldb_options.h +145 -0
  403. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h +43 -0
  404. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/lua/rocks_lua_util.h +55 -0
  405. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/memory_util.h +50 -0
  406. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/object_registry.h +205 -0
  407. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/optimistic_transaction_db.h +100 -0
  408. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/option_change_migration.h +19 -0
  409. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/options_type.h +876 -0
  410. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/options_util.h +128 -0
  411. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/sim_cache.h +94 -0
  412. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/stackable_db.h +504 -0
  413. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +95 -0
  414. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction.h +626 -0
  415. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction_db.h +432 -0
  416. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/transaction_db_mutex.h +92 -0
  417. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/utility_db.h +34 -0
  418. package/deps/rocksdb/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +279 -0
  419. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +16 -0
  420. package/deps/rocksdb/rocksdb/include/rocksdb/wal_filter.h +102 -0
  421. package/deps/rocksdb/rocksdb/include/rocksdb/write_batch.h +377 -0
  422. package/deps/rocksdb/rocksdb/include/rocksdb/write_batch_base.h +127 -0
  423. package/deps/rocksdb/rocksdb/include/rocksdb/write_buffer_manager.h +106 -0
  424. package/deps/rocksdb/rocksdb/logging/auto_roll_logger.cc +300 -0
  425. package/deps/rocksdb/rocksdb/logging/auto_roll_logger.h +165 -0
  426. package/deps/rocksdb/rocksdb/logging/auto_roll_logger_test.cc +684 -0
  427. package/deps/rocksdb/rocksdb/logging/env_logger.h +165 -0
  428. package/deps/rocksdb/rocksdb/logging/env_logger_test.cc +162 -0
  429. package/deps/rocksdb/rocksdb/logging/event_logger.cc +70 -0
  430. package/deps/rocksdb/rocksdb/logging/event_logger.h +203 -0
  431. package/deps/rocksdb/rocksdb/logging/event_logger_test.cc +43 -0
  432. package/deps/rocksdb/rocksdb/logging/log_buffer.cc +92 -0
  433. package/deps/rocksdb/rocksdb/logging/log_buffer.h +56 -0
  434. package/deps/rocksdb/rocksdb/logging/logging.h +68 -0
  435. package/deps/rocksdb/rocksdb/logging/posix_logger.h +185 -0
  436. package/deps/rocksdb/rocksdb/memory/allocator.h +57 -0
  437. package/deps/rocksdb/rocksdb/memory/arena.cc +233 -0
  438. package/deps/rocksdb/rocksdb/memory/arena.h +141 -0
  439. package/deps/rocksdb/rocksdb/memory/arena_test.cc +204 -0
  440. package/deps/rocksdb/rocksdb/memory/concurrent_arena.cc +47 -0
  441. package/deps/rocksdb/rocksdb/memory/concurrent_arena.h +218 -0
  442. package/deps/rocksdb/rocksdb/memory/jemalloc_nodump_allocator.cc +206 -0
  443. package/deps/rocksdb/rocksdb/memory/jemalloc_nodump_allocator.h +78 -0
  444. package/deps/rocksdb/rocksdb/memory/memkind_kmem_allocator.cc +33 -0
  445. package/deps/rocksdb/rocksdb/memory/memkind_kmem_allocator.h +27 -0
  446. package/deps/rocksdb/rocksdb/memory/memkind_kmem_allocator_test.cc +102 -0
  447. package/deps/rocksdb/rocksdb/memory/memory_allocator.h +38 -0
  448. package/deps/rocksdb/rocksdb/memory/memory_usage.h +25 -0
  449. package/deps/rocksdb/rocksdb/memtable/alloc_tracker.cc +62 -0
  450. package/deps/rocksdb/rocksdb/memtable/hash_linklist_rep.cc +844 -0
  451. package/deps/rocksdb/rocksdb/memtable/hash_linklist_rep.h +49 -0
  452. package/deps/rocksdb/rocksdb/memtable/hash_skiplist_rep.cc +349 -0
  453. package/deps/rocksdb/rocksdb/memtable/hash_skiplist_rep.h +44 -0
  454. package/deps/rocksdb/rocksdb/memtable/inlineskiplist.h +997 -0
  455. package/deps/rocksdb/rocksdb/memtable/inlineskiplist_test.cc +663 -0
  456. package/deps/rocksdb/rocksdb/memtable/memtablerep_bench.cc +677 -0
  457. package/deps/rocksdb/rocksdb/memtable/skiplist.h +496 -0
  458. package/deps/rocksdb/rocksdb/memtable/skiplist_test.cc +388 -0
  459. package/deps/rocksdb/rocksdb/memtable/skiplistrep.cc +280 -0
  460. package/deps/rocksdb/rocksdb/memtable/stl_wrappers.h +33 -0
  461. package/deps/rocksdb/rocksdb/memtable/vectorrep.cc +301 -0
  462. package/deps/rocksdb/rocksdb/memtable/write_buffer_manager.cc +148 -0
  463. package/deps/rocksdb/rocksdb/memtable/write_buffer_manager_test.cc +203 -0
  464. package/deps/rocksdb/rocksdb/monitoring/file_read_sample.h +23 -0
  465. package/deps/rocksdb/rocksdb/monitoring/histogram.cc +287 -0
  466. package/deps/rocksdb/rocksdb/monitoring/histogram.h +149 -0
  467. package/deps/rocksdb/rocksdb/monitoring/histogram_test.cc +231 -0
  468. package/deps/rocksdb/rocksdb/monitoring/histogram_windowing.cc +200 -0
  469. package/deps/rocksdb/rocksdb/monitoring/histogram_windowing.h +84 -0
  470. package/deps/rocksdb/rocksdb/monitoring/in_memory_stats_history.cc +49 -0
  471. package/deps/rocksdb/rocksdb/monitoring/in_memory_stats_history.h +74 -0
  472. package/deps/rocksdb/rocksdb/monitoring/instrumented_mutex.cc +71 -0
  473. package/deps/rocksdb/rocksdb/monitoring/instrumented_mutex.h +98 -0
  474. package/deps/rocksdb/rocksdb/monitoring/iostats_context.cc +62 -0
  475. package/deps/rocksdb/rocksdb/monitoring/iostats_context_imp.h +60 -0
  476. package/deps/rocksdb/rocksdb/monitoring/iostats_context_test.cc +29 -0
  477. package/deps/rocksdb/rocksdb/monitoring/perf_context.cc +566 -0
  478. package/deps/rocksdb/rocksdb/monitoring/perf_context_imp.h +97 -0
  479. package/deps/rocksdb/rocksdb/monitoring/perf_level.cc +28 -0
  480. package/deps/rocksdb/rocksdb/monitoring/perf_level_imp.h +18 -0
  481. package/deps/rocksdb/rocksdb/monitoring/perf_step_timer.h +79 -0
  482. package/deps/rocksdb/rocksdb/monitoring/persistent_stats_history.cc +169 -0
  483. package/deps/rocksdb/rocksdb/monitoring/persistent_stats_history.h +83 -0
  484. package/deps/rocksdb/rocksdb/monitoring/statistics.cc +431 -0
  485. package/deps/rocksdb/rocksdb/monitoring/statistics.h +138 -0
  486. package/deps/rocksdb/rocksdb/monitoring/statistics_test.cc +47 -0
  487. package/deps/rocksdb/rocksdb/monitoring/stats_history_test.cc +652 -0
  488. package/deps/rocksdb/rocksdb/monitoring/thread_status_impl.cc +163 -0
  489. package/deps/rocksdb/rocksdb/monitoring/thread_status_updater.cc +314 -0
  490. package/deps/rocksdb/rocksdb/monitoring/thread_status_updater.h +233 -0
  491. package/deps/rocksdb/rocksdb/monitoring/thread_status_updater_debug.cc +43 -0
  492. package/deps/rocksdb/rocksdb/monitoring/thread_status_util.cc +206 -0
  493. package/deps/rocksdb/rocksdb/monitoring/thread_status_util.h +134 -0
  494. package/deps/rocksdb/rocksdb/monitoring/thread_status_util_debug.cc +32 -0
  495. package/deps/rocksdb/rocksdb/options/cf_options.cc +1026 -0
  496. package/deps/rocksdb/rocksdb/options/cf_options.h +308 -0
  497. package/deps/rocksdb/rocksdb/options/configurable.cc +681 -0
  498. package/deps/rocksdb/rocksdb/options/configurable_helper.h +251 -0
  499. package/deps/rocksdb/rocksdb/options/configurable_test.cc +757 -0
  500. package/deps/rocksdb/rocksdb/options/configurable_test.h +127 -0
  501. package/deps/rocksdb/rocksdb/options/customizable.cc +77 -0
  502. package/deps/rocksdb/rocksdb/options/customizable_helper.h +216 -0
  503. package/deps/rocksdb/rocksdb/options/customizable_test.cc +625 -0
  504. package/deps/rocksdb/rocksdb/options/db_options.cc +835 -0
  505. package/deps/rocksdb/rocksdb/options/db_options.h +126 -0
  506. package/deps/rocksdb/rocksdb/options/options.cc +664 -0
  507. package/deps/rocksdb/rocksdb/options/options_helper.cc +1391 -0
  508. package/deps/rocksdb/rocksdb/options/options_helper.h +118 -0
  509. package/deps/rocksdb/rocksdb/options/options_parser.cc +721 -0
  510. package/deps/rocksdb/rocksdb/options/options_parser.h +151 -0
  511. package/deps/rocksdb/rocksdb/options/options_settable_test.cc +583 -0
  512. package/deps/rocksdb/rocksdb/options/options_test.cc +3794 -0
  513. package/deps/rocksdb/rocksdb/port/jemalloc_helper.h +106 -0
  514. package/deps/rocksdb/rocksdb/port/lang.h +16 -0
  515. package/deps/rocksdb/rocksdb/port/likely.h +18 -0
  516. package/deps/rocksdb/rocksdb/port/malloc.h +17 -0
  517. package/deps/rocksdb/rocksdb/port/port.h +21 -0
  518. package/deps/rocksdb/rocksdb/port/port_dirent.h +44 -0
  519. package/deps/rocksdb/rocksdb/port/port_example.h +101 -0
  520. package/deps/rocksdb/rocksdb/port/port_posix.cc +266 -0
  521. package/deps/rocksdb/rocksdb/port/port_posix.h +223 -0
  522. package/deps/rocksdb/rocksdb/port/stack_trace.cc +179 -0
  523. package/deps/rocksdb/rocksdb/port/stack_trace.h +28 -0
  524. package/deps/rocksdb/rocksdb/port/sys_time.h +47 -0
  525. package/deps/rocksdb/rocksdb/port/util_logger.h +20 -0
  526. package/deps/rocksdb/rocksdb/port/win/env_default.cc +45 -0
  527. package/deps/rocksdb/rocksdb/port/win/env_win.cc +1449 -0
  528. package/deps/rocksdb/rocksdb/port/win/env_win.h +294 -0
  529. package/deps/rocksdb/rocksdb/port/win/io_win.cc +1084 -0
  530. package/deps/rocksdb/rocksdb/port/win/io_win.h +494 -0
  531. package/deps/rocksdb/rocksdb/port/win/port_win.cc +283 -0
  532. package/deps/rocksdb/rocksdb/port/win/port_win.h +411 -0
  533. package/deps/rocksdb/rocksdb/port/win/win_jemalloc.cc +79 -0
  534. package/deps/rocksdb/rocksdb/port/win/win_logger.cc +194 -0
  535. package/deps/rocksdb/rocksdb/port/win/win_logger.h +67 -0
  536. package/deps/rocksdb/rocksdb/port/win/win_thread.cc +183 -0
  537. package/deps/rocksdb/rocksdb/port/win/win_thread.h +122 -0
  538. package/deps/rocksdb/rocksdb/port/win/xpress_win.cc +221 -0
  539. package/deps/rocksdb/rocksdb/port/win/xpress_win.h +26 -0
  540. package/deps/rocksdb/rocksdb/port/xpress.h +17 -0
  541. package/deps/rocksdb/rocksdb/src.mk +631 -0
  542. package/deps/rocksdb/rocksdb/table/adaptive/adaptive_table_factory.cc +126 -0
  543. package/deps/rocksdb/rocksdb/table/adaptive/adaptive_table_factory.h +57 -0
  544. package/deps/rocksdb/rocksdb/table/block_based/binary_search_index_reader.cc +73 -0
  545. package/deps/rocksdb/rocksdb/table/block_based/binary_search_index_reader.h +48 -0
  546. package/deps/rocksdb/rocksdb/table/block_based/block.cc +1049 -0
  547. package/deps/rocksdb/rocksdb/table/block_based/block.h +720 -0
  548. package/deps/rocksdb/rocksdb/table/block_based/block_based_filter_block.cc +348 -0
  549. package/deps/rocksdb/rocksdb/table/block_based/block_based_filter_block.h +119 -0
  550. package/deps/rocksdb/rocksdb/table/block_based/block_based_filter_block_test.cc +434 -0
  551. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.cc +1835 -0
  552. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_builder.h +193 -0
  553. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.cc +839 -0
  554. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_factory.h +95 -0
  555. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.cc +383 -0
  556. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_iterator.h +251 -0
  557. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.cc +3563 -0
  558. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +681 -0
  559. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_impl.h +190 -0
  560. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +347 -0
  561. package/deps/rocksdb/rocksdb/table/block_based/block_builder.cc +201 -0
  562. package/deps/rocksdb/rocksdb/table/block_based/block_builder.h +78 -0
  563. package/deps/rocksdb/rocksdb/table/block_based/block_prefetcher.cc +66 -0
  564. package/deps/rocksdb/rocksdb/table/block_based/block_prefetcher.h +32 -0
  565. package/deps/rocksdb/rocksdb/table/block_based/block_prefix_index.cc +232 -0
  566. package/deps/rocksdb/rocksdb/table/block_based/block_prefix_index.h +66 -0
  567. package/deps/rocksdb/rocksdb/table/block_based/block_test.cc +623 -0
  568. package/deps/rocksdb/rocksdb/table/block_based/block_type.h +30 -0
  569. package/deps/rocksdb/rocksdb/table/block_based/cachable_entry.h +220 -0
  570. package/deps/rocksdb/rocksdb/table/block_based/data_block_footer.cc +59 -0
  571. package/deps/rocksdb/rocksdb/table/block_based/data_block_footer.h +25 -0
  572. package/deps/rocksdb/rocksdb/table/block_based/data_block_hash_index.cc +93 -0
  573. package/deps/rocksdb/rocksdb/table/block_based/data_block_hash_index.h +136 -0
  574. package/deps/rocksdb/rocksdb/table/block_based/data_block_hash_index_test.cc +717 -0
  575. package/deps/rocksdb/rocksdb/table/block_based/filter_block.h +180 -0
  576. package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.cc +102 -0
  577. package/deps/rocksdb/rocksdb/table/block_based/filter_block_reader_common.h +55 -0
  578. package/deps/rocksdb/rocksdb/table/block_based/filter_policy.cc +1407 -0
  579. package/deps/rocksdb/rocksdb/table/block_based/filter_policy_internal.h +168 -0
  580. package/deps/rocksdb/rocksdb/table/block_based/flush_block_policy.cc +88 -0
  581. package/deps/rocksdb/rocksdb/table/block_based/flush_block_policy.h +41 -0
  582. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.cc +344 -0
  583. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block.h +139 -0
  584. package/deps/rocksdb/rocksdb/table/block_based/full_filter_block_test.cc +333 -0
  585. package/deps/rocksdb/rocksdb/table/block_based/hash_index_reader.cc +147 -0
  586. package/deps/rocksdb/rocksdb/table/block_based/hash_index_reader.h +49 -0
  587. package/deps/rocksdb/rocksdb/table/block_based/index_builder.cc +248 -0
  588. package/deps/rocksdb/rocksdb/table/block_based/index_builder.h +444 -0
  589. package/deps/rocksdb/rocksdb/table/block_based/index_reader_common.cc +54 -0
  590. package/deps/rocksdb/rocksdb/table/block_based/index_reader_common.h +85 -0
  591. package/deps/rocksdb/rocksdb/table/block_based/mock_block_based_table.h +56 -0
  592. package/deps/rocksdb/rocksdb/table/block_based/parsed_full_filter_block.cc +22 -0
  593. package/deps/rocksdb/rocksdb/table/block_based/parsed_full_filter_block.h +40 -0
  594. package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block.cc +521 -0
  595. package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block.h +144 -0
  596. package/deps/rocksdb/rocksdb/table/block_based/partitioned_filter_block_test.cc +424 -0
  597. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_iterator.cc +163 -0
  598. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_iterator.h +142 -0
  599. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_reader.cc +186 -0
  600. package/deps/rocksdb/rocksdb/table/block_based/partitioned_index_reader.h +51 -0
  601. package/deps/rocksdb/rocksdb/table/block_based/reader_common.cc +64 -0
  602. package/deps/rocksdb/rocksdb/table/block_based/reader_common.h +38 -0
  603. package/deps/rocksdb/rocksdb/table/block_based/uncompression_dict_reader.cc +120 -0
  604. package/deps/rocksdb/rocksdb/table/block_based/uncompression_dict_reader.h +59 -0
  605. package/deps/rocksdb/rocksdb/table/block_fetcher.cc +324 -0
  606. package/deps/rocksdb/rocksdb/table/block_fetcher.h +129 -0
  607. package/deps/rocksdb/rocksdb/table/block_fetcher_test.cc +534 -0
  608. package/deps/rocksdb/rocksdb/table/cleanable_test.cc +277 -0
  609. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder.cc +543 -0
  610. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder.h +136 -0
  611. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_builder_test.cc +663 -0
  612. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_factory.cc +107 -0
  613. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_factory.h +81 -0
  614. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_reader.cc +404 -0
  615. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_reader.h +101 -0
  616. package/deps/rocksdb/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +585 -0
  617. package/deps/rocksdb/rocksdb/table/format.cc +422 -0
  618. package/deps/rocksdb/rocksdb/table/format.h +348 -0
  619. package/deps/rocksdb/rocksdb/table/get_context.cc +408 -0
  620. package/deps/rocksdb/rocksdb/table/get_context.h +212 -0
  621. package/deps/rocksdb/rocksdb/table/internal_iterator.h +205 -0
  622. package/deps/rocksdb/rocksdb/table/iter_heap.h +42 -0
  623. package/deps/rocksdb/rocksdb/table/iterator.cc +210 -0
  624. package/deps/rocksdb/rocksdb/table/iterator_wrapper.h +180 -0
  625. package/deps/rocksdb/rocksdb/table/merger_test.cc +180 -0
  626. package/deps/rocksdb/rocksdb/table/merging_iterator.cc +481 -0
  627. package/deps/rocksdb/rocksdb/table/merging_iterator.h +64 -0
  628. package/deps/rocksdb/rocksdb/table/meta_blocks.cc +541 -0
  629. package/deps/rocksdb/rocksdb/table/meta_blocks.h +154 -0
  630. package/deps/rocksdb/rocksdb/table/mock_table.cc +328 -0
  631. package/deps/rocksdb/rocksdb/table/mock_table.h +89 -0
  632. package/deps/rocksdb/rocksdb/table/multiget_context.h +282 -0
  633. package/deps/rocksdb/rocksdb/table/persistent_cache_helper.cc +116 -0
  634. package/deps/rocksdb/rocksdb/table/persistent_cache_helper.h +44 -0
  635. package/deps/rocksdb/rocksdb/table/persistent_cache_options.h +34 -0
  636. package/deps/rocksdb/rocksdb/table/plain/plain_table_bloom.cc +78 -0
  637. package/deps/rocksdb/rocksdb/table/plain/plain_table_bloom.h +135 -0
  638. package/deps/rocksdb/rocksdb/table/plain/plain_table_builder.cc +332 -0
  639. package/deps/rocksdb/rocksdb/table/plain/plain_table_builder.h +153 -0
  640. package/deps/rocksdb/rocksdb/table/plain/plain_table_factory.cc +263 -0
  641. package/deps/rocksdb/rocksdb/table/plain/plain_table_factory.h +182 -0
  642. package/deps/rocksdb/rocksdb/table/plain/plain_table_index.cc +211 -0
  643. package/deps/rocksdb/rocksdb/table/plain/plain_table_index.h +249 -0
  644. package/deps/rocksdb/rocksdb/table/plain/plain_table_key_coding.cc +506 -0
  645. package/deps/rocksdb/rocksdb/table/plain/plain_table_key_coding.h +201 -0
  646. package/deps/rocksdb/rocksdb/table/plain/plain_table_reader.cc +781 -0
  647. package/deps/rocksdb/rocksdb/table/plain/plain_table_reader.h +247 -0
  648. package/deps/rocksdb/rocksdb/table/scoped_arena_iterator.h +61 -0
  649. package/deps/rocksdb/rocksdb/table/sst_file_dumper.cc +502 -0
  650. package/deps/rocksdb/rocksdb/table/sst_file_dumper.h +96 -0
  651. package/deps/rocksdb/rocksdb/table/sst_file_reader.cc +98 -0
  652. package/deps/rocksdb/rocksdb/table/sst_file_reader_test.cc +228 -0
  653. package/deps/rocksdb/rocksdb/table/sst_file_writer.cc +340 -0
  654. package/deps/rocksdb/rocksdb/table/sst_file_writer_collectors.h +94 -0
  655. package/deps/rocksdb/rocksdb/table/table_builder.h +203 -0
  656. package/deps/rocksdb/rocksdb/table/table_factory.cc +38 -0
  657. package/deps/rocksdb/rocksdb/table/table_properties.cc +300 -0
  658. package/deps/rocksdb/rocksdb/table/table_properties_internal.h +30 -0
  659. package/deps/rocksdb/rocksdb/table/table_reader.h +147 -0
  660. package/deps/rocksdb/rocksdb/table/table_reader_bench.cc +347 -0
  661. package/deps/rocksdb/rocksdb/table/table_reader_caller.h +39 -0
  662. package/deps/rocksdb/rocksdb/table/table_test.cc +4769 -0
  663. package/deps/rocksdb/rocksdb/table/two_level_iterator.cc +215 -0
  664. package/deps/rocksdb/rocksdb/table/two_level_iterator.h +43 -0
  665. package/deps/rocksdb/rocksdb/test_util/mock_time_env.cc +38 -0
  666. package/deps/rocksdb/rocksdb/test_util/mock_time_env.h +74 -0
  667. package/deps/rocksdb/rocksdb/test_util/sync_point.cc +93 -0
  668. package/deps/rocksdb/rocksdb/test_util/sync_point.h +161 -0
  669. package/deps/rocksdb/rocksdb/test_util/sync_point_impl.cc +129 -0
  670. package/deps/rocksdb/rocksdb/test_util/sync_point_impl.h +74 -0
  671. package/deps/rocksdb/rocksdb/test_util/testharness.cc +56 -0
  672. package/deps/rocksdb/rocksdb/test_util/testharness.h +53 -0
  673. package/deps/rocksdb/rocksdb/test_util/testutil.cc +566 -0
  674. package/deps/rocksdb/rocksdb/test_util/testutil.h +887 -0
  675. package/deps/rocksdb/rocksdb/test_util/testutil_test.cc +43 -0
  676. package/deps/rocksdb/rocksdb/test_util/transaction_test_util.cc +388 -0
  677. package/deps/rocksdb/rocksdb/test_util/transaction_test_util.h +132 -0
  678. package/deps/rocksdb/rocksdb/third-party/folly/folly/CPortability.h +27 -0
  679. package/deps/rocksdb/rocksdb/third-party/folly/folly/ConstexprMath.h +45 -0
  680. package/deps/rocksdb/rocksdb/third-party/folly/folly/Indestructible.h +166 -0
  681. package/deps/rocksdb/rocksdb/third-party/folly/folly/Optional.h +570 -0
  682. package/deps/rocksdb/rocksdb/third-party/folly/folly/Portability.h +92 -0
  683. package/deps/rocksdb/rocksdb/third-party/folly/folly/ScopeGuard.h +54 -0
  684. package/deps/rocksdb/rocksdb/third-party/folly/folly/Traits.h +152 -0
  685. package/deps/rocksdb/rocksdb/third-party/folly/folly/Unit.h +59 -0
  686. package/deps/rocksdb/rocksdb/third-party/folly/folly/Utility.h +141 -0
  687. package/deps/rocksdb/rocksdb/third-party/folly/folly/chrono/Hardware.h +33 -0
  688. package/deps/rocksdb/rocksdb/third-party/folly/folly/container/Array.h +74 -0
  689. package/deps/rocksdb/rocksdb/third-party/folly/folly/detail/Futex-inl.h +117 -0
  690. package/deps/rocksdb/rocksdb/third-party/folly/folly/detail/Futex.cpp +263 -0
  691. package/deps/rocksdb/rocksdb/third-party/folly/folly/detail/Futex.h +96 -0
  692. package/deps/rocksdb/rocksdb/third-party/folly/folly/functional/Invoke.h +40 -0
  693. package/deps/rocksdb/rocksdb/third-party/folly/folly/hash/Hash.h +29 -0
  694. package/deps/rocksdb/rocksdb/third-party/folly/folly/lang/Align.h +144 -0
  695. package/deps/rocksdb/rocksdb/third-party/folly/folly/lang/Bits.h +30 -0
  696. package/deps/rocksdb/rocksdb/third-party/folly/folly/lang/Launder.h +51 -0
  697. package/deps/rocksdb/rocksdb/third-party/folly/folly/portability/Asm.h +28 -0
  698. package/deps/rocksdb/rocksdb/third-party/folly/folly/portability/SysSyscall.h +10 -0
  699. package/deps/rocksdb/rocksdb/third-party/folly/folly/portability/SysTypes.h +26 -0
  700. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/AtomicNotification-inl.h +138 -0
  701. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/AtomicNotification.cpp +23 -0
  702. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/AtomicNotification.h +57 -0
  703. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/AtomicUtil-inl.h +260 -0
  704. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/AtomicUtil.h +52 -0
  705. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/Baton.h +328 -0
  706. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/DistributedMutex-inl.h +1703 -0
  707. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/DistributedMutex.cpp +16 -0
  708. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/DistributedMutex.h +304 -0
  709. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/DistributedMutexSpecializations.h +39 -0
  710. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/ParkingLot.cpp +26 -0
  711. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/ParkingLot.h +318 -0
  712. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/WaitOptions.cpp +12 -0
  713. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/WaitOptions.h +57 -0
  714. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/detail/InlineFunctionRef.h +219 -0
  715. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/detail/ProxyLockable-inl.h +207 -0
  716. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/detail/ProxyLockable.h +164 -0
  717. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/detail/Sleeper.h +57 -0
  718. package/deps/rocksdb/rocksdb/third-party/folly/folly/synchronization/detail/Spin.h +77 -0
  719. package/deps/rocksdb/rocksdb/third-party/gcc/ppc-asm.h +390 -0
  720. package/deps/rocksdb/rocksdb/thirdparty.inc +268 -0
  721. package/deps/rocksdb/rocksdb/tools/CMakeLists.txt +30 -0
  722. package/deps/rocksdb/rocksdb/tools/blob_dump.cc +110 -0
  723. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/__init__.py +2 -0
  724. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py +2000 -0
  725. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_pysim.sh +156 -0
  726. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_pysim_test.py +734 -0
  727. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +2307 -0
  728. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.h +395 -0
  729. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_plot.py +721 -0
  730. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +719 -0
  731. package/deps/rocksdb/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +25 -0
  732. package/deps/rocksdb/rocksdb/tools/db_bench.cc +21 -0
  733. package/deps/rocksdb/rocksdb/tools/db_bench_tool.cc +7416 -0
  734. package/deps/rocksdb/rocksdb/tools/db_bench_tool_test.cc +328 -0
  735. package/deps/rocksdb/rocksdb/tools/db_repl_stress.cc +130 -0
  736. package/deps/rocksdb/rocksdb/tools/db_sanity_test.cc +297 -0
  737. package/deps/rocksdb/rocksdb/tools/dump/db_dump_tool.cc +259 -0
  738. package/deps/rocksdb/rocksdb/tools/dump/rocksdb_dump.cc +63 -0
  739. package/deps/rocksdb/rocksdb/tools/dump/rocksdb_undump.cc +62 -0
  740. package/deps/rocksdb/rocksdb/tools/io_tracer_parser.cc +25 -0
  741. package/deps/rocksdb/rocksdb/tools/io_tracer_parser_test.cc +187 -0
  742. package/deps/rocksdb/rocksdb/tools/io_tracer_parser_tool.cc +120 -0
  743. package/deps/rocksdb/rocksdb/tools/io_tracer_parser_tool.h +40 -0
  744. package/deps/rocksdb/rocksdb/tools/ldb.cc +21 -0
  745. package/deps/rocksdb/rocksdb/tools/ldb_cmd.cc +3609 -0
  746. package/deps/rocksdb/rocksdb/tools/ldb_cmd_impl.h +665 -0
  747. package/deps/rocksdb/rocksdb/tools/ldb_cmd_test.cc +746 -0
  748. package/deps/rocksdb/rocksdb/tools/ldb_tool.cc +159 -0
  749. package/deps/rocksdb/rocksdb/tools/reduce_levels_test.cc +221 -0
  750. package/deps/rocksdb/rocksdb/tools/sst_dump.cc +20 -0
  751. package/deps/rocksdb/rocksdb/tools/sst_dump_test.cc +427 -0
  752. package/deps/rocksdb/rocksdb/tools/sst_dump_tool.cc +541 -0
  753. package/deps/rocksdb/rocksdb/tools/trace_analyzer.cc +25 -0
  754. package/deps/rocksdb/rocksdb/tools/trace_analyzer_test.cc +752 -0
  755. package/deps/rocksdb/rocksdb/tools/trace_analyzer_tool.cc +2001 -0
  756. package/deps/rocksdb/rocksdb/tools/trace_analyzer_tool.h +292 -0
  757. package/deps/rocksdb/rocksdb/tools/write_stress.cc +305 -0
  758. package/deps/rocksdb/rocksdb/trace_replay/block_cache_tracer.cc +496 -0
  759. package/deps/rocksdb/rocksdb/trace_replay/block_cache_tracer.h +294 -0
  760. package/deps/rocksdb/rocksdb/trace_replay/block_cache_tracer_test.cc +379 -0
  761. package/deps/rocksdb/rocksdb/trace_replay/io_tracer.cc +229 -0
  762. package/deps/rocksdb/rocksdb/trace_replay/io_tracer.h +174 -0
  763. package/deps/rocksdb/rocksdb/trace_replay/io_tracer_test.cc +215 -0
  764. package/deps/rocksdb/rocksdb/trace_replay/trace_replay.cc +491 -0
  765. package/deps/rocksdb/rocksdb/trace_replay/trace_replay.h +195 -0
  766. package/deps/rocksdb/rocksdb/util/aligned_buffer.h +255 -0
  767. package/deps/rocksdb/rocksdb/util/autovector.h +367 -0
  768. package/deps/rocksdb/rocksdb/util/autovector_test.cc +330 -0
  769. package/deps/rocksdb/rocksdb/util/bloom_impl.h +485 -0
  770. package/deps/rocksdb/rocksdb/util/bloom_test.cc +1191 -0
  771. package/deps/rocksdb/rocksdb/util/build_version.cc.in +5 -0
  772. package/deps/rocksdb/rocksdb/util/build_version.h +15 -0
  773. package/deps/rocksdb/rocksdb/util/cast_util.h +20 -0
  774. package/deps/rocksdb/rocksdb/util/channel.h +67 -0
  775. package/deps/rocksdb/rocksdb/util/coding.cc +89 -0
  776. package/deps/rocksdb/rocksdb/util/coding.h +419 -0
  777. package/deps/rocksdb/rocksdb/util/coding_lean.h +101 -0
  778. package/deps/rocksdb/rocksdb/util/coding_test.cc +217 -0
  779. package/deps/rocksdb/rocksdb/util/compaction_job_stats_impl.cc +92 -0
  780. package/deps/rocksdb/rocksdb/util/comparator.cc +219 -0
  781. package/deps/rocksdb/rocksdb/util/compression.h +1529 -0
  782. package/deps/rocksdb/rocksdb/util/compression_context_cache.cc +108 -0
  783. package/deps/rocksdb/rocksdb/util/compression_context_cache.h +47 -0
  784. package/deps/rocksdb/rocksdb/util/concurrent_task_limiter_impl.cc +67 -0
  785. package/deps/rocksdb/rocksdb/util/concurrent_task_limiter_impl.h +67 -0
  786. package/deps/rocksdb/rocksdb/util/core_local.h +83 -0
  787. package/deps/rocksdb/rocksdb/util/crc32c.cc +1283 -0
  788. package/deps/rocksdb/rocksdb/util/crc32c.h +51 -0
  789. package/deps/rocksdb/rocksdb/util/crc32c_arm64.cc +169 -0
  790. package/deps/rocksdb/rocksdb/util/crc32c_arm64.h +50 -0
  791. package/deps/rocksdb/rocksdb/util/crc32c_ppc.c +94 -0
  792. package/deps/rocksdb/rocksdb/util/crc32c_ppc.h +19 -0
  793. package/deps/rocksdb/rocksdb/util/crc32c_ppc_asm.S +756 -0
  794. package/deps/rocksdb/rocksdb/util/crc32c_ppc_constants.h +900 -0
  795. package/deps/rocksdb/rocksdb/util/crc32c_test.cc +180 -0
  796. package/deps/rocksdb/rocksdb/util/defer.h +52 -0
  797. package/deps/rocksdb/rocksdb/util/defer_test.cc +39 -0
  798. package/deps/rocksdb/rocksdb/util/duplicate_detector.h +68 -0
  799. package/deps/rocksdb/rocksdb/util/dynamic_bloom.cc +70 -0
  800. package/deps/rocksdb/rocksdb/util/dynamic_bloom.h +214 -0
  801. package/deps/rocksdb/rocksdb/util/dynamic_bloom_test.cc +323 -0
  802. package/deps/rocksdb/rocksdb/util/fastrange.h +112 -0
  803. package/deps/rocksdb/rocksdb/util/file_checksum_helper.cc +136 -0
  804. package/deps/rocksdb/rocksdb/util/file_checksum_helper.h +98 -0
  805. package/deps/rocksdb/rocksdb/util/file_reader_writer_test.cc +449 -0
  806. package/deps/rocksdb/rocksdb/util/filelock_test.cc +152 -0
  807. package/deps/rocksdb/rocksdb/util/filter_bench.cc +781 -0
  808. package/deps/rocksdb/rocksdb/util/gflags_compat.h +20 -0
  809. package/deps/rocksdb/rocksdb/util/hash.cc +83 -0
  810. package/deps/rocksdb/rocksdb/util/hash.h +107 -0
  811. package/deps/rocksdb/rocksdb/util/hash_map.h +67 -0
  812. package/deps/rocksdb/rocksdb/util/hash_test.cc +593 -0
  813. package/deps/rocksdb/rocksdb/util/heap.h +166 -0
  814. package/deps/rocksdb/rocksdb/util/heap_test.cc +139 -0
  815. package/deps/rocksdb/rocksdb/util/kv_map.h +33 -0
  816. package/deps/rocksdb/rocksdb/util/log_write_bench.cc +86 -0
  817. package/deps/rocksdb/rocksdb/util/math.h +186 -0
  818. package/deps/rocksdb/rocksdb/util/math128.h +298 -0
  819. package/deps/rocksdb/rocksdb/util/murmurhash.cc +191 -0
  820. package/deps/rocksdb/rocksdb/util/murmurhash.h +42 -0
  821. package/deps/rocksdb/rocksdb/util/mutexlock.h +186 -0
  822. package/deps/rocksdb/rocksdb/util/ppc-opcode.h +27 -0
  823. package/deps/rocksdb/rocksdb/util/random.cc +56 -0
  824. package/deps/rocksdb/rocksdb/util/random.h +186 -0
  825. package/deps/rocksdb/rocksdb/util/random_test.cc +105 -0
  826. package/deps/rocksdb/rocksdb/util/rate_limiter.cc +340 -0
  827. package/deps/rocksdb/rocksdb/util/rate_limiter.h +113 -0
  828. package/deps/rocksdb/rocksdb/util/rate_limiter_test.cc +251 -0
  829. package/deps/rocksdb/rocksdb/util/repeatable_thread.h +151 -0
  830. package/deps/rocksdb/rocksdb/util/repeatable_thread_test.cc +107 -0
  831. package/deps/rocksdb/rocksdb/util/ribbon_alg.h +1201 -0
  832. package/deps/rocksdb/rocksdb/util/ribbon_impl.h +1062 -0
  833. package/deps/rocksdb/rocksdb/util/ribbon_test.cc +931 -0
  834. package/deps/rocksdb/rocksdb/util/set_comparator.h +22 -0
  835. package/deps/rocksdb/rocksdb/util/slice.cc +243 -0
  836. package/deps/rocksdb/rocksdb/util/slice_test.cc +163 -0
  837. package/deps/rocksdb/rocksdb/util/slice_transform_test.cc +153 -0
  838. package/deps/rocksdb/rocksdb/util/status.cc +149 -0
  839. package/deps/rocksdb/rocksdb/util/stderr_logger.h +31 -0
  840. package/deps/rocksdb/rocksdb/util/stop_watch.h +118 -0
  841. package/deps/rocksdb/rocksdb/util/string_util.cc +422 -0
  842. package/deps/rocksdb/rocksdb/util/string_util.h +144 -0
  843. package/deps/rocksdb/rocksdb/util/thread_list_test.cc +354 -0
  844. package/deps/rocksdb/rocksdb/util/thread_local.cc +554 -0
  845. package/deps/rocksdb/rocksdb/util/thread_local.h +101 -0
  846. package/deps/rocksdb/rocksdb/util/thread_local_test.cc +583 -0
  847. package/deps/rocksdb/rocksdb/util/thread_operation.h +121 -0
  848. package/deps/rocksdb/rocksdb/util/threadpool_imp.cc +506 -0
  849. package/deps/rocksdb/rocksdb/util/threadpool_imp.h +112 -0
  850. package/deps/rocksdb/rocksdb/util/timer.h +331 -0
  851. package/deps/rocksdb/rocksdb/util/timer_queue.h +230 -0
  852. package/deps/rocksdb/rocksdb/util/timer_queue_test.cc +72 -0
  853. package/deps/rocksdb/rocksdb/util/timer_test.cc +399 -0
  854. package/deps/rocksdb/rocksdb/util/user_comparator_wrapper.h +80 -0
  855. package/deps/rocksdb/rocksdb/util/vector_iterator.h +101 -0
  856. package/deps/rocksdb/rocksdb/util/work_queue.h +148 -0
  857. package/deps/rocksdb/rocksdb/util/work_queue_test.cc +268 -0
  858. package/deps/rocksdb/rocksdb/util/xxh3p.h +1392 -0
  859. package/deps/rocksdb/rocksdb/util/xxhash.cc +1158 -0
  860. package/deps/rocksdb/rocksdb/util/xxhash.h +598 -0
  861. package/deps/rocksdb/rocksdb/utilities/backupable/backupable_db.cc +2354 -0
  862. package/deps/rocksdb/rocksdb/utilities/backupable/backupable_db_test.cc +2955 -0
  863. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_compaction_filter.cc +488 -0
  864. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_compaction_filter.h +199 -0
  865. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db.cc +112 -0
  866. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db.h +266 -0
  867. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_gc_stats.h +52 -0
  868. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_impl.cc +2167 -0
  869. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_impl.h +500 -0
  870. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +113 -0
  871. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_iterator.h +147 -0
  872. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_listener.h +66 -0
  873. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_db_test.cc +2386 -0
  874. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_dump_tool.cc +281 -0
  875. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_dump_tool.h +58 -0
  876. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_file.cc +314 -0
  877. package/deps/rocksdb/rocksdb/utilities/blob_db/blob_file.h +244 -0
  878. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc +47 -0
  879. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_compaction_filter.h +42 -0
  880. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_format_test.cc +375 -0
  881. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_functional_test.cc +327 -0
  882. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_row_merge_test.cc +114 -0
  883. package/deps/rocksdb/rocksdb/utilities/cassandra/cassandra_serialize_test.cc +187 -0
  884. package/deps/rocksdb/rocksdb/utilities/cassandra/format.cc +390 -0
  885. package/deps/rocksdb/rocksdb/utilities/cassandra/format.h +184 -0
  886. package/deps/rocksdb/rocksdb/utilities/cassandra/merge_operator.cc +67 -0
  887. package/deps/rocksdb/rocksdb/utilities/cassandra/merge_operator.h +44 -0
  888. package/deps/rocksdb/rocksdb/utilities/cassandra/serialize.h +75 -0
  889. package/deps/rocksdb/rocksdb/utilities/cassandra/test_utils.cc +72 -0
  890. package/deps/rocksdb/rocksdb/utilities/cassandra/test_utils.h +43 -0
  891. package/deps/rocksdb/rocksdb/utilities/checkpoint/checkpoint_impl.cc +588 -0
  892. package/deps/rocksdb/rocksdb/utilities/checkpoint/checkpoint_impl.h +82 -0
  893. package/deps/rocksdb/rocksdb/utilities/checkpoint/checkpoint_test.cc +821 -0
  894. package/deps/rocksdb/rocksdb/utilities/compaction_filters/layered_compaction_filter_base.h +37 -0
  895. package/deps/rocksdb/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +29 -0
  896. package/deps/rocksdb/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +27 -0
  897. package/deps/rocksdb/rocksdb/utilities/convenience/info_log_finder.cc +25 -0
  898. package/deps/rocksdb/rocksdb/utilities/debug.cc +82 -0
  899. package/deps/rocksdb/rocksdb/utilities/env_librados.cc +1497 -0
  900. package/deps/rocksdb/rocksdb/utilities/env_librados_test.cc +1146 -0
  901. package/deps/rocksdb/rocksdb/utilities/env_mirror.cc +262 -0
  902. package/deps/rocksdb/rocksdb/utilities/env_mirror_test.cc +223 -0
  903. package/deps/rocksdb/rocksdb/utilities/env_timed.cc +145 -0
  904. package/deps/rocksdb/rocksdb/utilities/env_timed_test.cc +44 -0
  905. package/deps/rocksdb/rocksdb/utilities/fault_injection_env.cc +490 -0
  906. package/deps/rocksdb/rocksdb/utilities/fault_injection_env.h +242 -0
  907. package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.cc +581 -0
  908. package/deps/rocksdb/rocksdb/utilities/fault_injection_fs.h +437 -0
  909. package/deps/rocksdb/rocksdb/utilities/leveldb_options/leveldb_options.cc +56 -0
  910. package/deps/rocksdb/rocksdb/utilities/memory/memory_test.cc +275 -0
  911. package/deps/rocksdb/rocksdb/utilities/memory/memory_util.cc +52 -0
  912. package/deps/rocksdb/rocksdb/utilities/merge_operators/bytesxor.cc +59 -0
  913. package/deps/rocksdb/rocksdb/utilities/merge_operators/bytesxor.h +39 -0
  914. package/deps/rocksdb/rocksdb/utilities/merge_operators/max.cc +77 -0
  915. package/deps/rocksdb/rocksdb/utilities/merge_operators/put.cc +83 -0
  916. package/deps/rocksdb/rocksdb/utilities/merge_operators/sortlist.cc +97 -0
  917. package/deps/rocksdb/rocksdb/utilities/merge_operators/sortlist.h +38 -0
  918. package/deps/rocksdb/rocksdb/utilities/merge_operators/string_append/stringappend.cc +59 -0
  919. package/deps/rocksdb/rocksdb/utilities/merge_operators/string_append/stringappend.h +31 -0
  920. package/deps/rocksdb/rocksdb/utilities/merge_operators/string_append/stringappend2.cc +117 -0
  921. package/deps/rocksdb/rocksdb/utilities/merge_operators/string_append/stringappend2.h +49 -0
  922. package/deps/rocksdb/rocksdb/utilities/merge_operators/string_append/stringappend_test.cc +598 -0
  923. package/deps/rocksdb/rocksdb/utilities/merge_operators/uint64add.cc +69 -0
  924. package/deps/rocksdb/rocksdb/utilities/merge_operators.h +55 -0
  925. package/deps/rocksdb/rocksdb/utilities/object_registry.cc +87 -0
  926. package/deps/rocksdb/rocksdb/utilities/object_registry_test.cc +174 -0
  927. package/deps/rocksdb/rocksdb/utilities/option_change_migration/option_change_migration.cc +168 -0
  928. package/deps/rocksdb/rocksdb/utilities/option_change_migration/option_change_migration_test.cc +431 -0
  929. package/deps/rocksdb/rocksdb/utilities/options/options_util.cc +159 -0
  930. package/deps/rocksdb/rocksdb/utilities/options/options_util_test.cc +655 -0
  931. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier.cc +425 -0
  932. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier.h +156 -0
  933. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc +609 -0
  934. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier_file.h +296 -0
  935. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier_file_buffer.h +127 -0
  936. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc +86 -0
  937. package/deps/rocksdb/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.h +125 -0
  938. package/deps/rocksdb/rocksdb/utilities/persistent_cache/hash_table.h +238 -0
  939. package/deps/rocksdb/rocksdb/utilities/persistent_cache/hash_table_bench.cc +308 -0
  940. package/deps/rocksdb/rocksdb/utilities/persistent_cache/hash_table_evictable.h +168 -0
  941. package/deps/rocksdb/rocksdb/utilities/persistent_cache/hash_table_test.cc +160 -0
  942. package/deps/rocksdb/rocksdb/utilities/persistent_cache/lrulist.h +174 -0
  943. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_bench.cc +360 -0
  944. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_test.cc +456 -0
  945. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_test.h +286 -0
  946. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc +167 -0
  947. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_tier.h +339 -0
  948. package/deps/rocksdb/rocksdb/utilities/persistent_cache/persistent_cache_util.h +67 -0
  949. package/deps/rocksdb/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc +140 -0
  950. package/deps/rocksdb/rocksdb/utilities/persistent_cache/volatile_tier_impl.h +142 -0
  951. package/deps/rocksdb/rocksdb/utilities/simulator_cache/cache_simulator.cc +285 -0
  952. package/deps/rocksdb/rocksdb/utilities/simulator_cache/cache_simulator.h +231 -0
  953. package/deps/rocksdb/rocksdb/utilities/simulator_cache/cache_simulator_test.cc +494 -0
  954. package/deps/rocksdb/rocksdb/utilities/simulator_cache/sim_cache.cc +356 -0
  955. package/deps/rocksdb/rocksdb/utilities/simulator_cache/sim_cache_test.cc +224 -0
  956. package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +122 -0
  957. package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.h +72 -0
  958. package/deps/rocksdb/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc +244 -0
  959. package/deps/rocksdb/rocksdb/utilities/trace/file_trace_reader_writer.cc +125 -0
  960. package/deps/rocksdb/rocksdb/utilities/trace/file_trace_reader_writer.h +48 -0
  961. package/deps/rocksdb/rocksdb/utilities/transactions/lock/lock_manager.cc +29 -0
  962. package/deps/rocksdb/rocksdb/utilities/transactions/lock/lock_manager.h +82 -0
  963. package/deps/rocksdb/rocksdb/utilities/transactions/lock/lock_tracker.h +209 -0
  964. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +720 -0
  965. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_manager.h +223 -0
  966. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.cc +181 -0
  967. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.h +319 -0
  968. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +270 -0
  969. package/deps/rocksdb/rocksdb/utilities/transactions/lock/point/point_lock_tracker.h +99 -0
  970. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_lock_manager.h +30 -0
  971. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_locking_test.cc +306 -0
  972. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.AGPLv3 +661 -0
  973. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.APACHEv2 +174 -0
  974. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.GPLv2 +339 -0
  975. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/db.h +76 -0
  976. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/comparator.h +138 -0
  977. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/ft-status.h +102 -0
  978. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +139 -0
  979. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.h +174 -0
  980. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +222 -0
  981. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.h +141 -0
  982. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +525 -0
  983. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +253 -0
  984. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +1007 -0
  985. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h +560 -0
  986. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +527 -0
  987. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +265 -0
  988. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.h +178 -0
  989. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +520 -0
  990. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.h +302 -0
  991. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +120 -0
  992. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.h +92 -0
  993. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +213 -0
  994. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.h +124 -0
  995. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/memory.h +215 -0
  996. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_assert_subst.h +39 -0
  997. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h +130 -0
  998. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_external_pthread.h +82 -0
  999. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_instrumentation.h +286 -0
  1000. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_portability.h +87 -0
  1001. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +520 -0
  1002. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_race_tools.h +179 -0
  1003. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +172 -0
  1004. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/txn_subst.h +27 -0
  1005. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +132 -0
  1006. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +153 -0
  1007. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.h +98 -0
  1008. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +144 -0
  1009. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +201 -0
  1010. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.h +141 -0
  1011. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt.h +794 -0
  1012. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt_impl.h +1295 -0
  1013. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/partitioned_counter.h +165 -0
  1014. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/status.h +76 -0
  1015. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +479 -0
  1016. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +130 -0
  1017. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +156 -0
  1018. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h +146 -0
  1019. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction.cc +196 -0
  1020. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction.h +101 -0
  1021. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc +111 -0
  1022. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction_db_impl.h +87 -0
  1023. package/deps/rocksdb/rocksdb/utilities/transactions/optimistic_transaction_test.cc +1418 -0
  1024. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.cc +752 -0
  1025. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction.h +232 -0
  1026. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +628 -0
  1027. package/deps/rocksdb/rocksdb/utilities/transactions/pessimistic_transaction_db.h +228 -0
  1028. package/deps/rocksdb/rocksdb/utilities/transactions/snapshot_checker.cc +49 -0
  1029. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_base.cc +678 -0
  1030. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_base.h +373 -0
  1031. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc +135 -0
  1032. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_db_mutex_impl.h +26 -0
  1033. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.cc +6350 -0
  1034. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_test.h +522 -0
  1035. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_util.cc +188 -0
  1036. package/deps/rocksdb/rocksdb/utilities/transactions/transaction_util.h +80 -0
  1037. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_transaction_test.cc +3531 -0
  1038. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn.cc +483 -0
  1039. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn.h +119 -0
  1040. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn_db.cc +999 -0
  1041. package/deps/rocksdb/rocksdb/utilities/transactions/write_prepared_txn_db.h +1109 -0
  1042. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +786 -0
  1043. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_txn.cc +1039 -0
  1044. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_txn.h +341 -0
  1045. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +470 -0
  1046. package/deps/rocksdb/rocksdb/utilities/transactions/write_unprepared_txn_db.h +108 -0
  1047. package/deps/rocksdb/rocksdb/utilities/ttl/db_ttl_impl.cc +332 -0
  1048. package/deps/rocksdb/rocksdb/utilities/ttl/db_ttl_impl.h +353 -0
  1049. package/deps/rocksdb/rocksdb/utilities/ttl/ttl_test.cc +703 -0
  1050. package/deps/rocksdb/rocksdb/utilities/util_merge_operators_test.cc +99 -0
  1051. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +617 -0
  1052. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +345 -0
  1053. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +569 -0
  1054. package/deps/rocksdb/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +1867 -0
  1055. package/deps/rocksdb/rocksdb.gyp +475 -0
  1056. package/deps/snappy/freebsd/config.h +135 -0
  1057. package/deps/snappy/freebsd/snappy-stubs-public.h +100 -0
  1058. package/deps/snappy/linux/config.h +135 -0
  1059. package/deps/snappy/linux/snappy-stubs-public.h +100 -0
  1060. package/deps/snappy/mac/config.h +137 -0
  1061. package/deps/snappy/mac/snappy-stubs-public.h +100 -0
  1062. package/deps/snappy/openbsd/config.h +135 -0
  1063. package/deps/snappy/openbsd/snappy-stubs-public.h +100 -0
  1064. package/deps/snappy/snappy-1.1.7/COPYING +54 -0
  1065. package/deps/snappy/snappy-1.1.7/cmake/SnappyConfig.cmake +1 -0
  1066. package/deps/snappy/snappy-1.1.7/cmake/config.h.in +62 -0
  1067. package/deps/snappy/snappy-1.1.7/snappy-c.cc +90 -0
  1068. package/deps/snappy/snappy-1.1.7/snappy-c.h +138 -0
  1069. package/deps/snappy/snappy-1.1.7/snappy-internal.h +224 -0
  1070. package/deps/snappy/snappy-1.1.7/snappy-sinksource.cc +104 -0
  1071. package/deps/snappy/snappy-1.1.7/snappy-sinksource.h +182 -0
  1072. package/deps/snappy/snappy-1.1.7/snappy-stubs-internal.cc +42 -0
  1073. package/deps/snappy/snappy-1.1.7/snappy-stubs-internal.h +561 -0
  1074. package/deps/snappy/snappy-1.1.7/snappy-stubs-public.h.in +94 -0
  1075. package/deps/snappy/snappy-1.1.7/snappy-test.cc +612 -0
  1076. package/deps/snappy/snappy-1.1.7/snappy-test.h +573 -0
  1077. package/deps/snappy/snappy-1.1.7/snappy.cc +1515 -0
  1078. package/deps/snappy/snappy-1.1.7/snappy.h +203 -0
  1079. package/deps/snappy/snappy-1.1.7/snappy_unittest.cc +1410 -0
  1080. package/deps/snappy/snappy.gyp +90 -0
  1081. package/deps/snappy/solaris/config.h +135 -0
  1082. package/deps/snappy/solaris/snappy-stubs-public.h +100 -0
  1083. package/deps/snappy/win32/config.h +29 -0
  1084. package/deps/snappy/win32/snappy-stubs-public.h +100 -0
  1085. package/iterator.js +55 -0
  1086. package/leveldown.js +113 -0
  1087. package/package-lock.json +23687 -0
  1088. package/package.json +70 -0
@@ -0,0 +1,1702 @@
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
+ // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
6
+ // Use of this source code is governed by a BSD-style license that can be
7
+ // found in the LICENSE file. See the AUTHORS file for names of contributors.
8
+
9
+ #pragma once
10
+
11
+ #include <stddef.h>
12
+ #include <stdint.h>
13
+
14
+ #include <limits>
15
+ #include <memory>
16
+ #include <string>
17
+ #include <unordered_map>
18
+ #include <vector>
19
+
20
+ #include "rocksdb/advanced_options.h"
21
+ #include "rocksdb/comparator.h"
22
+ #include "rocksdb/compression_type.h"
23
+ #include "rocksdb/env.h"
24
+ #include "rocksdb/file_checksum.h"
25
+ #include "rocksdb/listener.h"
26
+ #include "rocksdb/sst_partitioner.h"
27
+ #include "rocksdb/types.h"
28
+ #include "rocksdb/universal_compaction.h"
29
+ #include "rocksdb/version.h"
30
+ #include "rocksdb/write_buffer_manager.h"
31
+
32
+ #ifdef max
33
+ #undef max
34
+ #endif
35
+
36
+ namespace ROCKSDB_NAMESPACE {
37
+
38
+ class Cache;
39
+ class CompactionFilter;
40
+ class CompactionFilterFactory;
41
+ class Comparator;
42
+ class ConcurrentTaskLimiter;
43
+ class Env;
44
+ enum InfoLogLevel : unsigned char;
45
+ class SstFileManager;
46
+ class FilterPolicy;
47
+ class Logger;
48
+ class MergeOperator;
49
+ class Snapshot;
50
+ class MemTableRepFactory;
51
+ class RateLimiter;
52
+ class Slice;
53
+ class Statistics;
54
+ class InternalKeyComparator;
55
+ class WalFilter;
56
+ class FileSystem;
57
+
58
+ struct Options;
59
+ struct DbPath;
60
+
61
+ struct ColumnFamilyOptions : public AdvancedColumnFamilyOptions {
62
+ // The function recovers options to a previous version. Only 4.6 or later
63
+ // versions are supported.
64
+ ColumnFamilyOptions* OldDefaults(int rocksdb_major_version = 4,
65
+ int rocksdb_minor_version = 6);
66
+
67
+ // Some functions that make it easier to optimize RocksDB
68
+ // Use this if your DB is very small (like under 1GB) and you don't want to
69
+ // spend lots of memory for memtables.
70
+ // An optional cache object is passed in to be used as the block cache
71
+ ColumnFamilyOptions* OptimizeForSmallDb(
72
+ std::shared_ptr<Cache>* cache = nullptr);
73
+
74
+ // Use this if you don't need to keep the data sorted, i.e. you'll never use
75
+ // an iterator, only Put() and Get() API calls
76
+ //
77
+ // Not supported in ROCKSDB_LITE
78
+ ColumnFamilyOptions* OptimizeForPointLookup(uint64_t block_cache_size_mb);
79
+
80
+ // Default values for some parameters in ColumnFamilyOptions are not
81
+ // optimized for heavy workloads and big datasets, which means you might
82
+ // observe write stalls under some conditions. As a starting point for tuning
83
+ // RocksDB options, use the following two functions:
84
+ // * OptimizeLevelStyleCompaction -- optimizes level style compaction
85
+ // * OptimizeUniversalStyleCompaction -- optimizes universal style compaction
86
+ // Universal style compaction is focused on reducing Write Amplification
87
+ // Factor for big data sets, but increases Space Amplification. You can learn
88
+ // more about the different styles here:
89
+ // https://github.com/facebook/rocksdb/wiki/Rocksdb-Architecture-Guide
90
+ // Make sure to also call IncreaseParallelism(), which will provide the
91
+ // biggest performance gains.
92
+ // Note: we might use more memory than memtable_memory_budget during high
93
+ // write rate period
94
+ //
95
+ // OptimizeUniversalStyleCompaction is not supported in ROCKSDB_LITE
96
+ ColumnFamilyOptions* OptimizeLevelStyleCompaction(
97
+ uint64_t memtable_memory_budget = 512 * 1024 * 1024);
98
+ ColumnFamilyOptions* OptimizeUniversalStyleCompaction(
99
+ uint64_t memtable_memory_budget = 512 * 1024 * 1024);
100
+
101
+ // -------------------
102
+ // Parameters that affect behavior
103
+
104
+ // Comparator used to define the order of keys in the table.
105
+ // Default: a comparator that uses lexicographic byte-wise ordering
106
+ //
107
+ // REQUIRES: The client must ensure that the comparator supplied
108
+ // here has the same name and orders keys *exactly* the same as the
109
+ // comparator provided to previous open calls on the same DB.
110
+ const Comparator* comparator = BytewiseComparator();
111
+
112
+ // REQUIRES: The client must provide a merge operator if Merge operation
113
+ // needs to be accessed. Calling Merge on a DB without a merge operator
114
+ // would result in Status::NotSupported. The client must ensure that the
115
+ // merge operator supplied here has the same name and *exactly* the same
116
+ // semantics as the merge operator provided to previous open calls on
117
+ // the same DB. The only exception is reserved for upgrade, where a DB
118
+ // previously without a merge operator is introduced to Merge operation
119
+ // for the first time. It's necessary to specify a merge operator when
120
+ // opening the DB in this case.
121
+ // Default: nullptr
122
+ std::shared_ptr<MergeOperator> merge_operator = nullptr;
123
+
124
+ // A single CompactionFilter instance to call into during compaction.
125
+ // Allows an application to modify/delete a key-value during background
126
+ // compaction.
127
+ //
128
+ // If the client requires a new compaction filter to be used for different
129
+ // compaction runs, it can specify compaction_filter_factory instead of this
130
+ // option. The client should specify only one of the two.
131
+ // compaction_filter takes precedence over compaction_filter_factory if
132
+ // client specifies both.
133
+ //
134
+ // If multithreaded compaction is being used, the supplied CompactionFilter
135
+ // instance may be used from different threads concurrently and so should be
136
+ // thread-safe.
137
+ //
138
+ // Default: nullptr
139
+ const CompactionFilter* compaction_filter = nullptr;
140
+
141
+ // This is a factory that provides compaction filter objects which allow
142
+ // an application to modify/delete a key-value during background compaction.
143
+ //
144
+ // A new filter will be created on each compaction run. If multithreaded
145
+ // compaction is being used, each created CompactionFilter will only be used
146
+ // from a single thread and so does not need to be thread-safe.
147
+ //
148
+ // Default: nullptr
149
+ std::shared_ptr<CompactionFilterFactory> compaction_filter_factory = nullptr;
150
+
151
+ // -------------------
152
+ // Parameters that affect performance
153
+
154
+ // Amount of data to build up in memory (backed by an unsorted log
155
+ // on disk) before converting to a sorted on-disk file.
156
+ //
157
+ // Larger values increase performance, especially during bulk loads.
158
+ // Up to max_write_buffer_number write buffers may be held in memory
159
+ // at the same time,
160
+ // so you may wish to adjust this parameter to control memory usage.
161
+ // Also, a larger write buffer will result in a longer recovery time
162
+ // the next time the database is opened.
163
+ //
164
+ // Note that write_buffer_size is enforced per column family.
165
+ // See db_write_buffer_size for sharing memory across column families.
166
+ //
167
+ // Default: 64MB
168
+ //
169
+ // Dynamically changeable through SetOptions() API
170
+ size_t write_buffer_size = 64 << 20;
171
+
172
+ // Compress blocks using the specified compression algorithm.
173
+ //
174
+ // Default: kSnappyCompression, if it's supported. If snappy is not linked
175
+ // with the library, the default is kNoCompression.
176
+ //
177
+ // Typical speeds of kSnappyCompression on an Intel(R) Core(TM)2 2.4GHz:
178
+ // ~200-500MB/s compression
179
+ // ~400-800MB/s decompression
180
+ //
181
+ // Note that these speeds are significantly faster than most
182
+ // persistent storage speeds, and therefore it is typically never
183
+ // worth switching to kNoCompression. Even if the input data is
184
+ // incompressible, the kSnappyCompression implementation will
185
+ // efficiently detect that and will switch to uncompressed mode.
186
+ //
187
+ // If you do not set `compression_opts.level`, or set it to
188
+ // `CompressionOptions::kDefaultCompressionLevel`, we will attempt to pick the
189
+ // default corresponding to `compression` as follows:
190
+ //
191
+ // - kZSTD: 3
192
+ // - kZlibCompression: Z_DEFAULT_COMPRESSION (currently -1)
193
+ // - kLZ4HCCompression: 0
194
+ // - For all others, we do not specify a compression level
195
+ //
196
+ // Dynamically changeable through SetOptions() API
197
+ CompressionType compression;
198
+
199
+ // Compression algorithm that will be used for the bottommost level that
200
+ // contain files.
201
+ //
202
+ // Default: kDisableCompressionOption (Disabled)
203
+ CompressionType bottommost_compression = kDisableCompressionOption;
204
+
205
+ // different options for compression algorithms used by bottommost_compression
206
+ // if it is enabled. To enable it, please see the definition of
207
+ // CompressionOptions.
208
+ CompressionOptions bottommost_compression_opts;
209
+
210
+ // different options for compression algorithms
211
+ CompressionOptions compression_opts;
212
+
213
+ // Number of files to trigger level-0 compaction. A value <0 means that
214
+ // level-0 compaction will not be triggered by number of files at all.
215
+ //
216
+ // Default: 4
217
+ //
218
+ // Dynamically changeable through SetOptions() API
219
+ int level0_file_num_compaction_trigger = 4;
220
+
221
+ // If non-nullptr, use the specified function to determine the
222
+ // prefixes for keys. These prefixes will be placed in the filter.
223
+ // Depending on the workload, this can reduce the number of read-IOP
224
+ // cost for scans when a prefix is passed via ReadOptions to
225
+ // db.NewIterator(). For prefix filtering to work properly,
226
+ // "prefix_extractor" and "comparator" must be such that the following
227
+ // properties hold:
228
+ //
229
+ // 1) key.starts_with(prefix(key))
230
+ // 2) Compare(prefix(key), key) <= 0.
231
+ // 3) If Compare(k1, k2) <= 0, then Compare(prefix(k1), prefix(k2)) <= 0
232
+ // 4) prefix(prefix(key)) == prefix(key)
233
+ //
234
+ // Default: nullptr
235
+ std::shared_ptr<const SliceTransform> prefix_extractor = nullptr;
236
+
237
+ // Control maximum total data size for a level.
238
+ // max_bytes_for_level_base is the max total for level-1.
239
+ // Maximum number of bytes for level L can be calculated as
240
+ // (max_bytes_for_level_base) * (max_bytes_for_level_multiplier ^ (L-1))
241
+ // For example, if max_bytes_for_level_base is 200MB, and if
242
+ // max_bytes_for_level_multiplier is 10, total data size for level-1
243
+ // will be 200MB, total file size for level-2 will be 2GB,
244
+ // and total file size for level-3 will be 20GB.
245
+ //
246
+ // Default: 256MB.
247
+ //
248
+ // Dynamically changeable through SetOptions() API
249
+ uint64_t max_bytes_for_level_base = 256 * 1048576;
250
+
251
+ // Deprecated.
252
+ uint64_t snap_refresh_nanos = 0;
253
+
254
+ // Disable automatic compactions. Manual compactions can still
255
+ // be issued on this column family
256
+ //
257
+ // Dynamically changeable through SetOptions() API
258
+ bool disable_auto_compactions = false;
259
+
260
+ // This is a factory that provides TableFactory objects.
261
+ // Default: a block-based table factory that provides a default
262
+ // implementation of TableBuilder and TableReader with default
263
+ // BlockBasedTableOptions.
264
+ std::shared_ptr<TableFactory> table_factory;
265
+
266
+ // A list of paths where SST files for this column family
267
+ // can be put into, with its target size. Similar to db_paths,
268
+ // newer data is placed into paths specified earlier in the
269
+ // vector while older data gradually moves to paths specified
270
+ // later in the vector.
271
+ // Note that, if a path is supplied to multiple column
272
+ // families, it would have files and total size from all
273
+ // the column families combined. User should provision for the
274
+ // total size(from all the column families) in such cases.
275
+ //
276
+ // If left empty, db_paths will be used.
277
+ // Default: empty
278
+ std::vector<DbPath> cf_paths;
279
+
280
+ // Compaction concurrent thread limiter for the column family.
281
+ // If non-nullptr, use given concurrent thread limiter to control
282
+ // the max outstanding compaction tasks. Limiter can be shared with
283
+ // multiple column families across db instances.
284
+ //
285
+ // Default: nullptr
286
+ std::shared_ptr<ConcurrentTaskLimiter> compaction_thread_limiter = nullptr;
287
+
288
+ // If non-nullptr, use the specified factory for a function to determine the
289
+ // partitioning of sst files. This helps compaction to split the files
290
+ // on interesting boundaries (key prefixes) to make propagation of sst
291
+ // files less write amplifying (covering the whole key space).
292
+ // THE FEATURE IS STILL EXPERIMENTAL
293
+ //
294
+ // Default: nullptr
295
+ std::shared_ptr<SstPartitionerFactory> sst_partitioner_factory = nullptr;
296
+
297
+ // Create ColumnFamilyOptions with default values for all fields
298
+ ColumnFamilyOptions();
299
+ // Create ColumnFamilyOptions from Options
300
+ explicit ColumnFamilyOptions(const Options& options);
301
+
302
+ void Dump(Logger* log) const;
303
+ };
304
+
305
+ enum class WALRecoveryMode : char {
306
+ // Original levelDB recovery
307
+ //
308
+ // We tolerate the last record in any log to be incomplete due to a crash
309
+ // while writing it. Zeroed bytes from preallocation are also tolerated in the
310
+ // trailing data of any log.
311
+ //
312
+ // Use case: Applications for which updates, once applied, must not be rolled
313
+ // back even after a crash-recovery. In this recovery mode, RocksDB guarantees
314
+ // this as long as `WritableFile::Append()` writes are durable. In case the
315
+ // user needs the guarantee in more situations (e.g., when
316
+ // `WritableFile::Append()` writes to page cache, but the user desires this
317
+ // guarantee in face of power-loss crash-recovery), RocksDB offers various
318
+ // mechanisms to additionally invoke `WritableFile::Sync()` in order to
319
+ // strengthen the guarantee.
320
+ //
321
+ // This differs from `kPointInTimeRecovery` in that, in case a corruption is
322
+ // detected during recovery, this mode will refuse to open the DB. Whereas,
323
+ // `kPointInTimeRecovery` will stop recovery just before the corruption since
324
+ // that is a valid point-in-time to which to recover.
325
+ kTolerateCorruptedTailRecords = 0x00,
326
+ // Recover from clean shutdown
327
+ // We don't expect to find any corruption in the WAL
328
+ // Use case : This is ideal for unit tests and rare applications that
329
+ // can require high consistency guarantee
330
+ kAbsoluteConsistency = 0x01,
331
+ // Recover to point-in-time consistency (default)
332
+ // We stop the WAL playback on discovering WAL inconsistency
333
+ // Use case : Ideal for systems that have disk controller cache like
334
+ // hard disk, SSD without super capacitor that store related data
335
+ kPointInTimeRecovery = 0x02,
336
+ // Recovery after a disaster
337
+ // We ignore any corruption in the WAL and try to salvage as much data as
338
+ // possible
339
+ // Use case : Ideal for last ditch effort to recover data or systems that
340
+ // operate with low grade unrelated data
341
+ kSkipAnyCorruptedRecords = 0x03,
342
+ };
343
+
344
+ struct DbPath {
345
+ std::string path;
346
+ uint64_t target_size; // Target size of total files under the path, in byte.
347
+
348
+ DbPath() : target_size(0) {}
349
+ DbPath(const std::string& p, uint64_t t) : path(p), target_size(t) {}
350
+ };
351
+
352
+ extern const char* kHostnameForDbHostId;
353
+
354
+ struct DBOptions {
355
+ // The function recovers options to the option as in version 4.6.
356
+ DBOptions* OldDefaults(int rocksdb_major_version = 4,
357
+ int rocksdb_minor_version = 6);
358
+
359
+ // Some functions that make it easier to optimize RocksDB
360
+
361
+ // Use this if your DB is very small (like under 1GB) and you don't want to
362
+ // spend lots of memory for memtables.
363
+ // An optional cache object is passed in for the memory of the
364
+ // memtable to cost to
365
+ DBOptions* OptimizeForSmallDb(std::shared_ptr<Cache>* cache = nullptr);
366
+
367
+ #ifndef ROCKSDB_LITE
368
+ // By default, RocksDB uses only one background thread for flush and
369
+ // compaction. Calling this function will set it up such that total of
370
+ // `total_threads` is used. Good value for `total_threads` is the number of
371
+ // cores. You almost definitely want to call this function if your system is
372
+ // bottlenecked by RocksDB.
373
+ DBOptions* IncreaseParallelism(int total_threads = 16);
374
+ #endif // ROCKSDB_LITE
375
+
376
+ // If true, the database will be created if it is missing.
377
+ // Default: false
378
+ bool create_if_missing = false;
379
+
380
+ // If true, missing column families will be automatically created.
381
+ // Default: false
382
+ bool create_missing_column_families = false;
383
+
384
+ // If true, an error is raised if the database already exists.
385
+ // Default: false
386
+ bool error_if_exists = false;
387
+
388
+ // If true, RocksDB will aggressively check consistency of the data.
389
+ // Also, if any of the writes to the database fails (Put, Delete, Merge,
390
+ // Write), the database will switch to read-only mode and fail all other
391
+ // Write operations.
392
+ // In most cases you want this to be set to true.
393
+ // Default: true
394
+ bool paranoid_checks = true;
395
+
396
+ // If true, the log numbers and sizes of the synced WALs are tracked
397
+ // in MANIFEST, then during DB recovery, if a synced WAL is missing
398
+ // from disk, or the WAL's size does not match the recorded size in
399
+ // MANIFEST, an error will be reported and the recovery will be aborted.
400
+ //
401
+ // Note that this option does not work with secondary instance.
402
+ //
403
+ // Default: false
404
+ bool track_and_verify_wals_in_manifest = false;
405
+
406
+ // Use the specified object to interact with the environment,
407
+ // e.g. to read/write files, schedule background work, etc. In the near
408
+ // future, support for doing storage operations such as read/write files
409
+ // through env will be deprecated in favor of file_system (see below)
410
+ // Default: Env::Default()
411
+ Env* env = Env::Default();
412
+
413
+ // Use to control write rate of flush and compaction. Flush has higher
414
+ // priority than compaction. Rate limiting is disabled if nullptr.
415
+ // If rate limiter is enabled, bytes_per_sync is set to 1MB by default.
416
+ // Default: nullptr
417
+ std::shared_ptr<RateLimiter> rate_limiter = nullptr;
418
+
419
+ // Use to track SST files and control their file deletion rate.
420
+ //
421
+ // Features:
422
+ // - Throttle the deletion rate of the SST files.
423
+ // - Keep track the total size of all SST files.
424
+ // - Set a maximum allowed space limit for SST files that when reached
425
+ // the DB wont do any further flushes or compactions and will set the
426
+ // background error.
427
+ // - Can be shared between multiple dbs.
428
+ // Limitations:
429
+ // - Only track and throttle deletes of SST files in
430
+ // first db_path (db_name if db_paths is empty).
431
+ //
432
+ // Default: nullptr
433
+ std::shared_ptr<SstFileManager> sst_file_manager = nullptr;
434
+
435
+ // Any internal progress/error information generated by the db will
436
+ // be written to info_log if it is non-nullptr, or to a file stored
437
+ // in the same directory as the DB contents if info_log is nullptr.
438
+ // Default: nullptr
439
+ std::shared_ptr<Logger> info_log = nullptr;
440
+
441
+ #ifdef NDEBUG
442
+ InfoLogLevel info_log_level = INFO_LEVEL;
443
+ #else
444
+ InfoLogLevel info_log_level = DEBUG_LEVEL;
445
+ #endif // NDEBUG
446
+
447
+ // Number of open files that can be used by the DB. You may need to
448
+ // increase this if your database has a large working set. Value -1 means
449
+ // files opened are always kept open. You can estimate number of files based
450
+ // on target_file_size_base and target_file_size_multiplier for level-based
451
+ // compaction. For universal-style compaction, you can usually set it to -1.
452
+ //
453
+ // Default: -1
454
+ //
455
+ // Dynamically changeable through SetDBOptions() API.
456
+ int max_open_files = -1;
457
+
458
+ // If max_open_files is -1, DB will open all files on DB::Open(). You can
459
+ // use this option to increase the number of threads used to open the files.
460
+ // Default: 16
461
+ int max_file_opening_threads = 16;
462
+
463
+ // Once write-ahead logs exceed this size, we will start forcing the flush of
464
+ // column families whose memtables are backed by the oldest live WAL file
465
+ // (i.e. the ones that are causing all the space amplification). If set to 0
466
+ // (default), we will dynamically choose the WAL size limit to be
467
+ // [sum of all write_buffer_size * max_write_buffer_number] * 4
468
+ // This option takes effect only when there are more than one column family as
469
+ // otherwise the wal size is dictated by the write_buffer_size.
470
+ //
471
+ // Default: 0
472
+ //
473
+ // Dynamically changeable through SetDBOptions() API.
474
+ uint64_t max_total_wal_size = 0;
475
+
476
+ // If non-null, then we should collect metrics about database operations
477
+ std::shared_ptr<Statistics> statistics = nullptr;
478
+
479
+ // By default, writes to stable storage use fdatasync (on platforms
480
+ // where this function is available). If this option is true,
481
+ // fsync is used instead.
482
+ //
483
+ // fsync and fdatasync are equally safe for our purposes and fdatasync is
484
+ // faster, so it is rarely necessary to set this option. It is provided
485
+ // as a workaround for kernel/filesystem bugs, such as one that affected
486
+ // fdatasync with ext4 in kernel versions prior to 3.7.
487
+ bool use_fsync = false;
488
+
489
+ // A list of paths where SST files can be put into, with its target size.
490
+ // Newer data is placed into paths specified earlier in the vector while
491
+ // older data gradually moves to paths specified later in the vector.
492
+ //
493
+ // For example, you have a flash device with 10GB allocated for the DB,
494
+ // as well as a hard drive of 2TB, you should config it to be:
495
+ // [{"/flash_path", 10GB}, {"/hard_drive", 2TB}]
496
+ //
497
+ // The system will try to guarantee data under each path is close to but
498
+ // not larger than the target size. But current and future file sizes used
499
+ // by determining where to place a file are based on best-effort estimation,
500
+ // which means there is a chance that the actual size under the directory
501
+ // is slightly more than target size under some workloads. User should give
502
+ // some buffer room for those cases.
503
+ //
504
+ // If none of the paths has sufficient room to place a file, the file will
505
+ // be placed to the last path anyway, despite to the target size.
506
+ //
507
+ // Placing newer data to earlier paths is also best-efforts. User should
508
+ // expect user files to be placed in higher levels in some extreme cases.
509
+ //
510
+ // If left empty, only one path will be used, which is db_name passed when
511
+ // opening the DB.
512
+ // Default: empty
513
+ std::vector<DbPath> db_paths;
514
+
515
+ // This specifies the info LOG dir.
516
+ // If it is empty, the log files will be in the same dir as data.
517
+ // If it is non empty, the log files will be in the specified dir,
518
+ // and the db data dir's absolute path will be used as the log file
519
+ // name's prefix.
520
+ std::string db_log_dir = "";
521
+
522
+ // This specifies the absolute dir path for write-ahead logs (WAL).
523
+ // If it is empty, the log files will be in the same dir as data,
524
+ // dbname is used as the data dir by default
525
+ // If it is non empty, the log files will be in kept the specified dir.
526
+ // When destroying the db,
527
+ // all log files in wal_dir and the dir itself is deleted
528
+ std::string wal_dir = "";
529
+
530
+ // The periodicity when obsolete files get deleted. The default
531
+ // value is 6 hours. The files that get out of scope by compaction
532
+ // process will still get automatically delete on every compaction,
533
+ // regardless of this setting
534
+ //
535
+ // Default: 6 hours
536
+ //
537
+ // Dynamically changeable through SetDBOptions() API.
538
+ uint64_t delete_obsolete_files_period_micros = 6ULL * 60 * 60 * 1000000;
539
+
540
+ // Maximum number of concurrent background jobs (compactions and flushes).
541
+ //
542
+ // Default: 2
543
+ //
544
+ // Dynamically changeable through SetDBOptions() API.
545
+ int max_background_jobs = 2;
546
+
547
+ // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
548
+ // value of max_background_jobs. This option is ignored.
549
+ //
550
+ // Dynamically changeable through SetDBOptions() API.
551
+ int base_background_compactions = -1;
552
+
553
+ // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
554
+ // value of max_background_jobs. For backwards compatibility we will set
555
+ // `max_background_jobs = max_background_compactions + max_background_flushes`
556
+ // in the case where user sets at least one of `max_background_compactions` or
557
+ // `max_background_flushes` (we replace -1 by 1 in case one option is unset).
558
+ //
559
+ // Maximum number of concurrent background compaction jobs, submitted to
560
+ // the default LOW priority thread pool.
561
+ //
562
+ // If you're increasing this, also consider increasing number of threads in
563
+ // LOW priority thread pool. For more information, see
564
+ // Env::SetBackgroundThreads
565
+ //
566
+ // Default: -1
567
+ //
568
+ // Dynamically changeable through SetDBOptions() API.
569
+ int max_background_compactions = -1;
570
+
571
+ // This value represents the maximum number of threads that will
572
+ // concurrently perform a compaction job by breaking it into multiple,
573
+ // smaller ones that are run simultaneously.
574
+ // Default: 1 (i.e. no subcompactions)
575
+ //
576
+ // Dynamically changeable through SetDBOptions() API.
577
+ uint32_t max_subcompactions = 1;
578
+
579
+ // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
580
+ // value of max_background_jobs. For backwards compatibility we will set
581
+ // `max_background_jobs = max_background_compactions + max_background_flushes`
582
+ // in the case where user sets at least one of `max_background_compactions` or
583
+ // `max_background_flushes`.
584
+ //
585
+ // Maximum number of concurrent background memtable flush jobs, submitted by
586
+ // default to the HIGH priority thread pool. If the HIGH priority thread pool
587
+ // is configured to have zero threads, flush jobs will share the LOW priority
588
+ // thread pool with compaction jobs.
589
+ //
590
+ // It is important to use both thread pools when the same Env is shared by
591
+ // multiple db instances. Without a separate pool, long running compaction
592
+ // jobs could potentially block memtable flush jobs of other db instances,
593
+ // leading to unnecessary Put stalls.
594
+ //
595
+ // If you're increasing this, also consider increasing number of threads in
596
+ // HIGH priority thread pool. For more information, see
597
+ // Env::SetBackgroundThreads
598
+ // Default: -1
599
+ int max_background_flushes = -1;
600
+
601
+ // Specify the maximal size of the info log file. If the log file
602
+ // is larger than `max_log_file_size`, a new info log file will
603
+ // be created.
604
+ // If max_log_file_size == 0, all logs will be written to one
605
+ // log file.
606
+ size_t max_log_file_size = 0;
607
+
608
+ // Time for the info log file to roll (in seconds).
609
+ // If specified with non-zero value, log file will be rolled
610
+ // if it has been active longer than `log_file_time_to_roll`.
611
+ // Default: 0 (disabled)
612
+ // Not supported in ROCKSDB_LITE mode!
613
+ size_t log_file_time_to_roll = 0;
614
+
615
+ // Maximal info log files to be kept.
616
+ // Default: 1000
617
+ size_t keep_log_file_num = 1000;
618
+
619
+ // Recycle log files.
620
+ // If non-zero, we will reuse previously written log files for new
621
+ // logs, overwriting the old data. The value indicates how many
622
+ // such files we will keep around at any point in time for later
623
+ // use. This is more efficient because the blocks are already
624
+ // allocated and fdatasync does not need to update the inode after
625
+ // each write.
626
+ // Default: 0
627
+ size_t recycle_log_file_num = 0;
628
+
629
+ // manifest file is rolled over on reaching this limit.
630
+ // The older manifest file be deleted.
631
+ // The default value is 1GB so that the manifest file can grow, but not
632
+ // reach the limit of storage capacity.
633
+ uint64_t max_manifest_file_size = 1024 * 1024 * 1024;
634
+
635
+ // Number of shards used for table cache.
636
+ int table_cache_numshardbits = 6;
637
+
638
+ // NOT SUPPORTED ANYMORE
639
+ // int table_cache_remove_scan_count_limit;
640
+
641
+ // The following two fields affect how archived logs will be deleted.
642
+ // 1. If both set to 0, logs will be deleted asap and will not get into
643
+ // the archive.
644
+ // 2. If WAL_ttl_seconds is 0 and WAL_size_limit_MB is not 0,
645
+ // WAL files will be checked every 10 min and if total size is greater
646
+ // then WAL_size_limit_MB, they will be deleted starting with the
647
+ // earliest until size_limit is met. All empty files will be deleted.
648
+ // 3. If WAL_ttl_seconds is not 0 and WAL_size_limit_MB is 0, then
649
+ // WAL files will be checked every WAL_ttl_seconds / 2 and those that
650
+ // are older than WAL_ttl_seconds will be deleted.
651
+ // 4. If both are not 0, WAL files will be checked every 10 min and both
652
+ // checks will be performed with ttl being first.
653
+ uint64_t WAL_ttl_seconds = 0;
654
+ uint64_t WAL_size_limit_MB = 0;
655
+
656
+ // Number of bytes to preallocate (via fallocate) the manifest
657
+ // files. Default is 4mb, which is reasonable to reduce random IO
658
+ // as well as prevent overallocation for mounts that preallocate
659
+ // large amounts of data (such as xfs's allocsize option).
660
+ size_t manifest_preallocation_size = 4 * 1024 * 1024;
661
+
662
+ // Allow the OS to mmap file for reading sst tables. Default: false
663
+ bool allow_mmap_reads = false;
664
+
665
+ // Allow the OS to mmap file for writing.
666
+ // DB::SyncWAL() only works if this is set to false.
667
+ // Default: false
668
+ bool allow_mmap_writes = false;
669
+
670
+ // Enable direct I/O mode for read/write
671
+ // they may or may not improve performance depending on the use case
672
+ //
673
+ // Files will be opened in "direct I/O" mode
674
+ // which means that data r/w from the disk will not be cached or
675
+ // buffered. The hardware buffer of the devices may however still
676
+ // be used. Memory mapped files are not impacted by these parameters.
677
+
678
+ // Use O_DIRECT for user and compaction reads.
679
+ // When true, we also force new_table_reader_for_compaction_inputs to true.
680
+ // Default: false
681
+ // Not supported in ROCKSDB_LITE mode!
682
+ bool use_direct_reads = false;
683
+
684
+ // Use O_DIRECT for writes in background flush and compactions.
685
+ // Default: false
686
+ // Not supported in ROCKSDB_LITE mode!
687
+ bool use_direct_io_for_flush_and_compaction = false;
688
+
689
+ // If false, fallocate() calls are bypassed
690
+ bool allow_fallocate = true;
691
+
692
+ // Disable child process inherit open files. Default: true
693
+ bool is_fd_close_on_exec = true;
694
+
695
+ // NOT SUPPORTED ANYMORE -- this options is no longer used
696
+ bool skip_log_error_on_recovery = false;
697
+
698
+ // if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
699
+ //
700
+ // Default: 600 (10 min)
701
+ //
702
+ // Dynamically changeable through SetDBOptions() API.
703
+ unsigned int stats_dump_period_sec = 600;
704
+
705
+ // if not zero, dump rocksdb.stats to RocksDB every stats_persist_period_sec
706
+ // Default: 600
707
+ unsigned int stats_persist_period_sec = 600;
708
+
709
+ // If true, automatically persist stats to a hidden column family (column
710
+ // family name: ___rocksdb_stats_history___) every
711
+ // stats_persist_period_sec seconds; otherwise, write to an in-memory
712
+ // struct. User can query through `GetStatsHistory` API.
713
+ // If user attempts to create a column family with the same name on a DB
714
+ // which have previously set persist_stats_to_disk to true, the column family
715
+ // creation will fail, but the hidden column family will survive, as well as
716
+ // the previously persisted statistics.
717
+ // When peristing stats to disk, the stat name will be limited at 100 bytes.
718
+ // Default: false
719
+ bool persist_stats_to_disk = false;
720
+
721
+ // if not zero, periodically take stats snapshots and store in memory, the
722
+ // memory size for stats snapshots is capped at stats_history_buffer_size
723
+ // Default: 1MB
724
+ size_t stats_history_buffer_size = 1024 * 1024;
725
+
726
+ // If set true, will hint the underlying file system that the file
727
+ // access pattern is random, when a sst file is opened.
728
+ // Default: true
729
+ bool advise_random_on_open = true;
730
+
731
+ // Amount of data to build up in memtables across all column
732
+ // families before writing to disk.
733
+ //
734
+ // This is distinct from write_buffer_size, which enforces a limit
735
+ // for a single memtable.
736
+ //
737
+ // This feature is disabled by default. Specify a non-zero value
738
+ // to enable it.
739
+ //
740
+ // Default: 0 (disabled)
741
+ size_t db_write_buffer_size = 0;
742
+
743
+ // The memory usage of memtable will report to this object. The same object
744
+ // can be passed into multiple DBs and it will track the sum of size of all
745
+ // the DBs. If the total size of all live memtables of all the DBs exceeds
746
+ // a limit, a flush will be triggered in the next DB to which the next write
747
+ // is issued.
748
+ //
749
+ // If the object is only passed to one DB, the behavior is the same as
750
+ // db_write_buffer_size. When write_buffer_manager is set, the value set will
751
+ // override db_write_buffer_size.
752
+ //
753
+ // This feature is disabled by default. Specify a non-zero value
754
+ // to enable it.
755
+ //
756
+ // Default: null
757
+ std::shared_ptr<WriteBufferManager> write_buffer_manager = nullptr;
758
+
759
+ // Specify the file access pattern once a compaction is started.
760
+ // It will be applied to all input files of a compaction.
761
+ // Default: NORMAL
762
+ enum AccessHint { NONE, NORMAL, SEQUENTIAL, WILLNEED };
763
+ AccessHint access_hint_on_compaction_start = NORMAL;
764
+
765
+ // If true, always create a new file descriptor and new table reader
766
+ // for compaction inputs. Turn this parameter on may introduce extra
767
+ // memory usage in the table reader, if it allocates extra memory
768
+ // for indexes. This will allow file descriptor prefetch options
769
+ // to be set for compaction input files and not to impact file
770
+ // descriptors for the same file used by user queries.
771
+ // Suggest to enable BlockBasedTableOptions.cache_index_and_filter_blocks
772
+ // for this mode if using block-based table.
773
+ //
774
+ // Default: false
775
+ // This flag has no affect on the behavior of compaction and plan to delete
776
+ // in the future.
777
+ bool new_table_reader_for_compaction_inputs = false;
778
+
779
+ // If non-zero, we perform bigger reads when doing compaction. If you're
780
+ // running RocksDB on spinning disks, you should set this to at least 2MB.
781
+ // That way RocksDB's compaction is doing sequential instead of random reads.
782
+ //
783
+ // When non-zero, we also force new_table_reader_for_compaction_inputs to
784
+ // true.
785
+ //
786
+ // Default: 0
787
+ //
788
+ // Dynamically changeable through SetDBOptions() API.
789
+ size_t compaction_readahead_size = 0;
790
+
791
+ // This is a maximum buffer size that is used by WinMmapReadableFile in
792
+ // unbuffered disk I/O mode. We need to maintain an aligned buffer for
793
+ // reads. We allow the buffer to grow until the specified value and then
794
+ // for bigger requests allocate one shot buffers. In unbuffered mode we
795
+ // always bypass read-ahead buffer at ReadaheadRandomAccessFile
796
+ // When read-ahead is required we then make use of compaction_readahead_size
797
+ // value and always try to read ahead. With read-ahead we always
798
+ // pre-allocate buffer to the size instead of growing it up to a limit.
799
+ //
800
+ // This option is currently honored only on Windows
801
+ //
802
+ // Default: 1 Mb
803
+ //
804
+ // Special value: 0 - means do not maintain per instance buffer. Allocate
805
+ // per request buffer and avoid locking.
806
+ size_t random_access_max_buffer_size = 1024 * 1024;
807
+
808
+ // This is the maximum buffer size that is used by WritableFileWriter.
809
+ // On Windows, we need to maintain an aligned buffer for writes.
810
+ // We allow the buffer to grow until it's size hits the limit in buffered
811
+ // IO and fix the buffer size when using direct IO to ensure alignment of
812
+ // write requests if the logical sector size is unusual
813
+ //
814
+ // Default: 1024 * 1024 (1 MB)
815
+ //
816
+ // Dynamically changeable through SetDBOptions() API.
817
+ size_t writable_file_max_buffer_size = 1024 * 1024;
818
+
819
+ // Use adaptive mutex, which spins in the user space before resorting
820
+ // to kernel. This could reduce context switch when the mutex is not
821
+ // heavily contended. However, if the mutex is hot, we could end up
822
+ // wasting spin time.
823
+ // Default: false
824
+ bool use_adaptive_mutex = false;
825
+
826
+ // Create DBOptions with default values for all fields
827
+ DBOptions();
828
+ // Create DBOptions from Options
829
+ explicit DBOptions(const Options& options);
830
+
831
+ void Dump(Logger* log) const;
832
+
833
+ // Allows OS to incrementally sync files to disk while they are being
834
+ // written, asynchronously, in the background. This operation can be used
835
+ // to smooth out write I/Os over time. Users shouldn't rely on it for
836
+ // persistency guarantee.
837
+ // Issue one request for every bytes_per_sync written. 0 turns it off.
838
+ //
839
+ // You may consider using rate_limiter to regulate write rate to device.
840
+ // When rate limiter is enabled, it automatically enables bytes_per_sync
841
+ // to 1MB.
842
+ //
843
+ // This option applies to table files
844
+ //
845
+ // Default: 0, turned off
846
+ //
847
+ // Note: DOES NOT apply to WAL files. See wal_bytes_per_sync instead
848
+ // Dynamically changeable through SetDBOptions() API.
849
+ uint64_t bytes_per_sync = 0;
850
+
851
+ // Same as bytes_per_sync, but applies to WAL files
852
+ //
853
+ // Default: 0, turned off
854
+ //
855
+ // Dynamically changeable through SetDBOptions() API.
856
+ uint64_t wal_bytes_per_sync = 0;
857
+
858
+ // When true, guarantees WAL files have at most `wal_bytes_per_sync`
859
+ // bytes submitted for writeback at any given time, and SST files have at most
860
+ // `bytes_per_sync` bytes pending writeback at any given time. This can be
861
+ // used to handle cases where processing speed exceeds I/O speed during file
862
+ // generation, which can lead to a huge sync when the file is finished, even
863
+ // with `bytes_per_sync` / `wal_bytes_per_sync` properly configured.
864
+ //
865
+ // - If `sync_file_range` is supported it achieves this by waiting for any
866
+ // prior `sync_file_range`s to finish before proceeding. In this way,
867
+ // processing (compression, etc.) can proceed uninhibited in the gap
868
+ // between `sync_file_range`s, and we block only when I/O falls behind.
869
+ // - Otherwise the `WritableFile::Sync` method is used. Note this mechanism
870
+ // always blocks, thus preventing the interleaving of I/O and processing.
871
+ //
872
+ // Note: Enabling this option does not provide any additional persistence
873
+ // guarantees, as it may use `sync_file_range`, which does not write out
874
+ // metadata.
875
+ //
876
+ // Default: false
877
+ bool strict_bytes_per_sync = false;
878
+
879
+ // A vector of EventListeners whose callback functions will be called
880
+ // when specific RocksDB event happens.
881
+ std::vector<std::shared_ptr<EventListener>> listeners;
882
+
883
+ // If true, then the status of the threads involved in this DB will
884
+ // be tracked and available via GetThreadList() API.
885
+ //
886
+ // Default: false
887
+ bool enable_thread_tracking = false;
888
+
889
+ // The limited write rate to DB if soft_pending_compaction_bytes_limit or
890
+ // level0_slowdown_writes_trigger is triggered, or we are writing to the
891
+ // last mem table allowed and we allow more than 3 mem tables. It is
892
+ // calculated using size of user write requests before compression.
893
+ // RocksDB may decide to slow down more if the compaction still
894
+ // gets behind further.
895
+ // If the value is 0, we will infer a value from `rater_limiter` value
896
+ // if it is not empty, or 16MB if `rater_limiter` is empty. Note that
897
+ // if users change the rate in `rate_limiter` after DB is opened,
898
+ // `delayed_write_rate` won't be adjusted.
899
+ //
900
+ // Unit: byte per second.
901
+ //
902
+ // Default: 0
903
+ //
904
+ // Dynamically changeable through SetDBOptions() API.
905
+ uint64_t delayed_write_rate = 0;
906
+
907
+ // By default, a single write thread queue is maintained. The thread gets
908
+ // to the head of the queue becomes write batch group leader and responsible
909
+ // for writing to WAL and memtable for the batch group.
910
+ //
911
+ // If enable_pipelined_write is true, separate write thread queue is
912
+ // maintained for WAL write and memtable write. A write thread first enter WAL
913
+ // writer queue and then memtable writer queue. Pending thread on the WAL
914
+ // writer queue thus only have to wait for previous writers to finish their
915
+ // WAL writing but not the memtable writing. Enabling the feature may improve
916
+ // write throughput and reduce latency of the prepare phase of two-phase
917
+ // commit.
918
+ //
919
+ // Default: false
920
+ bool enable_pipelined_write = false;
921
+
922
+ // Setting unordered_write to true trades higher write throughput with
923
+ // relaxing the immutability guarantee of snapshots. This violates the
924
+ // repeatability one expects from ::Get from a snapshot, as well as
925
+ // ::MultiGet and Iterator's consistent-point-in-time view property.
926
+ // If the application cannot tolerate the relaxed guarantees, it can implement
927
+ // its own mechanisms to work around that and yet benefit from the higher
928
+ // throughput. Using TransactionDB with WRITE_PREPARED write policy and
929
+ // two_write_queues=true is one way to achieve immutable snapshots despite
930
+ // unordered_write.
931
+ //
932
+ // By default, i.e., when it is false, rocksdb does not advance the sequence
933
+ // number for new snapshots unless all the writes with lower sequence numbers
934
+ // are already finished. This provides the immutability that we except from
935
+ // snapshots. Moreover, since Iterator and MultiGet internally depend on
936
+ // snapshots, the snapshot immutability results into Iterator and MultiGet
937
+ // offering consistent-point-in-time view. If set to true, although
938
+ // Read-Your-Own-Write property is still provided, the snapshot immutability
939
+ // property is relaxed: the writes issued after the snapshot is obtained (with
940
+ // larger sequence numbers) will be still not visible to the reads from that
941
+ // snapshot, however, there still might be pending writes (with lower sequence
942
+ // number) that will change the state visible to the snapshot after they are
943
+ // landed to the memtable.
944
+ //
945
+ // Default: false
946
+ bool unordered_write = false;
947
+
948
+ // If true, allow multi-writers to update mem tables in parallel.
949
+ // Only some memtable_factory-s support concurrent writes; currently it
950
+ // is implemented only for SkipListFactory. Concurrent memtable writes
951
+ // are not compatible with inplace_update_support or filter_deletes.
952
+ // It is strongly recommended to set enable_write_thread_adaptive_yield
953
+ // if you are going to use this feature.
954
+ //
955
+ // Default: true
956
+ bool allow_concurrent_memtable_write = true;
957
+
958
+ // If true, threads synchronizing with the write batch group leader will
959
+ // wait for up to write_thread_max_yield_usec before blocking on a mutex.
960
+ // This can substantially improve throughput for concurrent workloads,
961
+ // regardless of whether allow_concurrent_memtable_write is enabled.
962
+ //
963
+ // Default: true
964
+ bool enable_write_thread_adaptive_yield = true;
965
+
966
+ // The maximum limit of number of bytes that are written in a single batch
967
+ // of WAL or memtable write. It is followed when the leader write size
968
+ // is larger than 1/8 of this limit.
969
+ //
970
+ // Default: 1 MB
971
+ uint64_t max_write_batch_group_size_bytes = 1 << 20;
972
+
973
+ // The maximum number of microseconds that a write operation will use
974
+ // a yielding spin loop to coordinate with other write threads before
975
+ // blocking on a mutex. (Assuming write_thread_slow_yield_usec is
976
+ // set properly) increasing this value is likely to increase RocksDB
977
+ // throughput at the expense of increased CPU usage.
978
+ //
979
+ // Default: 100
980
+ uint64_t write_thread_max_yield_usec = 100;
981
+
982
+ // The latency in microseconds after which a std::this_thread::yield
983
+ // call (sched_yield on Linux) is considered to be a signal that
984
+ // other processes or threads would like to use the current core.
985
+ // Increasing this makes writer threads more likely to take CPU
986
+ // by spinning, which will show up as an increase in the number of
987
+ // involuntary context switches.
988
+ //
989
+ // Default: 3
990
+ uint64_t write_thread_slow_yield_usec = 3;
991
+
992
+ // If true, then DB::Open() will not update the statistics used to optimize
993
+ // compaction decision by loading table properties from many files.
994
+ // Turning off this feature will improve DBOpen time especially in
995
+ // disk environment.
996
+ //
997
+ // Default: false
998
+ bool skip_stats_update_on_db_open = false;
999
+
1000
+ // If true, then DB::Open() will not fetch and check sizes of all sst files.
1001
+ // This may significantly speed up startup if there are many sst files,
1002
+ // especially when using non-default Env with expensive GetFileSize().
1003
+ // We'll still check that all required sst files exist.
1004
+ // If paranoid_checks is false, this option is ignored, and sst files are
1005
+ // not checked at all.
1006
+ //
1007
+ // Default: false
1008
+ bool skip_checking_sst_file_sizes_on_db_open = false;
1009
+
1010
+ // Recovery mode to control the consistency while replaying WAL
1011
+ // Default: kPointInTimeRecovery
1012
+ WALRecoveryMode wal_recovery_mode = WALRecoveryMode::kPointInTimeRecovery;
1013
+
1014
+ // if set to false then recovery will fail when a prepared
1015
+ // transaction is encountered in the WAL
1016
+ bool allow_2pc = false;
1017
+
1018
+ // A global cache for table-level rows.
1019
+ // Default: nullptr (disabled)
1020
+ // Not supported in ROCKSDB_LITE mode!
1021
+ std::shared_ptr<Cache> row_cache = nullptr;
1022
+
1023
+ #ifndef ROCKSDB_LITE
1024
+ // A filter object supplied to be invoked while processing write-ahead-logs
1025
+ // (WALs) during recovery. The filter provides a way to inspect log
1026
+ // records, ignoring a particular record or skipping replay.
1027
+ // The filter is invoked at startup and is invoked from a single-thread
1028
+ // currently.
1029
+ WalFilter* wal_filter = nullptr;
1030
+ #endif // ROCKSDB_LITE
1031
+
1032
+ // If true, then DB::Open / CreateColumnFamily / DropColumnFamily
1033
+ // / SetOptions will fail if options file is not detected or properly
1034
+ // persisted.
1035
+ //
1036
+ // DEFAULT: false
1037
+ bool fail_if_options_file_error = false;
1038
+
1039
+ // If true, then print malloc stats together with rocksdb.stats
1040
+ // when printing to LOG.
1041
+ // DEFAULT: false
1042
+ bool dump_malloc_stats = false;
1043
+
1044
+ // By default RocksDB replay WAL logs and flush them on DB open, which may
1045
+ // create very small SST files. If this option is enabled, RocksDB will try
1046
+ // to avoid (but not guarantee not to) flush during recovery. Also, existing
1047
+ // WAL logs will be kept, so that if crash happened before flush, we still
1048
+ // have logs to recover from.
1049
+ //
1050
+ // DEFAULT: false
1051
+ bool avoid_flush_during_recovery = false;
1052
+
1053
+ // By default RocksDB will flush all memtables on DB close if there are
1054
+ // unpersisted data (i.e. with WAL disabled) The flush can be skip to speedup
1055
+ // DB close. Unpersisted data WILL BE LOST.
1056
+ //
1057
+ // DEFAULT: false
1058
+ //
1059
+ // Dynamically changeable through SetDBOptions() API.
1060
+ bool avoid_flush_during_shutdown = false;
1061
+
1062
+ // Set this option to true during creation of database if you want
1063
+ // to be able to ingest behind (call IngestExternalFile() skipping keys
1064
+ // that already exist, rather than overwriting matching keys).
1065
+ // Setting this option to true will affect 2 things:
1066
+ // 1) Disable some internal optimizations around SST file compression
1067
+ // 2) Reserve bottom-most level for ingested files only.
1068
+ // 3) Note that num_levels should be >= 3 if this option is turned on.
1069
+ //
1070
+ // DEFAULT: false
1071
+ // Immutable.
1072
+ bool allow_ingest_behind = false;
1073
+
1074
+ // Needed to support differential snapshots.
1075
+ // If set to true then DB will only process deletes with sequence number
1076
+ // less than what was set by SetPreserveDeletesSequenceNumber(uint64_t ts).
1077
+ // Clients are responsible to periodically call this method to advance
1078
+ // the cutoff time. If this method is never called and preserve_deletes
1079
+ // is set to true NO deletes will ever be processed.
1080
+ // At the moment this only keeps normal deletes, SingleDeletes will
1081
+ // not be preserved.
1082
+ // DEFAULT: false
1083
+ // Immutable (TODO: make it dynamically changeable)
1084
+ bool preserve_deletes = false;
1085
+
1086
+ // If enabled it uses two queues for writes, one for the ones with
1087
+ // disable_memtable and one for the ones that also write to memtable. This
1088
+ // allows the memtable writes not to lag behind other writes. It can be used
1089
+ // to optimize MySQL 2PC in which only the commits, which are serial, write to
1090
+ // memtable.
1091
+ bool two_write_queues = false;
1092
+
1093
+ // If true WAL is not flushed automatically after each write. Instead it
1094
+ // relies on manual invocation of FlushWAL to write the WAL buffer to its
1095
+ // file.
1096
+ bool manual_wal_flush = false;
1097
+
1098
+ // If true, RocksDB supports flushing multiple column families and committing
1099
+ // their results atomically to MANIFEST. Note that it is not
1100
+ // necessary to set atomic_flush to true if WAL is always enabled since WAL
1101
+ // allows the database to be restored to the last persistent state in WAL.
1102
+ // This option is useful when there are column families with writes NOT
1103
+ // protected by WAL.
1104
+ // For manual flush, application has to specify which column families to
1105
+ // flush atomically in DB::Flush.
1106
+ // For auto-triggered flush, RocksDB atomically flushes ALL column families.
1107
+ //
1108
+ // Currently, any WAL-enabled writes after atomic flush may be replayed
1109
+ // independently if the process crashes later and tries to recover.
1110
+ bool atomic_flush = false;
1111
+
1112
+ // If true, working thread may avoid doing unnecessary and long-latency
1113
+ // operation (such as deleting obsolete files directly or deleting memtable)
1114
+ // and will instead schedule a background job to do it.
1115
+ // Use it if you're latency-sensitive.
1116
+ // If set to true, takes precedence over
1117
+ // ReadOptions::background_purge_on_iterator_cleanup.
1118
+ bool avoid_unnecessary_blocking_io = false;
1119
+
1120
+ // Historically DB ID has always been stored in Identity File in DB folder.
1121
+ // If this flag is true, the DB ID is written to Manifest file in addition
1122
+ // to the Identity file. By doing this 2 problems are solved
1123
+ // 1. We don't checksum the Identity file where as Manifest file is.
1124
+ // 2. Since the source of truth for DB is Manifest file DB ID will sit with
1125
+ // the source of truth. Previously the Identity file could be copied
1126
+ // independent of Manifest and that can result in wrong DB ID.
1127
+ // We recommend setting this flag to true.
1128
+ // Default: false
1129
+ bool write_dbid_to_manifest = false;
1130
+
1131
+ // The number of bytes to prefetch when reading the log. This is mostly useful
1132
+ // for reading a remotely located log, as it can save the number of
1133
+ // round-trips. If 0, then the prefetching is disabled.
1134
+ //
1135
+ // Default: 0
1136
+ size_t log_readahead_size = 0;
1137
+
1138
+ // If user does NOT provide the checksum generator factory, the file checksum
1139
+ // will NOT be used. A new file checksum generator object will be created
1140
+ // when a SST file is created. Therefore, each created FileChecksumGenerator
1141
+ // will only be used from a single thread and so does not need to be
1142
+ // thread-safe.
1143
+ //
1144
+ // Default: nullptr
1145
+ std::shared_ptr<FileChecksumGenFactory> file_checksum_gen_factory = nullptr;
1146
+
1147
+ // By default, RocksDB recovery fails if any table file referenced in
1148
+ // MANIFEST are missing after scanning the MANIFEST.
1149
+ // Best-efforts recovery is another recovery mode that
1150
+ // tries to restore the database to the most recent point in time without
1151
+ // missing file.
1152
+ // Currently not compatible with atomic flush. Furthermore, WAL files will
1153
+ // not be used for recovery if best_efforts_recovery is true.
1154
+ // Default: false
1155
+ bool best_efforts_recovery = false;
1156
+
1157
+ // It defines how many times db resume is called by a separate thread when
1158
+ // background retryable IO Error happens. When background retryable IO
1159
+ // Error happens, SetBGError is called to deal with the error. If the error
1160
+ // can be auto-recovered (e.g., retryable IO Error during Flush or WAL write),
1161
+ // then db resume is called in background to recover from the error. If this
1162
+ // value is 0 or negative, db resume will not be called.
1163
+ //
1164
+ // Default: INT_MAX
1165
+ int max_bgerror_resume_count = INT_MAX;
1166
+
1167
+ // If max_bgerror_resume_count is >= 2, db resume is called multiple times.
1168
+ // This option decides how long to wait to retry the next resume if the
1169
+ // previous resume fails and satisfy redo resume conditions.
1170
+ //
1171
+ // Default: 1000000 (microseconds).
1172
+ uint64_t bgerror_resume_retry_interval = 1000000;
1173
+
1174
+ // It allows user to opt-in to get error messages containing corrupted
1175
+ // keys/values. Corrupt keys, values will be logged in the
1176
+ // messages/logs/status that will help users with the useful information
1177
+ // regarding affected data. By default value is set false to prevent users
1178
+ // data to be exposed in the logs/messages etc.
1179
+ //
1180
+ // Default: false
1181
+ bool allow_data_in_errors = false;
1182
+
1183
+ // A string identifying the machine hosting the DB. This
1184
+ // will be written as a property in every SST file written by the DB (or
1185
+ // by offline writers such as SstFileWriter and RepairDB). It can be useful
1186
+ // for troubleshooting in memory corruption caused by a failing host when
1187
+ // writing a file, by tracing back to the writing host. These corruptions
1188
+ // may not be caught by the checksum since they happen before checksumming.
1189
+ // If left as default, the table writer will substitute it with the actual
1190
+ // hostname when writing the SST file. If set to an empty stirng, the
1191
+ // property will not be written to the SST file.
1192
+ //
1193
+ // Default: hostname
1194
+ std::string db_host_id = kHostnameForDbHostId;
1195
+ };
1196
+
1197
+ // Options to control the behavior of a database (passed to DB::Open)
1198
+ struct Options : public DBOptions, public ColumnFamilyOptions {
1199
+ // Create an Options object with default values for all fields.
1200
+ Options() : DBOptions(), ColumnFamilyOptions() {}
1201
+
1202
+ Options(const DBOptions& db_options,
1203
+ const ColumnFamilyOptions& column_family_options)
1204
+ : DBOptions(db_options), ColumnFamilyOptions(column_family_options) {}
1205
+
1206
+ // The function recovers options to the option as in version 4.6.
1207
+ Options* OldDefaults(int rocksdb_major_version = 4,
1208
+ int rocksdb_minor_version = 6);
1209
+
1210
+ void Dump(Logger* log) const;
1211
+
1212
+ void DumpCFOptions(Logger* log) const;
1213
+
1214
+ // Some functions that make it easier to optimize RocksDB
1215
+
1216
+ // Set appropriate parameters for bulk loading.
1217
+ // The reason that this is a function that returns "this" instead of a
1218
+ // constructor is to enable chaining of multiple similar calls in the future.
1219
+ //
1220
+
1221
+ // All data will be in level 0 without any automatic compaction.
1222
+ // It's recommended to manually call CompactRange(NULL, NULL) before reading
1223
+ // from the database, because otherwise the read can be very slow.
1224
+ Options* PrepareForBulkLoad();
1225
+
1226
+ // Use this if your DB is very small (like under 1GB) and you don't want to
1227
+ // spend lots of memory for memtables.
1228
+ Options* OptimizeForSmallDb();
1229
+ };
1230
+
1231
+ //
1232
+ // An application can issue a read request (via Get/Iterators) and specify
1233
+ // if that read should process data that ALREADY resides on a specified cache
1234
+ // level. For example, if an application specifies kBlockCacheTier then the
1235
+ // Get call will process data that is already processed in the memtable or
1236
+ // the block cache. It will not page in data from the OS cache or data that
1237
+ // resides in storage.
1238
+ enum ReadTier {
1239
+ kReadAllTier = 0x0, // data in memtable, block cache, OS cache or storage
1240
+ kBlockCacheTier = 0x1, // data in memtable or block cache
1241
+ kPersistedTier = 0x2, // persisted data. When WAL is disabled, this option
1242
+ // will skip data in memtable.
1243
+ // Note that this ReadTier currently only supports
1244
+ // Get and MultiGet and does not support iterators.
1245
+ kMemtableTier = 0x3 // data in memtable. used for memtable-only iterators.
1246
+ };
1247
+
1248
+ // Options that control read operations
1249
+ struct ReadOptions {
1250
+ // If "snapshot" is non-nullptr, read as of the supplied snapshot
1251
+ // (which must belong to the DB that is being read and which must
1252
+ // not have been released). If "snapshot" is nullptr, use an implicit
1253
+ // snapshot of the state at the beginning of this read operation.
1254
+ // Default: nullptr
1255
+ const Snapshot* snapshot;
1256
+
1257
+ // `iterate_lower_bound` defines the smallest key at which the backward
1258
+ // iterator can return an entry. Once the bound is passed, Valid() will be
1259
+ // false. `iterate_lower_bound` is inclusive ie the bound value is a valid
1260
+ // entry.
1261
+ //
1262
+ // If prefix_extractor is not null, the Seek target and `iterate_lower_bound`
1263
+ // need to have the same prefix. This is because ordering is not guaranteed
1264
+ // outside of prefix domain.
1265
+ //
1266
+ // Default: nullptr
1267
+ const Slice* iterate_lower_bound;
1268
+
1269
+ // "iterate_upper_bound" defines the extent upto which the forward iterator
1270
+ // can returns entries. Once the bound is reached, Valid() will be false.
1271
+ // "iterate_upper_bound" is exclusive ie the bound value is
1272
+ // not a valid entry. If prefix_extractor is not null, the Seek target
1273
+ // and iterate_upper_bound need to have the same prefix.
1274
+ // This is because ordering is not guaranteed outside of prefix domain.
1275
+ //
1276
+ // Default: nullptr
1277
+ const Slice* iterate_upper_bound;
1278
+
1279
+ // RocksDB does auto-readahead for iterators on noticing more than two reads
1280
+ // for a table file. The readahead starts at 8KB and doubles on every
1281
+ // additional read upto 256KB.
1282
+ // This option can help if most of the range scans are large, and if it is
1283
+ // determined that a larger readahead than that enabled by auto-readahead is
1284
+ // needed.
1285
+ // Using a large readahead size (> 2MB) can typically improve the performance
1286
+ // of forward iteration on spinning disks.
1287
+ // Default: 0
1288
+ size_t readahead_size;
1289
+
1290
+ // A threshold for the number of keys that can be skipped before failing an
1291
+ // iterator seek as incomplete. The default value of 0 should be used to
1292
+ // never fail a request as incomplete, even on skipping too many keys.
1293
+ // Default: 0
1294
+ uint64_t max_skippable_internal_keys;
1295
+
1296
+ // Specify if this read request should process data that ALREADY
1297
+ // resides on a particular cache. If the required data is not
1298
+ // found at the specified cache, then Status::Incomplete is returned.
1299
+ // Default: kReadAllTier
1300
+ ReadTier read_tier;
1301
+
1302
+ // If true, all data read from underlying storage will be
1303
+ // verified against corresponding checksums.
1304
+ // Default: true
1305
+ bool verify_checksums;
1306
+
1307
+ // Should the "data block"/"index block"" read for this iteration be placed in
1308
+ // block cache?
1309
+ // Callers may wish to set this field to false for bulk scans.
1310
+ // This would help not to the change eviction order of existing items in the
1311
+ // block cache.
1312
+ // Default: true
1313
+ bool fill_cache;
1314
+
1315
+ // Specify to create a tailing iterator -- a special iterator that has a
1316
+ // view of the complete database (i.e. it can also be used to read newly
1317
+ // added data) and is optimized for sequential reads. It will return records
1318
+ // that were inserted into the database after the creation of the iterator.
1319
+ // Default: false
1320
+ // Not supported in ROCKSDB_LITE mode!
1321
+ bool tailing;
1322
+
1323
+ // This options is not used anymore. It was to turn on a functionality that
1324
+ // has been removed.
1325
+ bool managed;
1326
+
1327
+ // Enable a total order seek regardless of index format (e.g. hash index)
1328
+ // used in the table. Some table format (e.g. plain table) may not support
1329
+ // this option.
1330
+ // If true when calling Get(), we also skip prefix bloom when reading from
1331
+ // block based table. It provides a way to read existing data after
1332
+ // changing implementation of prefix extractor.
1333
+ // Default: false
1334
+ bool total_order_seek;
1335
+
1336
+ // When true, by default use total_order_seek = true, and RocksDB can
1337
+ // selectively enable prefix seek mode if won't generate a different result
1338
+ // from total_order_seek, based on seek key, and iterator upper bound.
1339
+ // Not suppported in ROCKSDB_LITE mode, in the way that even with value true
1340
+ // prefix mode is not used.
1341
+ // Default: false
1342
+ bool auto_prefix_mode;
1343
+
1344
+ // Enforce that the iterator only iterates over the same prefix as the seek.
1345
+ // This option is effective only for prefix seeks, i.e. prefix_extractor is
1346
+ // non-null for the column family and total_order_seek is false. Unlike
1347
+ // iterate_upper_bound, prefix_same_as_start only works within a prefix
1348
+ // but in both directions.
1349
+ // Default: false
1350
+ bool prefix_same_as_start;
1351
+
1352
+ // Keep the blocks loaded by the iterator pinned in memory as long as the
1353
+ // iterator is not deleted, If used when reading from tables created with
1354
+ // BlockBasedTableOptions::use_delta_encoding = false,
1355
+ // Iterator's property "rocksdb.iterator.is-key-pinned" is guaranteed to
1356
+ // return 1.
1357
+ // Default: false
1358
+ bool pin_data;
1359
+
1360
+ // If true, when PurgeObsoleteFile is called in CleanupIteratorState, we
1361
+ // schedule a background job in the flush job queue and delete obsolete files
1362
+ // in background.
1363
+ // Default: false
1364
+ bool background_purge_on_iterator_cleanup;
1365
+
1366
+ // If true, keys deleted using the DeleteRange() API will be visible to
1367
+ // readers until they are naturally deleted during compaction. This improves
1368
+ // read performance in DBs with many range deletions.
1369
+ // Default: false
1370
+ bool ignore_range_deletions;
1371
+
1372
+ // A callback to determine whether relevant keys for this scan exist in a
1373
+ // given table based on the table's properties. The callback is passed the
1374
+ // properties of each table during iteration. If the callback returns false,
1375
+ // the table will not be scanned. This option only affects Iterators and has
1376
+ // no impact on point lookups.
1377
+ // Default: empty (every table will be scanned)
1378
+ std::function<bool(const TableProperties&)> table_filter;
1379
+
1380
+ // Needed to support differential snapshots. Has 2 effects:
1381
+ // 1) Iterator will skip all internal keys with seqnum < iter_start_seqnum
1382
+ // 2) if this param > 0 iterator will return INTERNAL keys instead of
1383
+ // user keys; e.g. return tombstones as well.
1384
+ // Default: 0 (don't filter by seqnum, return user keys)
1385
+ SequenceNumber iter_start_seqnum;
1386
+
1387
+ // Timestamp of operation. Read should return the latest data visible to the
1388
+ // specified timestamp. All timestamps of the same database must be of the
1389
+ // same length and format. The user is responsible for providing a customized
1390
+ // compare function via Comparator to order <key, timestamp> tuples.
1391
+ // For iterator, iter_start_ts is the lower bound (older) and timestamp
1392
+ // serves as the upper bound. Versions of the same record that fall in
1393
+ // the timestamp range will be returned. If iter_start_ts is nullptr,
1394
+ // only the most recent version visible to timestamp is returned.
1395
+ // The user-specified timestamp feature is still under active development,
1396
+ // and the API is subject to change.
1397
+ // Default: nullptr
1398
+ const Slice* timestamp;
1399
+ const Slice* iter_start_ts;
1400
+
1401
+ // Deadline for completing an API call (Get/MultiGet/Seek/Next for now)
1402
+ // in microseconds.
1403
+ // It should be set to microseconds since epoch, i.e, gettimeofday or
1404
+ // equivalent plus allowed duration in microseconds. The best way is to use
1405
+ // env->NowMicros() + some timeout.
1406
+ // This is best efforts. The call may exceed the deadline if there is IO
1407
+ // involved and the file system doesn't support deadlines, or due to
1408
+ // checking for deadline periodically rather than for every key if
1409
+ // processing a batch
1410
+ std::chrono::microseconds deadline;
1411
+
1412
+ // A timeout in microseconds to be passed to the underlying FileSystem for
1413
+ // reads. As opposed to deadline, this determines the timeout for each
1414
+ // individual file read request. If a MultiGet/Get/Seek/Next etc call
1415
+ // results in multiple reads, each read can last upto io_timeout us.
1416
+ std::chrono::microseconds io_timeout;
1417
+
1418
+ // It limits the maximum cumulative value size of the keys in batch while
1419
+ // reading through MultiGet. Once the cumulative value size exceeds this
1420
+ // soft limit then all the remaining keys are returned with status Aborted.
1421
+ //
1422
+ // Default: std::numeric_limits<uint64_t>::max()
1423
+ uint64_t value_size_soft_limit;
1424
+
1425
+ ReadOptions();
1426
+ ReadOptions(bool cksum, bool cache);
1427
+ };
1428
+
1429
+ // Options that control write operations
1430
+ struct WriteOptions {
1431
+ // If true, the write will be flushed from the operating system
1432
+ // buffer cache (by calling WritableFile::Sync()) before the write
1433
+ // is considered complete. If this flag is true, writes will be
1434
+ // slower.
1435
+ //
1436
+ // If this flag is false, and the machine crashes, some recent
1437
+ // writes may be lost. Note that if it is just the process that
1438
+ // crashes (i.e., the machine does not reboot), no writes will be
1439
+ // lost even if sync==false.
1440
+ //
1441
+ // In other words, a DB write with sync==false has similar
1442
+ // crash semantics as the "write()" system call. A DB write
1443
+ // with sync==true has similar crash semantics to a "write()"
1444
+ // system call followed by "fdatasync()".
1445
+ //
1446
+ // Default: false
1447
+ bool sync;
1448
+
1449
+ // If true, writes will not first go to the write ahead log,
1450
+ // and the write may get lost after a crash. The backup engine
1451
+ // relies on write-ahead logs to back up the memtable, so if
1452
+ // you disable write-ahead logs, you must create backups with
1453
+ // flush_before_backup=true to avoid losing unflushed memtable data.
1454
+ // Default: false
1455
+ bool disableWAL;
1456
+
1457
+ // If true and if user is trying to write to column families that don't exist
1458
+ // (they were dropped), ignore the write (don't return an error). If there
1459
+ // are multiple writes in a WriteBatch, other writes will succeed.
1460
+ // Default: false
1461
+ bool ignore_missing_column_families;
1462
+
1463
+ // If true and we need to wait or sleep for the write request, fails
1464
+ // immediately with Status::Incomplete().
1465
+ // Default: false
1466
+ bool no_slowdown;
1467
+
1468
+ // If true, this write request is of lower priority if compaction is
1469
+ // behind. In this case, no_slowdown = true, the request will be cancelled
1470
+ // immediately with Status::Incomplete() returned. Otherwise, it will be
1471
+ // slowed down. The slowdown value is determined by RocksDB to guarantee
1472
+ // it introduces minimum impacts to high priority writes.
1473
+ //
1474
+ // Default: false
1475
+ bool low_pri;
1476
+
1477
+ // If true, this writebatch will maintain the last insert positions of each
1478
+ // memtable as hints in concurrent write. It can improve write performance
1479
+ // in concurrent writes if keys in one writebatch are sequential. In
1480
+ // non-concurrent writes (when concurrent_memtable_writes is false) this
1481
+ // option will be ignored.
1482
+ //
1483
+ // Default: false
1484
+ bool memtable_insert_hint_per_batch;
1485
+
1486
+ // Timestamp of write operation, e.g. Put. All timestamps of the same
1487
+ // database must share the same length and format. The user is also
1488
+ // responsible for providing a customized compare function via Comparator to
1489
+ // order <key, timestamp> tuples. If the user wants to enable timestamp, then
1490
+ // all write operations must be associated with timestamp because RocksDB, as
1491
+ // a single-node storage engine currently has no knowledge of global time,
1492
+ // thus has to rely on the application.
1493
+ // The user-specified timestamp feature is still under active development,
1494
+ // and the API is subject to change.
1495
+ const Slice* timestamp;
1496
+
1497
+ WriteOptions()
1498
+ : sync(false),
1499
+ disableWAL(false),
1500
+ ignore_missing_column_families(false),
1501
+ no_slowdown(false),
1502
+ low_pri(false),
1503
+ memtable_insert_hint_per_batch(false),
1504
+ timestamp(nullptr) {}
1505
+ };
1506
+
1507
+ // Options that control flush operations
1508
+ struct FlushOptions {
1509
+ // If true, the flush will wait until the flush is done.
1510
+ // Default: true
1511
+ bool wait;
1512
+ // If true, the flush would proceed immediately even it means writes will
1513
+ // stall for the duration of the flush; if false the operation will wait
1514
+ // until it's possible to do flush w/o causing stall or until required flush
1515
+ // is performed by someone else (foreground call or background thread).
1516
+ // Default: false
1517
+ bool allow_write_stall;
1518
+ FlushOptions() : wait(true), allow_write_stall(false) {}
1519
+ };
1520
+
1521
+ // Create a Logger from provided DBOptions
1522
+ extern Status CreateLoggerFromOptions(const std::string& dbname,
1523
+ const DBOptions& options,
1524
+ std::shared_ptr<Logger>* logger);
1525
+
1526
+ // CompactionOptions are used in CompactFiles() call.
1527
+ struct CompactionOptions {
1528
+ // Compaction output compression type
1529
+ // Default: snappy
1530
+ // If set to `kDisableCompressionOption`, RocksDB will choose compression type
1531
+ // according to the `ColumnFamilyOptions`, taking into account the output
1532
+ // level if `compression_per_level` is specified.
1533
+ CompressionType compression;
1534
+ // Compaction will create files of size `output_file_size_limit`.
1535
+ // Default: MAX, which means that compaction will create a single file
1536
+ uint64_t output_file_size_limit;
1537
+ // If > 0, it will replace the option in the DBOptions for this compaction.
1538
+ uint32_t max_subcompactions;
1539
+
1540
+ CompactionOptions()
1541
+ : compression(kSnappyCompression),
1542
+ output_file_size_limit(std::numeric_limits<uint64_t>::max()),
1543
+ max_subcompactions(0) {}
1544
+ };
1545
+
1546
+ // For level based compaction, we can configure if we want to skip/force
1547
+ // bottommost level compaction.
1548
+ enum class BottommostLevelCompaction {
1549
+ // Skip bottommost level compaction
1550
+ kSkip,
1551
+ // Only compact bottommost level if there is a compaction filter
1552
+ // This is the default option
1553
+ kIfHaveCompactionFilter,
1554
+ // Always compact bottommost level
1555
+ kForce,
1556
+ // Always compact bottommost level but in bottommost level avoid
1557
+ // double-compacting files created in the same compaction
1558
+ kForceOptimized,
1559
+ };
1560
+
1561
+ // CompactRangeOptions is used by CompactRange() call.
1562
+ struct CompactRangeOptions {
1563
+ // If true, no other compaction will run at the same time as this
1564
+ // manual compaction
1565
+ bool exclusive_manual_compaction = true;
1566
+ // If true, compacted files will be moved to the minimum level capable
1567
+ // of holding the data or given level (specified non-negative target_level).
1568
+ bool change_level = false;
1569
+ // If change_level is true and target_level have non-negative value, compacted
1570
+ // files will be moved to target_level.
1571
+ int target_level = -1;
1572
+ // Compaction outputs will be placed in options.db_paths[target_path_id].
1573
+ // Behavior is undefined if target_path_id is out of range.
1574
+ uint32_t target_path_id = 0;
1575
+ // By default level based compaction will only compact the bottommost level
1576
+ // if there is a compaction filter
1577
+ BottommostLevelCompaction bottommost_level_compaction =
1578
+ BottommostLevelCompaction::kIfHaveCompactionFilter;
1579
+ // If true, will execute immediately even if doing so would cause the DB to
1580
+ // enter write stall mode. Otherwise, it'll sleep until load is low enough.
1581
+ bool allow_write_stall = false;
1582
+ // If > 0, it will replace the option in the DBOptions for this compaction.
1583
+ uint32_t max_subcompactions = 0;
1584
+ };
1585
+
1586
+ // IngestExternalFileOptions is used by IngestExternalFile()
1587
+ struct IngestExternalFileOptions {
1588
+ // Can be set to true to move the files instead of copying them.
1589
+ bool move_files = false;
1590
+ // If set to true, ingestion falls back to copy when move fails.
1591
+ bool failed_move_fall_back_to_copy = true;
1592
+ // If set to false, an ingested file keys could appear in existing snapshots
1593
+ // that where created before the file was ingested.
1594
+ bool snapshot_consistency = true;
1595
+ // If set to false, IngestExternalFile() will fail if the file key range
1596
+ // overlaps with existing keys or tombstones in the DB.
1597
+ bool allow_global_seqno = true;
1598
+ // If set to false and the file key range overlaps with the memtable key range
1599
+ // (memtable flush required), IngestExternalFile will fail.
1600
+ bool allow_blocking_flush = true;
1601
+ // Set to true if you would like duplicate keys in the file being ingested
1602
+ // to be skipped rather than overwriting existing data under that key.
1603
+ // Usecase: back-fill of some historical data in the database without
1604
+ // over-writing existing newer version of data.
1605
+ // This option could only be used if the DB has been running
1606
+ // with allow_ingest_behind=true since the dawn of time.
1607
+ // All files will be ingested at the bottommost level with seqno=0.
1608
+ bool ingest_behind = false;
1609
+ // Set to true if you would like to write global_seqno to a given offset in
1610
+ // the external SST file for backward compatibility. Older versions of
1611
+ // RocksDB writes a global_seqno to a given offset within ingested SST files,
1612
+ // and new versions of RocksDB do not. If you ingest an external SST using
1613
+ // new version of RocksDB and would like to be able to downgrade to an
1614
+ // older version of RocksDB, you should set 'write_global_seqno' to true. If
1615
+ // your service is just starting to use the new RocksDB, we recommend that
1616
+ // you set this option to false, which brings two benefits:
1617
+ // 1. No extra random write for global_seqno during ingestion.
1618
+ // 2. Without writing external SST file, it's possible to do checksum.
1619
+ // We have a plan to set this option to false by default in the future.
1620
+ bool write_global_seqno = true;
1621
+ // Set to true if you would like to verify the checksums of each block of the
1622
+ // external SST file before ingestion.
1623
+ // Warning: setting this to true causes slowdown in file ingestion because
1624
+ // the external SST file has to be read.
1625
+ bool verify_checksums_before_ingest = false;
1626
+ // When verify_checksums_before_ingest = true, RocksDB uses default
1627
+ // readahead setting to scan the file while verifying checksums before
1628
+ // ingestion.
1629
+ // Users can override the default value using this option.
1630
+ // Using a large readahead size (> 2MB) can typically improve the performance
1631
+ // of forward iteration on spinning disks.
1632
+ size_t verify_checksums_readahead_size = 0;
1633
+ // Set to TRUE if user wants to verify the sst file checksum of ingested
1634
+ // files. The DB checksum function will generate the checksum of each
1635
+ // ingested file (if file_checksum_gen_factory is set) and compare the
1636
+ // checksum function name and checksum with the ingested checksum information.
1637
+ //
1638
+ // If this option is set to True: 1) if DB does not enable checksum
1639
+ // (file_checksum_gen_factory == nullptr), the ingested checksum information
1640
+ // will be ignored; 2) If DB enable the checksum function, we calculate the
1641
+ // sst file checksum after the file is moved or copied and compare the
1642
+ // checksum and checksum name. If checksum or checksum function name does
1643
+ // not match, ingestion will be failed. If the verification is sucessful,
1644
+ // checksum and checksum function name will be stored in Manifest.
1645
+ // If this option is set to FALSE, 1) if DB does not enable checksum,
1646
+ // the ingested checksum information will be ignored; 2) if DB enable the
1647
+ // checksum, we only verify the ingested checksum function name and we
1648
+ // trust the ingested checksum. If the checksum function name matches, we
1649
+ // store the checksum in Manifest. DB does not calculate the checksum during
1650
+ // ingestion. However, if no checksum information is provided with the
1651
+ // ingested files, DB will generate the checksum and store in the Manifest.
1652
+ bool verify_file_checksum = true;
1653
+ };
1654
+
1655
+ enum TraceFilterType : uint64_t {
1656
+ // Trace all the operations
1657
+ kTraceFilterNone = 0x0,
1658
+ // Do not trace the get operations
1659
+ kTraceFilterGet = 0x1 << 0,
1660
+ // Do not trace the write operations
1661
+ kTraceFilterWrite = 0x1 << 1
1662
+ };
1663
+
1664
+ // TraceOptions is used for StartTrace
1665
+ struct TraceOptions {
1666
+ // To avoid the trace file size grows large than the storage space,
1667
+ // user can set the max trace file size in Bytes. Default is 64GB
1668
+ uint64_t max_trace_file_size = uint64_t{64} * 1024 * 1024 * 1024;
1669
+ // Specify trace sampling option, i.e. capture one per how many requests.
1670
+ // Default to 1 (capture every request).
1671
+ uint64_t sampling_frequency = 1;
1672
+ // Note: The filtering happens before sampling.
1673
+ uint64_t filter = kTraceFilterNone;
1674
+ };
1675
+
1676
+ // ImportColumnFamilyOptions is used by ImportColumnFamily()
1677
+ struct ImportColumnFamilyOptions {
1678
+ // Can be set to true to move the files instead of copying them.
1679
+ bool move_files = false;
1680
+ };
1681
+
1682
+ // Options used with DB::GetApproximateSizes()
1683
+ struct SizeApproximationOptions {
1684
+ // Defines whether the returned size should include the recently written
1685
+ // data in the mem-tables. If set to false, include_files must be true.
1686
+ bool include_memtabtles = false;
1687
+ // Defines whether the returned size should include data serialized to disk.
1688
+ // If set to false, include_memtabtles must be true.
1689
+ bool include_files = true;
1690
+ // When approximating the files total size that is used to store a keys range
1691
+ // using DB::GetApproximateSizes, allow approximation with an error margin of
1692
+ // up to total_files_size * files_size_error_margin. This allows to take some
1693
+ // shortcuts in files size approximation, resulting in better performance,
1694
+ // while guaranteeing the resulting error is within a reasonable margin.
1695
+ // E.g., if the value is 0.1, then the error margin of the returned files size
1696
+ // approximation will be within 10%.
1697
+ // If the value is non-positive - a more precise yet more CPU intensive
1698
+ // estimation is performed.
1699
+ double files_size_error_margin = -1.0;
1700
+ };
1701
+
1702
+ } // namespace ROCKSDB_NAMESPACE