@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,1485 @@
1
+ // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2
+ // This source code is licensed under both the GPLv2 (found in the
3
+ // COPYING file in the root directory) and Apache 2.0 License
4
+ // (found in the LICENSE.Apache file in the root directory).
5
+ //
6
+ // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7
+ // Use of this source code is governed by a BSD-style license that can be
8
+ // found in the LICENSE file. See the AUTHORS file for names of contributors.
9
+ //
10
+ // The representation of a DBImpl consists of a set of Versions. The
11
+ // newest version is called "current". Older versions may be kept
12
+ // around to provide a consistent view to live iterators.
13
+ //
14
+ // Each Version keeps track of a set of table files per level, as well as a
15
+ // set of blob files. The entire set of versions is maintained in a
16
+ // VersionSet.
17
+ //
18
+ // Version,VersionSet are thread-compatible, but require external
19
+ // synchronization on all accesses.
20
+
21
+ #pragma once
22
+ #include <atomic>
23
+ #include <deque>
24
+ #include <limits>
25
+ #include <map>
26
+ #include <memory>
27
+ #include <set>
28
+ #include <string>
29
+ #include <unordered_set>
30
+ #include <utility>
31
+ #include <vector>
32
+
33
+ #include "cache/cache_helpers.h"
34
+ #include "db/blob/blob_file_meta.h"
35
+ #include "db/column_family.h"
36
+ #include "db/compaction/compaction.h"
37
+ #include "db/compaction/compaction_picker.h"
38
+ #include "db/dbformat.h"
39
+ #include "db/file_indexer.h"
40
+ #include "db/log_reader.h"
41
+ #include "db/range_del_aggregator.h"
42
+ #include "db/read_callback.h"
43
+ #include "db/table_cache.h"
44
+ #include "db/version_builder.h"
45
+ #include "db/version_edit.h"
46
+ #include "db/write_controller.h"
47
+ #include "env/file_system_tracer.h"
48
+ #include "monitoring/instrumented_mutex.h"
49
+ #include "options/db_options.h"
50
+ #include "port/port.h"
51
+ #include "rocksdb/env.h"
52
+ #include "rocksdb/file_checksum.h"
53
+ #include "table/get_context.h"
54
+ #include "table/multiget_context.h"
55
+ #include "trace_replay/block_cache_tracer.h"
56
+
57
+ namespace ROCKSDB_NAMESPACE {
58
+
59
+ namespace log {
60
+ class Writer;
61
+ }
62
+
63
+ class BlobIndex;
64
+ class Compaction;
65
+ class LogBuffer;
66
+ class LookupKey;
67
+ class MemTable;
68
+ class Version;
69
+ class VersionSet;
70
+ class WriteBufferManager;
71
+ class MergeContext;
72
+ class ColumnFamilySet;
73
+ class MergeIteratorBuilder;
74
+
75
+ // VersionEdit is always supposed to be valid and it is used to point at
76
+ // entries in Manifest. Ideally it should not be used as a container to
77
+ // carry around few of its fields as function params because it can cause
78
+ // readers to think it's a valid entry from Manifest. To avoid that confusion
79
+ // introducing VersionEditParams to simply carry around multiple VersionEdit
80
+ // params. It need not point to a valid record in Manifest.
81
+ using VersionEditParams = VersionEdit;
82
+
83
+ // Return the smallest index i such that file_level.files[i]->largest >= key.
84
+ // Return file_level.num_files if there is no such file.
85
+ // REQUIRES: "file_level.files" contains a sorted list of
86
+ // non-overlapping files.
87
+ extern int FindFile(const InternalKeyComparator& icmp,
88
+ const LevelFilesBrief& file_level, const Slice& key);
89
+
90
+ // Returns true iff some file in "files" overlaps the user key range
91
+ // [*smallest,*largest].
92
+ // smallest==nullptr represents a key smaller than all keys in the DB.
93
+ // largest==nullptr represents a key largest than all keys in the DB.
94
+ // REQUIRES: If disjoint_sorted_files, file_level.files[]
95
+ // contains disjoint ranges in sorted order.
96
+ extern bool SomeFileOverlapsRange(const InternalKeyComparator& icmp,
97
+ bool disjoint_sorted_files,
98
+ const LevelFilesBrief& file_level,
99
+ const Slice* smallest_user_key,
100
+ const Slice* largest_user_key);
101
+
102
+ // Generate LevelFilesBrief from vector<FdWithKeyRange*>
103
+ // Would copy smallest_key and largest_key data to sequential memory
104
+ // arena: Arena used to allocate the memory
105
+ extern void DoGenerateLevelFilesBrief(LevelFilesBrief* file_level,
106
+ const std::vector<FileMetaData*>& files,
107
+ Arena* arena);
108
+
109
+ // Information of the storage associated with each Version, including number of
110
+ // levels of LSM tree, files information at each level, files marked for
111
+ // compaction, blob files, etc.
112
+ class VersionStorageInfo {
113
+ public:
114
+ VersionStorageInfo(const InternalKeyComparator* internal_comparator,
115
+ const Comparator* user_comparator, int num_levels,
116
+ CompactionStyle compaction_style,
117
+ VersionStorageInfo* src_vstorage,
118
+ bool _force_consistency_checks);
119
+ // No copying allowed
120
+ VersionStorageInfo(const VersionStorageInfo&) = delete;
121
+ void operator=(const VersionStorageInfo&) = delete;
122
+ ~VersionStorageInfo();
123
+
124
+ void Reserve(int level, size_t size) { files_[level].reserve(size); }
125
+
126
+ void AddFile(int level, FileMetaData* f);
127
+
128
+ void AddBlobFile(std::shared_ptr<BlobFileMetaData> blob_file_meta);
129
+
130
+ void SetFinalized();
131
+
132
+ // Update num_non_empty_levels_.
133
+ void UpdateNumNonEmptyLevels();
134
+
135
+ void GenerateFileIndexer() {
136
+ file_indexer_.UpdateIndex(&arena_, num_non_empty_levels_, files_);
137
+ }
138
+
139
+ // Update the accumulated stats from a file-meta.
140
+ void UpdateAccumulatedStats(FileMetaData* file_meta);
141
+
142
+ // Decrease the current stat from a to-be-deleted file-meta
143
+ void RemoveCurrentStats(FileMetaData* file_meta);
144
+
145
+ void ComputeCompensatedSizes();
146
+
147
+ // Updates internal structures that keep track of compaction scores
148
+ // We use compaction scores to figure out which compaction to do next
149
+ // REQUIRES: db_mutex held!!
150
+ // TODO find a better way to pass compaction_options_fifo.
151
+ void ComputeCompactionScore(const ImmutableCFOptions& immutable_cf_options,
152
+ const MutableCFOptions& mutable_cf_options);
153
+
154
+ // Estimate est_comp_needed_bytes_
155
+ void EstimateCompactionBytesNeeded(
156
+ const MutableCFOptions& mutable_cf_options);
157
+
158
+ // This computes files_marked_for_compaction_ and is called by
159
+ // ComputeCompactionScore()
160
+ void ComputeFilesMarkedForCompaction();
161
+
162
+ // This computes ttl_expired_files_ and is called by
163
+ // ComputeCompactionScore()
164
+ void ComputeExpiredTtlFiles(const ImmutableCFOptions& ioptions,
165
+ const uint64_t ttl);
166
+
167
+ // This computes files_marked_for_periodic_compaction_ and is called by
168
+ // ComputeCompactionScore()
169
+ void ComputeFilesMarkedForPeriodicCompaction(
170
+ const ImmutableCFOptions& ioptions,
171
+ const uint64_t periodic_compaction_seconds);
172
+
173
+ // This computes bottommost_files_marked_for_compaction_ and is called by
174
+ // ComputeCompactionScore() or UpdateOldestSnapshot().
175
+ //
176
+ // Among bottommost files (assumes they've already been computed), marks the
177
+ // ones that have keys that would be eliminated if recompacted, according to
178
+ // the seqnum of the oldest existing snapshot. Must be called every time
179
+ // oldest snapshot changes as that is when bottom-level files can become
180
+ // eligible for compaction.
181
+ //
182
+ // REQUIRES: DB mutex held
183
+ void ComputeBottommostFilesMarkedForCompaction();
184
+
185
+ // Generate level_files_brief_ from files_
186
+ void GenerateLevelFilesBrief();
187
+ // Sort all files for this version based on their file size and
188
+ // record results in files_by_compaction_pri_. The largest files are listed
189
+ // first.
190
+ void UpdateFilesByCompactionPri(CompactionPri compaction_pri);
191
+
192
+ void GenerateLevel0NonOverlapping();
193
+ bool level0_non_overlapping() const {
194
+ return level0_non_overlapping_;
195
+ }
196
+
197
+ // Check whether each file in this version is bottommost (i.e., nothing in its
198
+ // key-range could possibly exist in an older file/level).
199
+ // REQUIRES: This version has not been saved
200
+ void GenerateBottommostFiles();
201
+
202
+ // Updates the oldest snapshot and related internal state, like the bottommost
203
+ // files marked for compaction.
204
+ // REQUIRES: DB mutex held
205
+ void UpdateOldestSnapshot(SequenceNumber oldest_snapshot_seqnum);
206
+
207
+ int MaxInputLevel() const;
208
+ int MaxOutputLevel(bool allow_ingest_behind) const;
209
+
210
+ // Return level number that has idx'th highest score
211
+ int CompactionScoreLevel(int idx) const { return compaction_level_[idx]; }
212
+
213
+ // Return idx'th highest score
214
+ double CompactionScore(int idx) const { return compaction_score_[idx]; }
215
+
216
+ void GetOverlappingInputs(
217
+ int level, const InternalKey* begin, // nullptr means before all keys
218
+ const InternalKey* end, // nullptr means after all keys
219
+ std::vector<FileMetaData*>* inputs,
220
+ int hint_index = -1, // index of overlap file
221
+ int* file_index = nullptr, // return index of overlap file
222
+ bool expand_range = true, // if set, returns files which overlap the
223
+ // range and overlap each other. If false,
224
+ // then just files intersecting the range
225
+ InternalKey** next_smallest = nullptr) // if non-null, returns the
226
+ const; // smallest key of next file not included
227
+ void GetCleanInputsWithinInterval(
228
+ int level, const InternalKey* begin, // nullptr means before all keys
229
+ const InternalKey* end, // nullptr means after all keys
230
+ std::vector<FileMetaData*>* inputs,
231
+ int hint_index = -1, // index of overlap file
232
+ int* file_index = nullptr) // return index of overlap file
233
+ const;
234
+
235
+ void GetOverlappingInputsRangeBinarySearch(
236
+ int level, // level > 0
237
+ const InternalKey* begin, // nullptr means before all keys
238
+ const InternalKey* end, // nullptr means after all keys
239
+ std::vector<FileMetaData*>* inputs,
240
+ int hint_index, // index of overlap file
241
+ int* file_index, // return index of overlap file
242
+ bool within_interval = false, // if set, force the inputs within interval
243
+ InternalKey** next_smallest = nullptr) // if non-null, returns the
244
+ const; // smallest key of next file not included
245
+
246
+ // Returns true iff some file in the specified level overlaps
247
+ // some part of [*smallest_user_key,*largest_user_key].
248
+ // smallest_user_key==NULL represents a key smaller than all keys in the DB.
249
+ // largest_user_key==NULL represents a key largest than all keys in the DB.
250
+ bool OverlapInLevel(int level, const Slice* smallest_user_key,
251
+ const Slice* largest_user_key);
252
+
253
+ // Returns true iff the first or last file in inputs contains
254
+ // an overlapping user key to the file "just outside" of it (i.e.
255
+ // just after the last file, or just before the first file)
256
+ // REQUIRES: "*inputs" is a sorted list of non-overlapping files
257
+ bool HasOverlappingUserKey(const std::vector<FileMetaData*>* inputs,
258
+ int level);
259
+
260
+ int num_levels() const { return num_levels_; }
261
+
262
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
263
+ int num_non_empty_levels() const {
264
+ assert(finalized_);
265
+ return num_non_empty_levels_;
266
+ }
267
+
268
+ // REQUIRES: This version has been finalized.
269
+ // (CalculateBaseBytes() is called)
270
+ // This may or may not return number of level files. It is to keep backward
271
+ // compatible behavior in universal compaction.
272
+ int l0_delay_trigger_count() const { return l0_delay_trigger_count_; }
273
+
274
+ void set_l0_delay_trigger_count(int v) { l0_delay_trigger_count_ = v; }
275
+
276
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
277
+ int NumLevelFiles(int level) const {
278
+ assert(finalized_);
279
+ return static_cast<int>(files_[level].size());
280
+ }
281
+
282
+ // Return the combined file size of all files at the specified level.
283
+ uint64_t NumLevelBytes(int level) const;
284
+
285
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
286
+ const std::vector<FileMetaData*>& LevelFiles(int level) const {
287
+ return files_[level];
288
+ }
289
+
290
+ class FileLocation {
291
+ public:
292
+ FileLocation() = default;
293
+ FileLocation(int level, size_t position)
294
+ : level_(level), position_(position) {}
295
+
296
+ int GetLevel() const { return level_; }
297
+ size_t GetPosition() const { return position_; }
298
+
299
+ bool IsValid() const { return level_ >= 0; }
300
+
301
+ bool operator==(const FileLocation& rhs) const {
302
+ return level_ == rhs.level_ && position_ == rhs.position_;
303
+ }
304
+
305
+ bool operator!=(const FileLocation& rhs) const { return !(*this == rhs); }
306
+
307
+ static FileLocation Invalid() { return FileLocation(); }
308
+
309
+ private:
310
+ int level_ = -1;
311
+ size_t position_ = 0;
312
+ };
313
+
314
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
315
+ FileLocation GetFileLocation(uint64_t file_number) const {
316
+ const auto it = file_locations_.find(file_number);
317
+
318
+ if (it == file_locations_.end()) {
319
+ return FileLocation::Invalid();
320
+ }
321
+
322
+ assert(it->second.GetLevel() < num_levels_);
323
+ assert(it->second.GetPosition() < files_[it->second.GetLevel()].size());
324
+ assert(files_[it->second.GetLevel()][it->second.GetPosition()]);
325
+ assert(files_[it->second.GetLevel()][it->second.GetPosition()]
326
+ ->fd.GetNumber() == file_number);
327
+
328
+ return it->second;
329
+ }
330
+
331
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
332
+ FileMetaData* GetFileMetaDataByNumber(uint64_t file_number) const {
333
+ auto location = GetFileLocation(file_number);
334
+
335
+ if (!location.IsValid()) {
336
+ return nullptr;
337
+ }
338
+
339
+ return files_[location.GetLevel()][location.GetPosition()];
340
+ }
341
+
342
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
343
+ using BlobFiles = std::map<uint64_t, std::shared_ptr<BlobFileMetaData>>;
344
+ const BlobFiles& GetBlobFiles() const { return blob_files_; }
345
+
346
+ const ROCKSDB_NAMESPACE::LevelFilesBrief& LevelFilesBrief(int level) const {
347
+ assert(level < static_cast<int>(level_files_brief_.size()));
348
+ return level_files_brief_[level];
349
+ }
350
+
351
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
352
+ const std::vector<int>& FilesByCompactionPri(int level) const {
353
+ assert(finalized_);
354
+ return files_by_compaction_pri_[level];
355
+ }
356
+
357
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
358
+ // REQUIRES: DB mutex held during access
359
+ const autovector<std::pair<int, FileMetaData*>>& FilesMarkedForCompaction()
360
+ const {
361
+ assert(finalized_);
362
+ return files_marked_for_compaction_;
363
+ }
364
+
365
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
366
+ // REQUIRES: DB mutex held during access
367
+ const autovector<std::pair<int, FileMetaData*>>& ExpiredTtlFiles() const {
368
+ assert(finalized_);
369
+ return expired_ttl_files_;
370
+ }
371
+
372
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
373
+ // REQUIRES: DB mutex held during access
374
+ const autovector<std::pair<int, FileMetaData*>>&
375
+ FilesMarkedForPeriodicCompaction() const {
376
+ assert(finalized_);
377
+ return files_marked_for_periodic_compaction_;
378
+ }
379
+
380
+ void TEST_AddFileMarkedForPeriodicCompaction(int level, FileMetaData* f) {
381
+ files_marked_for_periodic_compaction_.emplace_back(level, f);
382
+ }
383
+
384
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
385
+ // REQUIRES: DB mutex held during access
386
+ const autovector<std::pair<int, FileMetaData*>>&
387
+ BottommostFilesMarkedForCompaction() const {
388
+ assert(finalized_);
389
+ return bottommost_files_marked_for_compaction_;
390
+ }
391
+
392
+ int base_level() const { return base_level_; }
393
+ double level_multiplier() const { return level_multiplier_; }
394
+
395
+ // REQUIRES: lock is held
396
+ // Set the index that is used to offset into files_by_compaction_pri_ to find
397
+ // the next compaction candidate file.
398
+ void SetNextCompactionIndex(int level, int index) {
399
+ next_file_to_compact_by_size_[level] = index;
400
+ }
401
+
402
+ // REQUIRES: lock is held
403
+ int NextCompactionIndex(int level) const {
404
+ return next_file_to_compact_by_size_[level];
405
+ }
406
+
407
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo)
408
+ const FileIndexer& file_indexer() const {
409
+ assert(finalized_);
410
+ return file_indexer_;
411
+ }
412
+
413
+ // Only the first few entries of files_by_compaction_pri_ are sorted.
414
+ // There is no need to sort all the files because it is likely
415
+ // that on a running system, we need to look at only the first
416
+ // few largest files because a new version is created every few
417
+ // seconds/minutes (because of concurrent compactions).
418
+ static const size_t kNumberFilesToSort = 50;
419
+
420
+ // Return a human-readable short (single-line) summary of the number
421
+ // of files per level. Uses *scratch as backing store.
422
+ struct LevelSummaryStorage {
423
+ char buffer[1000];
424
+ };
425
+ struct FileSummaryStorage {
426
+ char buffer[3000];
427
+ };
428
+ const char* LevelSummary(LevelSummaryStorage* scratch) const;
429
+ // Return a human-readable short (single-line) summary of files
430
+ // in a specified level. Uses *scratch as backing store.
431
+ const char* LevelFileSummary(FileSummaryStorage* scratch, int level) const;
432
+
433
+ // Return the maximum overlapping data (in bytes) at next level for any
434
+ // file at a level >= 1.
435
+ int64_t MaxNextLevelOverlappingBytes();
436
+
437
+ // Return a human readable string that describes this version's contents.
438
+ std::string DebugString(bool hex = false) const;
439
+
440
+ uint64_t GetAverageValueSize() const {
441
+ if (accumulated_num_non_deletions_ == 0) {
442
+ return 0;
443
+ }
444
+ assert(accumulated_raw_key_size_ + accumulated_raw_value_size_ > 0);
445
+ assert(accumulated_file_size_ > 0);
446
+ return accumulated_raw_value_size_ / accumulated_num_non_deletions_ *
447
+ accumulated_file_size_ /
448
+ (accumulated_raw_key_size_ + accumulated_raw_value_size_);
449
+ }
450
+
451
+ uint64_t GetEstimatedActiveKeys() const;
452
+
453
+ double GetEstimatedCompressionRatioAtLevel(int level) const;
454
+
455
+ // re-initializes the index that is used to offset into
456
+ // files_by_compaction_pri_
457
+ // to find the next compaction candidate file.
458
+ void ResetNextCompactionIndex(int level) {
459
+ next_file_to_compact_by_size_[level] = 0;
460
+ }
461
+
462
+ const InternalKeyComparator* InternalComparator() {
463
+ return internal_comparator_;
464
+ }
465
+
466
+ // Returns maximum total bytes of data on a given level.
467
+ uint64_t MaxBytesForLevel(int level) const;
468
+
469
+ // Must be called after any change to MutableCFOptions.
470
+ void CalculateBaseBytes(const ImmutableCFOptions& ioptions,
471
+ const MutableCFOptions& options);
472
+
473
+ // Returns an estimate of the amount of live data in bytes.
474
+ uint64_t EstimateLiveDataSize() const;
475
+
476
+ uint64_t estimated_compaction_needed_bytes() const {
477
+ return estimated_compaction_needed_bytes_;
478
+ }
479
+
480
+ void TEST_set_estimated_compaction_needed_bytes(uint64_t v) {
481
+ estimated_compaction_needed_bytes_ = v;
482
+ }
483
+
484
+ bool force_consistency_checks() const { return force_consistency_checks_; }
485
+
486
+ SequenceNumber bottommost_files_mark_threshold() const {
487
+ return bottommost_files_mark_threshold_;
488
+ }
489
+
490
+ // Returns whether any key in [`smallest_key`, `largest_key`] could appear in
491
+ // an older L0 file than `last_l0_idx` or in a greater level than `last_level`
492
+ //
493
+ // @param last_level Level after which we check for overlap
494
+ // @param last_l0_idx If `last_level == 0`, index of L0 file after which we
495
+ // check for overlap; otherwise, must be -1
496
+ bool RangeMightExistAfterSortedRun(const Slice& smallest_user_key,
497
+ const Slice& largest_user_key,
498
+ int last_level, int last_l0_idx);
499
+
500
+ private:
501
+ const InternalKeyComparator* internal_comparator_;
502
+ const Comparator* user_comparator_;
503
+ int num_levels_; // Number of levels
504
+ int num_non_empty_levels_; // Number of levels. Any level larger than it
505
+ // is guaranteed to be empty.
506
+ // Per-level max bytes
507
+ std::vector<uint64_t> level_max_bytes_;
508
+
509
+ // A short brief metadata of files per level
510
+ autovector<ROCKSDB_NAMESPACE::LevelFilesBrief> level_files_brief_;
511
+ FileIndexer file_indexer_;
512
+ Arena arena_; // Used to allocate space for file_levels_
513
+
514
+ CompactionStyle compaction_style_;
515
+
516
+ // List of files per level, files in each level are arranged
517
+ // in increasing order of keys
518
+ std::vector<FileMetaData*>* files_;
519
+
520
+ // Map of all table files in version. Maps file number to (level, position on
521
+ // level).
522
+ using FileLocations = std::unordered_map<uint64_t, FileLocation>;
523
+ FileLocations file_locations_;
524
+
525
+ // Map of blob files in version by number.
526
+ BlobFiles blob_files_;
527
+
528
+ // Level that L0 data should be compacted to. All levels < base_level_ should
529
+ // be empty. -1 if it is not level-compaction so it's not applicable.
530
+ int base_level_;
531
+
532
+ double level_multiplier_;
533
+
534
+ // A list for the same set of files that are stored in files_,
535
+ // but files in each level are now sorted based on file
536
+ // size. The file with the largest size is at the front.
537
+ // This vector stores the index of the file from files_.
538
+ std::vector<std::vector<int>> files_by_compaction_pri_;
539
+
540
+ // If true, means that files in L0 have keys with non overlapping ranges
541
+ bool level0_non_overlapping_;
542
+
543
+ // An index into files_by_compaction_pri_ that specifies the first
544
+ // file that is not yet compacted
545
+ std::vector<int> next_file_to_compact_by_size_;
546
+
547
+ // Only the first few entries of files_by_compaction_pri_ are sorted.
548
+ // There is no need to sort all the files because it is likely
549
+ // that on a running system, we need to look at only the first
550
+ // few largest files because a new version is created every few
551
+ // seconds/minutes (because of concurrent compactions).
552
+ static const size_t number_of_files_to_sort_ = 50;
553
+
554
+ // This vector contains list of files marked for compaction and also not
555
+ // currently being compacted. It is protected by DB mutex. It is calculated in
556
+ // ComputeCompactionScore()
557
+ autovector<std::pair<int, FileMetaData*>> files_marked_for_compaction_;
558
+
559
+ autovector<std::pair<int, FileMetaData*>> expired_ttl_files_;
560
+
561
+ autovector<std::pair<int, FileMetaData*>>
562
+ files_marked_for_periodic_compaction_;
563
+
564
+ // These files are considered bottommost because none of their keys can exist
565
+ // at lower levels. They are not necessarily all in the same level. The marked
566
+ // ones are eligible for compaction because they contain duplicate key
567
+ // versions that are no longer protected by snapshot. These variables are
568
+ // protected by DB mutex and are calculated in `GenerateBottommostFiles()` and
569
+ // `ComputeBottommostFilesMarkedForCompaction()`.
570
+ autovector<std::pair<int, FileMetaData*>> bottommost_files_;
571
+ autovector<std::pair<int, FileMetaData*>>
572
+ bottommost_files_marked_for_compaction_;
573
+
574
+ // Threshold for needing to mark another bottommost file. Maintain it so we
575
+ // can quickly check when releasing a snapshot whether more bottommost files
576
+ // became eligible for compaction. It's defined as the min of the max nonzero
577
+ // seqnums of unmarked bottommost files.
578
+ SequenceNumber bottommost_files_mark_threshold_ = kMaxSequenceNumber;
579
+
580
+ // Monotonically increases as we release old snapshots. Zero indicates no
581
+ // snapshots have been released yet. When no snapshots remain we set it to the
582
+ // current seqnum, which needs to be protected as a snapshot can still be
583
+ // created that references it.
584
+ SequenceNumber oldest_snapshot_seqnum_ = 0;
585
+
586
+ // Level that should be compacted next and its compaction score.
587
+ // Score < 1 means compaction is not strictly needed. These fields
588
+ // are initialized by Finalize().
589
+ // The most critical level to be compacted is listed first
590
+ // These are used to pick the best compaction level
591
+ std::vector<double> compaction_score_;
592
+ std::vector<int> compaction_level_;
593
+ int l0_delay_trigger_count_ = 0; // Count used to trigger slow down and stop
594
+ // for number of L0 files.
595
+
596
+ // the following are the sampled temporary stats.
597
+ // the current accumulated size of sampled files.
598
+ uint64_t accumulated_file_size_;
599
+ // the current accumulated size of all raw keys based on the sampled files.
600
+ uint64_t accumulated_raw_key_size_;
601
+ // the current accumulated size of all raw keys based on the sampled files.
602
+ uint64_t accumulated_raw_value_size_;
603
+ // total number of non-deletion entries
604
+ uint64_t accumulated_num_non_deletions_;
605
+ // total number of deletion entries
606
+ uint64_t accumulated_num_deletions_;
607
+ // current number of non_deletion entries
608
+ uint64_t current_num_non_deletions_;
609
+ // current number of deletion entries
610
+ uint64_t current_num_deletions_;
611
+ // current number of file samples
612
+ uint64_t current_num_samples_;
613
+ // Estimated bytes needed to be compacted until all levels' size is down to
614
+ // target sizes.
615
+ uint64_t estimated_compaction_needed_bytes_;
616
+
617
+ bool finalized_;
618
+
619
+ // If set to true, we will run consistency checks even if RocksDB
620
+ // is compiled in release mode
621
+ bool force_consistency_checks_;
622
+
623
+ friend class Version;
624
+ friend class VersionSet;
625
+ };
626
+
627
+ using MultiGetRange = MultiGetContext::Range;
628
+ // A column family's version consists of the table and blob files owned by
629
+ // the column family at a certain point in time.
630
+ class Version {
631
+ public:
632
+ // Append to *iters a sequence of iterators that will
633
+ // yield the contents of this Version when merged together.
634
+ // @param read_options Must outlive any iterator built by
635
+ // `merger_iter_builder`.
636
+ // REQUIRES: This version has been saved (see VersionSet::SaveTo).
637
+ void AddIterators(const ReadOptions& read_options,
638
+ const FileOptions& soptions,
639
+ MergeIteratorBuilder* merger_iter_builder,
640
+ RangeDelAggregator* range_del_agg,
641
+ bool allow_unprepared_value);
642
+
643
+ // @param read_options Must outlive any iterator built by
644
+ // `merger_iter_builder`.
645
+ void AddIteratorsForLevel(const ReadOptions& read_options,
646
+ const FileOptions& soptions,
647
+ MergeIteratorBuilder* merger_iter_builder,
648
+ int level, RangeDelAggregator* range_del_agg,
649
+ bool allow_unprepared_value);
650
+
651
+ Status OverlapWithLevelIterator(const ReadOptions&, const FileOptions&,
652
+ const Slice& smallest_user_key,
653
+ const Slice& largest_user_key,
654
+ int level, bool* overlap);
655
+
656
+ // Lookup the value for key or get all merge operands for key.
657
+ // If do_merge = true (default) then lookup value for key.
658
+ // Behavior if do_merge = true:
659
+ // If found, store it in *value and
660
+ // return OK. Else return a non-OK status.
661
+ // Uses *operands to store merge_operator operations to apply later.
662
+ //
663
+ // If the ReadOptions.read_tier is set to do a read-only fetch, then
664
+ // *value_found will be set to false if it cannot be determined whether
665
+ // this value exists without doing IO.
666
+ //
667
+ // If the key is Deleted, *status will be set to NotFound and
668
+ // *key_exists will be set to true.
669
+ // If no key was found, *status will be set to NotFound and
670
+ // *key_exists will be set to false.
671
+ // If seq is non-null, *seq will be set to the sequence number found
672
+ // for the key if a key was found.
673
+ // Behavior if do_merge = false
674
+ // If the key has any merge operands then store them in
675
+ // merge_context.operands_list and don't merge the operands
676
+ // REQUIRES: lock is not held
677
+ void Get(const ReadOptions&, const LookupKey& key, PinnableSlice* value,
678
+ std::string* timestamp, Status* status, MergeContext* merge_context,
679
+ SequenceNumber* max_covering_tombstone_seq,
680
+ bool* value_found = nullptr, bool* key_exists = nullptr,
681
+ SequenceNumber* seq = nullptr, ReadCallback* callback = nullptr,
682
+ bool* is_blob = nullptr, bool do_merge = true);
683
+
684
+ void MultiGet(const ReadOptions&, MultiGetRange* range,
685
+ ReadCallback* callback = nullptr);
686
+
687
+ // Interprets blob_index_slice as a blob reference, and (assuming the
688
+ // corresponding blob file is part of this Version) retrieves the blob and
689
+ // saves it in *value.
690
+ // REQUIRES: blob_index_slice stores an encoded blob reference
691
+ Status GetBlob(const ReadOptions& read_options, const Slice& user_key,
692
+ const Slice& blob_index_slice, PinnableSlice* value) const;
693
+
694
+ // Retrieves a blob using a blob reference and saves it in *value,
695
+ // assuming the corresponding blob file is part of this Version.
696
+ Status GetBlob(const ReadOptions& read_options, const Slice& user_key,
697
+ const BlobIndex& blob_index, PinnableSlice* value) const;
698
+
699
+ // Loads some stats information from files. Call without mutex held. It needs
700
+ // to be called before applying the version to the version set.
701
+ void PrepareApply(const MutableCFOptions& mutable_cf_options,
702
+ bool update_stats);
703
+
704
+ // Reference count management (so Versions do not disappear out from
705
+ // under live iterators)
706
+ void Ref();
707
+ // Decrease reference count. Delete the object if no reference left
708
+ // and return true. Otherwise, return false.
709
+ bool Unref();
710
+
711
+ // Add all files listed in the current version to *live_table_files and
712
+ // *live_blob_files.
713
+ void AddLiveFiles(std::vector<uint64_t>* live_table_files,
714
+ std::vector<uint64_t>* live_blob_files) const;
715
+
716
+ // Return a human readable string that describes this version's contents.
717
+ std::string DebugString(bool hex = false, bool print_stats = false) const;
718
+
719
+ // Returns the version number of this version
720
+ uint64_t GetVersionNumber() const { return version_number_; }
721
+
722
+ // REQUIRES: lock is held
723
+ // On success, "tp" will contains the table properties of the file
724
+ // specified in "file_meta". If the file name of "file_meta" is
725
+ // known ahead, passing it by a non-null "fname" can save a
726
+ // file-name conversion.
727
+ Status GetTableProperties(std::shared_ptr<const TableProperties>* tp,
728
+ const FileMetaData* file_meta,
729
+ const std::string* fname = nullptr) const;
730
+
731
+ // REQUIRES: lock is held
732
+ // On success, *props will be populated with all SSTables' table properties.
733
+ // The keys of `props` are the sst file name, the values of `props` are the
734
+ // tables' properties, represented as std::shared_ptr.
735
+ Status GetPropertiesOfAllTables(TablePropertiesCollection* props);
736
+ Status GetPropertiesOfAllTables(TablePropertiesCollection* props, int level);
737
+ Status GetPropertiesOfTablesInRange(const Range* range, std::size_t n,
738
+ TablePropertiesCollection* props) const;
739
+
740
+ // Print summary of range delete tombstones in SST files into out_str,
741
+ // with maximum max_entries_to_print entries printed out.
742
+ Status TablesRangeTombstoneSummary(int max_entries_to_print,
743
+ std::string* out_str);
744
+
745
+ // REQUIRES: lock is held
746
+ // On success, "tp" will contains the aggregated table property among
747
+ // the table properties of all sst files in this version.
748
+ Status GetAggregatedTableProperties(
749
+ std::shared_ptr<const TableProperties>* tp, int level = -1);
750
+
751
+ uint64_t GetEstimatedActiveKeys() {
752
+ return storage_info_.GetEstimatedActiveKeys();
753
+ }
754
+
755
+ size_t GetMemoryUsageByTableReaders();
756
+
757
+ ColumnFamilyData* cfd() const { return cfd_; }
758
+
759
+ // Return the next Version in the linked list. Used for debug only
760
+ Version* TEST_Next() const {
761
+ return next_;
762
+ }
763
+
764
+ int TEST_refs() const { return refs_; }
765
+
766
+ VersionStorageInfo* storage_info() { return &storage_info_; }
767
+
768
+ VersionSet* version_set() { return vset_; }
769
+
770
+ void GetColumnFamilyMetaData(ColumnFamilyMetaData* cf_meta);
771
+
772
+ uint64_t GetSstFilesSize();
773
+
774
+ // Retrieves the file_creation_time of the oldest file in the DB.
775
+ // Prerequisite for this API is max_open_files = -1
776
+ void GetCreationTimeOfOldestFile(uint64_t* creation_time);
777
+
778
+ const MutableCFOptions& GetMutableCFOptions() { return mutable_cf_options_; }
779
+
780
+ private:
781
+ Env* env_;
782
+ friend class ReactiveVersionSet;
783
+ friend class VersionSet;
784
+ friend class VersionEditHandler;
785
+ friend class VersionEditHandlerPointInTime;
786
+
787
+ const InternalKeyComparator* internal_comparator() const {
788
+ return storage_info_.internal_comparator_;
789
+ }
790
+ const Comparator* user_comparator() const {
791
+ return storage_info_.user_comparator_;
792
+ }
793
+
794
+ // Returns true if the filter blocks in the specified level will not be
795
+ // checked during read operations. In certain cases (trivial move or preload),
796
+ // the filter block may already be cached, but we still do not access it such
797
+ // that it eventually expires from the cache.
798
+ bool IsFilterSkipped(int level, bool is_file_last_in_level = false);
799
+
800
+ // The helper function of UpdateAccumulatedStats, which may fill the missing
801
+ // fields of file_meta from its associated TableProperties.
802
+ // Returns true if it does initialize FileMetaData.
803
+ bool MaybeInitializeFileMetaData(FileMetaData* file_meta);
804
+
805
+ // Update the accumulated stats associated with the current version.
806
+ // This accumulated stats will be used in compaction.
807
+ void UpdateAccumulatedStats(bool update_stats);
808
+
809
+ // Sort all files for this version based on their file size and
810
+ // record results in files_by_compaction_pri_. The largest files are listed
811
+ // first.
812
+ void UpdateFilesByCompactionPri();
813
+
814
+ ColumnFamilyData* cfd_; // ColumnFamilyData to which this Version belongs
815
+ Logger* info_log_;
816
+ Statistics* db_statistics_;
817
+ TableCache* table_cache_;
818
+ BlobFileCache* blob_file_cache_;
819
+ const MergeOperator* merge_operator_;
820
+
821
+ VersionStorageInfo storage_info_;
822
+ VersionSet* vset_; // VersionSet to which this Version belongs
823
+ Version* next_; // Next version in linked list
824
+ Version* prev_; // Previous version in linked list
825
+ int refs_; // Number of live refs to this version
826
+ const FileOptions file_options_;
827
+ const MutableCFOptions mutable_cf_options_;
828
+ // Cached value to avoid recomputing it on every read.
829
+ const size_t max_file_size_for_l0_meta_pin_;
830
+
831
+ // A version number that uniquely represents this version. This is
832
+ // used for debugging and logging purposes only.
833
+ uint64_t version_number_;
834
+ std::shared_ptr<IOTracer> io_tracer_;
835
+
836
+ Version(ColumnFamilyData* cfd, VersionSet* vset, const FileOptions& file_opt,
837
+ MutableCFOptions mutable_cf_options,
838
+ const std::shared_ptr<IOTracer>& io_tracer,
839
+ uint64_t version_number = 0);
840
+
841
+ ~Version();
842
+
843
+ // No copying allowed
844
+ Version(const Version&) = delete;
845
+ void operator=(const Version&) = delete;
846
+ };
847
+
848
+ struct ObsoleteFileInfo {
849
+ FileMetaData* metadata;
850
+ std::string path;
851
+
852
+ ObsoleteFileInfo() noexcept : metadata(nullptr) {}
853
+ ObsoleteFileInfo(FileMetaData* f, const std::string& file_path)
854
+ : metadata(f), path(file_path) {}
855
+
856
+ ObsoleteFileInfo(const ObsoleteFileInfo&) = delete;
857
+ ObsoleteFileInfo& operator=(const ObsoleteFileInfo&) = delete;
858
+
859
+ ObsoleteFileInfo(ObsoleteFileInfo&& rhs) noexcept :
860
+ ObsoleteFileInfo() {
861
+ *this = std::move(rhs);
862
+ }
863
+
864
+ ObsoleteFileInfo& operator=(ObsoleteFileInfo&& rhs) noexcept {
865
+ path = std::move(rhs.path);
866
+ metadata = rhs.metadata;
867
+ rhs.metadata = nullptr;
868
+
869
+ return *this;
870
+ }
871
+
872
+ void DeleteMetadata() {
873
+ delete metadata;
874
+ metadata = nullptr;
875
+ }
876
+ };
877
+
878
+ class ObsoleteBlobFileInfo {
879
+ public:
880
+ ObsoleteBlobFileInfo(uint64_t blob_file_number, std::string path)
881
+ : blob_file_number_(blob_file_number), path_(std::move(path)) {}
882
+
883
+ uint64_t GetBlobFileNumber() const { return blob_file_number_; }
884
+ const std::string& GetPath() const { return path_; }
885
+
886
+ private:
887
+ uint64_t blob_file_number_;
888
+ std::string path_;
889
+ };
890
+
891
+ class BaseReferencedVersionBuilder;
892
+
893
+ class AtomicGroupReadBuffer {
894
+ public:
895
+ Status AddEdit(VersionEdit* edit);
896
+ void Clear();
897
+ bool IsFull() const;
898
+ bool IsEmpty() const;
899
+
900
+ uint64_t TEST_read_edits_in_atomic_group() const {
901
+ return read_edits_in_atomic_group_;
902
+ }
903
+ std::vector<VersionEdit>& replay_buffer() { return replay_buffer_; }
904
+
905
+ private:
906
+ uint64_t read_edits_in_atomic_group_ = 0;
907
+ std::vector<VersionEdit> replay_buffer_;
908
+ };
909
+
910
+ // VersionSet is the collection of versions of all the column families of the
911
+ // database. Each database owns one VersionSet. A VersionSet has access to all
912
+ // column families via ColumnFamilySet, i.e. set of the column families.
913
+ class VersionSet {
914
+ public:
915
+ VersionSet(const std::string& dbname, const ImmutableDBOptions* db_options,
916
+ const FileOptions& file_options, Cache* table_cache,
917
+ WriteBufferManager* write_buffer_manager,
918
+ WriteController* write_controller,
919
+ BlockCacheTracer* const block_cache_tracer,
920
+ const std::shared_ptr<IOTracer>& io_tracer);
921
+ // No copying allowed
922
+ VersionSet(const VersionSet&) = delete;
923
+ void operator=(const VersionSet&) = delete;
924
+
925
+ virtual ~VersionSet();
926
+
927
+ Status LogAndApplyToDefaultColumnFamily(
928
+ VersionEdit* edit, InstrumentedMutex* mu,
929
+ FSDirectory* db_directory = nullptr, bool new_descriptor_log = false,
930
+ const ColumnFamilyOptions* column_family_options = nullptr) {
931
+ ColumnFamilyData* default_cf = GetColumnFamilySet()->GetDefault();
932
+ const MutableCFOptions* cf_options =
933
+ default_cf->GetLatestMutableCFOptions();
934
+ return LogAndApply(default_cf, *cf_options, edit, mu, db_directory,
935
+ new_descriptor_log, column_family_options);
936
+ }
937
+
938
+ // Apply *edit to the current version to form a new descriptor that
939
+ // is both saved to persistent state and installed as the new
940
+ // current version. Will release *mu while actually writing to the file.
941
+ // column_family_options has to be set if edit is column family add
942
+ // REQUIRES: *mu is held on entry.
943
+ // REQUIRES: no other thread concurrently calls LogAndApply()
944
+ Status LogAndApply(
945
+ ColumnFamilyData* column_family_data,
946
+ const MutableCFOptions& mutable_cf_options, VersionEdit* edit,
947
+ InstrumentedMutex* mu, FSDirectory* db_directory = nullptr,
948
+ bool new_descriptor_log = false,
949
+ const ColumnFamilyOptions* column_family_options = nullptr) {
950
+ autovector<ColumnFamilyData*> cfds;
951
+ cfds.emplace_back(column_family_data);
952
+ autovector<const MutableCFOptions*> mutable_cf_options_list;
953
+ mutable_cf_options_list.emplace_back(&mutable_cf_options);
954
+ autovector<autovector<VersionEdit*>> edit_lists;
955
+ autovector<VersionEdit*> edit_list;
956
+ edit_list.emplace_back(edit);
957
+ edit_lists.emplace_back(edit_list);
958
+ return LogAndApply(cfds, mutable_cf_options_list, edit_lists, mu,
959
+ db_directory, new_descriptor_log, column_family_options);
960
+ }
961
+ // The batch version. If edit_list.size() > 1, caller must ensure that
962
+ // no edit in the list column family add or drop
963
+ Status LogAndApply(
964
+ ColumnFamilyData* column_family_data,
965
+ const MutableCFOptions& mutable_cf_options,
966
+ const autovector<VersionEdit*>& edit_list, InstrumentedMutex* mu,
967
+ FSDirectory* db_directory = nullptr, bool new_descriptor_log = false,
968
+ const ColumnFamilyOptions* column_family_options = nullptr,
969
+ const std::function<void(const Status&)>& manifest_wcb = {}) {
970
+ autovector<ColumnFamilyData*> cfds;
971
+ cfds.emplace_back(column_family_data);
972
+ autovector<const MutableCFOptions*> mutable_cf_options_list;
973
+ mutable_cf_options_list.emplace_back(&mutable_cf_options);
974
+ autovector<autovector<VersionEdit*>> edit_lists;
975
+ edit_lists.emplace_back(edit_list);
976
+ return LogAndApply(cfds, mutable_cf_options_list, edit_lists, mu,
977
+ db_directory, new_descriptor_log, column_family_options,
978
+ {manifest_wcb});
979
+ }
980
+
981
+ // The across-multi-cf batch version. If edit_lists contain more than
982
+ // 1 version edits, caller must ensure that no edit in the []list is column
983
+ // family manipulation.
984
+ virtual Status LogAndApply(
985
+ const autovector<ColumnFamilyData*>& cfds,
986
+ const autovector<const MutableCFOptions*>& mutable_cf_options_list,
987
+ const autovector<autovector<VersionEdit*>>& edit_lists,
988
+ InstrumentedMutex* mu, FSDirectory* db_directory = nullptr,
989
+ bool new_descriptor_log = false,
990
+ const ColumnFamilyOptions* new_cf_options = nullptr,
991
+ const std::vector<std::function<void(const Status&)>>& manifest_wcbs =
992
+ {});
993
+
994
+ static Status GetCurrentManifestPath(const std::string& dbname,
995
+ FileSystem* fs,
996
+ std::string* manifest_filename,
997
+ uint64_t* manifest_file_number);
998
+
999
+ // Recover the last saved descriptor from persistent storage.
1000
+ // If read_only == true, Recover() will not complain if some column families
1001
+ // are not opened
1002
+ Status Recover(const std::vector<ColumnFamilyDescriptor>& column_families,
1003
+ bool read_only = false, std::string* db_id = nullptr);
1004
+
1005
+ Status TryRecover(const std::vector<ColumnFamilyDescriptor>& column_families,
1006
+ bool read_only,
1007
+ const std::vector<std::string>& files_in_dbname,
1008
+ std::string* db_id, bool* has_missing_table_file);
1009
+
1010
+ // Try to recover the version set to the most recent consistent state
1011
+ // recorded in the specified manifest.
1012
+ Status TryRecoverFromOneManifest(
1013
+ const std::string& manifest_path,
1014
+ const std::vector<ColumnFamilyDescriptor>& column_families,
1015
+ bool read_only, std::string* db_id, bool* has_missing_table_file);
1016
+
1017
+ // Reads a manifest file and returns a list of column families in
1018
+ // column_families.
1019
+ static Status ListColumnFamilies(std::vector<std::string>* column_families,
1020
+ const std::string& dbname, FileSystem* fs);
1021
+
1022
+ #ifndef ROCKSDB_LITE
1023
+ // Try to reduce the number of levels. This call is valid when
1024
+ // only one level from the new max level to the old
1025
+ // max level containing files.
1026
+ // The call is static, since number of levels is immutable during
1027
+ // the lifetime of a RocksDB instance. It reduces number of levels
1028
+ // in a DB by applying changes to manifest.
1029
+ // For example, a db currently has 7 levels [0-6], and a call to
1030
+ // to reduce to 5 [0-4] can only be executed when only one level
1031
+ // among [4-6] contains files.
1032
+ static Status ReduceNumberOfLevels(const std::string& dbname,
1033
+ const Options* options,
1034
+ const FileOptions& file_options,
1035
+ int new_levels);
1036
+
1037
+ // Get the checksum information of all live files
1038
+ Status GetLiveFilesChecksumInfo(FileChecksumList* checksum_list);
1039
+
1040
+ // printf contents (for debugging)
1041
+ Status DumpManifest(Options& options, std::string& manifestFileName,
1042
+ bool verbose, bool hex = false, bool json = false);
1043
+
1044
+ #endif // ROCKSDB_LITE
1045
+
1046
+ // Return the current manifest file number
1047
+ uint64_t manifest_file_number() const { return manifest_file_number_; }
1048
+
1049
+ uint64_t options_file_number() const { return options_file_number_; }
1050
+
1051
+ uint64_t pending_manifest_file_number() const {
1052
+ return pending_manifest_file_number_;
1053
+ }
1054
+
1055
+ uint64_t current_next_file_number() const { return next_file_number_.load(); }
1056
+
1057
+ uint64_t min_log_number_to_keep_2pc() const {
1058
+ return min_log_number_to_keep_2pc_.load();
1059
+ }
1060
+
1061
+ // Allocate and return a new file number
1062
+ uint64_t NewFileNumber() { return next_file_number_.fetch_add(1); }
1063
+
1064
+ // Fetch And Add n new file number
1065
+ uint64_t FetchAddFileNumber(uint64_t n) {
1066
+ return next_file_number_.fetch_add(n);
1067
+ }
1068
+
1069
+ // Return the last sequence number.
1070
+ uint64_t LastSequence() const {
1071
+ return last_sequence_.load(std::memory_order_acquire);
1072
+ }
1073
+
1074
+ // Note: memory_order_acquire must be sufficient.
1075
+ uint64_t LastAllocatedSequence() const {
1076
+ return last_allocated_sequence_.load(std::memory_order_seq_cst);
1077
+ }
1078
+
1079
+ // Note: memory_order_acquire must be sufficient.
1080
+ uint64_t LastPublishedSequence() const {
1081
+ return last_published_sequence_.load(std::memory_order_seq_cst);
1082
+ }
1083
+
1084
+ // Set the last sequence number to s.
1085
+ void SetLastSequence(uint64_t s) {
1086
+ assert(s >= last_sequence_);
1087
+ // Last visible sequence must always be less than last written seq
1088
+ assert(!db_options_->two_write_queues || s <= last_allocated_sequence_);
1089
+ last_sequence_.store(s, std::memory_order_release);
1090
+ }
1091
+
1092
+ // Note: memory_order_release must be sufficient
1093
+ void SetLastPublishedSequence(uint64_t s) {
1094
+ assert(s >= last_published_sequence_);
1095
+ last_published_sequence_.store(s, std::memory_order_seq_cst);
1096
+ }
1097
+
1098
+ // Note: memory_order_release must be sufficient
1099
+ void SetLastAllocatedSequence(uint64_t s) {
1100
+ assert(s >= last_allocated_sequence_);
1101
+ last_allocated_sequence_.store(s, std::memory_order_seq_cst);
1102
+ }
1103
+
1104
+ // Note: memory_order_release must be sufficient
1105
+ uint64_t FetchAddLastAllocatedSequence(uint64_t s) {
1106
+ return last_allocated_sequence_.fetch_add(s, std::memory_order_seq_cst);
1107
+ }
1108
+
1109
+ // Mark the specified file number as used.
1110
+ // REQUIRED: this is only called during single-threaded recovery or repair.
1111
+ void MarkFileNumberUsed(uint64_t number);
1112
+
1113
+ // Mark the specified log number as deleted
1114
+ // REQUIRED: this is only called during single-threaded recovery or repair, or
1115
+ // from ::LogAndApply where the global mutex is held.
1116
+ void MarkMinLogNumberToKeep2PC(uint64_t number);
1117
+
1118
+ // Return the log file number for the log file that is currently
1119
+ // being compacted, or zero if there is no such log file.
1120
+ uint64_t prev_log_number() const { return prev_log_number_; }
1121
+
1122
+ // Returns the minimum log number which still has data not flushed to any SST
1123
+ // file.
1124
+ // In non-2PC mode, all the log numbers smaller than this number can be safely
1125
+ // deleted.
1126
+ uint64_t MinLogNumberWithUnflushedData() const {
1127
+ return PreComputeMinLogNumberWithUnflushedData(nullptr);
1128
+ }
1129
+ // Returns the minimum log number which still has data not flushed to any SST
1130
+ // file.
1131
+ // Empty column families' log number is considered to be
1132
+ // new_log_number_for_empty_cf.
1133
+ uint64_t PreComputeMinLogNumberWithUnflushedData(
1134
+ uint64_t new_log_number_for_empty_cf) const {
1135
+ uint64_t min_log_num = port::kMaxUint64;
1136
+ for (auto cfd : *column_family_set_) {
1137
+ // It's safe to ignore dropped column families here:
1138
+ // cfd->IsDropped() becomes true after the drop is persisted in MANIFEST.
1139
+ uint64_t num =
1140
+ cfd->IsEmpty() ? new_log_number_for_empty_cf : cfd->GetLogNumber();
1141
+ if (min_log_num > num && !cfd->IsDropped()) {
1142
+ min_log_num = num;
1143
+ }
1144
+ }
1145
+ return min_log_num;
1146
+ }
1147
+ // Returns the minimum log number which still has data not flushed to any SST
1148
+ // file, except data from `cfd_to_skip`.
1149
+ uint64_t PreComputeMinLogNumberWithUnflushedData(
1150
+ const ColumnFamilyData* cfd_to_skip) const {
1151
+ uint64_t min_log_num = port::kMaxUint64;
1152
+ for (auto cfd : *column_family_set_) {
1153
+ if (cfd == cfd_to_skip) {
1154
+ continue;
1155
+ }
1156
+ // It's safe to ignore dropped column families here:
1157
+ // cfd->IsDropped() becomes true after the drop is persisted in MANIFEST.
1158
+ if (min_log_num > cfd->GetLogNumber() && !cfd->IsDropped()) {
1159
+ min_log_num = cfd->GetLogNumber();
1160
+ }
1161
+ }
1162
+ return min_log_num;
1163
+ }
1164
+ // Returns the minimum log number which still has data not flushed to any SST
1165
+ // file, except data from `cfds_to_skip`.
1166
+ uint64_t PreComputeMinLogNumberWithUnflushedData(
1167
+ const std::unordered_set<const ColumnFamilyData*>& cfds_to_skip) const {
1168
+ uint64_t min_log_num = port::kMaxUint64;
1169
+ for (auto cfd : *column_family_set_) {
1170
+ if (cfds_to_skip.count(cfd)) {
1171
+ continue;
1172
+ }
1173
+ // It's safe to ignore dropped column families here:
1174
+ // cfd->IsDropped() becomes true after the drop is persisted in MANIFEST.
1175
+ if (min_log_num > cfd->GetLogNumber() && !cfd->IsDropped()) {
1176
+ min_log_num = cfd->GetLogNumber();
1177
+ }
1178
+ }
1179
+ return min_log_num;
1180
+ }
1181
+
1182
+ // Create an iterator that reads over the compaction inputs for "*c".
1183
+ // The caller should delete the iterator when no longer needed.
1184
+ // @param read_options Must outlive the returned iterator.
1185
+ InternalIterator* MakeInputIterator(
1186
+ const ReadOptions& read_options, const Compaction* c,
1187
+ RangeDelAggregator* range_del_agg,
1188
+ const FileOptions& file_options_compactions);
1189
+
1190
+ // Add all files listed in any live version to *live_table_files and
1191
+ // *live_blob_files. Note that these lists may contain duplicates.
1192
+ void AddLiveFiles(std::vector<uint64_t>* live_table_files,
1193
+ std::vector<uint64_t>* live_blob_files) const;
1194
+
1195
+ // Return the approximate size of data to be scanned for range [start, end)
1196
+ // in levels [start_level, end_level). If end_level == -1 it will search
1197
+ // through all non-empty levels
1198
+ uint64_t ApproximateSize(const SizeApproximationOptions& options, Version* v,
1199
+ const Slice& start, const Slice& end,
1200
+ int start_level, int end_level,
1201
+ TableReaderCaller caller);
1202
+
1203
+ // Return the size of the current manifest file
1204
+ uint64_t manifest_file_size() const { return manifest_file_size_; }
1205
+
1206
+ // verify that the files that we started with for a compaction
1207
+ // still exist in the current version and in the same original level.
1208
+ // This ensures that a concurrent compaction did not erroneously
1209
+ // pick the same files to compact.
1210
+ bool VerifyCompactionFileConsistency(Compaction* c);
1211
+
1212
+ Status GetMetadataForFile(uint64_t number, int* filelevel,
1213
+ FileMetaData** metadata, ColumnFamilyData** cfd);
1214
+
1215
+ // This function doesn't support leveldb SST filenames
1216
+ void GetLiveFilesMetaData(std::vector<LiveFileMetaData> *metadata);
1217
+
1218
+ void AddObsoleteBlobFile(uint64_t blob_file_number, std::string path) {
1219
+ assert(table_cache_);
1220
+
1221
+ table_cache_->Erase(GetSlice(&blob_file_number));
1222
+
1223
+ obsolete_blob_files_.emplace_back(blob_file_number, std::move(path));
1224
+ }
1225
+
1226
+ void GetObsoleteFiles(std::vector<ObsoleteFileInfo>* files,
1227
+ std::vector<ObsoleteBlobFileInfo>* blob_files,
1228
+ std::vector<std::string>* manifest_filenames,
1229
+ uint64_t min_pending_output);
1230
+
1231
+ ColumnFamilySet* GetColumnFamilySet() { return column_family_set_.get(); }
1232
+ const FileOptions& file_options() { return file_options_; }
1233
+ void ChangeFileOptions(const MutableDBOptions& new_options) {
1234
+ file_options_.writable_file_max_buffer_size =
1235
+ new_options.writable_file_max_buffer_size;
1236
+ }
1237
+
1238
+ const ImmutableDBOptions* db_options() const { return db_options_; }
1239
+
1240
+ static uint64_t GetNumLiveVersions(Version* dummy_versions);
1241
+
1242
+ static uint64_t GetTotalSstFilesSize(Version* dummy_versions);
1243
+
1244
+ // Get the IO Status returned by written Manifest.
1245
+ const IOStatus& io_status() const { return io_status_; }
1246
+
1247
+ // The returned WalSet needs to be accessed with DB mutex held.
1248
+ const WalSet& GetWalSet() const { return wals_; }
1249
+
1250
+ void TEST_CreateAndAppendVersion(ColumnFamilyData* cfd) {
1251
+ assert(cfd);
1252
+
1253
+ const auto& mutable_cf_options = *cfd->GetLatestMutableCFOptions();
1254
+ Version* const version =
1255
+ new Version(cfd, this, file_options_, mutable_cf_options, io_tracer_);
1256
+
1257
+ constexpr bool update_stats = false;
1258
+ version->PrepareApply(mutable_cf_options, update_stats);
1259
+ AppendVersion(cfd, version);
1260
+ }
1261
+
1262
+ protected:
1263
+ using VersionBuilderMap =
1264
+ std::unordered_map<uint32_t,
1265
+ std::unique_ptr<BaseReferencedVersionBuilder>>;
1266
+
1267
+ struct ManifestWriter;
1268
+
1269
+ friend class Version;
1270
+ friend class VersionEditHandler;
1271
+ friend class VersionEditHandlerPointInTime;
1272
+ friend class DumpManifestHandler;
1273
+ friend class DBImpl;
1274
+ friend class DBImplReadOnly;
1275
+
1276
+ struct LogReporter : public log::Reader::Reporter {
1277
+ Status* status;
1278
+ virtual void Corruption(size_t /*bytes*/, const Status& s) override {
1279
+ if (status->ok()) {
1280
+ *status = s;
1281
+ }
1282
+ }
1283
+ };
1284
+
1285
+ void Reset();
1286
+
1287
+ // Returns approximated offset of a key in a file for a given version.
1288
+ uint64_t ApproximateOffsetOf(Version* v, const FdWithKeyRange& f,
1289
+ const Slice& key, TableReaderCaller caller);
1290
+
1291
+ // Returns approximated data size between start and end keys in a file
1292
+ // for a given version.
1293
+ uint64_t ApproximateSize(Version* v, const FdWithKeyRange& f,
1294
+ const Slice& start, const Slice& end,
1295
+ TableReaderCaller caller);
1296
+
1297
+ struct MutableCFState {
1298
+ uint64_t log_number;
1299
+ std::string full_history_ts_low;
1300
+
1301
+ explicit MutableCFState() = default;
1302
+ explicit MutableCFState(uint64_t _log_number, std::string ts_low)
1303
+ : log_number(_log_number), full_history_ts_low(std::move(ts_low)) {}
1304
+ };
1305
+
1306
+ // Save current contents to *log
1307
+ Status WriteCurrentStateToManifest(
1308
+ const std::unordered_map<uint32_t, MutableCFState>& curr_state,
1309
+ const VersionEdit& wal_additions, log::Writer* log, IOStatus& io_s);
1310
+
1311
+ void AppendVersion(ColumnFamilyData* column_family_data, Version* v);
1312
+
1313
+ ColumnFamilyData* CreateColumnFamily(const ColumnFamilyOptions& cf_options,
1314
+ const VersionEdit* edit);
1315
+
1316
+ Status ReadAndRecover(
1317
+ log::Reader& reader, AtomicGroupReadBuffer* read_buffer,
1318
+ const std::unordered_map<std::string, ColumnFamilyOptions>&
1319
+ name_to_options,
1320
+ std::unordered_map<int, std::string>& column_families_not_found,
1321
+ std::unordered_map<
1322
+ uint32_t, std::unique_ptr<BaseReferencedVersionBuilder>>& builders,
1323
+ Status* log_read_status, VersionEditParams* version_edit,
1324
+ std::string* db_id = nullptr);
1325
+
1326
+ // REQUIRES db mutex
1327
+ Status ApplyOneVersionEditToBuilder(
1328
+ VersionEdit& edit,
1329
+ const std::unordered_map<std::string, ColumnFamilyOptions>& name_to_opts,
1330
+ std::unordered_map<int, std::string>& column_families_not_found,
1331
+ std::unordered_map<
1332
+ uint32_t, std::unique_ptr<BaseReferencedVersionBuilder>>& builders,
1333
+ VersionEditParams* version_edit);
1334
+
1335
+ Status ExtractInfoFromVersionEdit(ColumnFamilyData* cfd,
1336
+ const VersionEdit& from_edit,
1337
+ VersionEditParams* version_edit_params);
1338
+
1339
+ Status VerifyFileMetadata(const std::string& fpath,
1340
+ const FileMetaData& meta) const;
1341
+
1342
+ // Protected by DB mutex.
1343
+ WalSet wals_;
1344
+
1345
+ std::unique_ptr<ColumnFamilySet> column_family_set_;
1346
+ Cache* table_cache_;
1347
+ Env* const env_;
1348
+ FileSystemPtr const fs_;
1349
+ const std::string dbname_;
1350
+ std::string db_id_;
1351
+ const ImmutableDBOptions* const db_options_;
1352
+ std::atomic<uint64_t> next_file_number_;
1353
+ // Any WAL number smaller than this should be ignored during recovery,
1354
+ // and is qualified for being deleted in 2PC mode. In non-2PC mode, this
1355
+ // number is ignored.
1356
+ std::atomic<uint64_t> min_log_number_to_keep_2pc_ = {0};
1357
+ uint64_t manifest_file_number_;
1358
+ uint64_t options_file_number_;
1359
+ uint64_t pending_manifest_file_number_;
1360
+ // The last seq visible to reads. It normally indicates the last sequence in
1361
+ // the memtable but when using two write queues it could also indicate the
1362
+ // last sequence in the WAL visible to reads.
1363
+ std::atomic<uint64_t> last_sequence_;
1364
+ // The last seq that is already allocated. It is applicable only when we have
1365
+ // two write queues. In that case seq might or might not have appreated in
1366
+ // memtable but it is expected to appear in the WAL.
1367
+ // We have last_sequence <= last_allocated_sequence_
1368
+ std::atomic<uint64_t> last_allocated_sequence_;
1369
+ // The last allocated sequence that is also published to the readers. This is
1370
+ // applicable only when last_seq_same_as_publish_seq_ is not set. Otherwise
1371
+ // last_sequence_ also indicates the last published seq.
1372
+ // We have last_sequence <= last_published_sequence_ <=
1373
+ // last_allocated_sequence_
1374
+ std::atomic<uint64_t> last_published_sequence_;
1375
+ uint64_t prev_log_number_; // 0 or backing store for memtable being compacted
1376
+
1377
+ // Opened lazily
1378
+ std::unique_ptr<log::Writer> descriptor_log_;
1379
+
1380
+ // generates a increasing version number for every new version
1381
+ uint64_t current_version_number_;
1382
+
1383
+ // Queue of writers to the manifest file
1384
+ std::deque<ManifestWriter*> manifest_writers_;
1385
+
1386
+ // Current size of manifest file
1387
+ uint64_t manifest_file_size_;
1388
+
1389
+ std::vector<ObsoleteFileInfo> obsolete_files_;
1390
+ std::vector<ObsoleteBlobFileInfo> obsolete_blob_files_;
1391
+ std::vector<std::string> obsolete_manifests_;
1392
+
1393
+ // env options for all reads and writes except compactions
1394
+ FileOptions file_options_;
1395
+
1396
+ BlockCacheTracer* const block_cache_tracer_;
1397
+
1398
+ // Store the IO status when Manifest is written
1399
+ IOStatus io_status_;
1400
+
1401
+ std::shared_ptr<IOTracer> io_tracer_;
1402
+
1403
+ private:
1404
+ // REQUIRES db mutex at beginning. may release and re-acquire db mutex
1405
+ Status ProcessManifestWrites(std::deque<ManifestWriter>& writers,
1406
+ InstrumentedMutex* mu, FSDirectory* db_directory,
1407
+ bool new_descriptor_log,
1408
+ const ColumnFamilyOptions* new_cf_options);
1409
+
1410
+ void LogAndApplyCFHelper(VersionEdit* edit);
1411
+ Status LogAndApplyHelper(ColumnFamilyData* cfd, VersionBuilder* b,
1412
+ VersionEdit* edit, InstrumentedMutex* mu);
1413
+ };
1414
+
1415
+ // ReactiveVersionSet represents a collection of versions of the column
1416
+ // families of the database. Users of ReactiveVersionSet, e.g. DBImplSecondary,
1417
+ // need to replay the MANIFEST (description log in older terms) in order to
1418
+ // reconstruct and install versions.
1419
+ class ReactiveVersionSet : public VersionSet {
1420
+ public:
1421
+ ReactiveVersionSet(const std::string& dbname,
1422
+ const ImmutableDBOptions* _db_options,
1423
+ const FileOptions& _file_options, Cache* table_cache,
1424
+ WriteBufferManager* write_buffer_manager,
1425
+ WriteController* write_controller,
1426
+ const std::shared_ptr<IOTracer>& io_tracer);
1427
+
1428
+ ~ReactiveVersionSet() override;
1429
+
1430
+ Status ReadAndApply(
1431
+ InstrumentedMutex* mu,
1432
+ std::unique_ptr<log::FragmentBufferedReader>* manifest_reader,
1433
+ std::unordered_set<ColumnFamilyData*>* cfds_changed);
1434
+
1435
+ Status Recover(const std::vector<ColumnFamilyDescriptor>& column_families,
1436
+ std::unique_ptr<log::FragmentBufferedReader>* manifest_reader,
1437
+ std::unique_ptr<log::Reader::Reporter>* manifest_reporter,
1438
+ std::unique_ptr<Status>* manifest_reader_status);
1439
+
1440
+ uint64_t TEST_read_edits_in_atomic_group() const {
1441
+ return read_buffer_.TEST_read_edits_in_atomic_group();
1442
+ }
1443
+ std::vector<VersionEdit>& replay_buffer() {
1444
+ return read_buffer_.replay_buffer();
1445
+ }
1446
+
1447
+ protected:
1448
+ using VersionSet::ApplyOneVersionEditToBuilder;
1449
+
1450
+ // REQUIRES db mutex
1451
+ Status ApplyOneVersionEditToBuilder(
1452
+ VersionEdit& edit, std::unordered_set<ColumnFamilyData*>* cfds_changed,
1453
+ VersionEdit* version_edit);
1454
+
1455
+ Status MaybeSwitchManifest(
1456
+ log::Reader::Reporter* reporter,
1457
+ std::unique_ptr<log::FragmentBufferedReader>* manifest_reader);
1458
+
1459
+ private:
1460
+ VersionBuilderMap active_version_builders_;
1461
+ AtomicGroupReadBuffer read_buffer_;
1462
+ // Number of version edits to skip by ReadAndApply at the beginning of a new
1463
+ // MANIFEST created by primary.
1464
+ int number_of_edits_to_skip_;
1465
+
1466
+ using VersionSet::LogAndApply;
1467
+ using VersionSet::Recover;
1468
+
1469
+ Status LogAndApply(
1470
+ const autovector<ColumnFamilyData*>& /*cfds*/,
1471
+ const autovector<const MutableCFOptions*>& /*mutable_cf_options_list*/,
1472
+ const autovector<autovector<VersionEdit*>>& /*edit_lists*/,
1473
+ InstrumentedMutex* /*mu*/, FSDirectory* /*db_directory*/,
1474
+ bool /*new_descriptor_log*/, const ColumnFamilyOptions* /*new_cf_option*/,
1475
+ const std::vector<std::function<void(const Status&)>>& /*manifest_wcbs*/)
1476
+ override {
1477
+ return Status::NotSupported("not supported in reactive mode");
1478
+ }
1479
+
1480
+ // No copy allowed
1481
+ ReactiveVersionSet(const ReactiveVersionSet&);
1482
+ ReactiveVersionSet& operator=(const ReactiveVersionSet&);
1483
+ };
1484
+
1485
+ } // namespace ROCKSDB_NAMESPACE