rocksdb-native 2.6.2 → 2.6.4

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 (956) hide show
  1. package/CMakeLists.txt +29 -17
  2. package/binding.js +1 -1
  3. package/package.json +7 -4
  4. package/prebuilds/darwin-arm64/rocksdb-native.bare +0 -0
  5. package/prebuilds/darwin-arm64/rocksdb-native.node +0 -0
  6. package/prebuilds/darwin-x64/rocksdb-native.bare +0 -0
  7. package/prebuilds/darwin-x64/rocksdb-native.node +0 -0
  8. package/prebuilds/ios-arm64/rocksdb-native.bare +0 -0
  9. package/prebuilds/ios-arm64-simulator/rocksdb-native.bare +0 -0
  10. package/prebuilds/ios-x64-simulator/rocksdb-native.bare +0 -0
  11. package/prebuilds/linux-arm64/rocksdb-native.bare +0 -0
  12. package/prebuilds/linux-arm64/rocksdb-native.node +0 -0
  13. package/prebuilds/linux-x64/rocksdb-native.bare +0 -0
  14. package/prebuilds/linux-x64/rocksdb-native.node +0 -0
  15. package/prebuilds/win32-arm64/rocksdb-native.bare +0 -0
  16. package/prebuilds/win32-arm64/rocksdb-native.node +0 -0
  17. package/prebuilds/win32-x64/rocksdb-native.bare +0 -0
  18. package/prebuilds/win32-x64/rocksdb-native.node +0 -0
  19. package/vendor/librocksdb/CMakeLists.txt +0 -94
  20. package/vendor/librocksdb/LICENSE +0 -201
  21. package/vendor/librocksdb/NOTICE +0 -13
  22. package/vendor/librocksdb/README.md +0 -11
  23. package/vendor/librocksdb/include/rocksdb.h +0 -294
  24. package/vendor/librocksdb/src/rocksdb.cc +0 -714
  25. package/vendor/librocksdb/vendor/rocksdb/CMakeLists.txt +0 -1642
  26. package/vendor/librocksdb/vendor/rocksdb/cache/cache.cc +0 -193
  27. package/vendor/librocksdb/vendor/rocksdb/cache/cache_bench.cc +0 -20
  28. package/vendor/librocksdb/vendor/rocksdb/cache/cache_bench_tool.cc +0 -1177
  29. package/vendor/librocksdb/vendor/rocksdb/cache/cache_entry_roles.cc +0 -104
  30. package/vendor/librocksdb/vendor/rocksdb/cache/cache_entry_roles.h +0 -20
  31. package/vendor/librocksdb/vendor/rocksdb/cache/cache_entry_stats.h +0 -182
  32. package/vendor/librocksdb/vendor/rocksdb/cache/cache_helpers.cc +0 -41
  33. package/vendor/librocksdb/vendor/rocksdb/cache/cache_helpers.h +0 -139
  34. package/vendor/librocksdb/vendor/rocksdb/cache/cache_key.cc +0 -364
  35. package/vendor/librocksdb/vendor/rocksdb/cache/cache_key.h +0 -143
  36. package/vendor/librocksdb/vendor/rocksdb/cache/cache_reservation_manager.cc +0 -184
  37. package/vendor/librocksdb/vendor/rocksdb/cache/cache_reservation_manager.h +0 -318
  38. package/vendor/librocksdb/vendor/rocksdb/cache/charged_cache.cc +0 -111
  39. package/vendor/librocksdb/vendor/rocksdb/cache/charged_cache.h +0 -61
  40. package/vendor/librocksdb/vendor/rocksdb/cache/clock_cache.cc +0 -3657
  41. package/vendor/librocksdb/vendor/rocksdb/cache/clock_cache.h +0 -1165
  42. package/vendor/librocksdb/vendor/rocksdb/cache/compressed_secondary_cache.cc +0 -414
  43. package/vendor/librocksdb/vendor/rocksdb/cache/compressed_secondary_cache.h +0 -151
  44. package/vendor/librocksdb/vendor/rocksdb/cache/lru_cache.cc +0 -726
  45. package/vendor/librocksdb/vendor/rocksdb/cache/lru_cache.h +0 -467
  46. package/vendor/librocksdb/vendor/rocksdb/cache/secondary_cache.cc +0 -12
  47. package/vendor/librocksdb/vendor/rocksdb/cache/secondary_cache_adapter.cc +0 -743
  48. package/vendor/librocksdb/vendor/rocksdb/cache/secondary_cache_adapter.h +0 -103
  49. package/vendor/librocksdb/vendor/rocksdb/cache/sharded_cache.cc +0 -147
  50. package/vendor/librocksdb/vendor/rocksdb/cache/sharded_cache.h +0 -322
  51. package/vendor/librocksdb/vendor/rocksdb/cache/tiered_secondary_cache.cc +0 -125
  52. package/vendor/librocksdb/vendor/rocksdb/cache/tiered_secondary_cache.h +0 -158
  53. package/vendor/librocksdb/vendor/rocksdb/cache/typed_cache.h +0 -380
  54. package/vendor/librocksdb/vendor/rocksdb/cmake/RocksDBConfig.cmake.in +0 -54
  55. package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.cc +0 -182
  56. package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.h +0 -128
  57. package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.cc +0 -20
  58. package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.h +0 -83
  59. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_constants.h +0 -16
  60. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_contents.cc +0 -42
  61. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_contents.h +0 -60
  62. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_counting_iterator.h +0 -150
  63. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_fetcher.cc +0 -34
  64. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_fetcher.h +0 -37
  65. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_addition.cc +0 -156
  66. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_addition.h +0 -67
  67. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_builder.cc +0 -429
  68. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_builder.h +0 -113
  69. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_cache.cc +0 -101
  70. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_cache.h +0 -56
  71. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_completion_callback.h +0 -84
  72. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_garbage.cc +0 -134
  73. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_garbage.h +0 -57
  74. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_meta.cc +0 -62
  75. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_meta.h +0 -170
  76. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_reader.cc +0 -622
  77. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_file_reader.h +0 -111
  78. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_garbage_meter.cc +0 -100
  79. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_garbage_meter.h +0 -102
  80. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_index.h +0 -187
  81. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_format.cc +0 -143
  82. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_format.h +0 -164
  83. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_sequential_reader.cc +0 -133
  84. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_sequential_reader.h +0 -83
  85. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_writer.cc +0 -207
  86. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_log_writer.h +0 -87
  87. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_read_request.h +0 -58
  88. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_source.cc +0 -459
  89. package/vendor/librocksdb/vendor/rocksdb/db/blob/blob_source.h +0 -161
  90. package/vendor/librocksdb/vendor/rocksdb/db/blob/prefetch_buffer_collection.cc +0 -23
  91. package/vendor/librocksdb/vendor/rocksdb/db/blob/prefetch_buffer_collection.h +0 -38
  92. package/vendor/librocksdb/vendor/rocksdb/db/builder.cc +0 -517
  93. package/vendor/librocksdb/vendor/rocksdb/db/builder.h +0 -76
  94. package/vendor/librocksdb/vendor/rocksdb/db/c.cc +0 -7133
  95. package/vendor/librocksdb/vendor/rocksdb/db/c_test.c +0 -4052
  96. package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.cc +0 -47
  97. package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.h +0 -79
  98. package/vendor/librocksdb/vendor/rocksdb/db/column_family.cc +0 -1859
  99. package/vendor/librocksdb/vendor/rocksdb/db/column_family.h +0 -918
  100. package/vendor/librocksdb/vendor/rocksdb/db/compaction/clipping_iterator.h +0 -281
  101. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.cc +0 -995
  102. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.h +0 -602
  103. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iteration_stats.h +0 -56
  104. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.cc +0 -1523
  105. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.h +0 -557
  106. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.cc +0 -2155
  107. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.h +0 -520
  108. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.cc +0 -802
  109. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.h +0 -411
  110. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.cc +0 -1245
  111. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.h +0 -322
  112. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_fifo.cc +0 -478
  113. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_fifo.h +0 -61
  114. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_level.cc +0 -977
  115. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_level.h +0 -32
  116. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +0 -1578
  117. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_universal.h +0 -29
  118. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_service_job.cc +0 -835
  119. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_state.cc +0 -46
  120. package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_state.h +0 -42
  121. package/vendor/librocksdb/vendor/rocksdb/db/compaction/file_pri.h +0 -94
  122. package/vendor/librocksdb/vendor/rocksdb/db/compaction/sst_partitioner.cc +0 -83
  123. package/vendor/librocksdb/vendor/rocksdb/db/compaction/subcompaction_state.cc +0 -106
  124. package/vendor/librocksdb/vendor/rocksdb/db/compaction/subcompaction_state.h +0 -220
  125. package/vendor/librocksdb/vendor/rocksdb/db/convenience.cc +0 -101
  126. package/vendor/librocksdb/vendor/rocksdb/db/convenience_impl.h +0 -15
  127. package/vendor/librocksdb/vendor/rocksdb/db/db_filesnapshot.cc +0 -506
  128. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/compacted_db_impl.cc +0 -275
  129. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/compacted_db_impl.h +0 -147
  130. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.cc +0 -6767
  131. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.h +0 -3056
  132. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +0 -4390
  133. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_debug.cc +0 -327
  134. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_experimental.cc +0 -164
  135. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_files.cc +0 -1032
  136. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.cc +0 -348
  137. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.h +0 -54
  138. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_open.cc +0 -2325
  139. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_readonly.cc +0 -376
  140. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_readonly.h +0 -179
  141. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +0 -1025
  142. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.h +0 -322
  143. package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_write.cc +0 -2624
  144. package/vendor/librocksdb/vendor/rocksdb/db/db_info_dumper.cc +0 -165
  145. package/vendor/librocksdb/vendor/rocksdb/db/db_info_dumper.h +0 -15
  146. package/vendor/librocksdb/vendor/rocksdb/db/db_iter.cc +0 -1774
  147. package/vendor/librocksdb/vendor/rocksdb/db/db_iter.h +0 -444
  148. package/vendor/librocksdb/vendor/rocksdb/db/db_test2.cc +0 -7839
  149. package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.cc +0 -1800
  150. package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.h +0 -1427
  151. package/vendor/librocksdb/vendor/rocksdb/db/db_with_timestamp_test_util.cc +0 -96
  152. package/vendor/librocksdb/vendor/rocksdb/db/db_with_timestamp_test_util.h +0 -126
  153. package/vendor/librocksdb/vendor/rocksdb/db/dbformat.cc +0 -282
  154. package/vendor/librocksdb/vendor/rocksdb/db/dbformat.h +0 -1101
  155. package/vendor/librocksdb/vendor/rocksdb/db/error_handler.cc +0 -806
  156. package/vendor/librocksdb/vendor/rocksdb/db/error_handler.h +0 -149
  157. package/vendor/librocksdb/vendor/rocksdb/db/event_helpers.cc +0 -332
  158. package/vendor/librocksdb/vendor/rocksdb/db/event_helpers.h +0 -78
  159. package/vendor/librocksdb/vendor/rocksdb/db/experimental.cc +0 -1212
  160. package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +0 -1249
  161. package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.h +0 -268
  162. package/vendor/librocksdb/vendor/rocksdb/db/file_indexer.cc +0 -216
  163. package/vendor/librocksdb/vendor/rocksdb/db/file_indexer.h +0 -140
  164. package/vendor/librocksdb/vendor/rocksdb/db/flush_job.cc +0 -1217
  165. package/vendor/librocksdb/vendor/rocksdb/db/flush_job.h +0 -240
  166. package/vendor/librocksdb/vendor/rocksdb/db/flush_scheduler.cc +0 -86
  167. package/vendor/librocksdb/vendor/rocksdb/db/flush_scheduler.h +0 -55
  168. package/vendor/librocksdb/vendor/rocksdb/db/forward_iterator.cc +0 -1082
  169. package/vendor/librocksdb/vendor/rocksdb/db/forward_iterator.h +0 -166
  170. package/vendor/librocksdb/vendor/rocksdb/db/forward_iterator_bench.cc +0 -378
  171. package/vendor/librocksdb/vendor/rocksdb/db/history_trimming_iterator.h +0 -95
  172. package/vendor/librocksdb/vendor/rocksdb/db/import_column_family_job.cc +0 -463
  173. package/vendor/librocksdb/vendor/rocksdb/db/import_column_family_job.h +0 -91
  174. package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.cc +0 -2198
  175. package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.h +0 -896
  176. package/vendor/librocksdb/vendor/rocksdb/db/job_context.h +0 -254
  177. package/vendor/librocksdb/vendor/rocksdb/db/kv_checksum.h +0 -484
  178. package/vendor/librocksdb/vendor/rocksdb/db/log_format.h +0 -55
  179. package/vendor/librocksdb/vendor/rocksdb/db/log_reader.cc +0 -958
  180. package/vendor/librocksdb/vendor/rocksdb/db/log_reader.h +0 -245
  181. package/vendor/librocksdb/vendor/rocksdb/db/log_writer.cc +0 -355
  182. package/vendor/librocksdb/vendor/rocksdb/db/log_writer.h +0 -151
  183. package/vendor/librocksdb/vendor/rocksdb/db/logs_with_prep_tracker.cc +0 -67
  184. package/vendor/librocksdb/vendor/rocksdb/db/logs_with_prep_tracker.h +0 -62
  185. package/vendor/librocksdb/vendor/rocksdb/db/lookup_key.h +0 -68
  186. package/vendor/librocksdb/vendor/rocksdb/db/malloc_stats.cc +0 -52
  187. package/vendor/librocksdb/vendor/rocksdb/db/malloc_stats.h +0 -22
  188. package/vendor/librocksdb/vendor/rocksdb/db/memtable.cc +0 -1684
  189. package/vendor/librocksdb/vendor/rocksdb/db/memtable.h +0 -712
  190. package/vendor/librocksdb/vendor/rocksdb/db/memtable_list.cc +0 -1028
  191. package/vendor/librocksdb/vendor/rocksdb/db/memtable_list.h +0 -514
  192. package/vendor/librocksdb/vendor/rocksdb/db/merge_context.h +0 -150
  193. package/vendor/librocksdb/vendor/rocksdb/db/merge_helper.cc +0 -699
  194. package/vendor/librocksdb/vendor/rocksdb/db/merge_helper.h +0 -318
  195. package/vendor/librocksdb/vendor/rocksdb/db/merge_operator.cc +0 -167
  196. package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator_impl.h +0 -296
  197. package/vendor/librocksdb/vendor/rocksdb/db/output_validator.cc +0 -29
  198. package/vendor/librocksdb/vendor/rocksdb/db/output_validator.h +0 -45
  199. package/vendor/librocksdb/vendor/rocksdb/db/periodic_task_scheduler.cc +0 -110
  200. package/vendor/librocksdb/vendor/rocksdb/db/periodic_task_scheduler.h +0 -108
  201. package/vendor/librocksdb/vendor/rocksdb/db/pinned_iterators_manager.h +0 -92
  202. package/vendor/librocksdb/vendor/rocksdb/db/post_memtable_callback.h +0 -25
  203. package/vendor/librocksdb/vendor/rocksdb/db/pre_release_callback.h +0 -37
  204. package/vendor/librocksdb/vendor/rocksdb/db/range_del_aggregator.cc +0 -553
  205. package/vendor/librocksdb/vendor/rocksdb/db/range_del_aggregator.h +0 -481
  206. package/vendor/librocksdb/vendor/rocksdb/db/range_del_aggregator_bench.cc +0 -280
  207. package/vendor/librocksdb/vendor/rocksdb/db/range_tombstone_fragmenter.cc +0 -515
  208. package/vendor/librocksdb/vendor/rocksdb/db/range_tombstone_fragmenter.h +0 -361
  209. package/vendor/librocksdb/vendor/rocksdb/db/read_callback.h +0 -54
  210. package/vendor/librocksdb/vendor/rocksdb/db/repair.cc +0 -864
  211. package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.cc +0 -573
  212. package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.h +0 -307
  213. package/vendor/librocksdb/vendor/rocksdb/db/snapshot_checker.h +0 -58
  214. package/vendor/librocksdb/vendor/rocksdb/db/snapshot_impl.cc +0 -25
  215. package/vendor/librocksdb/vendor/rocksdb/db/snapshot_impl.h +0 -239
  216. package/vendor/librocksdb/vendor/rocksdb/db/table_cache.cc +0 -745
  217. package/vendor/librocksdb/vendor/rocksdb/db/table_cache.h +0 -298
  218. package/vendor/librocksdb/vendor/rocksdb/db/table_cache_sync_and_async.h +0 -135
  219. package/vendor/librocksdb/vendor/rocksdb/db/table_properties_collector.cc +0 -74
  220. package/vendor/librocksdb/vendor/rocksdb/db/table_properties_collector.h +0 -185
  221. package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.cc +0 -296
  222. package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.h +0 -128
  223. package/vendor/librocksdb/vendor/rocksdb/db/trim_history_scheduler.cc +0 -54
  224. package/vendor/librocksdb/vendor/rocksdb/db/trim_history_scheduler.h +0 -46
  225. package/vendor/librocksdb/vendor/rocksdb/db/version_builder.cc +0 -1431
  226. package/vendor/librocksdb/vendor/rocksdb/db/version_builder.h +0 -93
  227. package/vendor/librocksdb/vendor/rocksdb/db/version_edit.cc +0 -1119
  228. package/vendor/librocksdb/vendor/rocksdb/db/version_edit.h +0 -769
  229. package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.cc +0 -1264
  230. package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.h +0 -390
  231. package/vendor/librocksdb/vendor/rocksdb/db/version_set.cc +0 -7562
  232. package/vendor/librocksdb/vendor/rocksdb/db/version_set.h +0 -1799
  233. package/vendor/librocksdb/vendor/rocksdb/db/version_set_sync_and_async.h +0 -169
  234. package/vendor/librocksdb/vendor/rocksdb/db/version_util.h +0 -77
  235. package/vendor/librocksdb/vendor/rocksdb/db/wal_edit.cc +0 -211
  236. package/vendor/librocksdb/vendor/rocksdb/db/wal_edit.h +0 -177
  237. package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.cc +0 -539
  238. package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.h +0 -138
  239. package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_column_serialization.cc +0 -166
  240. package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_column_serialization.h +0 -57
  241. package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns.cc +0 -22
  242. package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns_helper.cc +0 -52
  243. package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns_helper.h +0 -40
  244. package/vendor/librocksdb/vendor/rocksdb/db/write_batch.cc +0 -3394
  245. package/vendor/librocksdb/vendor/rocksdb/db/write_batch_base.cc +0 -94
  246. package/vendor/librocksdb/vendor/rocksdb/db/write_batch_internal.h +0 -408
  247. package/vendor/librocksdb/vendor/rocksdb/db/write_callback.h +0 -27
  248. package/vendor/librocksdb/vendor/rocksdb/db/write_controller.cc +0 -121
  249. package/vendor/librocksdb/vendor/rocksdb/db/write_controller.h +0 -148
  250. package/vendor/librocksdb/vendor/rocksdb/db/write_stall_stats.cc +0 -179
  251. package/vendor/librocksdb/vendor/rocksdb/db/write_stall_stats.h +0 -47
  252. package/vendor/librocksdb/vendor/rocksdb/db/write_thread.cc +0 -931
  253. package/vendor/librocksdb/vendor/rocksdb/db/write_thread.h +0 -498
  254. package/vendor/librocksdb/vendor/rocksdb/env/composite_env.cc +0 -534
  255. package/vendor/librocksdb/vendor/rocksdb/env/composite_env_wrapper.h +0 -399
  256. package/vendor/librocksdb/vendor/rocksdb/env/emulated_clock.h +0 -114
  257. package/vendor/librocksdb/vendor/rocksdb/env/env.cc +0 -1253
  258. package/vendor/librocksdb/vendor/rocksdb/env/env_chroot.cc +0 -149
  259. package/vendor/librocksdb/vendor/rocksdb/env/env_chroot.h +0 -55
  260. package/vendor/librocksdb/vendor/rocksdb/env/env_encryption.cc +0 -1192
  261. package/vendor/librocksdb/vendor/rocksdb/env/env_encryption_ctr.h +0 -97
  262. package/vendor/librocksdb/vendor/rocksdb/env/env_posix.cc +0 -530
  263. package/vendor/librocksdb/vendor/rocksdb/env/file_system.cc +0 -278
  264. package/vendor/librocksdb/vendor/rocksdb/env/file_system_tracer.cc +0 -564
  265. package/vendor/librocksdb/vendor/rocksdb/env/file_system_tracer.h +0 -461
  266. package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.cc +0 -331
  267. package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.h +0 -139
  268. package/vendor/librocksdb/vendor/rocksdb/env/fs_posix.cc +0 -1285
  269. package/vendor/librocksdb/vendor/rocksdb/env/fs_readonly.h +0 -105
  270. package/vendor/librocksdb/vendor/rocksdb/env/fs_remap.cc +0 -341
  271. package/vendor/librocksdb/vendor/rocksdb/env/fs_remap.h +0 -137
  272. package/vendor/librocksdb/vendor/rocksdb/env/io_posix.cc +0 -1738
  273. package/vendor/librocksdb/vendor/rocksdb/env/io_posix.h +0 -517
  274. package/vendor/librocksdb/vendor/rocksdb/env/mock_env.cc +0 -1058
  275. package/vendor/librocksdb/vendor/rocksdb/env/mock_env.h +0 -144
  276. package/vendor/librocksdb/vendor/rocksdb/env/unique_id_gen.cc +0 -243
  277. package/vendor/librocksdb/vendor/rocksdb/env/unique_id_gen.h +0 -119
  278. package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.cc +0 -513
  279. package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.h +0 -200
  280. package/vendor/librocksdb/vendor/rocksdb/file/file_prefetch_buffer.cc +0 -992
  281. package/vendor/librocksdb/vendor/rocksdb/file/file_prefetch_buffer.h +0 -629
  282. package/vendor/librocksdb/vendor/rocksdb/file/file_util.cc +0 -308
  283. package/vendor/librocksdb/vendor/rocksdb/file/file_util.h +0 -123
  284. package/vendor/librocksdb/vendor/rocksdb/file/filename.cc +0 -538
  285. package/vendor/librocksdb/vendor/rocksdb/file/filename.h +0 -186
  286. package/vendor/librocksdb/vendor/rocksdb/file/line_file_reader.cc +0 -73
  287. package/vendor/librocksdb/vendor/rocksdb/file/line_file_reader.h +0 -60
  288. package/vendor/librocksdb/vendor/rocksdb/file/random_access_file_reader.cc +0 -639
  289. package/vendor/librocksdb/vendor/rocksdb/file/random_access_file_reader.h +0 -197
  290. package/vendor/librocksdb/vendor/rocksdb/file/read_write_util.cc +0 -33
  291. package/vendor/librocksdb/vendor/rocksdb/file/read_write_util.h +0 -31
  292. package/vendor/librocksdb/vendor/rocksdb/file/readahead_file_info.h +0 -33
  293. package/vendor/librocksdb/vendor/rocksdb/file/readahead_raf.cc +0 -169
  294. package/vendor/librocksdb/vendor/rocksdb/file/readahead_raf.h +0 -29
  295. package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.cc +0 -324
  296. package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.h +0 -127
  297. package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.cc +0 -525
  298. package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.h +0 -220
  299. package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.cc +0 -1007
  300. package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.h +0 -370
  301. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/advanced_cache.h +0 -665
  302. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/advanced_options.h +0 -1101
  303. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/attribute_groups.h +0 -114
  304. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/block_cache_trace_writer.h +0 -149
  305. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/c.h +0 -3122
  306. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/cache.h +0 -579
  307. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/cache_bench_tool.h +0 -14
  308. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/cleanable.h +0 -128
  309. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/compaction_filter.h +0 -374
  310. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/compaction_job_stats.h +0 -112
  311. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/comparator.h +0 -231
  312. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/compression_type.h +0 -186
  313. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/concurrent_task_limiter.h +0 -51
  314. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/configurable.h +0 -390
  315. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/convenience.h +0 -466
  316. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/customizable.h +0 -229
  317. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/data_structure.h +0 -186
  318. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db.h +0 -2174
  319. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db_bench_tool.h +0 -11
  320. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db_dump_tool.h +0 -43
  321. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db_stress_tool.h +0 -11
  322. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/env.h +0 -1920
  323. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/env_encryption.h +0 -363
  324. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/experimental.h +0 -492
  325. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/file_checksum.h +0 -146
  326. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/file_system.h +0 -1961
  327. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/filter_policy.h +0 -211
  328. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/flush_block_policy.h +0 -75
  329. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/functor_wrapper.h +0 -56
  330. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/io_status.h +0 -244
  331. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iostats_context.h +0 -98
  332. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator.h +0 -104
  333. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator_base.h +0 -90
  334. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/ldb_tool.h +0 -42
  335. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/listener.h +0 -869
  336. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/memory_allocator.h +0 -87
  337. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/memtablerep.h +0 -421
  338. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/merge_operator.h +0 -337
  339. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/metadata.h +0 -258
  340. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/options.h +0 -2339
  341. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/perf_context.h +0 -319
  342. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/perf_level.h +0 -39
  343. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/persistent_cache.h +0 -74
  344. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/port_defs.h +0 -26
  345. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/rate_limiter.h +0 -172
  346. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/rocksdb_namespace.h +0 -16
  347. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/secondary_cache.h +0 -220
  348. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/slice.h +0 -264
  349. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/slice_transform.h +0 -135
  350. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/snapshot.h +0 -53
  351. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_dump_tool.h +0 -17
  352. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_file_manager.h +0 -139
  353. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_file_reader.h +0 -61
  354. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_file_writer.h +0 -203
  355. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_partitioner.h +0 -142
  356. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/statistics.h +0 -794
  357. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/stats_history.h +0 -70
  358. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/status.h +0 -609
  359. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/system_clock.h +0 -129
  360. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table.h +0 -938
  361. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table_properties.h +0 -380
  362. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table_reader_caller.h +0 -41
  363. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/thread_status.h +0 -197
  364. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/threadpool.h +0 -67
  365. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/trace_reader_writer.h +0 -52
  366. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/trace_record.h +0 -248
  367. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/trace_record_result.h +0 -187
  368. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/transaction_log.h +0 -128
  369. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/types.h +0 -113
  370. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/unique_id.h +0 -55
  371. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/universal_compaction.h +0 -127
  372. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/user_write_callback.h +0 -29
  373. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/agg_merge.h +0 -138
  374. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/backup_engine.h +0 -689
  375. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +0 -144
  376. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +0 -65
  377. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/convenience.h +0 -10
  378. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +0 -321
  379. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/db_ttl.h +0 -70
  380. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/debug.h +0 -46
  381. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +0 -179
  382. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/info_log_finder.h +0 -19
  383. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +0 -338
  384. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd_execute_result.h +0 -75
  385. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/leveldb_options.h +0 -145
  386. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h +0 -43
  387. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_util.h +0 -55
  388. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/memory_util.h +0 -48
  389. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/object_registry.h +0 -583
  390. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/optimistic_transaction_db.h +0 -129
  391. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +0 -24
  392. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/options_type.h +0 -1222
  393. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/options_util.h +0 -105
  394. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/replayer.h +0 -85
  395. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/sim_cache.h +0 -92
  396. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +0 -593
  397. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +0 -133
  398. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction.h +0 -765
  399. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +0 -510
  400. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction_db_mutex.h +0 -89
  401. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/types_util.h +0 -36
  402. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +0 -402
  403. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/version.h +0 -43
  404. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/wal_filter.h +0 -111
  405. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/wide_columns.h +0 -303
  406. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/write_batch.h +0 -518
  407. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/write_batch_base.h +0 -165
  408. package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/write_buffer_manager.h +0 -183
  409. package/vendor/librocksdb/vendor/rocksdb/logging/auto_roll_logger.cc +0 -366
  410. package/vendor/librocksdb/vendor/rocksdb/logging/auto_roll_logger.h +0 -165
  411. package/vendor/librocksdb/vendor/rocksdb/logging/env_logger.h +0 -195
  412. package/vendor/librocksdb/vendor/rocksdb/logging/event_logger.cc +0 -68
  413. package/vendor/librocksdb/vendor/rocksdb/logging/event_logger.h +0 -202
  414. package/vendor/librocksdb/vendor/rocksdb/logging/log_buffer.cc +0 -91
  415. package/vendor/librocksdb/vendor/rocksdb/logging/log_buffer.h +0 -57
  416. package/vendor/librocksdb/vendor/rocksdb/logging/logging.h +0 -62
  417. package/vendor/librocksdb/vendor/rocksdb/memory/allocator.h +0 -58
  418. package/vendor/librocksdb/vendor/rocksdb/memory/arena.cc +0 -170
  419. package/vendor/librocksdb/vendor/rocksdb/memory/arena.h +0 -146
  420. package/vendor/librocksdb/vendor/rocksdb/memory/concurrent_arena.cc +0 -45
  421. package/vendor/librocksdb/vendor/rocksdb/memory/concurrent_arena.h +0 -215
  422. package/vendor/librocksdb/vendor/rocksdb/memory/jemalloc_nodump_allocator.cc +0 -304
  423. package/vendor/librocksdb/vendor/rocksdb/memory/jemalloc_nodump_allocator.h +0 -99
  424. package/vendor/librocksdb/vendor/rocksdb/memory/memkind_kmem_allocator.cc +0 -44
  425. package/vendor/librocksdb/vendor/rocksdb/memory/memkind_kmem_allocator.h +0 -43
  426. package/vendor/librocksdb/vendor/rocksdb/memory/memory_allocator.cc +0 -81
  427. package/vendor/librocksdb/vendor/rocksdb/memory/memory_allocator_impl.h +0 -47
  428. package/vendor/librocksdb/vendor/rocksdb/memory/memory_usage.h +0 -38
  429. package/vendor/librocksdb/vendor/rocksdb/memtable/alloc_tracker.cc +0 -63
  430. package/vendor/librocksdb/vendor/rocksdb/memtable/hash_linklist_rep.cc +0 -925
  431. package/vendor/librocksdb/vendor/rocksdb/memtable/hash_skiplist_rep.cc +0 -392
  432. package/vendor/librocksdb/vendor/rocksdb/memtable/inlineskiplist.h +0 -1051
  433. package/vendor/librocksdb/vendor/rocksdb/memtable/memtablerep_bench.cc +0 -687
  434. package/vendor/librocksdb/vendor/rocksdb/memtable/skiplist.h +0 -498
  435. package/vendor/librocksdb/vendor/rocksdb/memtable/skiplistrep.cc +0 -368
  436. package/vendor/librocksdb/vendor/rocksdb/memtable/stl_wrappers.h +0 -33
  437. package/vendor/librocksdb/vendor/rocksdb/memtable/vectorrep.cc +0 -307
  438. package/vendor/librocksdb/vendor/rocksdb/memtable/write_buffer_manager.cc +0 -185
  439. package/vendor/librocksdb/vendor/rocksdb/monitoring/file_read_sample.h +0 -23
  440. package/vendor/librocksdb/vendor/rocksdb/monitoring/histogram.cc +0 -280
  441. package/vendor/librocksdb/vendor/rocksdb/monitoring/histogram.h +0 -143
  442. package/vendor/librocksdb/vendor/rocksdb/monitoring/histogram_windowing.cc +0 -198
  443. package/vendor/librocksdb/vendor/rocksdb/monitoring/histogram_windowing.h +0 -84
  444. package/vendor/librocksdb/vendor/rocksdb/monitoring/in_memory_stats_history.cc +0 -50
  445. package/vendor/librocksdb/vendor/rocksdb/monitoring/in_memory_stats_history.h +0 -74
  446. package/vendor/librocksdb/vendor/rocksdb/monitoring/instrumented_mutex.cc +0 -90
  447. package/vendor/librocksdb/vendor/rocksdb/monitoring/instrumented_mutex.h +0 -126
  448. package/vendor/librocksdb/vendor/rocksdb/monitoring/iostats_context.cc +0 -78
  449. package/vendor/librocksdb/vendor/rocksdb/monitoring/iostats_context_imp.h +0 -62
  450. package/vendor/librocksdb/vendor/rocksdb/monitoring/perf_context.cc +0 -317
  451. package/vendor/librocksdb/vendor/rocksdb/monitoring/perf_context_imp.h +0 -103
  452. package/vendor/librocksdb/vendor/rocksdb/monitoring/perf_level.cc +0 -23
  453. package/vendor/librocksdb/vendor/rocksdb/monitoring/perf_level_imp.h +0 -14
  454. package/vendor/librocksdb/vendor/rocksdb/monitoring/perf_step_timer.h +0 -77
  455. package/vendor/librocksdb/vendor/rocksdb/monitoring/persistent_stats_history.cc +0 -173
  456. package/vendor/librocksdb/vendor/rocksdb/monitoring/persistent_stats_history.h +0 -83
  457. package/vendor/librocksdb/vendor/rocksdb/monitoring/statistics.cc +0 -561
  458. package/vendor/librocksdb/vendor/rocksdb/monitoring/statistics_impl.h +0 -143
  459. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_impl.cc +0 -163
  460. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_updater.cc +0 -328
  461. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_updater.h +0 -226
  462. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_updater_debug.cc +0 -43
  463. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_util.cc +0 -214
  464. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_util.h +0 -139
  465. package/vendor/librocksdb/vendor/rocksdb/monitoring/thread_status_util_debug.cc +0 -60
  466. package/vendor/librocksdb/vendor/rocksdb/options/cf_options.cc +0 -1218
  467. package/vendor/librocksdb/vendor/rocksdb/options/cf_options.h +0 -352
  468. package/vendor/librocksdb/vendor/rocksdb/options/configurable.cc +0 -720
  469. package/vendor/librocksdb/vendor/rocksdb/options/configurable_helper.h +0 -185
  470. package/vendor/librocksdb/vendor/rocksdb/options/configurable_test.h +0 -116
  471. package/vendor/librocksdb/vendor/rocksdb/options/customizable.cc +0 -133
  472. package/vendor/librocksdb/vendor/rocksdb/options/db_options.cc +0 -1113
  473. package/vendor/librocksdb/vendor/rocksdb/options/db_options.h +0 -160
  474. package/vendor/librocksdb/vendor/rocksdb/options/offpeak_time_info.cc +0 -59
  475. package/vendor/librocksdb/vendor/rocksdb/options/offpeak_time_info.h +0 -37
  476. package/vendor/librocksdb/vendor/rocksdb/options/options.cc +0 -717
  477. package/vendor/librocksdb/vendor/rocksdb/options/options_helper.cc +0 -1438
  478. package/vendor/librocksdb/vendor/rocksdb/options/options_helper.h +0 -115
  479. package/vendor/librocksdb/vendor/rocksdb/options/options_parser.cc +0 -745
  480. package/vendor/librocksdb/vendor/rocksdb/options/options_parser.h +0 -151
  481. package/vendor/librocksdb/vendor/rocksdb/port/jemalloc_helper.h +0 -107
  482. package/vendor/librocksdb/vendor/rocksdb/port/lang.h +0 -97
  483. package/vendor/librocksdb/vendor/rocksdb/port/likely.h +0 -18
  484. package/vendor/librocksdb/vendor/rocksdb/port/malloc.h +0 -17
  485. package/vendor/librocksdb/vendor/rocksdb/port/mmap.cc +0 -98
  486. package/vendor/librocksdb/vendor/rocksdb/port/mmap.h +0 -90
  487. package/vendor/librocksdb/vendor/rocksdb/port/port.h +0 -21
  488. package/vendor/librocksdb/vendor/rocksdb/port/port_dirent.h +0 -44
  489. package/vendor/librocksdb/vendor/rocksdb/port/port_example.h +0 -101
  490. package/vendor/librocksdb/vendor/rocksdb/port/port_posix.cc +0 -300
  491. package/vendor/librocksdb/vendor/rocksdb/port/port_posix.h +0 -246
  492. package/vendor/librocksdb/vendor/rocksdb/port/stack_trace.cc +0 -418
  493. package/vendor/librocksdb/vendor/rocksdb/port/stack_trace.h +0 -31
  494. package/vendor/librocksdb/vendor/rocksdb/port/sys_time.h +0 -63
  495. package/vendor/librocksdb/vendor/rocksdb/port/util_logger.h +0 -18
  496. package/vendor/librocksdb/vendor/rocksdb/port/win/env_default.cc +0 -45
  497. package/vendor/librocksdb/vendor/rocksdb/port/win/env_win.cc +0 -1436
  498. package/vendor/librocksdb/vendor/rocksdb/port/win/env_win.h +0 -305
  499. package/vendor/librocksdb/vendor/rocksdb/port/win/io_win.cc +0 -1101
  500. package/vendor/librocksdb/vendor/rocksdb/port/win/io_win.h +0 -504
  501. package/vendor/librocksdb/vendor/rocksdb/port/win/port_win.cc +0 -305
  502. package/vendor/librocksdb/vendor/rocksdb/port/win/port_win.h +0 -382
  503. package/vendor/librocksdb/vendor/rocksdb/port/win/win_jemalloc.cc +0 -80
  504. package/vendor/librocksdb/vendor/rocksdb/port/win/win_logger.cc +0 -192
  505. package/vendor/librocksdb/vendor/rocksdb/port/win/win_logger.h +0 -64
  506. package/vendor/librocksdb/vendor/rocksdb/port/win/win_thread.cc +0 -170
  507. package/vendor/librocksdb/vendor/rocksdb/port/win/win_thread.h +0 -117
  508. package/vendor/librocksdb/vendor/rocksdb/port/win/xpress_win.cc +0 -210
  509. package/vendor/librocksdb/vendor/rocksdb/port/win/xpress_win.h +0 -26
  510. package/vendor/librocksdb/vendor/rocksdb/port/xpress.h +0 -17
  511. package/vendor/librocksdb/vendor/rocksdb/rocksdb.pc.in +0 -10
  512. package/vendor/librocksdb/vendor/rocksdb/table/adaptive/adaptive_table_factory.cc +0 -119
  513. package/vendor/librocksdb/vendor/rocksdb/table/adaptive/adaptive_table_factory.h +0 -56
  514. package/vendor/librocksdb/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +0 -73
  515. package/vendor/librocksdb/vendor/rocksdb/table/block_based/binary_search_index_reader.h +0 -48
  516. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block.cc +0 -1341
  517. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block.h +0 -969
  518. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_builder.cc +0 -2148
  519. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_builder.h +0 -208
  520. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_factory.cc +0 -980
  521. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_factory.h +0 -102
  522. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +0 -893
  523. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.h +0 -445
  524. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.cc +0 -3296
  525. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.h +0 -785
  526. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +0 -205
  527. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +0 -819
  528. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_builder.cc +0 -266
  529. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_builder.h +0 -128
  530. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_cache.cc +0 -108
  531. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_cache.h +0 -190
  532. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefetcher.cc +0 -158
  533. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefetcher.h +0 -74
  534. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefix_index.cc +0 -226
  535. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefix_index.h +0 -70
  536. package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_type.h +0 -34
  537. package/vendor/librocksdb/vendor/rocksdb/table/block_based/cachable_entry.h +0 -249
  538. package/vendor/librocksdb/vendor/rocksdb/table/block_based/data_block_footer.cc +0 -59
  539. package/vendor/librocksdb/vendor/rocksdb/table/block_based/data_block_footer.h +0 -25
  540. package/vendor/librocksdb/vendor/rocksdb/table/block_based/data_block_hash_index.cc +0 -94
  541. package/vendor/librocksdb/vendor/rocksdb/table/block_based/data_block_hash_index.h +0 -137
  542. package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block.h +0 -189
  543. package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +0 -169
  544. package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.h +0 -79
  545. package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_policy.cc +0 -1989
  546. package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_policy_internal.h +0 -341
  547. package/vendor/librocksdb/vendor/rocksdb/table/block_based/flush_block_policy.cc +0 -132
  548. package/vendor/librocksdb/vendor/rocksdb/table/block_based/flush_block_policy_impl.h +0 -40
  549. package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.cc +0 -297
  550. package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.h +0 -142
  551. package/vendor/librocksdb/vendor/rocksdb/table/block_based/hash_index_reader.cc +0 -146
  552. package/vendor/librocksdb/vendor/rocksdb/table/block_based/hash_index_reader.h +0 -49
  553. package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.cc +0 -305
  554. package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.h +0 -534
  555. package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.cc +0 -62
  556. package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.h +0 -94
  557. package/vendor/librocksdb/vendor/rocksdb/table/block_based/mock_block_based_table.h +0 -62
  558. package/vendor/librocksdb/vendor/rocksdb/table/block_based/parsed_full_filter_block.cc +0 -23
  559. package/vendor/librocksdb/vendor/rocksdb/table/block_based/parsed_full_filter_block.h +0 -47
  560. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +0 -610
  561. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.h +0 -188
  562. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_iterator.cc +0 -164
  563. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_iterator.h +0 -160
  564. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +0 -264
  565. package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.h +0 -58
  566. package/vendor/librocksdb/vendor/rocksdb/table/block_based/reader_common.cc +0 -64
  567. package/vendor/librocksdb/vendor/rocksdb/table/block_based/reader_common.h +0 -36
  568. package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +0 -118
  569. package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +0 -60
  570. package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.cc +0 -458
  571. package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.h +0 -168
  572. package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.cc +0 -370
  573. package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.h +0 -45
  574. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.cc +0 -555
  575. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.h +0 -136
  576. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.cc +0 -100
  577. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.h +0 -80
  578. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.cc +0 -416
  579. package/vendor/librocksdb/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.h +0 -100
  580. package/vendor/librocksdb/vendor/rocksdb/table/format.cc +0 -708
  581. package/vendor/librocksdb/vendor/rocksdb/table/format.h +0 -439
  582. package/vendor/librocksdb/vendor/rocksdb/table/get_context.cc +0 -622
  583. package/vendor/librocksdb/vendor/rocksdb/table/get_context.h +0 -259
  584. package/vendor/librocksdb/vendor/rocksdb/table/internal_iterator.h +0 -242
  585. package/vendor/librocksdb/vendor/rocksdb/table/iter_heap.h +0 -44
  586. package/vendor/librocksdb/vendor/rocksdb/table/iterator.cc +0 -134
  587. package/vendor/librocksdb/vendor/rocksdb/table/iterator_wrapper.h +0 -225
  588. package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.cc +0 -1755
  589. package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.h +0 -100
  590. package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.cc +0 -590
  591. package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.h +0 -181
  592. package/vendor/librocksdb/vendor/rocksdb/table/mock_table.cc +0 -355
  593. package/vendor/librocksdb/vendor/rocksdb/table/mock_table.h +0 -92
  594. package/vendor/librocksdb/vendor/rocksdb/table/multiget_context.h +0 -405
  595. package/vendor/librocksdb/vendor/rocksdb/table/persistent_cache_helper.cc +0 -110
  596. package/vendor/librocksdb/vendor/rocksdb/table/persistent_cache_helper.h +0 -46
  597. package/vendor/librocksdb/vendor/rocksdb/table/persistent_cache_options.h +0 -34
  598. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_bloom.cc +0 -78
  599. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_bloom.h +0 -132
  600. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_builder.cc +0 -348
  601. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_builder.h +0 -151
  602. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_factory.cc +0 -295
  603. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_factory.h +0 -180
  604. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_index.cc +0 -211
  605. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_index.h +0 -246
  606. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_key_coding.cc +0 -508
  607. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_key_coding.h +0 -199
  608. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_reader.cc +0 -778
  609. package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_reader.h +0 -243
  610. package/vendor/librocksdb/vendor/rocksdb/table/sst_file_dumper.cc +0 -601
  611. package/vendor/librocksdb/vendor/rocksdb/table/sst_file_dumper.h +0 -104
  612. package/vendor/librocksdb/vendor/rocksdb/table/sst_file_reader.cc +0 -166
  613. package/vendor/librocksdb/vendor/rocksdb/table/sst_file_writer.cc +0 -536
  614. package/vendor/librocksdb/vendor/rocksdb/table/sst_file_writer_collectors.h +0 -97
  615. package/vendor/librocksdb/vendor/rocksdb/table/table_builder.h +0 -239
  616. package/vendor/librocksdb/vendor/rocksdb/table/table_factory.cc +0 -52
  617. package/vendor/librocksdb/vendor/rocksdb/table/table_iterator.h +0 -69
  618. package/vendor/librocksdb/vendor/rocksdb/table/table_properties.cc +0 -357
  619. package/vendor/librocksdb/vendor/rocksdb/table/table_properties_internal.h +0 -14
  620. package/vendor/librocksdb/vendor/rocksdb/table/table_reader.h +0 -202
  621. package/vendor/librocksdb/vendor/rocksdb/table/table_reader_bench.cc +0 -341
  622. package/vendor/librocksdb/vendor/rocksdb/table/two_level_iterator.cc +0 -222
  623. package/vendor/librocksdb/vendor/rocksdb/table/two_level_iterator.h +0 -43
  624. package/vendor/librocksdb/vendor/rocksdb/table/unique_id.cc +0 -223
  625. package/vendor/librocksdb/vendor/rocksdb/table/unique_id_impl.h +0 -93
  626. package/vendor/librocksdb/vendor/rocksdb/test_util/mock_time_env.cc +0 -38
  627. package/vendor/librocksdb/vendor/rocksdb/test_util/mock_time_env.h +0 -109
  628. package/vendor/librocksdb/vendor/rocksdb/test_util/secondary_cache_test_util.cc +0 -93
  629. package/vendor/librocksdb/vendor/rocksdb/test_util/secondary_cache_test_util.h +0 -131
  630. package/vendor/librocksdb/vendor/rocksdb/test_util/sync_point.cc +0 -82
  631. package/vendor/librocksdb/vendor/rocksdb/test_util/sync_point.h +0 -182
  632. package/vendor/librocksdb/vendor/rocksdb/test_util/sync_point_impl.cc +0 -152
  633. package/vendor/librocksdb/vendor/rocksdb/test_util/sync_point_impl.h +0 -96
  634. package/vendor/librocksdb/vendor/rocksdb/test_util/testharness.cc +0 -105
  635. package/vendor/librocksdb/vendor/rocksdb/test_util/testharness.h +0 -124
  636. package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.cc +0 -776
  637. package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.h +0 -908
  638. package/vendor/librocksdb/vendor/rocksdb/test_util/transaction_test_util.cc +0 -400
  639. package/vendor/librocksdb/vendor/rocksdb/test_util/transaction_test_util.h +0 -147
  640. package/vendor/librocksdb/vendor/rocksdb/tools/CMakeLists.txt +0 -30
  641. package/vendor/librocksdb/vendor/rocksdb/tools/blob_dump.cc +0 -103
  642. package/vendor/librocksdb/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +0 -2331
  643. package/vendor/librocksdb/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.h +0 -398
  644. package/vendor/librocksdb/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +0 -17
  645. package/vendor/librocksdb/vendor/rocksdb/tools/db_bench.cc +0 -21
  646. package/vendor/librocksdb/vendor/rocksdb/tools/db_bench_tool.cc +0 -8743
  647. package/vendor/librocksdb/vendor/rocksdb/tools/db_repl_stress.cc +0 -132
  648. package/vendor/librocksdb/vendor/rocksdb/tools/dump/db_dump_tool.cc +0 -264
  649. package/vendor/librocksdb/vendor/rocksdb/tools/dump/rocksdb_dump.cc +0 -60
  650. package/vendor/librocksdb/vendor/rocksdb/tools/dump/rocksdb_undump.cc +0 -59
  651. package/vendor/librocksdb/vendor/rocksdb/tools/io_tracer_parser.cc +0 -17
  652. package/vendor/librocksdb/vendor/rocksdb/tools/io_tracer_parser_tool.cc +0 -142
  653. package/vendor/librocksdb/vendor/rocksdb/tools/io_tracer_parser_tool.h +0 -38
  654. package/vendor/librocksdb/vendor/rocksdb/tools/ldb.cc +0 -13
  655. package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd.cc +0 -5044
  656. package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd_impl.h +0 -814
  657. package/vendor/librocksdb/vendor/rocksdb/tools/ldb_tool.cc +0 -192
  658. package/vendor/librocksdb/vendor/rocksdb/tools/simulated_hybrid_file_system.cc +0 -244
  659. package/vendor/librocksdb/vendor/rocksdb/tools/simulated_hybrid_file_system.h +0 -124
  660. package/vendor/librocksdb/vendor/rocksdb/tools/sst_dump.cc +0 -12
  661. package/vendor/librocksdb/vendor/rocksdb/tools/sst_dump_tool.cc +0 -588
  662. package/vendor/librocksdb/vendor/rocksdb/tools/trace_analyzer.cc +0 -17
  663. package/vendor/librocksdb/vendor/rocksdb/tools/trace_analyzer_tool.cc +0 -1935
  664. package/vendor/librocksdb/vendor/rocksdb/tools/trace_analyzer_tool.h +0 -329
  665. package/vendor/librocksdb/vendor/rocksdb/tools/write_stress.cc +0 -305
  666. package/vendor/librocksdb/vendor/rocksdb/trace_replay/block_cache_tracer.cc +0 -509
  667. package/vendor/librocksdb/vendor/rocksdb/trace_replay/block_cache_tracer.h +0 -239
  668. package/vendor/librocksdb/vendor/rocksdb/trace_replay/io_tracer.cc +0 -303
  669. package/vendor/librocksdb/vendor/rocksdb/trace_replay/io_tracer.h +0 -185
  670. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_record.cc +0 -206
  671. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_record_handler.cc +0 -190
  672. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_record_handler.h +0 -46
  673. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_record_result.cc +0 -146
  674. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_replay.cc +0 -632
  675. package/vendor/librocksdb/vendor/rocksdb/trace_replay/trace_replay.h +0 -184
  676. package/vendor/librocksdb/vendor/rocksdb/util/aligned_buffer.h +0 -235
  677. package/vendor/librocksdb/vendor/rocksdb/util/aligned_storage.h +0 -24
  678. package/vendor/librocksdb/vendor/rocksdb/util/async_file_reader.cc +0 -84
  679. package/vendor/librocksdb/vendor/rocksdb/util/async_file_reader.h +0 -144
  680. package/vendor/librocksdb/vendor/rocksdb/util/atomic.h +0 -111
  681. package/vendor/librocksdb/vendor/rocksdb/util/autovector.h +0 -397
  682. package/vendor/librocksdb/vendor/rocksdb/util/bloom_impl.h +0 -489
  683. package/vendor/librocksdb/vendor/rocksdb/util/build_version.cc.in +0 -79
  684. package/vendor/librocksdb/vendor/rocksdb/util/cast_util.h +0 -88
  685. package/vendor/librocksdb/vendor/rocksdb/util/channel.h +0 -69
  686. package/vendor/librocksdb/vendor/rocksdb/util/cleanable.cc +0 -181
  687. package/vendor/librocksdb/vendor/rocksdb/util/coding.cc +0 -90
  688. package/vendor/librocksdb/vendor/rocksdb/util/coding.h +0 -385
  689. package/vendor/librocksdb/vendor/rocksdb/util/coding_lean.h +0 -101
  690. package/vendor/librocksdb/vendor/rocksdb/util/compaction_job_stats_impl.cc +0 -94
  691. package/vendor/librocksdb/vendor/rocksdb/util/comparator.cc +0 -443
  692. package/vendor/librocksdb/vendor/rocksdb/util/compression.cc +0 -122
  693. package/vendor/librocksdb/vendor/rocksdb/util/compression.h +0 -1879
  694. package/vendor/librocksdb/vendor/rocksdb/util/compression_context_cache.cc +0 -106
  695. package/vendor/librocksdb/vendor/rocksdb/util/compression_context_cache.h +0 -47
  696. package/vendor/librocksdb/vendor/rocksdb/util/concurrent_task_limiter_impl.cc +0 -64
  697. package/vendor/librocksdb/vendor/rocksdb/util/concurrent_task_limiter_impl.h +0 -67
  698. package/vendor/librocksdb/vendor/rocksdb/util/core_local.h +0 -85
  699. package/vendor/librocksdb/vendor/rocksdb/util/coro_utils.h +0 -112
  700. package/vendor/librocksdb/vendor/rocksdb/util/crc32c.cc +0 -1295
  701. package/vendor/librocksdb/vendor/rocksdb/util/crc32c.h +0 -56
  702. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_arm64.cc +0 -213
  703. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_arm64.h +0 -51
  704. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_ppc.c +0 -94
  705. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_ppc.h +0 -21
  706. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_ppc_asm.S +0 -756
  707. package/vendor/librocksdb/vendor/rocksdb/util/crc32c_ppc_constants.h +0 -900
  708. package/vendor/librocksdb/vendor/rocksdb/util/data_structure.cc +0 -16
  709. package/vendor/librocksdb/vendor/rocksdb/util/defer.h +0 -82
  710. package/vendor/librocksdb/vendor/rocksdb/util/distributed_mutex.h +0 -50
  711. package/vendor/librocksdb/vendor/rocksdb/util/duplicate_detector.h +0 -69
  712. package/vendor/librocksdb/vendor/rocksdb/util/dynamic_bloom.cc +0 -70
  713. package/vendor/librocksdb/vendor/rocksdb/util/dynamic_bloom.h +0 -214
  714. package/vendor/librocksdb/vendor/rocksdb/util/fastrange.h +0 -114
  715. package/vendor/librocksdb/vendor/rocksdb/util/file_checksum_helper.cc +0 -170
  716. package/vendor/librocksdb/vendor/rocksdb/util/file_checksum_helper.h +0 -101
  717. package/vendor/librocksdb/vendor/rocksdb/util/filter_bench.cc +0 -840
  718. package/vendor/librocksdb/vendor/rocksdb/util/gflags_compat.h +0 -29
  719. package/vendor/librocksdb/vendor/rocksdb/util/hash.cc +0 -201
  720. package/vendor/librocksdb/vendor/rocksdb/util/hash.h +0 -141
  721. package/vendor/librocksdb/vendor/rocksdb/util/hash128.h +0 -26
  722. package/vendor/librocksdb/vendor/rocksdb/util/hash_containers.h +0 -51
  723. package/vendor/librocksdb/vendor/rocksdb/util/hash_map.h +0 -67
  724. package/vendor/librocksdb/vendor/rocksdb/util/heap.h +0 -174
  725. package/vendor/librocksdb/vendor/rocksdb/util/kv_map.h +0 -33
  726. package/vendor/librocksdb/vendor/rocksdb/util/log_write_bench.cc +0 -88
  727. package/vendor/librocksdb/vendor/rocksdb/util/math.h +0 -351
  728. package/vendor/librocksdb/vendor/rocksdb/util/math128.h +0 -338
  729. package/vendor/librocksdb/vendor/rocksdb/util/murmurhash.cc +0 -196
  730. package/vendor/librocksdb/vendor/rocksdb/util/murmurhash.h +0 -43
  731. package/vendor/librocksdb/vendor/rocksdb/util/mutexlock.h +0 -189
  732. package/vendor/librocksdb/vendor/rocksdb/util/overload.h +0 -23
  733. package/vendor/librocksdb/vendor/rocksdb/util/ppc-opcode.h +0 -27
  734. package/vendor/librocksdb/vendor/rocksdb/util/random.cc +0 -63
  735. package/vendor/librocksdb/vendor/rocksdb/util/random.h +0 -190
  736. package/vendor/librocksdb/vendor/rocksdb/util/rate_limiter.cc +0 -391
  737. package/vendor/librocksdb/vendor/rocksdb/util/rate_limiter_impl.h +0 -156
  738. package/vendor/librocksdb/vendor/rocksdb/util/repeatable_thread.h +0 -149
  739. package/vendor/librocksdb/vendor/rocksdb/util/ribbon_alg.h +0 -1225
  740. package/vendor/librocksdb/vendor/rocksdb/util/ribbon_config.cc +0 -498
  741. package/vendor/librocksdb/vendor/rocksdb/util/ribbon_config.h +0 -182
  742. package/vendor/librocksdb/vendor/rocksdb/util/ribbon_impl.h +0 -1137
  743. package/vendor/librocksdb/vendor/rocksdb/util/set_comparator.h +0 -24
  744. package/vendor/librocksdb/vendor/rocksdb/util/single_thread_executor.h +0 -57
  745. package/vendor/librocksdb/vendor/rocksdb/util/slice.cc +0 -366
  746. package/vendor/librocksdb/vendor/rocksdb/util/status.cc +0 -163
  747. package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.cc +0 -62
  748. package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.h +0 -41
  749. package/vendor/librocksdb/vendor/rocksdb/util/stop_watch.h +0 -136
  750. package/vendor/librocksdb/vendor/rocksdb/util/string_util.cc +0 -554
  751. package/vendor/librocksdb/vendor/rocksdb/util/string_util.h +0 -185
  752. package/vendor/librocksdb/vendor/rocksdb/util/thread_guard.h +0 -41
  753. package/vendor/librocksdb/vendor/rocksdb/util/thread_local.cc +0 -521
  754. package/vendor/librocksdb/vendor/rocksdb/util/thread_local.h +0 -100
  755. package/vendor/librocksdb/vendor/rocksdb/util/thread_operation.h +0 -122
  756. package/vendor/librocksdb/vendor/rocksdb/util/threadpool_imp.cc +0 -550
  757. package/vendor/librocksdb/vendor/rocksdb/util/threadpool_imp.h +0 -120
  758. package/vendor/librocksdb/vendor/rocksdb/util/timer.h +0 -340
  759. package/vendor/librocksdb/vendor/rocksdb/util/timer_queue.h +0 -231
  760. package/vendor/librocksdb/vendor/rocksdb/util/udt_util.cc +0 -418
  761. package/vendor/librocksdb/vendor/rocksdb/util/udt_util.h +0 -275
  762. package/vendor/librocksdb/vendor/rocksdb/util/user_comparator_wrapper.h +0 -64
  763. package/vendor/librocksdb/vendor/rocksdb/util/vector_iterator.h +0 -114
  764. package/vendor/librocksdb/vendor/rocksdb/util/work_queue.h +0 -150
  765. package/vendor/librocksdb/vendor/rocksdb/util/write_batch_util.cc +0 -25
  766. package/vendor/librocksdb/vendor/rocksdb/util/write_batch_util.h +0 -90
  767. package/vendor/librocksdb/vendor/rocksdb/util/xxhash.cc +0 -48
  768. package/vendor/librocksdb/vendor/rocksdb/util/xxhash.h +0 -6364
  769. package/vendor/librocksdb/vendor/rocksdb/util/xxph3.h +0 -1760
  770. package/vendor/librocksdb/vendor/rocksdb/utilities/agg_merge/agg_merge.cc +0 -237
  771. package/vendor/librocksdb/vendor/rocksdb/utilities/agg_merge/agg_merge_impl.h +0 -49
  772. package/vendor/librocksdb/vendor/rocksdb/utilities/agg_merge/test_agg_merge.cc +0 -103
  773. package/vendor/librocksdb/vendor/rocksdb/utilities/agg_merge/test_agg_merge.h +0 -47
  774. package/vendor/librocksdb/vendor/rocksdb/utilities/backup/backup_engine.cc +0 -3357
  775. package/vendor/librocksdb/vendor/rocksdb/utilities/backup/backup_engine_impl.h +0 -34
  776. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.cc +0 -490
  777. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.h +0 -202
  778. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db.cc +0 -109
  779. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db.h +0 -231
  780. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_gc_stats.h +0 -54
  781. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl.cc +0 -2269
  782. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +0 -514
  783. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +0 -127
  784. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_iterator.h +0 -148
  785. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_listener.h +0 -71
  786. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_dump_tool.cc +0 -276
  787. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_dump_tool.h +0 -56
  788. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_file.cc +0 -311
  789. package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_file.h +0 -245
  790. package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load.cc +0 -67
  791. package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.cc +0 -389
  792. package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.h +0 -368
  793. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc +0 -104
  794. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.h +0 -57
  795. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/cassandra_options.h +0 -41
  796. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/format.cc +0 -365
  797. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/format.h +0 -183
  798. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/merge_operator.cc +0 -76
  799. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/merge_operator.h +0 -43
  800. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/serialize.h +0 -81
  801. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/test_utils.cc +0 -67
  802. package/vendor/librocksdb/vendor/rocksdb/utilities/cassandra/test_utils.h +0 -42
  803. package/vendor/librocksdb/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.cc +0 -472
  804. package/vendor/librocksdb/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.h +0 -64
  805. package/vendor/librocksdb/vendor/rocksdb/utilities/compaction_filters/layered_compaction_filter_base.h +0 -41
  806. package/vendor/librocksdb/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +0 -24
  807. package/vendor/librocksdb/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +0 -26
  808. package/vendor/librocksdb/vendor/rocksdb/utilities/compaction_filters.cc +0 -52
  809. package/vendor/librocksdb/vendor/rocksdb/utilities/convenience/info_log_finder.cc +0 -26
  810. package/vendor/librocksdb/vendor/rocksdb/utilities/counted_fs.cc +0 -379
  811. package/vendor/librocksdb/vendor/rocksdb/utilities/counted_fs.h +0 -158
  812. package/vendor/librocksdb/vendor/rocksdb/utilities/debug.cc +0 -134
  813. package/vendor/librocksdb/vendor/rocksdb/utilities/env_mirror.cc +0 -280
  814. package/vendor/librocksdb/vendor/rocksdb/utilities/env_timed.cc +0 -181
  815. package/vendor/librocksdb/vendor/rocksdb/utilities/env_timed.h +0 -95
  816. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_env.cc +0 -555
  817. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_env.h +0 -252
  818. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.cc +0 -1507
  819. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.h +0 -760
  820. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_secondary_cache.cc +0 -138
  821. package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_secondary_cache.h +0 -115
  822. package/vendor/librocksdb/vendor/rocksdb/utilities/leveldb_options/leveldb_options.cc +0 -57
  823. package/vendor/librocksdb/vendor/rocksdb/utilities/memory/memory_util.cc +0 -50
  824. package/vendor/librocksdb/vendor/rocksdb/utilities/memory_allocators.h +0 -103
  825. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/bytesxor.cc +0 -57
  826. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/bytesxor.h +0 -39
  827. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/max.cc +0 -64
  828. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/max_operator.h +0 -35
  829. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/put.cc +0 -74
  830. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/put_operator.h +0 -56
  831. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/sortlist.cc +0 -97
  832. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/sortlist.h +0 -42
  833. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.cc +0 -76
  834. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.h +0 -32
  835. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.cc +0 -129
  836. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.h +0 -51
  837. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/uint64add.cc +0 -56
  838. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators/uint64add.h +0 -35
  839. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators.cc +0 -115
  840. package/vendor/librocksdb/vendor/rocksdb/utilities/merge_operators.h +0 -36
  841. package/vendor/librocksdb/vendor/rocksdb/utilities/object_registry.cc +0 -381
  842. package/vendor/librocksdb/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +0 -169
  843. package/vendor/librocksdb/vendor/rocksdb/utilities/options/options_util.cc +0 -117
  844. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.cc +0 -420
  845. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.h +0 -154
  846. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc +0 -607
  847. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.h +0 -291
  848. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file_buffer.h +0 -127
  849. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc +0 -84
  850. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.h +0 -122
  851. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/hash_table.h +0 -237
  852. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/hash_table_bench.cc +0 -310
  853. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/hash_table_evictable.h +0 -166
  854. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/lrulist.h +0 -172
  855. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/persistent_cache_bench.cc +0 -355
  856. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.h +0 -284
  857. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc +0 -165
  858. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.h +0 -340
  859. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/persistent_cache_util.h +0 -67
  860. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc +0 -138
  861. package/vendor/librocksdb/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.h +0 -139
  862. package/vendor/librocksdb/vendor/rocksdb/utilities/simulator_cache/cache_simulator.cc +0 -287
  863. package/vendor/librocksdb/vendor/rocksdb/utilities/simulator_cache/cache_simulator.h +0 -231
  864. package/vendor/librocksdb/vendor/rocksdb/utilities/simulator_cache/sim_cache.cc +0 -375
  865. package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.cc +0 -144
  866. package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.h +0 -45
  867. package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +0 -233
  868. package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.h +0 -65
  869. package/vendor/librocksdb/vendor/rocksdb/utilities/trace/file_trace_reader_writer.cc +0 -132
  870. package/vendor/librocksdb/vendor/rocksdb/utilities/trace/file_trace_reader_writer.h +0 -48
  871. package/vendor/librocksdb/vendor/rocksdb/utilities/trace/replayer_impl.cc +0 -313
  872. package/vendor/librocksdb/vendor/rocksdb/utilities/trace/replayer_impl.h +0 -84
  873. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/lock_manager.cc +0 -27
  874. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/lock_manager.h +0 -80
  875. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/lock_tracker.h +0 -207
  876. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +0 -718
  877. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.h +0 -222
  878. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.h +0 -324
  879. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +0 -255
  880. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.h +0 -97
  881. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_lock_manager.h +0 -34
  882. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/db.h +0 -81
  883. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/comparator.h +0 -138
  884. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/ft-status.h +0 -102
  885. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +0 -137
  886. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.h +0 -174
  887. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +0 -220
  888. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.h +0 -141
  889. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +0 -525
  890. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +0 -255
  891. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +0 -1021
  892. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h +0 -580
  893. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +0 -525
  894. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +0 -263
  895. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.h +0 -178
  896. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +0 -518
  897. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.h +0 -302
  898. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +0 -118
  899. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.h +0 -92
  900. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +0 -211
  901. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.h +0 -124
  902. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/memory.h +0 -215
  903. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_assert_subst.h +0 -43
  904. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h +0 -130
  905. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_external_pthread.h +0 -87
  906. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_instrumentation.h +0 -286
  907. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_portability.h +0 -87
  908. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +0 -520
  909. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_race_tools.h +0 -179
  910. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +0 -197
  911. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/txn_subst.h +0 -31
  912. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +0 -139
  913. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +0 -165
  914. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.h +0 -98
  915. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +0 -144
  916. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +0 -199
  917. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.h +0 -141
  918. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt.h +0 -794
  919. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt_impl.h +0 -1295
  920. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/partitioned_counter.h +0 -165
  921. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/status.h +0 -76
  922. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +0 -501
  923. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +0 -135
  924. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +0 -156
  925. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h +0 -146
  926. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/optimistic_transaction.cc +0 -208
  927. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/optimistic_transaction.h +0 -99
  928. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc +0 -111
  929. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.h +0 -110
  930. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +0 -1278
  931. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +0 -345
  932. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +0 -845
  933. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +0 -345
  934. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/snapshot_checker.cc +0 -37
  935. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.cc +0 -912
  936. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.h +0 -455
  937. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc +0 -133
  938. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.h +0 -24
  939. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_test.h +0 -589
  940. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.cc +0 -207
  941. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.h +0 -86
  942. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +0 -548
  943. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn.h +0 -118
  944. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +0 -1100
  945. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +0 -1149
  946. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +0 -1089
  947. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn.h +0 -333
  948. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +0 -486
  949. package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.h +0 -105
  950. package/vendor/librocksdb/vendor/rocksdb/utilities/ttl/db_ttl_impl.cc +0 -638
  951. package/vendor/librocksdb/vendor/rocksdb/utilities/ttl/db_ttl_impl.h +0 -239
  952. package/vendor/librocksdb/vendor/rocksdb/utilities/types_util.cc +0 -88
  953. package/vendor/librocksdb/vendor/rocksdb/utilities/wal_filter.cc +0 -22
  954. package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +0 -1134
  955. package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +0 -934
  956. package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +0 -468
@@ -1,3296 +0,0 @@
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
- #include "table/block_based/block_based_table_reader.h"
10
-
11
- #include <algorithm>
12
- #include <array>
13
- #include <atomic>
14
- #include <cstdint>
15
- #include <limits>
16
- #include <memory>
17
- #include <string>
18
- #include <unordered_set>
19
- #include <utility>
20
- #include <vector>
21
-
22
- #include "block_cache.h"
23
- #include "cache/cache_entry_roles.h"
24
- #include "cache/cache_key.h"
25
- #include "db/compaction/compaction_picker.h"
26
- #include "db/dbformat.h"
27
- #include "db/pinned_iterators_manager.h"
28
- #include "file/file_prefetch_buffer.h"
29
- #include "file/file_util.h"
30
- #include "file/random_access_file_reader.h"
31
- #include "logging/logging.h"
32
- #include "monitoring/perf_context_imp.h"
33
- #include "parsed_full_filter_block.h"
34
- #include "port/lang.h"
35
- #include "rocksdb/cache.h"
36
- #include "rocksdb/comparator.h"
37
- #include "rocksdb/convenience.h"
38
- #include "rocksdb/env.h"
39
- #include "rocksdb/file_system.h"
40
- #include "rocksdb/filter_policy.h"
41
- #include "rocksdb/iterator.h"
42
- #include "rocksdb/options.h"
43
- #include "rocksdb/snapshot.h"
44
- #include "rocksdb/statistics.h"
45
- #include "rocksdb/system_clock.h"
46
- #include "rocksdb/table.h"
47
- #include "rocksdb/table_properties.h"
48
- #include "rocksdb/trace_record.h"
49
- #include "table/block_based/binary_search_index_reader.h"
50
- #include "table/block_based/block.h"
51
- #include "table/block_based/block_based_table_factory.h"
52
- #include "table/block_based/block_based_table_iterator.h"
53
- #include "table/block_based/block_prefix_index.h"
54
- #include "table/block_based/block_type.h"
55
- #include "table/block_based/filter_block.h"
56
- #include "table/block_based/filter_policy_internal.h"
57
- #include "table/block_based/full_filter_block.h"
58
- #include "table/block_based/hash_index_reader.h"
59
- #include "table/block_based/partitioned_filter_block.h"
60
- #include "table/block_based/partitioned_index_reader.h"
61
- #include "table/block_fetcher.h"
62
- #include "table/format.h"
63
- #include "table/get_context.h"
64
- #include "table/internal_iterator.h"
65
- #include "table/meta_blocks.h"
66
- #include "table/multiget_context.h"
67
- #include "table/persistent_cache_helper.h"
68
- #include "table/persistent_cache_options.h"
69
- #include "table/sst_file_writer_collectors.h"
70
- #include "table/two_level_iterator.h"
71
- #include "test_util/sync_point.h"
72
- #include "util/coding.h"
73
- #include "util/crc32c.h"
74
- #include "util/stop_watch.h"
75
- #include "util/string_util.h"
76
-
77
- namespace ROCKSDB_NAMESPACE {
78
- namespace {
79
-
80
- CacheAllocationPtr CopyBufferToHeap(MemoryAllocator* allocator, Slice& buf) {
81
- CacheAllocationPtr heap_buf;
82
- heap_buf = AllocateBlock(buf.size(), allocator);
83
- memcpy(heap_buf.get(), buf.data(), buf.size());
84
- return heap_buf;
85
- }
86
- } // namespace
87
-
88
- // Explicitly instantiate templates for each "blocklike" type we use (and
89
- // before implicit specialization).
90
- // This makes it possible to keep the template definitions in the .cc file.
91
- #define INSTANTIATE_BLOCKLIKE_TEMPLATES(T) \
92
- template Status BlockBasedTable::RetrieveBlock<T>( \
93
- FilePrefetchBuffer * prefetch_buffer, const ReadOptions& ro, \
94
- const BlockHandle& handle, const UncompressionDict& uncompression_dict, \
95
- CachableEntry<T>* out_parsed_block, GetContext* get_context, \
96
- BlockCacheLookupContext* lookup_context, bool for_compaction, \
97
- bool use_cache, bool async_read, bool use_block_cache_for_lookup) const; \
98
- template Status BlockBasedTable::MaybeReadBlockAndLoadToCache<T>( \
99
- FilePrefetchBuffer * prefetch_buffer, const ReadOptions& ro, \
100
- const BlockHandle& handle, const UncompressionDict& uncompression_dict, \
101
- bool for_compaction, CachableEntry<T>* block_entry, \
102
- GetContext* get_context, BlockCacheLookupContext* lookup_context, \
103
- BlockContents* contents, bool async_read, \
104
- bool use_block_cache_for_lookup) const; \
105
- template Status BlockBasedTable::LookupAndPinBlocksInCache<T>( \
106
- const ReadOptions& ro, const BlockHandle& handle, \
107
- CachableEntry<T>* out_parsed_block) const;
108
-
109
- INSTANTIATE_BLOCKLIKE_TEMPLATES(ParsedFullFilterBlock);
110
- INSTANTIATE_BLOCKLIKE_TEMPLATES(UncompressionDict);
111
- INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kData);
112
- INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kIndex);
113
- INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kFilterPartitionIndex);
114
- INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kRangeDeletion);
115
- INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kMetaIndex);
116
-
117
- } // namespace ROCKSDB_NAMESPACE
118
-
119
- // Generate the regular and coroutine versions of some methods by
120
- // including block_based_table_reader_sync_and_async.h twice
121
- // Macros in the header will expand differently based on whether
122
- // WITH_COROUTINES or WITHOUT_COROUTINES is defined
123
- // clang-format off
124
- #define WITHOUT_COROUTINES
125
- #include "table/block_based/block_based_table_reader_sync_and_async.h"
126
- #undef WITHOUT_COROUTINES
127
- #define WITH_COROUTINES
128
- #include "table/block_based/block_based_table_reader_sync_and_async.h"
129
- #undef WITH_COROUTINES
130
- // clang-format on
131
-
132
- namespace ROCKSDB_NAMESPACE {
133
-
134
- extern const uint64_t kBlockBasedTableMagicNumber;
135
- extern const std::string kHashIndexPrefixesBlock;
136
- extern const std::string kHashIndexPrefixesMetadataBlock;
137
-
138
- BlockBasedTable::~BlockBasedTable() {
139
- auto ua = rep_->uncache_aggressiveness.LoadRelaxed();
140
- if (ua > 0 && rep_->table_options.block_cache) {
141
- if (rep_->filter) {
142
- rep_->filter->EraseFromCacheBeforeDestruction(ua);
143
- }
144
- if (rep_->index_reader) {
145
- {
146
- // TODO: Also uncache data blocks known after any gaps in partitioned
147
- // index. Right now the iterator errors out as soon as there's an
148
- // index partition not in cache.
149
- IndexBlockIter iiter_on_stack;
150
- ReadOptions ropts;
151
- ropts.read_tier = kBlockCacheTier; // No I/O
152
- auto iiter = NewIndexIterator(
153
- ropts, /*disable_prefix_seek=*/false, &iiter_on_stack,
154
- /*get_context=*/nullptr, /*lookup_context=*/nullptr);
155
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
156
- if (iiter != &iiter_on_stack) {
157
- iiter_unique_ptr.reset(iiter);
158
- }
159
- // Un-cache the data blocks the index iterator with tell us about
160
- // without I/O. (NOTE: It's extremely unlikely that a data block
161
- // will be in block cache without the index block pointing to it
162
- // also in block cache.)
163
- UncacheAggressivenessAdvisor advisor(ua);
164
- for (iiter->SeekToFirst(); iiter->Valid() && advisor.ShouldContinue();
165
- iiter->Next()) {
166
- bool erased = EraseFromCache(iiter->value().handle);
167
- advisor.Report(erased);
168
- }
169
- iiter->status().PermitUncheckedError();
170
- }
171
-
172
- // Un-cache the index block(s)
173
- rep_->index_reader->EraseFromCacheBeforeDestruction(ua);
174
- }
175
- }
176
- delete rep_;
177
- }
178
-
179
- namespace {
180
- // Read the block identified by "handle" from "file".
181
- // The only relevant option is options.verify_checksums for now.
182
- // On failure return non-OK.
183
- // On success fill *result and return OK - caller owns *result
184
- // @param uncompression_dict Data for presetting the compression library's
185
- // dictionary.
186
- template <typename TBlocklike>
187
- Status ReadAndParseBlockFromFile(
188
- RandomAccessFileReader* file, FilePrefetchBuffer* prefetch_buffer,
189
- const Footer& footer, const ReadOptions& options, const BlockHandle& handle,
190
- std::unique_ptr<TBlocklike>* result, const ImmutableOptions& ioptions,
191
- BlockCreateContext& create_context, bool maybe_compressed,
192
- const UncompressionDict& uncompression_dict,
193
- const PersistentCacheOptions& cache_options,
194
- MemoryAllocator* memory_allocator, bool for_compaction, bool async_read) {
195
- assert(result);
196
-
197
- BlockContents contents;
198
- BlockFetcher block_fetcher(
199
- file, prefetch_buffer, footer, options, handle, &contents, ioptions,
200
- /*do_uncompress*/ maybe_compressed, maybe_compressed,
201
- TBlocklike::kBlockType, uncompression_dict, cache_options,
202
- memory_allocator, nullptr, for_compaction);
203
- Status s;
204
- // If prefetch_buffer is not allocated, it will fallback to synchronous
205
- // reading of block contents.
206
- if (async_read && prefetch_buffer != nullptr) {
207
- s = block_fetcher.ReadAsyncBlockContents();
208
- if (!s.ok()) {
209
- return s;
210
- }
211
- } else {
212
- s = block_fetcher.ReadBlockContents();
213
- }
214
- if (s.ok()) {
215
- create_context.Create(result, std::move(contents));
216
- }
217
- return s;
218
- }
219
-
220
- // For hash based index, return false if table_properties->prefix_extractor_name
221
- // and prefix_extractor both exist and match, otherwise true.
222
- inline bool PrefixExtractorChangedHelper(
223
- const TableProperties* table_properties,
224
- const SliceTransform* prefix_extractor) {
225
- // BlockBasedTableOptions::kHashSearch requires prefix_extractor to be set.
226
- // Turn off hash index in prefix_extractor is not set; if prefix_extractor
227
- // is set but prefix_extractor_block is not set, also disable hash index
228
- if (prefix_extractor == nullptr || table_properties == nullptr ||
229
- table_properties->prefix_extractor_name.empty()) {
230
- return true;
231
- }
232
-
233
- // prefix_extractor and prefix_extractor_block are both non-empty
234
- if (table_properties->prefix_extractor_name != prefix_extractor->AsString()) {
235
- return true;
236
- } else {
237
- return false;
238
- }
239
- }
240
-
241
- template <typename TBlocklike>
242
- uint32_t GetBlockNumRestarts(const TBlocklike& block) {
243
- if constexpr (std::is_convertible_v<const TBlocklike&, const Block&>) {
244
- const Block& b = block;
245
- return b.NumRestarts();
246
- } else {
247
- return 0;
248
- }
249
- }
250
-
251
- } // namespace
252
-
253
- void BlockBasedTable::UpdateCacheHitMetrics(BlockType block_type,
254
- GetContext* get_context,
255
- size_t usage) const {
256
- Statistics* const statistics = rep_->ioptions.stats;
257
-
258
- PERF_COUNTER_ADD(block_cache_hit_count, 1);
259
- PERF_COUNTER_ADD(block_cache_read_byte, usage);
260
- PERF_COUNTER_BY_LEVEL_ADD(block_cache_hit_count, 1,
261
- static_cast<uint32_t>(rep_->level));
262
-
263
- if (get_context) {
264
- ++get_context->get_context_stats_.num_cache_hit;
265
- get_context->get_context_stats_.num_cache_bytes_read += usage;
266
- } else {
267
- RecordTick(statistics, BLOCK_CACHE_HIT);
268
- RecordTick(statistics, BLOCK_CACHE_BYTES_READ, usage);
269
- }
270
-
271
- switch (block_type) {
272
- case BlockType::kFilter:
273
- case BlockType::kFilterPartitionIndex:
274
- PERF_COUNTER_ADD(block_cache_filter_hit_count, 1);
275
- PERF_COUNTER_ADD(block_cache_filter_read_byte, usage);
276
-
277
- if (get_context) {
278
- ++get_context->get_context_stats_.num_cache_filter_hit;
279
- } else {
280
- RecordTick(statistics, BLOCK_CACHE_FILTER_HIT);
281
- }
282
- break;
283
-
284
- case BlockType::kCompressionDictionary:
285
- // TODO: introduce perf counter for compression dictionary hit count
286
- PERF_COUNTER_ADD(block_cache_compression_dict_read_byte, usage);
287
- if (get_context) {
288
- ++get_context->get_context_stats_.num_cache_compression_dict_hit;
289
- } else {
290
- RecordTick(statistics, BLOCK_CACHE_COMPRESSION_DICT_HIT);
291
- }
292
- break;
293
-
294
- case BlockType::kIndex:
295
- PERF_COUNTER_ADD(block_cache_index_hit_count, 1);
296
- PERF_COUNTER_ADD(block_cache_index_read_byte, usage);
297
-
298
- if (get_context) {
299
- ++get_context->get_context_stats_.num_cache_index_hit;
300
- } else {
301
- RecordTick(statistics, BLOCK_CACHE_INDEX_HIT);
302
- }
303
- break;
304
-
305
- default:
306
- // TODO: introduce dedicated tickers/statistics/counters
307
- // for range tombstones
308
- if (get_context) {
309
- ++get_context->get_context_stats_.num_cache_data_hit;
310
- } else {
311
- RecordTick(statistics, BLOCK_CACHE_DATA_HIT);
312
- }
313
- break;
314
- }
315
- }
316
-
317
- void BlockBasedTable::UpdateCacheMissMetrics(BlockType block_type,
318
- GetContext* get_context) const {
319
- Statistics* const statistics = rep_->ioptions.stats;
320
-
321
- // TODO: introduce aggregate (not per-level) block cache miss count
322
- PERF_COUNTER_BY_LEVEL_ADD(block_cache_miss_count, 1,
323
- static_cast<uint32_t>(rep_->level));
324
-
325
- if (get_context) {
326
- ++get_context->get_context_stats_.num_cache_miss;
327
- } else {
328
- RecordTick(statistics, BLOCK_CACHE_MISS);
329
- }
330
-
331
- // TODO: introduce perf counters for misses per block type
332
- switch (block_type) {
333
- case BlockType::kFilter:
334
- case BlockType::kFilterPartitionIndex:
335
- if (get_context) {
336
- ++get_context->get_context_stats_.num_cache_filter_miss;
337
- } else {
338
- RecordTick(statistics, BLOCK_CACHE_FILTER_MISS);
339
- }
340
- break;
341
-
342
- case BlockType::kCompressionDictionary:
343
- if (get_context) {
344
- ++get_context->get_context_stats_.num_cache_compression_dict_miss;
345
- } else {
346
- RecordTick(statistics, BLOCK_CACHE_COMPRESSION_DICT_MISS);
347
- }
348
- break;
349
-
350
- case BlockType::kIndex:
351
- if (get_context) {
352
- ++get_context->get_context_stats_.num_cache_index_miss;
353
- } else {
354
- RecordTick(statistics, BLOCK_CACHE_INDEX_MISS);
355
- }
356
- break;
357
-
358
- default:
359
- // TODO: introduce dedicated tickers/statistics/counters
360
- // for range tombstones
361
- if (get_context) {
362
- ++get_context->get_context_stats_.num_cache_data_miss;
363
- } else {
364
- RecordTick(statistics, BLOCK_CACHE_DATA_MISS);
365
- }
366
- break;
367
- }
368
- }
369
-
370
- void BlockBasedTable::UpdateCacheInsertionMetrics(
371
- BlockType block_type, GetContext* get_context, size_t usage, bool redundant,
372
- Statistics* const statistics) {
373
- // TODO: introduce perf counters for block cache insertions
374
- if (get_context) {
375
- ++get_context->get_context_stats_.num_cache_add;
376
- if (redundant) {
377
- ++get_context->get_context_stats_.num_cache_add_redundant;
378
- }
379
- get_context->get_context_stats_.num_cache_bytes_write += usage;
380
- } else {
381
- RecordTick(statistics, BLOCK_CACHE_ADD);
382
- if (redundant) {
383
- RecordTick(statistics, BLOCK_CACHE_ADD_REDUNDANT);
384
- }
385
- RecordTick(statistics, BLOCK_CACHE_BYTES_WRITE, usage);
386
- }
387
-
388
- switch (block_type) {
389
- case BlockType::kFilter:
390
- case BlockType::kFilterPartitionIndex:
391
- if (get_context) {
392
- ++get_context->get_context_stats_.num_cache_filter_add;
393
- if (redundant) {
394
- ++get_context->get_context_stats_.num_cache_filter_add_redundant;
395
- }
396
- get_context->get_context_stats_.num_cache_filter_bytes_insert += usage;
397
- } else {
398
- RecordTick(statistics, BLOCK_CACHE_FILTER_ADD);
399
- if (redundant) {
400
- RecordTick(statistics, BLOCK_CACHE_FILTER_ADD_REDUNDANT);
401
- }
402
- RecordTick(statistics, BLOCK_CACHE_FILTER_BYTES_INSERT, usage);
403
- }
404
- break;
405
-
406
- case BlockType::kCompressionDictionary:
407
- if (get_context) {
408
- ++get_context->get_context_stats_.num_cache_compression_dict_add;
409
- if (redundant) {
410
- ++get_context->get_context_stats_
411
- .num_cache_compression_dict_add_redundant;
412
- }
413
- get_context->get_context_stats_
414
- .num_cache_compression_dict_bytes_insert += usage;
415
- } else {
416
- RecordTick(statistics, BLOCK_CACHE_COMPRESSION_DICT_ADD);
417
- if (redundant) {
418
- RecordTick(statistics, BLOCK_CACHE_COMPRESSION_DICT_ADD_REDUNDANT);
419
- }
420
- RecordTick(statistics, BLOCK_CACHE_COMPRESSION_DICT_BYTES_INSERT,
421
- usage);
422
- }
423
- break;
424
-
425
- case BlockType::kIndex:
426
- if (get_context) {
427
- ++get_context->get_context_stats_.num_cache_index_add;
428
- if (redundant) {
429
- ++get_context->get_context_stats_.num_cache_index_add_redundant;
430
- }
431
- get_context->get_context_stats_.num_cache_index_bytes_insert += usage;
432
- } else {
433
- RecordTick(statistics, BLOCK_CACHE_INDEX_ADD);
434
- if (redundant) {
435
- RecordTick(statistics, BLOCK_CACHE_INDEX_ADD_REDUNDANT);
436
- }
437
- RecordTick(statistics, BLOCK_CACHE_INDEX_BYTES_INSERT, usage);
438
- }
439
- break;
440
-
441
- default:
442
- // TODO: introduce dedicated tickers/statistics/counters
443
- // for range tombstones
444
- if (get_context) {
445
- ++get_context->get_context_stats_.num_cache_data_add;
446
- if (redundant) {
447
- ++get_context->get_context_stats_.num_cache_data_add_redundant;
448
- }
449
- get_context->get_context_stats_.num_cache_data_bytes_insert += usage;
450
- } else {
451
- RecordTick(statistics, BLOCK_CACHE_DATA_ADD);
452
- if (redundant) {
453
- RecordTick(statistics, BLOCK_CACHE_DATA_ADD_REDUNDANT);
454
- }
455
- RecordTick(statistics, BLOCK_CACHE_DATA_BYTES_INSERT, usage);
456
- }
457
- break;
458
- }
459
- }
460
-
461
- namespace {
462
- // Return True if table_properties has `user_prop_name` has a `true` value
463
- // or it doesn't contain this property (for backward compatible).
464
- bool IsFeatureSupported(const TableProperties& table_properties,
465
- const std::string& user_prop_name, Logger* info_log) {
466
- auto& props = table_properties.user_collected_properties;
467
- auto pos = props.find(user_prop_name);
468
- // Older version doesn't have this value set. Skip this check.
469
- if (pos != props.end()) {
470
- if (pos->second == kPropFalse) {
471
- return false;
472
- } else if (pos->second != kPropTrue) {
473
- ROCKS_LOG_WARN(info_log, "Property %s has invalidate value %s",
474
- user_prop_name.c_str(), pos->second.c_str());
475
- }
476
- }
477
- return true;
478
- }
479
-
480
- // Caller has to ensure seqno is not nullptr.
481
- // Set *seqno to the global sequence number for reading this file.
482
- Status GetGlobalSequenceNumber(const TableProperties& table_properties,
483
- SequenceNumber largest_seqno,
484
- SequenceNumber* seqno) {
485
- const auto& props = table_properties.user_collected_properties;
486
- const auto version_pos = props.find(ExternalSstFilePropertyNames::kVersion);
487
- const auto seqno_pos = props.find(ExternalSstFilePropertyNames::kGlobalSeqno);
488
-
489
- *seqno = kDisableGlobalSequenceNumber;
490
- if (version_pos == props.end()) {
491
- if (seqno_pos != props.end()) {
492
- std::array<char, 200> msg_buf;
493
- // This is not an external sst file, global_seqno is not supported.
494
- snprintf(
495
- msg_buf.data(), msg_buf.max_size(),
496
- "A non-external sst file have global seqno property with value %s",
497
- seqno_pos->second.c_str());
498
- return Status::Corruption(msg_buf.data());
499
- }
500
- return Status::OK();
501
- }
502
-
503
- uint32_t version = DecodeFixed32(version_pos->second.c_str());
504
- if (version != 2) {
505
- std::array<char, 200> msg_buf;
506
- if (version != 1) {
507
- snprintf(msg_buf.data(), msg_buf.max_size(),
508
- "An external sst file has corrupted version %u.", version);
509
- return Status::Corruption(msg_buf.data());
510
- }
511
- if (seqno_pos != props.end()) {
512
- // This is a v1 external sst file, global_seqno is not supported.
513
- snprintf(msg_buf.data(), msg_buf.max_size(),
514
- "An external sst file with version %u has global seqno "
515
- "property with value %s",
516
- version, seqno_pos->second.c_str());
517
- return Status::Corruption(msg_buf.data());
518
- }
519
- return Status::OK();
520
- }
521
-
522
- // Since we have a plan to deprecate global_seqno, we do not return failure
523
- // if seqno_pos == props.end(). We rely on version_pos to detect whether the
524
- // SST is external.
525
- SequenceNumber global_seqno(0);
526
- if (seqno_pos != props.end()) {
527
- global_seqno = DecodeFixed64(seqno_pos->second.c_str());
528
- }
529
- // SstTableReader open table reader with kMaxSequenceNumber as largest_seqno
530
- // to denote it is unknown.
531
- if (largest_seqno < kMaxSequenceNumber) {
532
- if (global_seqno == 0) {
533
- global_seqno = largest_seqno;
534
- }
535
- if (global_seqno != largest_seqno) {
536
- std::array<char, 200> msg_buf;
537
- snprintf(
538
- msg_buf.data(), msg_buf.max_size(),
539
- "An external sst file with version %u have global seqno property "
540
- "with value %s, while largest seqno in the file is %llu",
541
- version, seqno_pos->second.c_str(),
542
- static_cast<unsigned long long>(largest_seqno));
543
- return Status::Corruption(msg_buf.data());
544
- }
545
- }
546
- *seqno = global_seqno;
547
-
548
- if (global_seqno > kMaxSequenceNumber) {
549
- std::array<char, 200> msg_buf;
550
- snprintf(msg_buf.data(), msg_buf.max_size(),
551
- "An external sst file with version %u have global seqno property "
552
- "with value %llu, which is greater than kMaxSequenceNumber",
553
- version, static_cast<unsigned long long>(global_seqno));
554
- return Status::Corruption(msg_buf.data());
555
- }
556
-
557
- return Status::OK();
558
- }
559
- } // namespace
560
-
561
- void BlockBasedTable::SetupBaseCacheKey(const TableProperties* properties,
562
- const std::string& cur_db_session_id,
563
- uint64_t cur_file_number,
564
- OffsetableCacheKey* out_base_cache_key,
565
- bool* out_is_stable) {
566
- // Use a stable cache key if sufficient data is in table properties
567
- std::string db_session_id;
568
- uint64_t file_num;
569
- std::string db_id;
570
- if (properties && !properties->db_session_id.empty() &&
571
- properties->orig_file_number > 0) {
572
- // (Newer SST file case)
573
- // We must have both properties to get a stable unique id because
574
- // CreateColumnFamilyWithImport or IngestExternalFiles can change the
575
- // file numbers on a file.
576
- db_session_id = properties->db_session_id;
577
- file_num = properties->orig_file_number;
578
- // Less critical, populated in earlier release than above
579
- db_id = properties->db_id;
580
- if (out_is_stable) {
581
- *out_is_stable = true;
582
- }
583
- } else {
584
- // (Old SST file case)
585
- // We use (unique) cache keys based on current identifiers. These are at
586
- // least stable across table file close and re-open, but not across
587
- // different DBs nor DB close and re-open.
588
- db_session_id = cur_db_session_id;
589
- file_num = cur_file_number;
590
- // Plumbing through the DB ID to here would be annoying, and of limited
591
- // value because of the case of VersionSet::Recover opening some table
592
- // files and later setting the DB ID. So we just rely on uniqueness
593
- // level provided by session ID.
594
- db_id = "unknown";
595
- if (out_is_stable) {
596
- *out_is_stable = false;
597
- }
598
- }
599
-
600
- // Too many tests to update to get these working
601
- // assert(file_num > 0);
602
- // assert(!db_session_id.empty());
603
- // assert(!db_id.empty());
604
-
605
- // Minimum block size is 5 bytes; therefore we can trim off two lower bits
606
- // from offsets. See GetCacheKey.
607
- *out_base_cache_key = OffsetableCacheKey(db_id, db_session_id, file_num);
608
- }
609
-
610
- CacheKey BlockBasedTable::GetCacheKey(const OffsetableCacheKey& base_cache_key,
611
- const BlockHandle& handle) {
612
- // Minimum block size is 5 bytes; therefore we can trim off two lower bits
613
- // from offet.
614
- return base_cache_key.WithOffset(handle.offset() >> 2);
615
- }
616
-
617
- Status BlockBasedTable::Open(
618
- const ReadOptions& read_options, const ImmutableOptions& ioptions,
619
- const EnvOptions& env_options, const BlockBasedTableOptions& table_options,
620
- const InternalKeyComparator& internal_comparator,
621
- std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
622
- uint8_t block_protection_bytes_per_key,
623
- std::unique_ptr<TableReader>* table_reader, uint64_t tail_size,
624
- std::shared_ptr<CacheReservationManager> table_reader_cache_res_mgr,
625
- const std::shared_ptr<const SliceTransform>& prefix_extractor,
626
- const bool prefetch_index_and_filter_in_cache, const bool skip_filters,
627
- const int level, const bool immortal_table,
628
- const SequenceNumber largest_seqno, const bool force_direct_prefetch,
629
- TailPrefetchStats* tail_prefetch_stats,
630
- BlockCacheTracer* const block_cache_tracer,
631
- size_t max_file_size_for_l0_meta_pin, const std::string& cur_db_session_id,
632
- uint64_t cur_file_num, UniqueId64x2 expected_unique_id,
633
- const bool user_defined_timestamps_persisted) {
634
- table_reader->reset();
635
-
636
- Status s;
637
- Footer footer;
638
- std::unique_ptr<FilePrefetchBuffer> prefetch_buffer;
639
-
640
- // From read_options, retain deadline, io_timeout, rate_limiter_priority, and
641
- // verify_checksums. In future, we may retain more options.
642
- // TODO: audit more ReadOptions and do this in a way that brings attention
643
- // on new ReadOptions?
644
- ReadOptions ro;
645
- ro.deadline = read_options.deadline;
646
- ro.io_timeout = read_options.io_timeout;
647
- ro.rate_limiter_priority = read_options.rate_limiter_priority;
648
- ro.verify_checksums = read_options.verify_checksums;
649
- ro.io_activity = read_options.io_activity;
650
-
651
- // prefetch both index and filters, down to all partitions
652
- const bool prefetch_all = prefetch_index_and_filter_in_cache || level == 0;
653
- const bool preload_all = !table_options.cache_index_and_filter_blocks;
654
-
655
- if (!ioptions.allow_mmap_reads && !env_options.use_mmap_reads) {
656
- s = PrefetchTail(ro, file.get(), file_size, force_direct_prefetch,
657
- tail_prefetch_stats, prefetch_all, preload_all,
658
- &prefetch_buffer, ioptions.stats, tail_size,
659
- ioptions.logger);
660
- // Return error in prefetch path to users.
661
- if (!s.ok()) {
662
- return s;
663
- }
664
- } else {
665
- // Should not prefetch for mmap mode.
666
- prefetch_buffer.reset(new FilePrefetchBuffer(
667
- ReadaheadParams(), false /* enable */, true /* track_min_offset */));
668
- }
669
-
670
- // Read in the following order:
671
- // 1. Footer
672
- // 2. [metaindex block]
673
- // 3. [meta block: properties]
674
- // 4. [meta block: range deletion tombstone]
675
- // 5. [meta block: compression dictionary]
676
- // 6. [meta block: index]
677
- // 7. [meta block: filter]
678
- IOOptions opts;
679
- s = file->PrepareIOOptions(ro, opts);
680
- if (s.ok()) {
681
- s = ReadFooterFromFile(opts, file.get(), *ioptions.fs,
682
- prefetch_buffer.get(), file_size, &footer,
683
- kBlockBasedTableMagicNumber);
684
- }
685
- // If the footer is corrupted and the FS supports checksum verification and
686
- // correction, try reading the footer again
687
- if (s.IsCorruption()) {
688
- RecordTick(ioptions.statistics.get(), SST_FOOTER_CORRUPTION_COUNT);
689
- if (CheckFSFeatureSupport(ioptions.fs.get(),
690
- FSSupportedOps::kVerifyAndReconstructRead)) {
691
- IOOptions retry_opts = opts;
692
- retry_opts.verify_and_reconstruct_read = true;
693
- s = ReadFooterFromFile(retry_opts, file.get(), *ioptions.fs,
694
- prefetch_buffer.get(), file_size, &footer,
695
- kBlockBasedTableMagicNumber);
696
- }
697
- }
698
- if (!s.ok()) {
699
- return s;
700
- }
701
- if (!IsSupportedFormatVersion(footer.format_version())) {
702
- return Status::Corruption(
703
- "Unknown Footer version. Maybe this file was created with newer "
704
- "version of RocksDB?");
705
- }
706
-
707
- BlockCacheLookupContext lookup_context{TableReaderCaller::kPrefetch};
708
- Rep* rep = new BlockBasedTable::Rep(
709
- ioptions, env_options, table_options, internal_comparator, skip_filters,
710
- file_size, level, immortal_table, user_defined_timestamps_persisted);
711
- rep->file = std::move(file);
712
- rep->footer = footer;
713
-
714
- // For fully portable/stable cache keys, we need to read the properties
715
- // block before setting up cache keys. TODO: consider setting up a bootstrap
716
- // cache key for PersistentCache to use for metaindex and properties blocks.
717
- rep->persistent_cache_options = PersistentCacheOptions();
718
-
719
- // Meta-blocks are not dictionary compressed. Explicitly set the dictionary
720
- // handle to null, otherwise it may be seen as uninitialized during the below
721
- // meta-block reads.
722
- rep->compression_dict_handle = BlockHandle::NullBlockHandle();
723
-
724
- rep->create_context.protection_bytes_per_key = block_protection_bytes_per_key;
725
- // Read metaindex
726
- std::unique_ptr<BlockBasedTable> new_table(
727
- new BlockBasedTable(rep, block_cache_tracer));
728
- std::unique_ptr<Block> metaindex;
729
- std::unique_ptr<InternalIterator> metaindex_iter;
730
- s = new_table->ReadMetaIndexBlock(ro, prefetch_buffer.get(), &metaindex,
731
- &metaindex_iter);
732
- if (!s.ok()) {
733
- return s;
734
- }
735
-
736
- // Populates table_properties and some fields that depend on it,
737
- // such as index_type.
738
- s = new_table->ReadPropertiesBlock(ro, prefetch_buffer.get(),
739
- metaindex_iter.get(), largest_seqno);
740
- if (!s.ok()) {
741
- return s;
742
- }
743
-
744
- // Populate BlockCreateContext
745
- bool blocks_definitely_zstd_compressed =
746
- rep->table_properties &&
747
- (rep->table_properties->compression_name ==
748
- CompressionTypeToString(kZSTD) ||
749
- rep->table_properties->compression_name ==
750
- CompressionTypeToString(kZSTDNotFinalCompression));
751
- rep->create_context = BlockCreateContext(
752
- &rep->table_options, &rep->ioptions, rep->ioptions.stats,
753
- blocks_definitely_zstd_compressed, block_protection_bytes_per_key,
754
- rep->internal_comparator.user_comparator(), rep->index_value_is_full,
755
- rep->index_has_first_key);
756
-
757
- // Check expected unique id if provided
758
- if (expected_unique_id != kNullUniqueId64x2) {
759
- auto props = rep->table_properties;
760
- if (!props) {
761
- return Status::Corruption("Missing table properties on file " +
762
- std::to_string(cur_file_num) +
763
- " with known unique ID");
764
- }
765
- UniqueId64x2 actual_unique_id{};
766
- s = GetSstInternalUniqueId(props->db_id, props->db_session_id,
767
- props->orig_file_number, &actual_unique_id,
768
- /*force*/ true);
769
- assert(s.ok()); // because force=true
770
- if (expected_unique_id != actual_unique_id) {
771
- return Status::Corruption(
772
- "Mismatch in unique ID on table file " +
773
- std::to_string(cur_file_num) +
774
- ". Expected: " + InternalUniqueIdToHumanString(&expected_unique_id) +
775
- " Actual: " + InternalUniqueIdToHumanString(&actual_unique_id));
776
- }
777
- TEST_SYNC_POINT_CALLBACK("BlockBasedTable::Open::PassedVerifyUniqueId",
778
- &actual_unique_id);
779
- } else {
780
- TEST_SYNC_POINT_CALLBACK("BlockBasedTable::Open::SkippedVerifyUniqueId",
781
- nullptr);
782
- if (ioptions.verify_sst_unique_id_in_manifest && ioptions.logger) {
783
- // A crude but isolated way of reporting unverified files. This should not
784
- // be an ongoing concern so doesn't deserve a place in Statistics IMHO.
785
- static std::atomic<uint64_t> unverified_count{0};
786
- auto prev_count =
787
- unverified_count.fetch_add(1, std::memory_order_relaxed);
788
- if (prev_count == 0) {
789
- ROCKS_LOG_WARN(
790
- ioptions.logger,
791
- "At least one SST file opened without unique ID to verify: %" PRIu64
792
- ".sst",
793
- cur_file_num);
794
- } else if (prev_count % 1000 == 0) {
795
- ROCKS_LOG_WARN(
796
- ioptions.logger,
797
- "Another ~1000 SST files opened without unique ID to verify");
798
- }
799
- }
800
- }
801
-
802
- // Set up prefix extracto as needed
803
- bool force_null_table_prefix_extractor = false;
804
- TEST_SYNC_POINT_CALLBACK(
805
- "BlockBasedTable::Open::ForceNullTablePrefixExtractor",
806
- &force_null_table_prefix_extractor);
807
- if (force_null_table_prefix_extractor) {
808
- assert(!rep->table_prefix_extractor);
809
- } else if (!PrefixExtractorChangedHelper(rep->table_properties.get(),
810
- prefix_extractor.get())) {
811
- // Establish fast path for unchanged prefix_extractor
812
- rep->table_prefix_extractor = prefix_extractor;
813
- } else {
814
- // Current prefix_extractor doesn't match table
815
- if (rep->table_properties) {
816
- //**TODO: If/When the DBOptions has a registry in it, the ConfigOptions
817
- // will need to use it
818
- ConfigOptions config_options;
819
- Status st = SliceTransform::CreateFromString(
820
- config_options, rep->table_properties->prefix_extractor_name,
821
- &(rep->table_prefix_extractor));
822
- if (!st.ok()) {
823
- //**TODO: Should this be error be returned or swallowed?
824
- ROCKS_LOG_ERROR(rep->ioptions.logger,
825
- "Failed to create prefix extractor[%s]: %s",
826
- rep->table_properties->prefix_extractor_name.c_str(),
827
- st.ToString().c_str());
828
- }
829
- }
830
- }
831
-
832
- // With properties loaded, we can set up portable/stable cache keys
833
- SetupBaseCacheKey(rep->table_properties.get(), cur_db_session_id,
834
- cur_file_num, &rep->base_cache_key);
835
-
836
- rep->persistent_cache_options =
837
- PersistentCacheOptions(rep->table_options.persistent_cache,
838
- rep->base_cache_key, rep->ioptions.stats);
839
-
840
- s = new_table->ReadRangeDelBlock(ro, prefetch_buffer.get(),
841
- metaindex_iter.get(), internal_comparator,
842
- &lookup_context);
843
- if (!s.ok()) {
844
- return s;
845
- }
846
- rep->verify_checksum_set_on_open = ro.verify_checksums;
847
- s = new_table->PrefetchIndexAndFilterBlocks(
848
- ro, prefetch_buffer.get(), metaindex_iter.get(), new_table.get(),
849
- prefetch_all, table_options, level, file_size,
850
- max_file_size_for_l0_meta_pin, &lookup_context);
851
-
852
- if (s.ok()) {
853
- // Update tail prefetch stats
854
- assert(prefetch_buffer.get() != nullptr);
855
- if (tail_prefetch_stats != nullptr) {
856
- assert(prefetch_buffer->min_offset_read() < file_size);
857
- tail_prefetch_stats->RecordEffectiveSize(
858
- static_cast<size_t>(file_size) - prefetch_buffer->min_offset_read());
859
- }
860
- }
861
-
862
- if (s.ok() && table_reader_cache_res_mgr) {
863
- std::size_t mem_usage = new_table->ApproximateMemoryUsage();
864
- s = table_reader_cache_res_mgr->MakeCacheReservation(
865
- mem_usage, &(rep->table_reader_cache_res_handle));
866
- if (s.IsMemoryLimit()) {
867
- s = Status::MemoryLimit(
868
- "Can't allocate " +
869
- kCacheEntryRoleToCamelString[static_cast<std::uint32_t>(
870
- CacheEntryRole::kBlockBasedTableReader)] +
871
- " due to memory limit based on "
872
- "cache capacity for memory allocation");
873
- }
874
- }
875
-
876
- if (s.ok()) {
877
- *table_reader = std::move(new_table);
878
- }
879
- return s;
880
- }
881
-
882
- Status BlockBasedTable::PrefetchTail(
883
- const ReadOptions& ro, RandomAccessFileReader* file, uint64_t file_size,
884
- bool force_direct_prefetch, TailPrefetchStats* tail_prefetch_stats,
885
- const bool prefetch_all, const bool preload_all,
886
- std::unique_ptr<FilePrefetchBuffer>* prefetch_buffer, Statistics* stats,
887
- uint64_t tail_size, Logger* const logger) {
888
- assert(tail_size <= file_size);
889
-
890
- size_t tail_prefetch_size = 0;
891
- if (tail_size != 0) {
892
- tail_prefetch_size = tail_size;
893
- } else {
894
- // Fallback for SST files, for which tail size is not recorded in the
895
- // manifest. Eventually, this fallback might be removed, so it's
896
- // better to make sure that such SST files get compacted.
897
- // See https://github.com/facebook/rocksdb/issues/12664
898
- if (tail_prefetch_stats != nullptr) {
899
- // Multiple threads may get a 0 (no history) when running in parallel,
900
- // but it will get cleared after the first of them finishes.
901
- tail_prefetch_size = tail_prefetch_stats->GetSuggestedPrefetchSize();
902
- }
903
- if (tail_prefetch_size == 0) {
904
- // Before read footer, readahead backwards to prefetch data. Do more
905
- // readahead if we're going to read index/filter.
906
- // TODO: This may incorrectly select small readahead in case partitioned
907
- // index/filter is enabled and top-level partition pinning is enabled.
908
- // That's because we need to issue readahead before we read the
909
- // properties, at which point we don't yet know the index type.
910
- tail_prefetch_size = prefetch_all || preload_all ? 512 * 1024 : 4 * 1024;
911
-
912
- ROCKS_LOG_WARN(
913
- logger,
914
- "[%s] Tail prefetch size %zu is calculated based on heuristics.",
915
- file->file_name().c_str(), tail_prefetch_size);
916
- } else {
917
- ROCKS_LOG_WARN(logger,
918
- "[%s] Tail prefetch size %zu is calculated based on "
919
- "TailPrefetchStats.",
920
- file->file_name().c_str(), tail_prefetch_size);
921
- }
922
- }
923
- size_t prefetch_off;
924
- size_t prefetch_len;
925
- if (file_size < tail_prefetch_size) {
926
- prefetch_off = 0;
927
- prefetch_len = static_cast<size_t>(file_size);
928
- } else {
929
- prefetch_off = static_cast<size_t>(file_size - tail_prefetch_size);
930
- prefetch_len = tail_prefetch_size;
931
- }
932
-
933
- #ifndef NDEBUG
934
- std::pair<size_t*, size_t*> prefetch_off_len_pair = {&prefetch_off,
935
- &prefetch_len};
936
- TEST_SYNC_POINT_CALLBACK("BlockBasedTable::Open::TailPrefetchLen",
937
- &prefetch_off_len_pair);
938
- #endif // NDEBUG
939
-
940
- IOOptions opts;
941
- Status s = file->PrepareIOOptions(ro, opts);
942
- // Try file system prefetch
943
- if (s.ok() && !file->use_direct_io() && !force_direct_prefetch) {
944
- if (!file->Prefetch(opts, prefetch_off, prefetch_len).IsNotSupported()) {
945
- prefetch_buffer->reset(new FilePrefetchBuffer(
946
- ReadaheadParams(), false /* enable */, true /* track_min_offset */));
947
- return Status::OK();
948
- }
949
- }
950
-
951
- // Use `FilePrefetchBuffer`
952
- prefetch_buffer->reset(new FilePrefetchBuffer(
953
- ReadaheadParams(), true /* enable */, true /* track_min_offset */,
954
- nullptr /* fs */, nullptr /* clock */, stats,
955
- /* readahead_cb */ nullptr,
956
- FilePrefetchBufferUsage::kTableOpenPrefetchTail));
957
-
958
- if (s.ok()) {
959
- s = (*prefetch_buffer)->Prefetch(opts, file, prefetch_off, prefetch_len);
960
- }
961
- return s;
962
- }
963
-
964
- Status BlockBasedTable::ReadPropertiesBlock(
965
- const ReadOptions& ro, FilePrefetchBuffer* prefetch_buffer,
966
- InternalIterator* meta_iter, const SequenceNumber largest_seqno) {
967
- Status s;
968
- BlockHandle handle;
969
- s = FindOptionalMetaBlock(meta_iter, kPropertiesBlockName, &handle);
970
-
971
- if (!s.ok()) {
972
- ROCKS_LOG_WARN(rep_->ioptions.logger,
973
- "Error when seeking to properties block from file: %s",
974
- s.ToString().c_str());
975
- } else if (!handle.IsNull()) {
976
- s = meta_iter->status();
977
- std::unique_ptr<TableProperties> table_properties;
978
- if (s.ok()) {
979
- s = ReadTablePropertiesHelper(
980
- ro, handle, rep_->file.get(), prefetch_buffer, rep_->footer,
981
- rep_->ioptions, &table_properties, nullptr /* memory_allocator */);
982
- }
983
- IGNORE_STATUS_IF_ERROR(s);
984
-
985
- if (!s.ok()) {
986
- ROCKS_LOG_WARN(rep_->ioptions.logger,
987
- "Encountered error while reading data from properties "
988
- "block %s",
989
- s.ToString().c_str());
990
- } else {
991
- assert(table_properties != nullptr);
992
- rep_->table_properties = std::move(table_properties);
993
-
994
- if (s.ok()) {
995
- s = rep_->seqno_to_time_mapping.DecodeFrom(
996
- rep_->table_properties->seqno_to_time_mapping);
997
- }
998
- if (!s.ok()) {
999
- ROCKS_LOG_WARN(
1000
- rep_->ioptions.logger,
1001
- "Problem reading or processing seqno-to-time mapping: %s",
1002
- s.ToString().c_str());
1003
- }
1004
- rep_->blocks_maybe_compressed =
1005
- rep_->table_properties->compression_name !=
1006
- CompressionTypeToString(kNoCompression);
1007
- }
1008
- } else {
1009
- ROCKS_LOG_ERROR(rep_->ioptions.logger,
1010
- "Cannot find Properties block from file.");
1011
- }
1012
-
1013
- // Read the table properties, if provided.
1014
- if (rep_->table_properties) {
1015
- rep_->whole_key_filtering &=
1016
- IsFeatureSupported(*(rep_->table_properties),
1017
- BlockBasedTablePropertyNames::kWholeKeyFiltering,
1018
- rep_->ioptions.logger);
1019
- rep_->prefix_filtering &= IsFeatureSupported(
1020
- *(rep_->table_properties),
1021
- BlockBasedTablePropertyNames::kPrefixFiltering, rep_->ioptions.logger);
1022
-
1023
- rep_->index_key_includes_seq =
1024
- rep_->table_properties->index_key_is_user_key == 0;
1025
- rep_->index_value_is_full =
1026
- rep_->table_properties->index_value_is_delta_encoded == 0;
1027
-
1028
- // Update index_type with the true type.
1029
- // If table properties don't contain index type, we assume that the table
1030
- // is in very old format and has kBinarySearch index type.
1031
- auto& props = rep_->table_properties->user_collected_properties;
1032
- auto index_type_pos = props.find(BlockBasedTablePropertyNames::kIndexType);
1033
- if (index_type_pos != props.end()) {
1034
- rep_->index_type = static_cast<BlockBasedTableOptions::IndexType>(
1035
- DecodeFixed32(index_type_pos->second.c_str()));
1036
- }
1037
- auto min_ts_pos = props.find("rocksdb.timestamp_min");
1038
- if (min_ts_pos != props.end()) {
1039
- rep_->min_timestamp = Slice(min_ts_pos->second);
1040
- }
1041
- auto max_ts_pos = props.find("rocksdb.timestamp_max");
1042
- if (max_ts_pos != props.end()) {
1043
- rep_->max_timestamp = Slice(max_ts_pos->second);
1044
- }
1045
-
1046
- rep_->index_has_first_key =
1047
- rep_->index_type == BlockBasedTableOptions::kBinarySearchWithFirstKey;
1048
-
1049
- s = GetGlobalSequenceNumber(*(rep_->table_properties), largest_seqno,
1050
- &(rep_->global_seqno));
1051
- if (!s.ok()) {
1052
- ROCKS_LOG_ERROR(rep_->ioptions.logger, "%s", s.ToString().c_str());
1053
- }
1054
- }
1055
- return s;
1056
- }
1057
-
1058
- Status BlockBasedTable::ReadRangeDelBlock(
1059
- const ReadOptions& read_options, FilePrefetchBuffer* prefetch_buffer,
1060
- InternalIterator* meta_iter,
1061
- const InternalKeyComparator& internal_comparator,
1062
- BlockCacheLookupContext* lookup_context) {
1063
- Status s;
1064
- BlockHandle range_del_handle;
1065
- s = FindOptionalMetaBlock(meta_iter, kRangeDelBlockName, &range_del_handle);
1066
- if (!s.ok()) {
1067
- ROCKS_LOG_WARN(
1068
- rep_->ioptions.logger,
1069
- "Error when seeking to range delete tombstones block from file: %s",
1070
- s.ToString().c_str());
1071
- } else if (!range_del_handle.IsNull()) {
1072
- Status tmp_status;
1073
- std::unique_ptr<InternalIterator> iter(NewDataBlockIterator<DataBlockIter>(
1074
- read_options, range_del_handle,
1075
- /*input_iter=*/nullptr, BlockType::kRangeDeletion,
1076
- /*get_context=*/nullptr, lookup_context, prefetch_buffer,
1077
- /*for_compaction= */ false, /*async_read= */ false, tmp_status,
1078
- /*use_block_cache_for_lookup=*/true));
1079
- assert(iter != nullptr);
1080
- s = iter->status();
1081
- if (!s.ok()) {
1082
- ROCKS_LOG_WARN(
1083
- rep_->ioptions.logger,
1084
- "Encountered error while reading data from range del block %s",
1085
- s.ToString().c_str());
1086
- IGNORE_STATUS_IF_ERROR(s);
1087
- } else {
1088
- std::vector<SequenceNumber> snapshots;
1089
- // When user defined timestamps are not persisted, the range tombstone end
1090
- // key read from the data block doesn't include user timestamp.
1091
- // The range tombstone start key should already include user timestamp as
1092
- // it's handled at block parsing level in the same way as the other data
1093
- // blocks.
1094
- rep_->fragmented_range_dels =
1095
- std::make_shared<FragmentedRangeTombstoneList>(
1096
- std::move(iter), internal_comparator, false /*for_compaction=*/,
1097
- snapshots, rep_->user_defined_timestamps_persisted);
1098
- }
1099
- }
1100
- return s;
1101
- }
1102
-
1103
- Status BlockBasedTable::PrefetchIndexAndFilterBlocks(
1104
- const ReadOptions& ro, FilePrefetchBuffer* prefetch_buffer,
1105
- InternalIterator* meta_iter, BlockBasedTable* new_table, bool prefetch_all,
1106
- const BlockBasedTableOptions& table_options, const int level,
1107
- size_t file_size, size_t max_file_size_for_l0_meta_pin,
1108
- BlockCacheLookupContext* lookup_context) {
1109
- // Find filter handle and filter type
1110
- if (rep_->filter_policy) {
1111
- auto name = rep_->filter_policy->CompatibilityName();
1112
- bool builtin_compatible =
1113
- strcmp(name, BuiltinFilterPolicy::kCompatibilityName()) == 0;
1114
-
1115
- for (const auto& [filter_type, prefix] :
1116
- {std::make_pair(Rep::FilterType::kFullFilter, kFullFilterBlockPrefix),
1117
- std::make_pair(Rep::FilterType::kPartitionedFilter,
1118
- kPartitionedFilterBlockPrefix),
1119
- std::make_pair(Rep::FilterType::kNoFilter,
1120
- kObsoleteFilterBlockPrefix)}) {
1121
- if (builtin_compatible) {
1122
- // This code is only here to deal with a hiccup in early 7.0.x where
1123
- // there was an unintentional name change in the SST files metadata.
1124
- // It should be OK to remove this in the future (late 2022) and just
1125
- // have the 'else' code.
1126
- // NOTE: the test:: names below are likely not needed but included
1127
- // out of caution
1128
- static const std::unordered_set<std::string> kBuiltinNameAndAliases = {
1129
- BuiltinFilterPolicy::kCompatibilityName(),
1130
- test::LegacyBloomFilterPolicy::kClassName(),
1131
- test::FastLocalBloomFilterPolicy::kClassName(),
1132
- test::Standard128RibbonFilterPolicy::kClassName(),
1133
- "rocksdb.internal.DeprecatedBlockBasedBloomFilter",
1134
- BloomFilterPolicy::kClassName(),
1135
- RibbonFilterPolicy::kClassName(),
1136
- };
1137
-
1138
- // For efficiency, do a prefix seek and see if the first match is
1139
- // good.
1140
- meta_iter->Seek(prefix);
1141
- if (meta_iter->status().ok() && meta_iter->Valid()) {
1142
- Slice key = meta_iter->key();
1143
- if (key.starts_with(prefix)) {
1144
- key.remove_prefix(prefix.size());
1145
- if (kBuiltinNameAndAliases.find(key.ToString()) !=
1146
- kBuiltinNameAndAliases.end()) {
1147
- Slice v = meta_iter->value();
1148
- Status s = rep_->filter_handle.DecodeFrom(&v);
1149
- if (s.ok()) {
1150
- rep_->filter_type = filter_type;
1151
- if (filter_type == Rep::FilterType::kNoFilter) {
1152
- ROCKS_LOG_WARN(rep_->ioptions.logger,
1153
- "Detected obsolete filter type in %s. Read "
1154
- "performance might suffer until DB is fully "
1155
- "re-compacted.",
1156
- rep_->file->file_name().c_str());
1157
- }
1158
- break;
1159
- }
1160
- }
1161
- }
1162
- }
1163
- } else {
1164
- std::string filter_block_key = prefix + name;
1165
- if (FindMetaBlock(meta_iter, filter_block_key, &rep_->filter_handle)
1166
- .ok()) {
1167
- rep_->filter_type = filter_type;
1168
- if (filter_type == Rep::FilterType::kNoFilter) {
1169
- ROCKS_LOG_WARN(
1170
- rep_->ioptions.logger,
1171
- "Detected obsolete filter type in %s. Read performance might "
1172
- "suffer until DB is fully re-compacted.",
1173
- rep_->file->file_name().c_str());
1174
- }
1175
- break;
1176
- }
1177
- }
1178
- }
1179
- }
1180
- // Partition filters cannot be enabled without partition indexes
1181
- assert(rep_->filter_type != Rep::FilterType::kPartitionedFilter ||
1182
- rep_->index_type == BlockBasedTableOptions::kTwoLevelIndexSearch);
1183
-
1184
- // Find compression dictionary handle
1185
- Status s = FindOptionalMetaBlock(meta_iter, kCompressionDictBlockName,
1186
- &rep_->compression_dict_handle);
1187
- if (!s.ok()) {
1188
- return s;
1189
- }
1190
-
1191
- BlockBasedTableOptions::IndexType index_type = rep_->index_type;
1192
-
1193
- const bool use_cache = table_options.cache_index_and_filter_blocks;
1194
-
1195
- const bool maybe_flushed =
1196
- level == 0 && file_size <= max_file_size_for_l0_meta_pin;
1197
- std::function<bool(PinningTier, PinningTier)> is_pinned =
1198
- [maybe_flushed, &is_pinned](PinningTier pinning_tier,
1199
- PinningTier fallback_pinning_tier) {
1200
- // Fallback to fallback would lead to infinite recursion. Disallow it.
1201
- assert(fallback_pinning_tier != PinningTier::kFallback);
1202
-
1203
- switch (pinning_tier) {
1204
- case PinningTier::kFallback:
1205
- return is_pinned(fallback_pinning_tier,
1206
- PinningTier::kNone /* fallback_pinning_tier */);
1207
- case PinningTier::kNone:
1208
- return false;
1209
- case PinningTier::kFlushedAndSimilar:
1210
- return maybe_flushed;
1211
- case PinningTier::kAll:
1212
- return true;
1213
- };
1214
-
1215
- // In GCC, this is needed to suppress `control reaches end of non-void
1216
- // function [-Werror=return-type]`.
1217
- assert(false);
1218
- return false;
1219
- };
1220
- const bool pin_top_level_index = is_pinned(
1221
- table_options.metadata_cache_options.top_level_index_pinning,
1222
- table_options.pin_top_level_index_and_filter ? PinningTier::kAll
1223
- : PinningTier::kNone);
1224
- const bool pin_partition =
1225
- is_pinned(table_options.metadata_cache_options.partition_pinning,
1226
- table_options.pin_l0_filter_and_index_blocks_in_cache
1227
- ? PinningTier::kFlushedAndSimilar
1228
- : PinningTier::kNone);
1229
- const bool pin_unpartitioned =
1230
- is_pinned(table_options.metadata_cache_options.unpartitioned_pinning,
1231
- table_options.pin_l0_filter_and_index_blocks_in_cache
1232
- ? PinningTier::kFlushedAndSimilar
1233
- : PinningTier::kNone);
1234
-
1235
- // pin the first level of index
1236
- const bool pin_index =
1237
- index_type == BlockBasedTableOptions::kTwoLevelIndexSearch
1238
- ? pin_top_level_index
1239
- : pin_unpartitioned;
1240
- // prefetch the first level of index
1241
- // WART: this might be redundant (unnecessary cache hit) if !pin_index,
1242
- // depending on prepopulate_block_cache option
1243
- const bool prefetch_index = prefetch_all || pin_index;
1244
-
1245
- std::unique_ptr<IndexReader> index_reader;
1246
- s = new_table->CreateIndexReader(ro, prefetch_buffer, meta_iter, use_cache,
1247
- prefetch_index, pin_index, lookup_context,
1248
- &index_reader);
1249
- if (!s.ok()) {
1250
- return s;
1251
- }
1252
-
1253
- rep_->index_reader = std::move(index_reader);
1254
-
1255
- // The partitions of partitioned index are always stored in cache. They
1256
- // are hence follow the configuration for pin and prefetch regardless of
1257
- // the value of cache_index_and_filter_blocks
1258
- if (prefetch_all || pin_partition) {
1259
- s = rep_->index_reader->CacheDependencies(ro, pin_partition,
1260
- prefetch_buffer);
1261
- }
1262
- if (!s.ok()) {
1263
- return s;
1264
- }
1265
-
1266
- // pin the first level of filter
1267
- const bool pin_filter =
1268
- rep_->filter_type == Rep::FilterType::kPartitionedFilter
1269
- ? pin_top_level_index
1270
- : pin_unpartitioned;
1271
- // prefetch the first level of filter
1272
- // WART: this might be redundant (unnecessary cache hit) if !pin_filter,
1273
- // depending on prepopulate_block_cache option
1274
- const bool prefetch_filter = prefetch_all || pin_filter;
1275
-
1276
- if (rep_->filter_policy) {
1277
- auto filter = new_table->CreateFilterBlockReader(
1278
- ro, prefetch_buffer, use_cache, prefetch_filter, pin_filter,
1279
- lookup_context);
1280
-
1281
- if (filter) {
1282
- // Refer to the comment above about paritioned indexes always being cached
1283
- if (prefetch_all || pin_partition) {
1284
- s = filter->CacheDependencies(ro, pin_partition, prefetch_buffer);
1285
- if (!s.ok()) {
1286
- return s;
1287
- }
1288
- }
1289
- rep_->filter = std::move(filter);
1290
- }
1291
- }
1292
-
1293
- if (!rep_->compression_dict_handle.IsNull()) {
1294
- std::unique_ptr<UncompressionDictReader> uncompression_dict_reader;
1295
- s = UncompressionDictReader::Create(
1296
- this, ro, prefetch_buffer, use_cache, prefetch_all || pin_unpartitioned,
1297
- pin_unpartitioned, lookup_context, &uncompression_dict_reader);
1298
- if (!s.ok()) {
1299
- return s;
1300
- }
1301
-
1302
- rep_->uncompression_dict_reader = std::move(uncompression_dict_reader);
1303
- }
1304
-
1305
- assert(s.ok());
1306
- return s;
1307
- }
1308
-
1309
- void BlockBasedTable::SetupForCompaction() {}
1310
-
1311
- std::shared_ptr<const TableProperties> BlockBasedTable::GetTableProperties()
1312
- const {
1313
- return rep_->table_properties;
1314
- }
1315
-
1316
- const SeqnoToTimeMapping& BlockBasedTable::GetSeqnoToTimeMapping() const {
1317
- return rep_->seqno_to_time_mapping;
1318
- }
1319
-
1320
- size_t BlockBasedTable::ApproximateMemoryUsage() const {
1321
- size_t usage = 0;
1322
- if (rep_) {
1323
- usage += rep_->ApproximateMemoryUsage();
1324
- } else {
1325
- return usage;
1326
- }
1327
- if (rep_->filter) {
1328
- usage += rep_->filter->ApproximateMemoryUsage();
1329
- }
1330
- if (rep_->index_reader) {
1331
- usage += rep_->index_reader->ApproximateMemoryUsage();
1332
- }
1333
- if (rep_->uncompression_dict_reader) {
1334
- usage += rep_->uncompression_dict_reader->ApproximateMemoryUsage();
1335
- }
1336
- if (rep_->table_properties) {
1337
- usage += rep_->table_properties->ApproximateMemoryUsage();
1338
- }
1339
- return usage;
1340
- }
1341
-
1342
- // Load the meta-index-block from the file. On success, return the loaded
1343
- // metaindex
1344
- // block and its iterator.
1345
- Status BlockBasedTable::ReadMetaIndexBlock(
1346
- const ReadOptions& ro, FilePrefetchBuffer* prefetch_buffer,
1347
- std::unique_ptr<Block>* metaindex_block,
1348
- std::unique_ptr<InternalIterator>* iter) {
1349
- // TODO(sanjay): Skip this if footer.metaindex_handle() size indicates
1350
- // it is an empty block.
1351
- std::unique_ptr<Block_kMetaIndex> metaindex;
1352
- Status s = ReadAndParseBlockFromFile(
1353
- rep_->file.get(), prefetch_buffer, rep_->footer, ro,
1354
- rep_->footer.metaindex_handle(), &metaindex, rep_->ioptions,
1355
- rep_->create_context, true /*maybe_compressed*/,
1356
- UncompressionDict::GetEmptyDict(), rep_->persistent_cache_options,
1357
- GetMemoryAllocator(rep_->table_options), false /* for_compaction */,
1358
- false /* async_read */);
1359
-
1360
- if (!s.ok()) {
1361
- ROCKS_LOG_ERROR(rep_->ioptions.logger,
1362
- "Encountered error while reading data from properties"
1363
- " block %s",
1364
- s.ToString().c_str());
1365
- return s;
1366
- }
1367
-
1368
- *metaindex_block = std::move(metaindex);
1369
- // meta block uses bytewise comparator.
1370
- iter->reset(metaindex_block->get()->NewMetaIterator());
1371
- return Status::OK();
1372
- }
1373
-
1374
- template <typename TBlocklike>
1375
- Cache::Priority BlockBasedTable::GetCachePriority() const {
1376
- // Here we treat the legacy name "...index_and_filter_blocks..." to mean all
1377
- // metadata blocks that might go into block cache, EXCEPT only those needed
1378
- // for the read path (Get, etc.). TableProperties should not be needed on the
1379
- // read path (prefix extractor setting is an O(1) size special case that we
1380
- // are working not to require from TableProperties), so it is not given
1381
- // high-priority treatment if it should go into BlockCache.
1382
- if constexpr (TBlocklike::kBlockType == BlockType::kData ||
1383
- TBlocklike::kBlockType == BlockType::kProperties) {
1384
- return Cache::Priority::LOW;
1385
- } else if (rep_->table_options
1386
- .cache_index_and_filter_blocks_with_high_priority) {
1387
- return Cache::Priority::HIGH;
1388
- } else {
1389
- return Cache::Priority::LOW;
1390
- }
1391
- }
1392
-
1393
- template <typename TBlocklike>
1394
- WithBlocklikeCheck<Status, TBlocklike> BlockBasedTable::GetDataBlockFromCache(
1395
- const Slice& cache_key, BlockCacheInterface<TBlocklike> block_cache,
1396
- CachableEntry<TBlocklike>* out_parsed_block, GetContext* get_context,
1397
- const UncompressionDict* dict) const {
1398
- assert(out_parsed_block);
1399
- assert(out_parsed_block->IsEmpty());
1400
-
1401
- Status s;
1402
- Statistics* statistics = rep_->ioptions.statistics.get();
1403
-
1404
- // Lookup uncompressed cache first
1405
- if (block_cache) {
1406
- BlockCreateContext create_ctx = rep_->create_context;
1407
- create_ctx.dict = dict;
1408
- assert(!cache_key.empty());
1409
- auto cache_handle = block_cache.LookupFull(
1410
- cache_key, &create_ctx, GetCachePriority<TBlocklike>(), statistics,
1411
- rep_->ioptions.lowest_used_cache_tier);
1412
-
1413
- // Avoid updating metrics here if the handle is not complete yet. This
1414
- // happens with MultiGet and secondary cache. So update the metrics only
1415
- // if its a miss, or a hit and value is ready
1416
- if (!cache_handle) {
1417
- UpdateCacheMissMetrics(TBlocklike::kBlockType, get_context);
1418
- } else {
1419
- TBlocklike* value = block_cache.Value(cache_handle);
1420
- if (value) {
1421
- UpdateCacheHitMetrics(TBlocklike::kBlockType, get_context,
1422
- block_cache.get()->GetUsage(cache_handle));
1423
- }
1424
- out_parsed_block->SetCachedValue(value, block_cache.get(), cache_handle);
1425
- return s;
1426
- }
1427
- }
1428
-
1429
- // If not found, search from the compressed block cache.
1430
- assert(out_parsed_block->IsEmpty());
1431
-
1432
- return s;
1433
- }
1434
-
1435
- template <typename TBlocklike>
1436
- WithBlocklikeCheck<Status, TBlocklike> BlockBasedTable::PutDataBlockToCache(
1437
- const Slice& cache_key, BlockCacheInterface<TBlocklike> block_cache,
1438
- CachableEntry<TBlocklike>* out_parsed_block,
1439
- BlockContents&& uncompressed_block_contents,
1440
- BlockContents&& compressed_block_contents, CompressionType block_comp_type,
1441
- const UncompressionDict& uncompression_dict,
1442
- MemoryAllocator* memory_allocator, GetContext* get_context) const {
1443
- const ImmutableOptions& ioptions = rep_->ioptions;
1444
- const uint32_t format_version = rep_->table_options.format_version;
1445
- assert(out_parsed_block);
1446
- assert(out_parsed_block->IsEmpty());
1447
-
1448
- Status s;
1449
- Statistics* statistics = ioptions.stats;
1450
-
1451
- std::unique_ptr<TBlocklike> block_holder;
1452
- if (block_comp_type != kNoCompression &&
1453
- uncompressed_block_contents.data.empty()) {
1454
- assert(compressed_block_contents.data.data());
1455
- // Retrieve the uncompressed contents into a new buffer
1456
- UncompressionContext context(block_comp_type);
1457
- UncompressionInfo info(context, uncompression_dict, block_comp_type);
1458
- s = UncompressBlockData(info, compressed_block_contents.data.data(),
1459
- compressed_block_contents.data.size(),
1460
- &uncompressed_block_contents, format_version,
1461
- ioptions, memory_allocator);
1462
- if (!s.ok()) {
1463
- return s;
1464
- }
1465
- }
1466
- rep_->create_context.Create(&block_holder,
1467
- std::move(uncompressed_block_contents));
1468
-
1469
- // insert into uncompressed block cache
1470
- if (block_cache && block_holder->own_bytes()) {
1471
- size_t charge = block_holder->ApproximateMemoryUsage();
1472
- BlockCacheTypedHandle<TBlocklike>* cache_handle = nullptr;
1473
- s = block_cache.InsertFull(cache_key, block_holder.get(), charge,
1474
- &cache_handle, GetCachePriority<TBlocklike>(),
1475
- rep_->ioptions.lowest_used_cache_tier,
1476
- compressed_block_contents.data, block_comp_type);
1477
-
1478
- if (s.ok()) {
1479
- assert(cache_handle != nullptr);
1480
- out_parsed_block->SetCachedValue(block_holder.release(),
1481
- block_cache.get(), cache_handle);
1482
-
1483
- UpdateCacheInsertionMetrics(TBlocklike::kBlockType, get_context, charge,
1484
- s.IsOkOverwritten(), rep_->ioptions.stats);
1485
- } else {
1486
- RecordTick(statistics, BLOCK_CACHE_ADD_FAILURES);
1487
- }
1488
- } else {
1489
- out_parsed_block->SetOwnedValue(std::move(block_holder));
1490
- }
1491
-
1492
- return s;
1493
- }
1494
-
1495
- std::unique_ptr<FilterBlockReader> BlockBasedTable::CreateFilterBlockReader(
1496
- const ReadOptions& ro, FilePrefetchBuffer* prefetch_buffer, bool use_cache,
1497
- bool prefetch, bool pin, BlockCacheLookupContext* lookup_context) {
1498
- auto& rep = rep_;
1499
- auto filter_type = rep->filter_type;
1500
- if (filter_type == Rep::FilterType::kNoFilter) {
1501
- return std::unique_ptr<FilterBlockReader>();
1502
- }
1503
-
1504
- assert(rep->filter_policy);
1505
-
1506
- switch (filter_type) {
1507
- case Rep::FilterType::kPartitionedFilter:
1508
- return PartitionedFilterBlockReader::Create(
1509
- this, ro, prefetch_buffer, use_cache, prefetch, pin, lookup_context);
1510
-
1511
- case Rep::FilterType::kFullFilter:
1512
- return FullFilterBlockReader::Create(this, ro, prefetch_buffer, use_cache,
1513
- prefetch, pin, lookup_context);
1514
-
1515
- default:
1516
- // filter_type is either kNoFilter (exited the function at the first if),
1517
- // or it must be covered in this switch block
1518
- assert(false);
1519
- return std::unique_ptr<FilterBlockReader>();
1520
- }
1521
- }
1522
-
1523
- // disable_prefix_seek should be set to true when prefix_extractor found in SST
1524
- // differs from the one in mutable_cf_options and index type is HashBasedIndex
1525
- InternalIteratorBase<IndexValue>* BlockBasedTable::NewIndexIterator(
1526
- const ReadOptions& read_options, bool disable_prefix_seek,
1527
- IndexBlockIter* input_iter, GetContext* get_context,
1528
- BlockCacheLookupContext* lookup_context) const {
1529
- assert(rep_ != nullptr);
1530
- assert(rep_->index_reader != nullptr);
1531
-
1532
- // We don't return pinned data from index blocks, so no need
1533
- // to set `block_contents_pinned`.
1534
- return rep_->index_reader->NewIterator(read_options, disable_prefix_seek,
1535
- input_iter, get_context,
1536
- lookup_context);
1537
- }
1538
-
1539
- // TODO?
1540
- template <>
1541
- DataBlockIter* BlockBasedTable::InitBlockIterator<DataBlockIter>(
1542
- const Rep* rep, Block* block, BlockType block_type,
1543
- DataBlockIter* input_iter, bool block_contents_pinned) {
1544
- return block->NewDataIterator(rep->internal_comparator.user_comparator(),
1545
- rep->get_global_seqno(block_type), input_iter,
1546
- rep->ioptions.stats, block_contents_pinned,
1547
- rep->user_defined_timestamps_persisted);
1548
- }
1549
-
1550
- // TODO?
1551
- template <>
1552
- IndexBlockIter* BlockBasedTable::InitBlockIterator<IndexBlockIter>(
1553
- const Rep* rep, Block* block, BlockType block_type,
1554
- IndexBlockIter* input_iter, bool block_contents_pinned) {
1555
- return block->NewIndexIterator(
1556
- rep->internal_comparator.user_comparator(),
1557
- rep->get_global_seqno(block_type), input_iter, rep->ioptions.stats,
1558
- /* total_order_seek */ true, rep->index_has_first_key,
1559
- rep->index_key_includes_seq, rep->index_value_is_full,
1560
- block_contents_pinned, rep->user_defined_timestamps_persisted);
1561
- }
1562
-
1563
- // Right now only called for Data blocks.
1564
- template <typename TBlocklike>
1565
- Status BlockBasedTable::LookupAndPinBlocksInCache(
1566
- const ReadOptions& ro, const BlockHandle& handle,
1567
- CachableEntry<TBlocklike>* out_parsed_block) const {
1568
- BlockCacheInterface<TBlocklike> block_cache{
1569
- rep_->table_options.block_cache.get()};
1570
-
1571
- assert(block_cache);
1572
-
1573
- Status s;
1574
- CachableEntry<UncompressionDict> uncompression_dict;
1575
- if (rep_->uncompression_dict_reader) {
1576
- s = rep_->uncompression_dict_reader->GetOrReadUncompressionDictionary(
1577
- /* prefetch_buffer= */ nullptr, ro,
1578
- /* get_context= */ nullptr, /* lookup_context= */ nullptr,
1579
- &uncompression_dict);
1580
- if (!s.ok()) {
1581
- return s;
1582
- }
1583
- }
1584
-
1585
- // Do the lookup.
1586
- CacheKey key_data = GetCacheKey(rep_->base_cache_key, handle);
1587
- const Slice key = key_data.AsSlice();
1588
-
1589
- Statistics* statistics = rep_->ioptions.statistics.get();
1590
-
1591
- BlockCreateContext create_ctx = rep_->create_context;
1592
- create_ctx.dict = uncompression_dict.GetValue()
1593
- ? uncompression_dict.GetValue()
1594
- : &UncompressionDict::GetEmptyDict();
1595
-
1596
- auto cache_handle =
1597
- block_cache.LookupFull(key, &create_ctx, GetCachePriority<TBlocklike>(),
1598
- statistics, rep_->ioptions.lowest_used_cache_tier);
1599
-
1600
- if (!cache_handle) {
1601
- UpdateCacheMissMetrics(TBlocklike::kBlockType, /* get_context = */ nullptr);
1602
- return s;
1603
- }
1604
-
1605
- // Found in Cache.
1606
- TBlocklike* value = block_cache.Value(cache_handle);
1607
- if (value) {
1608
- UpdateCacheHitMetrics(TBlocklike::kBlockType, /* get_context = */ nullptr,
1609
- block_cache.get()->GetUsage(cache_handle));
1610
- }
1611
- out_parsed_block->SetCachedValue(value, block_cache.get(), cache_handle);
1612
-
1613
- assert(!out_parsed_block->IsEmpty());
1614
-
1615
- return s;
1616
- }
1617
-
1618
- // If contents is nullptr, this function looks up the block caches for the
1619
- // data block referenced by handle, and read the block from disk if necessary.
1620
- // If contents is non-null, it skips the cache lookup and disk read, since
1621
- // the caller has already read it. In both cases, if ro.fill_cache is true,
1622
- // it inserts the block into the block cache.
1623
- template <typename TBlocklike>
1624
- WithBlocklikeCheck<Status, TBlocklike>
1625
- BlockBasedTable::MaybeReadBlockAndLoadToCache(
1626
- FilePrefetchBuffer* prefetch_buffer, const ReadOptions& ro,
1627
- const BlockHandle& handle, const UncompressionDict& uncompression_dict,
1628
- bool for_compaction, CachableEntry<TBlocklike>* out_parsed_block,
1629
- GetContext* get_context, BlockCacheLookupContext* lookup_context,
1630
- BlockContents* contents, bool async_read,
1631
- bool use_block_cache_for_lookup) const {
1632
- assert(out_parsed_block != nullptr);
1633
- const bool no_io = (ro.read_tier == kBlockCacheTier);
1634
- BlockCacheInterface<TBlocklike> block_cache{
1635
- rep_->table_options.block_cache.get()};
1636
- // First, try to get the block from the cache
1637
- //
1638
- // If either block cache is enabled, we'll try to read from it.
1639
- Status s;
1640
- CacheKey key_data;
1641
- Slice key;
1642
- bool is_cache_hit = false;
1643
- if (block_cache) {
1644
- // create key for block cache
1645
- key_data = GetCacheKey(rep_->base_cache_key, handle);
1646
- key = key_data.AsSlice();
1647
-
1648
- if (!contents) {
1649
- if (use_block_cache_for_lookup) {
1650
- s = GetDataBlockFromCache(key, block_cache, out_parsed_block,
1651
- get_context, &uncompression_dict);
1652
- // Value could still be null at this point, so check the cache handle
1653
- // and update the read pattern for prefetching
1654
- if (out_parsed_block->GetValue() ||
1655
- out_parsed_block->GetCacheHandle()) {
1656
- // TODO(haoyu): Differentiate cache hit on uncompressed block cache
1657
- // and compressed block cache.
1658
- is_cache_hit = true;
1659
- if (prefetch_buffer) {
1660
- // Update the block details so that PrefetchBuffer can use the read
1661
- // pattern to determine if reads are sequential or not for
1662
- // prefetching. It should also take in account blocks read from
1663
- // cache.
1664
- prefetch_buffer->UpdateReadPattern(
1665
- handle.offset(), BlockSizeWithTrailer(handle),
1666
- ro.adaptive_readahead /*decrease_readahead_size*/);
1667
- }
1668
- }
1669
- }
1670
- }
1671
-
1672
- // Can't find the block from the cache. If I/O is allowed, read from the
1673
- // file.
1674
- if (out_parsed_block->GetValue() == nullptr &&
1675
- out_parsed_block->GetCacheHandle() == nullptr && !no_io &&
1676
- ro.fill_cache) {
1677
- Statistics* statistics = rep_->ioptions.stats;
1678
- const bool maybe_compressed =
1679
- TBlocklike::kBlockType != BlockType::kFilter &&
1680
- TBlocklike::kBlockType != BlockType::kCompressionDictionary &&
1681
- rep_->blocks_maybe_compressed;
1682
- // This flag, if true, tells BlockFetcher to return the uncompressed
1683
- // block when ReadBlockContents() is called.
1684
- const bool do_uncompress = maybe_compressed;
1685
- CompressionType contents_comp_type;
1686
- // Maybe serialized or uncompressed
1687
- BlockContents tmp_contents;
1688
- BlockContents uncomp_contents;
1689
- BlockContents comp_contents;
1690
- if (!contents) {
1691
- Histograms histogram = for_compaction ? READ_BLOCK_COMPACTION_MICROS
1692
- : READ_BLOCK_GET_MICROS;
1693
- StopWatch sw(rep_->ioptions.clock, statistics, histogram);
1694
- // Setting do_uncompress to false may cause an extra mempcy in the
1695
- // following cases -
1696
- // 1. Compression is enabled, but block is not actually compressed
1697
- // 2. Compressed block is in the prefetch buffer
1698
- // 3. Direct IO
1699
- //
1700
- // It would also cause a memory allocation to be used rather than
1701
- // stack if the compressed block size is < 5KB
1702
- BlockFetcher block_fetcher(
1703
- rep_->file.get(), prefetch_buffer, rep_->footer, ro, handle,
1704
- &tmp_contents, rep_->ioptions, do_uncompress, maybe_compressed,
1705
- TBlocklike::kBlockType, uncompression_dict,
1706
- rep_->persistent_cache_options,
1707
- GetMemoryAllocator(rep_->table_options),
1708
- /*allocator=*/nullptr);
1709
-
1710
- // If prefetch_buffer is not allocated, it will fallback to synchronous
1711
- // reading of block contents.
1712
- if (async_read && prefetch_buffer != nullptr) {
1713
- s = block_fetcher.ReadAsyncBlockContents();
1714
- if (!s.ok()) {
1715
- return s;
1716
- }
1717
- } else {
1718
- s = block_fetcher.ReadBlockContents();
1719
- }
1720
-
1721
- contents_comp_type = block_fetcher.get_compression_type();
1722
- if (get_context) {
1723
- switch (TBlocklike::kBlockType) {
1724
- case BlockType::kIndex:
1725
- ++get_context->get_context_stats_.num_index_read;
1726
- break;
1727
- case BlockType::kFilter:
1728
- case BlockType::kFilterPartitionIndex:
1729
- ++get_context->get_context_stats_.num_filter_read;
1730
- break;
1731
- default:
1732
- break;
1733
- }
1734
- }
1735
- if (s.ok()) {
1736
- if (do_uncompress && contents_comp_type != kNoCompression) {
1737
- comp_contents = BlockContents(block_fetcher.GetCompressedBlock());
1738
- uncomp_contents = std::move(tmp_contents);
1739
- } else if (contents_comp_type != kNoCompression) {
1740
- // do_uncompress must be false, so output of BlockFetcher is
1741
- // compressed
1742
- comp_contents = std::move(tmp_contents);
1743
- } else {
1744
- uncomp_contents = std::move(tmp_contents);
1745
- }
1746
-
1747
- // If filling cache is allowed and a cache is configured, try to put
1748
- // the block to the cache. Do this here while block_fetcher is in
1749
- // scope, since comp_contents will be a reference to the compressed
1750
- // block in block_fetcher
1751
- s = PutDataBlockToCache(
1752
- key, block_cache, out_parsed_block, std::move(uncomp_contents),
1753
- std::move(comp_contents), contents_comp_type, uncompression_dict,
1754
- GetMemoryAllocator(rep_->table_options), get_context);
1755
- }
1756
- } else {
1757
- contents_comp_type = GetBlockCompressionType(*contents);
1758
- if (contents_comp_type != kNoCompression) {
1759
- comp_contents = std::move(*contents);
1760
- } else {
1761
- uncomp_contents = std::move(*contents);
1762
- }
1763
-
1764
- if (s.ok()) {
1765
- // If filling cache is allowed and a cache is configured, try to put
1766
- // the block to the cache.
1767
- s = PutDataBlockToCache(
1768
- key, block_cache, out_parsed_block, std::move(uncomp_contents),
1769
- std::move(comp_contents), contents_comp_type, uncompression_dict,
1770
- GetMemoryAllocator(rep_->table_options), get_context);
1771
- }
1772
- }
1773
- }
1774
- }
1775
-
1776
- // TODO: optimize so that lookup_context != nullptr implies the others
1777
- if (block_cache_tracer_ && block_cache_tracer_->is_tracing_enabled() &&
1778
- lookup_context) {
1779
- SaveLookupContextOrTraceRecord(
1780
- key, is_cache_hit, ro, out_parsed_block->GetValue(), lookup_context);
1781
- }
1782
-
1783
- assert(s.ok() || out_parsed_block->GetValue() == nullptr);
1784
- return s;
1785
- }
1786
-
1787
- template <typename TBlocklike>
1788
- WithBlocklikeCheck<void, TBlocklike>
1789
- BlockBasedTable::SaveLookupContextOrTraceRecord(
1790
- const Slice& block_key, bool is_cache_hit, const ReadOptions& ro,
1791
- const TBlocklike* parsed_block_value,
1792
- BlockCacheLookupContext* lookup_context) const {
1793
- assert(lookup_context);
1794
- size_t usage = 0;
1795
- uint64_t nkeys = 0;
1796
- if (parsed_block_value) {
1797
- // Approximate the number of keys in the block using restarts.
1798
- int interval = rep_->table_options.block_restart_interval;
1799
- nkeys = interval * GetBlockNumRestarts(*parsed_block_value);
1800
- // On average, the last restart should be just over half utilized.
1801
- // Specifically, 1..N should be N/2 + 0.5. For example, 7 -> 4, 8 -> 4.5.
1802
- // Use the get_id to alternate between rounding up vs. down.
1803
- if (nkeys > 0) {
1804
- bool rounding = static_cast<int>(lookup_context->get_id) & 1;
1805
- nkeys -= (interval - rounding) / 2;
1806
- }
1807
- usage = parsed_block_value->ApproximateMemoryUsage();
1808
- }
1809
- TraceType trace_block_type = TraceType::kTraceMax;
1810
- switch (TBlocklike::kBlockType) {
1811
- case BlockType::kData:
1812
- trace_block_type = TraceType::kBlockTraceDataBlock;
1813
- break;
1814
- case BlockType::kFilter:
1815
- case BlockType::kFilterPartitionIndex:
1816
- trace_block_type = TraceType::kBlockTraceFilterBlock;
1817
- break;
1818
- case BlockType::kCompressionDictionary:
1819
- trace_block_type = TraceType::kBlockTraceUncompressionDictBlock;
1820
- break;
1821
- case BlockType::kRangeDeletion:
1822
- trace_block_type = TraceType::kBlockTraceRangeDeletionBlock;
1823
- break;
1824
- case BlockType::kIndex:
1825
- trace_block_type = TraceType::kBlockTraceIndexBlock;
1826
- break;
1827
- default:
1828
- // This cannot happen.
1829
- assert(false);
1830
- break;
1831
- }
1832
- const bool no_io = ro.read_tier == kBlockCacheTier;
1833
- bool no_insert = no_io || !ro.fill_cache;
1834
- if (BlockCacheTraceHelper::IsGetOrMultiGetOnDataBlock(
1835
- trace_block_type, lookup_context->caller)) {
1836
- // Make a copy of the block key here since it will be logged later.
1837
- lookup_context->FillLookupContext(is_cache_hit, no_insert, trace_block_type,
1838
- /*block_size=*/usage,
1839
- block_key.ToString(), nkeys);
1840
-
1841
- // Defer logging the access to Get() and MultiGet() to trace additional
1842
- // information, e.g., referenced_key
1843
- } else {
1844
- // Avoid making copy of block_key if it doesn't need to be saved in
1845
- // BlockCacheLookupContext
1846
- lookup_context->FillLookupContext(is_cache_hit, no_insert, trace_block_type,
1847
- /*block_size=*/usage,
1848
- /*block_key=*/{}, nkeys);
1849
-
1850
- // Fill in default values for irrelevant/unknown fields
1851
- FinishTraceRecord(*lookup_context, block_key,
1852
- lookup_context->referenced_key,
1853
- /*does_referenced_key_exist*/ false,
1854
- /*referenced_data_size*/ 0);
1855
- }
1856
- }
1857
-
1858
- void BlockBasedTable::FinishTraceRecord(
1859
- const BlockCacheLookupContext& lookup_context, const Slice& block_key,
1860
- const Slice& referenced_key, bool does_referenced_key_exist,
1861
- uint64_t referenced_data_size) const {
1862
- // Avoid making copy of referenced_key if it doesn't need to be saved in
1863
- // BlockCacheLookupContext
1864
- BlockCacheTraceRecord access_record(
1865
- rep_->ioptions.clock->NowMicros(),
1866
- /*block_key=*/"", lookup_context.block_type, lookup_context.block_size,
1867
- rep_->cf_id_for_tracing(),
1868
- /*cf_name=*/"", rep_->level_for_tracing(), rep_->sst_number_for_tracing(),
1869
- lookup_context.caller, lookup_context.is_cache_hit,
1870
- lookup_context.no_insert, lookup_context.get_id,
1871
- lookup_context.get_from_user_specified_snapshot,
1872
- /*referenced_key=*/"", referenced_data_size,
1873
- lookup_context.num_keys_in_block, does_referenced_key_exist);
1874
- // TODO: Should handle status here?
1875
- block_cache_tracer_
1876
- ->WriteBlockAccess(access_record, block_key, rep_->cf_name_for_tracing(),
1877
- referenced_key)
1878
- .PermitUncheckedError();
1879
- }
1880
-
1881
- template <typename TBlocklike /*, auto*/>
1882
- WithBlocklikeCheck<Status, TBlocklike> BlockBasedTable::RetrieveBlock(
1883
- FilePrefetchBuffer* prefetch_buffer, const ReadOptions& ro,
1884
- const BlockHandle& handle, const UncompressionDict& uncompression_dict,
1885
- CachableEntry<TBlocklike>* out_parsed_block, GetContext* get_context,
1886
- BlockCacheLookupContext* lookup_context, bool for_compaction,
1887
- bool use_cache, bool async_read, bool use_block_cache_for_lookup) const {
1888
- assert(out_parsed_block);
1889
- assert(out_parsed_block->IsEmpty());
1890
-
1891
- Status s;
1892
- if (use_cache) {
1893
- s = MaybeReadBlockAndLoadToCache(
1894
- prefetch_buffer, ro, handle, uncompression_dict, for_compaction,
1895
- out_parsed_block, get_context, lookup_context,
1896
- /*contents=*/nullptr, async_read, use_block_cache_for_lookup);
1897
-
1898
- if (!s.ok()) {
1899
- return s;
1900
- }
1901
-
1902
- if (out_parsed_block->GetValue() != nullptr ||
1903
- out_parsed_block->GetCacheHandle() != nullptr) {
1904
- assert(s.ok());
1905
- return s;
1906
- }
1907
- }
1908
-
1909
- assert(out_parsed_block->IsEmpty());
1910
-
1911
- const bool no_io = ro.read_tier == kBlockCacheTier;
1912
- if (no_io) {
1913
- return Status::Incomplete("no blocking io");
1914
- }
1915
-
1916
- const bool maybe_compressed =
1917
- TBlocklike::kBlockType != BlockType::kFilter &&
1918
- TBlocklike::kBlockType != BlockType::kCompressionDictionary &&
1919
- rep_->blocks_maybe_compressed;
1920
- std::unique_ptr<TBlocklike> block;
1921
-
1922
- {
1923
- Histograms histogram =
1924
- for_compaction ? READ_BLOCK_COMPACTION_MICROS : READ_BLOCK_GET_MICROS;
1925
- StopWatch sw(rep_->ioptions.clock, rep_->ioptions.stats, histogram);
1926
- s = ReadAndParseBlockFromFile(
1927
- rep_->file.get(), prefetch_buffer, rep_->footer, ro, handle, &block,
1928
- rep_->ioptions, rep_->create_context, maybe_compressed,
1929
- uncompression_dict, rep_->persistent_cache_options,
1930
- GetMemoryAllocator(rep_->table_options), for_compaction, async_read);
1931
-
1932
- if (get_context) {
1933
- switch (TBlocklike::kBlockType) {
1934
- case BlockType::kIndex:
1935
- ++(get_context->get_context_stats_.num_index_read);
1936
- break;
1937
- case BlockType::kFilter:
1938
- case BlockType::kFilterPartitionIndex:
1939
- ++(get_context->get_context_stats_.num_filter_read);
1940
- break;
1941
- default:
1942
- break;
1943
- }
1944
- }
1945
- }
1946
-
1947
- if (!s.ok()) {
1948
- return s;
1949
- }
1950
-
1951
- out_parsed_block->SetOwnedValue(std::move(block));
1952
-
1953
- assert(s.ok());
1954
- return s;
1955
- }
1956
-
1957
- BlockBasedTable::PartitionedIndexIteratorState::PartitionedIndexIteratorState(
1958
- const BlockBasedTable* table,
1959
- UnorderedMap<uint64_t, CachableEntry<Block>>* block_map)
1960
- : table_(table), block_map_(block_map) {}
1961
-
1962
- InternalIteratorBase<IndexValue>*
1963
- BlockBasedTable::PartitionedIndexIteratorState::NewSecondaryIterator(
1964
- const BlockHandle& handle) {
1965
- // Return a block iterator on the index partition
1966
- auto block = block_map_->find(handle.offset());
1967
- // block_map_ must be exhaustive
1968
- if (block == block_map_->end()) {
1969
- assert(false);
1970
- // Signal problem to caller
1971
- return nullptr;
1972
- }
1973
- const Rep* rep = table_->get_rep();
1974
- assert(rep);
1975
-
1976
- Statistics* kNullStats = nullptr;
1977
- // We don't return pinned data from index blocks, so no need
1978
- // to set `block_contents_pinned`.
1979
- return block->second.GetValue()->NewIndexIterator(
1980
- rep->internal_comparator.user_comparator(),
1981
- rep->get_global_seqno(BlockType::kIndex), nullptr, kNullStats, true,
1982
- rep->index_has_first_key, rep->index_key_includes_seq,
1983
- rep->index_value_is_full, /*block_contents_pinned=*/false,
1984
- rep->user_defined_timestamps_persisted);
1985
- }
1986
-
1987
- // This will be broken if the user specifies an unusual implementation
1988
- // of Options.comparator, or if the user specifies an unusual
1989
- // definition of prefixes in BlockBasedTableOptions.filter_policy.
1990
- // In particular, we require the following three properties:
1991
- //
1992
- // 1) key.starts_with(prefix(key))
1993
- // 2) Compare(prefix(key), key) <= 0.
1994
- // 3) If Compare(key1, key2) <= 0, then Compare(prefix(key1), prefix(key2)) <= 0
1995
- //
1996
- // If read_options.read_tier == kBlockCacheTier, this method will do no I/O and
1997
- // will return true if the filter block is not in memory and not found in block
1998
- // cache.
1999
- //
2000
- // REQUIRES: this method shouldn't be called while the DB lock is held.
2001
- bool BlockBasedTable::PrefixRangeMayMatch(
2002
- const Slice& internal_key, const ReadOptions& read_options,
2003
- const SliceTransform* options_prefix_extractor,
2004
- const bool need_upper_bound_check, BlockCacheLookupContext* lookup_context,
2005
- bool* filter_checked) const {
2006
- if (!rep_->filter_policy) {
2007
- return true;
2008
- }
2009
-
2010
- const SliceTransform* prefix_extractor;
2011
-
2012
- if (rep_->table_prefix_extractor == nullptr) {
2013
- if (need_upper_bound_check) {
2014
- return true;
2015
- }
2016
- prefix_extractor = options_prefix_extractor;
2017
- } else {
2018
- prefix_extractor = rep_->table_prefix_extractor.get();
2019
- }
2020
- auto ts_sz = rep_->internal_comparator.user_comparator()->timestamp_size();
2021
- auto user_key_without_ts =
2022
- ExtractUserKeyAndStripTimestamp(internal_key, ts_sz);
2023
- if (!prefix_extractor->InDomain(user_key_without_ts)) {
2024
- return true;
2025
- }
2026
-
2027
- bool may_match = true;
2028
-
2029
- FilterBlockReader* const filter = rep_->filter.get();
2030
- *filter_checked = false;
2031
- if (filter != nullptr) {
2032
- const Slice* const const_ikey_ptr = &internal_key;
2033
- may_match = filter->RangeMayExist(
2034
- read_options.iterate_upper_bound, user_key_without_ts, prefix_extractor,
2035
- rep_->internal_comparator.user_comparator(), const_ikey_ptr,
2036
- filter_checked, need_upper_bound_check, lookup_context, read_options);
2037
- }
2038
-
2039
- return may_match;
2040
- }
2041
-
2042
- bool BlockBasedTable::PrefixExtractorChanged(
2043
- const SliceTransform* prefix_extractor) const {
2044
- if (prefix_extractor == nullptr) {
2045
- return true;
2046
- } else if (prefix_extractor == rep_->table_prefix_extractor.get()) {
2047
- return false;
2048
- } else {
2049
- return PrefixExtractorChangedHelper(rep_->table_properties.get(),
2050
- prefix_extractor);
2051
- }
2052
- }
2053
-
2054
- Statistics* BlockBasedTable::GetStatistics() const {
2055
- return rep_->ioptions.stats;
2056
- }
2057
- bool BlockBasedTable::IsLastLevel() const {
2058
- return rep_->level == rep_->ioptions.num_levels - 1;
2059
- }
2060
-
2061
- InternalIterator* BlockBasedTable::NewIterator(
2062
- const ReadOptions& read_options, const SliceTransform* prefix_extractor,
2063
- Arena* arena, bool skip_filters, TableReaderCaller caller,
2064
- size_t compaction_readahead_size, bool allow_unprepared_value) {
2065
- BlockCacheLookupContext lookup_context{caller};
2066
- bool need_upper_bound_check =
2067
- read_options.auto_prefix_mode || PrefixExtractorChanged(prefix_extractor);
2068
- std::unique_ptr<InternalIteratorBase<IndexValue>> index_iter(NewIndexIterator(
2069
- read_options,
2070
- /*disable_prefix_seek=*/need_upper_bound_check &&
2071
- rep_->index_type == BlockBasedTableOptions::kHashSearch,
2072
- /*input_iter=*/nullptr, /*get_context=*/nullptr, &lookup_context));
2073
- if (arena == nullptr) {
2074
- return new BlockBasedTableIterator(
2075
- this, read_options, rep_->internal_comparator, std::move(index_iter),
2076
- !skip_filters && !read_options.total_order_seek &&
2077
- prefix_extractor != nullptr,
2078
- need_upper_bound_check, prefix_extractor, caller,
2079
- compaction_readahead_size, allow_unprepared_value);
2080
- } else {
2081
- auto* mem = arena->AllocateAligned(sizeof(BlockBasedTableIterator));
2082
- return new (mem) BlockBasedTableIterator(
2083
- this, read_options, rep_->internal_comparator, std::move(index_iter),
2084
- !skip_filters && !read_options.total_order_seek &&
2085
- prefix_extractor != nullptr,
2086
- need_upper_bound_check, prefix_extractor, caller,
2087
- compaction_readahead_size, allow_unprepared_value);
2088
- }
2089
- }
2090
-
2091
- FragmentedRangeTombstoneIterator* BlockBasedTable::NewRangeTombstoneIterator(
2092
- const ReadOptions& read_options) {
2093
- if (rep_->fragmented_range_dels == nullptr) {
2094
- return nullptr;
2095
- }
2096
- SequenceNumber snapshot = kMaxSequenceNumber;
2097
- if (read_options.snapshot != nullptr) {
2098
- snapshot = read_options.snapshot->GetSequenceNumber();
2099
- }
2100
- return new FragmentedRangeTombstoneIterator(rep_->fragmented_range_dels,
2101
- rep_->internal_comparator,
2102
- snapshot, read_options.timestamp);
2103
- }
2104
-
2105
- FragmentedRangeTombstoneIterator* BlockBasedTable::NewRangeTombstoneIterator(
2106
- SequenceNumber read_seqno, const Slice* timestamp) {
2107
- if (rep_->fragmented_range_dels == nullptr) {
2108
- return nullptr;
2109
- }
2110
- return new FragmentedRangeTombstoneIterator(rep_->fragmented_range_dels,
2111
- rep_->internal_comparator,
2112
- read_seqno, timestamp);
2113
- }
2114
-
2115
- bool BlockBasedTable::FullFilterKeyMayMatch(
2116
- FilterBlockReader* filter, const Slice& internal_key,
2117
- const SliceTransform* prefix_extractor, GetContext* get_context,
2118
- BlockCacheLookupContext* lookup_context,
2119
- const ReadOptions& read_options) const {
2120
- if (filter == nullptr) {
2121
- return true;
2122
- }
2123
- Slice user_key = ExtractUserKey(internal_key);
2124
- const Slice* const const_ikey_ptr = &internal_key;
2125
- bool may_match = true;
2126
- size_t ts_sz = rep_->internal_comparator.user_comparator()->timestamp_size();
2127
- Slice user_key_without_ts = StripTimestampFromUserKey(user_key, ts_sz);
2128
- if (rep_->whole_key_filtering) {
2129
- may_match = filter->KeyMayMatch(user_key_without_ts, const_ikey_ptr,
2130
- get_context, lookup_context, read_options);
2131
- if (may_match) {
2132
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_FULL_POSITIVE);
2133
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_positive, 1, rep_->level);
2134
- } else {
2135
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_USEFUL);
2136
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_useful, 1, rep_->level);
2137
- }
2138
- } else if (!PrefixExtractorChanged(prefix_extractor) &&
2139
- prefix_extractor->InDomain(user_key_without_ts)) {
2140
- // FIXME ^^^: there should be no reason for Get() to depend on current
2141
- // prefix_extractor at all. It should always use table_prefix_extractor.
2142
- may_match = filter->PrefixMayMatch(
2143
- prefix_extractor->Transform(user_key_without_ts), const_ikey_ptr,
2144
- get_context, lookup_context, read_options);
2145
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_PREFIX_CHECKED);
2146
- if (may_match) {
2147
- // Includes prefix stats
2148
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_positive, 1, rep_->level);
2149
- } else {
2150
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_PREFIX_USEFUL);
2151
- // Includes prefix stats
2152
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_useful, 1, rep_->level);
2153
- }
2154
- }
2155
- return may_match;
2156
- }
2157
-
2158
- void BlockBasedTable::FullFilterKeysMayMatch(
2159
- FilterBlockReader* filter, MultiGetRange* range,
2160
- const SliceTransform* prefix_extractor,
2161
- BlockCacheLookupContext* lookup_context,
2162
- const ReadOptions& read_options) const {
2163
- if (filter == nullptr) {
2164
- return;
2165
- }
2166
- uint64_t before_keys = range->KeysLeft();
2167
- assert(before_keys > 0); // Caller should ensure
2168
- if (rep_->whole_key_filtering) {
2169
- filter->KeysMayMatch(range, lookup_context, read_options);
2170
- uint64_t after_keys = range->KeysLeft();
2171
- if (after_keys) {
2172
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_FULL_POSITIVE, after_keys);
2173
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_positive, after_keys,
2174
- rep_->level);
2175
- }
2176
- uint64_t filtered_keys = before_keys - after_keys;
2177
- if (filtered_keys) {
2178
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_USEFUL, filtered_keys);
2179
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_useful, filtered_keys,
2180
- rep_->level);
2181
- }
2182
- } else if (!PrefixExtractorChanged(prefix_extractor)) {
2183
- // FIXME ^^^: there should be no reason for MultiGet() to depend on current
2184
- // prefix_extractor at all. It should always use table_prefix_extractor.
2185
- filter->PrefixesMayMatch(range, prefix_extractor, lookup_context,
2186
- read_options);
2187
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_PREFIX_CHECKED, before_keys);
2188
- uint64_t after_keys = range->KeysLeft();
2189
- if (after_keys) {
2190
- // Includes prefix stats
2191
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_positive, after_keys,
2192
- rep_->level);
2193
- }
2194
- uint64_t filtered_keys = before_keys - after_keys;
2195
- if (filtered_keys) {
2196
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_PREFIX_USEFUL,
2197
- filtered_keys);
2198
- // Includes prefix stats
2199
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_useful, filtered_keys,
2200
- rep_->level);
2201
- }
2202
- }
2203
- }
2204
-
2205
- Status BlockBasedTable::ApproximateKeyAnchors(const ReadOptions& read_options,
2206
- std::vector<Anchor>& anchors) {
2207
- // We iterator the whole index block here. More efficient implementation
2208
- // is possible if we push this operation into IndexReader. For example, we
2209
- // can directly sample from restart block entries in the index block and
2210
- // only read keys needed. Here we take a simple solution. Performance is
2211
- // likely not to be a problem. We are compacting the whole file, so all
2212
- // keys will be read out anyway. An extra read to index block might be
2213
- // a small share of the overhead. We can try to optimize if needed.
2214
- //
2215
- // `CacheDependencies()` brings all the blocks into cache using one I/O. That
2216
- // way the full index scan usually finds the index data it is looking for in
2217
- // cache rather than doing an I/O for each "dependency" (partition).
2218
- Status s = rep_->index_reader->CacheDependencies(
2219
- read_options, false /* pin */, nullptr /* prefetch_buffer */);
2220
- if (!s.ok()) {
2221
- return s;
2222
- }
2223
-
2224
- IndexBlockIter iiter_on_stack;
2225
- auto iiter = NewIndexIterator(
2226
- read_options, /*disable_prefix_seek=*/false, &iiter_on_stack,
2227
- /*get_context=*/nullptr, /*lookup_context=*/nullptr);
2228
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2229
- if (iiter != &iiter_on_stack) {
2230
- iiter_unique_ptr.reset(iiter);
2231
- }
2232
-
2233
- // If needed the threshold could be more adaptive. For example, it can be
2234
- // based on size, so that a larger will be sampled to more partitions than a
2235
- // smaller file. The size might also need to be passed in by the caller based
2236
- // on total compaction size.
2237
- const uint64_t kMaxNumAnchors = uint64_t{128};
2238
- uint64_t num_blocks = this->GetTableProperties()->num_data_blocks;
2239
- uint64_t num_blocks_per_anchor = num_blocks / kMaxNumAnchors;
2240
- if (num_blocks_per_anchor == 0) {
2241
- num_blocks_per_anchor = 1;
2242
- }
2243
-
2244
- uint64_t count = 0;
2245
- std::string last_key;
2246
- uint64_t range_size = 0;
2247
- uint64_t prev_offset = 0;
2248
- for (iiter->SeekToFirst(); iiter->Valid(); iiter->Next()) {
2249
- const BlockHandle& bh = iiter->value().handle;
2250
- range_size += bh.offset() + bh.size() - prev_offset;
2251
- prev_offset = bh.offset() + bh.size();
2252
- if (++count % num_blocks_per_anchor == 0) {
2253
- count = 0;
2254
- anchors.emplace_back(iiter->user_key(), range_size);
2255
- range_size = 0;
2256
- } else {
2257
- last_key = iiter->user_key().ToString();
2258
- }
2259
- }
2260
- if (count != 0) {
2261
- anchors.emplace_back(last_key, range_size);
2262
- }
2263
- return Status::OK();
2264
- }
2265
-
2266
- bool BlockBasedTable::TimestampMayMatch(const ReadOptions& read_options) const {
2267
- if (read_options.timestamp != nullptr && !rep_->min_timestamp.empty()) {
2268
- RecordTick(rep_->ioptions.stats, TIMESTAMP_FILTER_TABLE_CHECKED);
2269
- auto read_ts = read_options.timestamp;
2270
- auto comparator = rep_->internal_comparator.user_comparator();
2271
- if (comparator->CompareTimestamp(*read_ts, rep_->min_timestamp) < 0) {
2272
- RecordTick(rep_->ioptions.stats, TIMESTAMP_FILTER_TABLE_FILTERED);
2273
- return false;
2274
- }
2275
- }
2276
- return true;
2277
- }
2278
-
2279
- Status BlockBasedTable::Get(const ReadOptions& read_options, const Slice& key,
2280
- GetContext* get_context,
2281
- const SliceTransform* prefix_extractor,
2282
- bool skip_filters) {
2283
- // Similar to Bloom filter !may_match
2284
- // If timestamp is beyond the range of the table, skip
2285
- if (!TimestampMayMatch(read_options)) {
2286
- return Status::OK();
2287
- }
2288
- assert(key.size() >= 8); // key must be internal key
2289
- assert(get_context != nullptr);
2290
- Status s;
2291
-
2292
- FilterBlockReader* const filter =
2293
- !skip_filters ? rep_->filter.get() : nullptr;
2294
-
2295
- // First check the full filter
2296
- // If full filter not useful, Then go into each block
2297
- uint64_t tracing_get_id = get_context->get_tracing_get_id();
2298
- BlockCacheLookupContext lookup_context{
2299
- TableReaderCaller::kUserGet, tracing_get_id,
2300
- /*get_from_user_specified_snapshot=*/read_options.snapshot != nullptr};
2301
- if (block_cache_tracer_ && block_cache_tracer_->is_tracing_enabled()) {
2302
- // Trace the key since it contains both user key and sequence number.
2303
- lookup_context.referenced_key = key.ToString();
2304
- lookup_context.get_from_user_specified_snapshot =
2305
- read_options.snapshot != nullptr;
2306
- }
2307
- TEST_SYNC_POINT("BlockBasedTable::Get:BeforeFilterMatch");
2308
- const bool may_match =
2309
- FullFilterKeyMayMatch(filter, key, prefix_extractor, get_context,
2310
- &lookup_context, read_options);
2311
- TEST_SYNC_POINT("BlockBasedTable::Get:AfterFilterMatch");
2312
- if (may_match) {
2313
- IndexBlockIter iiter_on_stack;
2314
- // if prefix_extractor found in block differs from options, disable
2315
- // BlockPrefixIndex. Only do this check when index_type is kHashSearch.
2316
- bool need_upper_bound_check = false;
2317
- if (rep_->index_type == BlockBasedTableOptions::kHashSearch) {
2318
- need_upper_bound_check = PrefixExtractorChanged(prefix_extractor);
2319
- }
2320
- auto iiter =
2321
- NewIndexIterator(read_options, need_upper_bound_check, &iiter_on_stack,
2322
- get_context, &lookup_context);
2323
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2324
- if (iiter != &iiter_on_stack) {
2325
- iiter_unique_ptr.reset(iiter);
2326
- }
2327
-
2328
- size_t ts_sz =
2329
- rep_->internal_comparator.user_comparator()->timestamp_size();
2330
- bool matched = false; // if such user key matched a key in SST
2331
- bool done = false;
2332
- for (iiter->Seek(key); iiter->Valid() && !done; iiter->Next()) {
2333
- IndexValue v = iiter->value();
2334
-
2335
- if (!v.first_internal_key.empty() && !skip_filters &&
2336
- UserComparatorWrapper(rep_->internal_comparator.user_comparator())
2337
- .CompareWithoutTimestamp(
2338
- ExtractUserKey(key),
2339
- ExtractUserKey(v.first_internal_key)) < 0) {
2340
- // The requested key falls between highest key in previous block and
2341
- // lowest key in current block.
2342
- break;
2343
- }
2344
-
2345
- BlockCacheLookupContext lookup_data_block_context{
2346
- TableReaderCaller::kUserGet, tracing_get_id,
2347
- /*get_from_user_specified_snapshot=*/read_options.snapshot !=
2348
- nullptr};
2349
- bool does_referenced_key_exist = false;
2350
- DataBlockIter biter;
2351
- uint64_t referenced_data_size = 0;
2352
- Status tmp_status;
2353
- NewDataBlockIterator<DataBlockIter>(
2354
- read_options, v.handle, &biter, BlockType::kData, get_context,
2355
- &lookup_data_block_context, /*prefetch_buffer=*/nullptr,
2356
- /*for_compaction=*/false, /*async_read=*/false, tmp_status,
2357
- /*use_block_cache_for_lookup=*/true);
2358
-
2359
- if (read_options.read_tier == kBlockCacheTier &&
2360
- biter.status().IsIncomplete()) {
2361
- // couldn't get block from block_cache
2362
- // Update Saver.state to Found because we are only looking for
2363
- // whether we can guarantee the key is not there when "no_io" is set
2364
- get_context->MarkKeyMayExist();
2365
- s = biter.status();
2366
- break;
2367
- }
2368
- if (!biter.status().ok()) {
2369
- s = biter.status();
2370
- break;
2371
- }
2372
-
2373
- bool may_exist = biter.SeekForGet(key);
2374
- // If user-specified timestamp is supported, we cannot end the search
2375
- // just because hash index lookup indicates the key+ts does not exist.
2376
- if (!may_exist && ts_sz == 0) {
2377
- // HashSeek cannot find the key this block and the the iter is not
2378
- // the end of the block, i.e. cannot be in the following blocks
2379
- // either. In this case, the seek_key cannot be found, so we break
2380
- // from the top level for-loop.
2381
- done = true;
2382
- } else {
2383
- // Call the *saver function on each entry/block until it returns false
2384
- for (; biter.Valid(); biter.Next()) {
2385
- ParsedInternalKey parsed_key;
2386
- Status pik_status = ParseInternalKey(
2387
- biter.key(), &parsed_key, false /* log_err_key */); // TODO
2388
- if (!pik_status.ok()) {
2389
- s = pik_status;
2390
- break;
2391
- }
2392
-
2393
- Status read_status;
2394
- bool ret = get_context->SaveValue(
2395
- parsed_key, biter.value(), &matched, &read_status,
2396
- biter.IsValuePinned() ? &biter : nullptr);
2397
- if (!read_status.ok()) {
2398
- s = read_status;
2399
- break;
2400
- }
2401
- if (!ret) {
2402
- if (get_context->State() == GetContext::GetState::kFound) {
2403
- does_referenced_key_exist = true;
2404
- referenced_data_size = biter.key().size() + biter.value().size();
2405
- }
2406
- done = true;
2407
- break;
2408
- }
2409
- }
2410
- if (s.ok()) {
2411
- s = biter.status();
2412
- }
2413
- if (!s.ok()) {
2414
- break;
2415
- }
2416
- }
2417
- // Write the block cache access record.
2418
- if (block_cache_tracer_ && block_cache_tracer_->is_tracing_enabled()) {
2419
- // Avoid making copy of block_key, cf_name, and referenced_key when
2420
- // constructing the access record.
2421
- Slice referenced_key;
2422
- if (does_referenced_key_exist) {
2423
- referenced_key = biter.key();
2424
- } else {
2425
- referenced_key = key;
2426
- }
2427
- FinishTraceRecord(lookup_data_block_context,
2428
- lookup_data_block_context.block_key, referenced_key,
2429
- does_referenced_key_exist, referenced_data_size);
2430
- }
2431
-
2432
- if (done) {
2433
- // Avoid the extra Next which is expensive in two-level indexes
2434
- break;
2435
- }
2436
- }
2437
- if (matched && filter != nullptr) {
2438
- if (rep_->whole_key_filtering) {
2439
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_FULL_TRUE_POSITIVE);
2440
- } else {
2441
- RecordTick(rep_->ioptions.stats, BLOOM_FILTER_PREFIX_TRUE_POSITIVE);
2442
- }
2443
- // Includes prefix stats
2444
- PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_true_positive, 1,
2445
- rep_->level);
2446
- }
2447
-
2448
- if (s.ok() && !iiter->status().IsNotFound()) {
2449
- s = iiter->status();
2450
- }
2451
- }
2452
-
2453
- return s;
2454
- }
2455
-
2456
- Status BlockBasedTable::MultiGetFilter(const ReadOptions& read_options,
2457
- const SliceTransform* prefix_extractor,
2458
- MultiGetRange* mget_range) {
2459
- if (mget_range->empty()) {
2460
- // Caller should ensure non-empty (performance bug)
2461
- assert(false);
2462
- return Status::OK(); // Nothing to do
2463
- }
2464
-
2465
- FilterBlockReader* const filter = rep_->filter.get();
2466
- if (!filter) {
2467
- return Status::OK();
2468
- }
2469
-
2470
- // First check the full filter
2471
- // If full filter not useful, Then go into each block
2472
- uint64_t tracing_mget_id = BlockCacheTraceHelper::kReservedGetId;
2473
- if (mget_range->begin()->get_context) {
2474
- tracing_mget_id = mget_range->begin()->get_context->get_tracing_get_id();
2475
- }
2476
- BlockCacheLookupContext lookup_context{
2477
- TableReaderCaller::kUserMultiGet, tracing_mget_id,
2478
- /*_get_from_user_specified_snapshot=*/read_options.snapshot != nullptr};
2479
- FullFilterKeysMayMatch(filter, mget_range, prefix_extractor, &lookup_context,
2480
- read_options);
2481
-
2482
- return Status::OK();
2483
- }
2484
-
2485
- Status BlockBasedTable::Prefetch(const ReadOptions& read_options,
2486
- const Slice* const begin,
2487
- const Slice* const end) {
2488
- auto& comparator = rep_->internal_comparator;
2489
- UserComparatorWrapper user_comparator(comparator.user_comparator());
2490
- // pre-condition
2491
- if (begin && end && comparator.Compare(*begin, *end) > 0) {
2492
- return Status::InvalidArgument(*begin, *end);
2493
- }
2494
- BlockCacheLookupContext lookup_context{TableReaderCaller::kPrefetch};
2495
- IndexBlockIter iiter_on_stack;
2496
- auto iiter = NewIndexIterator(read_options, /*need_upper_bound_check=*/false,
2497
- &iiter_on_stack, /*get_context=*/nullptr,
2498
- &lookup_context);
2499
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2500
- if (iiter != &iiter_on_stack) {
2501
- iiter_unique_ptr = std::unique_ptr<InternalIteratorBase<IndexValue>>(iiter);
2502
- }
2503
-
2504
- if (!iiter->status().ok()) {
2505
- // error opening index iterator
2506
- return iiter->status();
2507
- }
2508
-
2509
- // indicates if we are on the last page that need to be pre-fetched
2510
- bool prefetching_boundary_page = false;
2511
-
2512
- for (begin ? iiter->Seek(*begin) : iiter->SeekToFirst(); iiter->Valid();
2513
- iiter->Next()) {
2514
- BlockHandle block_handle = iiter->value().handle;
2515
- const bool is_user_key = !rep_->index_key_includes_seq;
2516
- if (end &&
2517
- ((!is_user_key && comparator.Compare(iiter->key(), *end) >= 0) ||
2518
- (is_user_key &&
2519
- user_comparator.Compare(iiter->key(), ExtractUserKey(*end)) >= 0))) {
2520
- if (prefetching_boundary_page) {
2521
- break;
2522
- }
2523
-
2524
- // The index entry represents the last key in the data block.
2525
- // We should load this page into memory as well, but no more
2526
- prefetching_boundary_page = true;
2527
- }
2528
-
2529
- // Load the block specified by the block_handle into the block cache
2530
- DataBlockIter biter;
2531
- Status tmp_status;
2532
- NewDataBlockIterator<DataBlockIter>(
2533
- read_options, block_handle, &biter, /*type=*/BlockType::kData,
2534
- /*get_context=*/nullptr, &lookup_context,
2535
- /*prefetch_buffer=*/nullptr, /*for_compaction=*/false,
2536
- /*async_read=*/false, tmp_status, /*use_block_cache_for_lookup=*/true);
2537
-
2538
- if (!biter.status().ok()) {
2539
- // there was an unexpected error while pre-fetching
2540
- return biter.status();
2541
- }
2542
- }
2543
-
2544
- return Status::OK();
2545
- }
2546
-
2547
- Status BlockBasedTable::VerifyChecksum(const ReadOptions& read_options,
2548
- TableReaderCaller caller) {
2549
- Status s;
2550
- // Check Meta blocks
2551
- std::unique_ptr<Block> metaindex;
2552
- std::unique_ptr<InternalIterator> metaindex_iter;
2553
- s = ReadMetaIndexBlock(read_options, nullptr /* prefetch buffer */,
2554
- &metaindex, &metaindex_iter);
2555
- if (s.ok()) {
2556
- s = VerifyChecksumInMetaBlocks(read_options, metaindex_iter.get());
2557
- if (!s.ok()) {
2558
- return s;
2559
- }
2560
- } else {
2561
- return s;
2562
- }
2563
- // Check Data blocks
2564
- IndexBlockIter iiter_on_stack;
2565
- BlockCacheLookupContext context{caller};
2566
- InternalIteratorBase<IndexValue>* iiter = NewIndexIterator(
2567
- read_options, /*disable_prefix_seek=*/false, &iiter_on_stack,
2568
- /*get_context=*/nullptr, &context);
2569
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2570
- if (iiter != &iiter_on_stack) {
2571
- iiter_unique_ptr = std::unique_ptr<InternalIteratorBase<IndexValue>>(iiter);
2572
- }
2573
- if (!iiter->status().ok()) {
2574
- // error opening index iterator
2575
- return iiter->status();
2576
- }
2577
- s = VerifyChecksumInBlocks(read_options, iiter);
2578
- return s;
2579
- }
2580
-
2581
- Status BlockBasedTable::VerifyChecksumInBlocks(
2582
- const ReadOptions& read_options,
2583
- InternalIteratorBase<IndexValue>* index_iter) {
2584
- Status s;
2585
- // We are scanning the whole file, so no need to do exponential
2586
- // increasing of the buffer size.
2587
- size_t readahead_size = (read_options.readahead_size != 0)
2588
- ? read_options.readahead_size
2589
- : rep_->table_options.max_auto_readahead_size;
2590
- // FilePrefetchBuffer doesn't work in mmap mode and readahead is not
2591
- // needed there.
2592
- ReadaheadParams readahead_params;
2593
- readahead_params.initial_readahead_size = readahead_size;
2594
- readahead_params.max_readahead_size = readahead_size;
2595
- FilePrefetchBuffer prefetch_buffer(
2596
- readahead_params, !rep_->ioptions.allow_mmap_reads /* enable */);
2597
-
2598
- for (index_iter->SeekToFirst(); index_iter->Valid(); index_iter->Next()) {
2599
- s = index_iter->status();
2600
- if (!s.ok()) {
2601
- break;
2602
- }
2603
- BlockHandle handle = index_iter->value().handle;
2604
- BlockContents contents;
2605
- BlockFetcher block_fetcher(
2606
- rep_->file.get(), &prefetch_buffer, rep_->footer, read_options, handle,
2607
- &contents, rep_->ioptions, false /* decompress */,
2608
- false /*maybe_compressed*/, BlockType::kData,
2609
- UncompressionDict::GetEmptyDict(), rep_->persistent_cache_options);
2610
- s = block_fetcher.ReadBlockContents();
2611
- if (!s.ok()) {
2612
- break;
2613
- }
2614
- }
2615
- if (s.ok()) {
2616
- // In the case of two level indexes, we would have exited the above loop
2617
- // by checking index_iter->Valid(), but Valid() might have returned false
2618
- // due to an IO error. So check the index_iter status
2619
- s = index_iter->status();
2620
- }
2621
- return s;
2622
- }
2623
-
2624
- BlockType BlockBasedTable::GetBlockTypeForMetaBlockByName(
2625
- const Slice& meta_block_name) {
2626
- if (meta_block_name.starts_with(kFullFilterBlockPrefix)) {
2627
- return BlockType::kFilter;
2628
- }
2629
-
2630
- if (meta_block_name.starts_with(kPartitionedFilterBlockPrefix)) {
2631
- return BlockType::kFilterPartitionIndex;
2632
- }
2633
-
2634
- if (meta_block_name == kPropertiesBlockName) {
2635
- return BlockType::kProperties;
2636
- }
2637
-
2638
- if (meta_block_name == kCompressionDictBlockName) {
2639
- return BlockType::kCompressionDictionary;
2640
- }
2641
-
2642
- if (meta_block_name == kRangeDelBlockName) {
2643
- return BlockType::kRangeDeletion;
2644
- }
2645
-
2646
- if (meta_block_name == kHashIndexPrefixesBlock) {
2647
- return BlockType::kHashIndexPrefixes;
2648
- }
2649
-
2650
- if (meta_block_name == kHashIndexPrefixesMetadataBlock) {
2651
- return BlockType::kHashIndexMetadata;
2652
- }
2653
-
2654
- if (meta_block_name == kIndexBlockName) {
2655
- return BlockType::kIndex;
2656
- }
2657
-
2658
- if (meta_block_name.starts_with(kObsoleteFilterBlockPrefix)) {
2659
- // Obsolete but possible in old files
2660
- return BlockType::kInvalid;
2661
- }
2662
-
2663
- assert(false);
2664
- return BlockType::kInvalid;
2665
- }
2666
-
2667
- Status BlockBasedTable::VerifyChecksumInMetaBlocks(
2668
- const ReadOptions& read_options, InternalIteratorBase<Slice>* index_iter) {
2669
- Status s;
2670
- for (index_iter->SeekToFirst(); index_iter->Valid(); index_iter->Next()) {
2671
- s = index_iter->status();
2672
- if (!s.ok()) {
2673
- break;
2674
- }
2675
- BlockHandle handle;
2676
- Slice input = index_iter->value();
2677
- s = handle.DecodeFrom(&input);
2678
- if (!s.ok()) {
2679
- break;
2680
- }
2681
- BlockContents contents;
2682
- const Slice meta_block_name = index_iter->key();
2683
- if (meta_block_name == kPropertiesBlockName) {
2684
- // Unfortunate special handling for properties block checksum w/
2685
- // global seqno
2686
- std::unique_ptr<TableProperties> table_properties;
2687
- s = ReadTablePropertiesHelper(read_options, handle, rep_->file.get(),
2688
- nullptr /* prefetch_buffer */, rep_->footer,
2689
- rep_->ioptions, &table_properties,
2690
- nullptr /* memory_allocator */);
2691
- } else if (rep_->verify_checksum_set_on_open &&
2692
- meta_block_name == kIndexBlockName) {
2693
- // WART: For now, to maintain similar I/O behavior as before
2694
- // format_version=6, we skip verifying index block checksum--but only
2695
- // if it was checked on open.
2696
- } else {
2697
- // FIXME? Need to verify checksums of index and filter partitions?
2698
- s = BlockFetcher(
2699
- rep_->file.get(), nullptr /* prefetch buffer */, rep_->footer,
2700
- read_options, handle, &contents, rep_->ioptions,
2701
- false /* decompress */, false /*maybe_compressed*/,
2702
- GetBlockTypeForMetaBlockByName(meta_block_name),
2703
- UncompressionDict::GetEmptyDict(), rep_->persistent_cache_options)
2704
- .ReadBlockContents();
2705
- }
2706
- if (!s.ok()) {
2707
- break;
2708
- }
2709
- }
2710
- return s;
2711
- }
2712
-
2713
- bool BlockBasedTable::EraseFromCache(const BlockHandle& handle) const {
2714
- assert(rep_ != nullptr);
2715
-
2716
- Cache* const cache = rep_->table_options.block_cache.get();
2717
- if (cache == nullptr) {
2718
- return false;
2719
- }
2720
-
2721
- CacheKey key = GetCacheKey(rep_->base_cache_key, handle);
2722
-
2723
- Cache::Handle* const cache_handle = cache->Lookup(key.AsSlice());
2724
- if (cache_handle == nullptr) {
2725
- return false;
2726
- }
2727
-
2728
- return cache->Release(cache_handle, /*erase_if_last_ref=*/true);
2729
- }
2730
-
2731
- bool BlockBasedTable::TEST_BlockInCache(const BlockHandle& handle) const {
2732
- assert(rep_ != nullptr);
2733
-
2734
- Cache* const cache = rep_->table_options.block_cache.get();
2735
- if (cache == nullptr) {
2736
- return false;
2737
- }
2738
-
2739
- CacheKey key = GetCacheKey(rep_->base_cache_key, handle);
2740
-
2741
- Cache::Handle* const cache_handle = cache->Lookup(key.AsSlice());
2742
- if (cache_handle == nullptr) {
2743
- return false;
2744
- }
2745
-
2746
- cache->Release(cache_handle);
2747
-
2748
- return true;
2749
- }
2750
-
2751
- bool BlockBasedTable::TEST_KeyInCache(const ReadOptions& options,
2752
- const Slice& key) {
2753
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter(NewIndexIterator(
2754
- options, /*need_upper_bound_check=*/false, /*input_iter=*/nullptr,
2755
- /*get_context=*/nullptr, /*lookup_context=*/nullptr));
2756
- iiter->Seek(key);
2757
- assert(iiter->status().ok());
2758
- assert(iiter->Valid());
2759
-
2760
- return TEST_BlockInCache(iiter->value().handle);
2761
- }
2762
-
2763
- void BlockBasedTable::TEST_GetDataBlockHandle(const ReadOptions& options,
2764
- const Slice& key,
2765
- BlockHandle& handle) {
2766
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter(NewIndexIterator(
2767
- options, /*disable_prefix_seek=*/false, /*input_iter=*/nullptr,
2768
- /*get_context=*/nullptr, /*lookup_context=*/nullptr));
2769
- iiter->Seek(key);
2770
- assert(iiter->Valid());
2771
- handle = iiter->value().handle;
2772
- }
2773
-
2774
- // REQUIRES: The following fields of rep_ should have already been populated:
2775
- // 1. file
2776
- // 2. index_handle,
2777
- // 3. options
2778
- // 4. internal_comparator
2779
- // 5. index_type
2780
- Status BlockBasedTable::CreateIndexReader(
2781
- const ReadOptions& ro, FilePrefetchBuffer* prefetch_buffer,
2782
- InternalIterator* meta_iter, bool use_cache, bool prefetch, bool pin,
2783
- BlockCacheLookupContext* lookup_context,
2784
- std::unique_ptr<IndexReader>* index_reader) {
2785
- if (FormatVersionUsesIndexHandleInFooter(rep_->footer.format_version())) {
2786
- rep_->index_handle = rep_->footer.index_handle();
2787
- } else {
2788
- Status s = FindMetaBlock(meta_iter, kIndexBlockName, &rep_->index_handle);
2789
- if (!s.ok()) {
2790
- return s;
2791
- }
2792
- }
2793
-
2794
- switch (rep_->index_type) {
2795
- case BlockBasedTableOptions::kTwoLevelIndexSearch: {
2796
- return PartitionIndexReader::Create(this, ro, prefetch_buffer, use_cache,
2797
- prefetch, pin, lookup_context,
2798
- index_reader);
2799
- }
2800
- case BlockBasedTableOptions::kBinarySearch:
2801
- FALLTHROUGH_INTENDED;
2802
- case BlockBasedTableOptions::kBinarySearchWithFirstKey: {
2803
- return BinarySearchIndexReader::Create(this, ro, prefetch_buffer,
2804
- use_cache, prefetch, pin,
2805
- lookup_context, index_reader);
2806
- }
2807
- case BlockBasedTableOptions::kHashSearch: {
2808
- if (!rep_->table_prefix_extractor) {
2809
- ROCKS_LOG_WARN(rep_->ioptions.logger,
2810
- "Missing prefix extractor for hash index. Fall back to"
2811
- " binary search index.");
2812
- return BinarySearchIndexReader::Create(this, ro, prefetch_buffer,
2813
- use_cache, prefetch, pin,
2814
- lookup_context, index_reader);
2815
- } else {
2816
- return HashIndexReader::Create(this, ro, prefetch_buffer, meta_iter,
2817
- use_cache, prefetch, pin, lookup_context,
2818
- index_reader);
2819
- }
2820
- }
2821
- default: {
2822
- std::string error_message =
2823
- "Unrecognized index type: " + std::to_string(rep_->index_type);
2824
- return Status::InvalidArgument(error_message.c_str());
2825
- }
2826
- }
2827
- }
2828
-
2829
- uint64_t BlockBasedTable::ApproximateDataOffsetOf(
2830
- const InternalIteratorBase<IndexValue>& index_iter,
2831
- uint64_t data_size) const {
2832
- assert(index_iter.status().ok());
2833
- if (index_iter.Valid()) {
2834
- BlockHandle handle = index_iter.value().handle;
2835
- return handle.offset();
2836
- } else {
2837
- // The iterator is past the last key in the file.
2838
- return data_size;
2839
- }
2840
- }
2841
-
2842
- uint64_t BlockBasedTable::GetApproximateDataSize() {
2843
- // Should be in table properties unless super old version
2844
- if (rep_->table_properties) {
2845
- return rep_->table_properties->data_size;
2846
- }
2847
- // Fall back to rough estimate from footer
2848
- return rep_->footer.metaindex_handle().offset();
2849
- }
2850
-
2851
- uint64_t BlockBasedTable::ApproximateOffsetOf(const ReadOptions& read_options,
2852
- const Slice& key,
2853
- TableReaderCaller caller) {
2854
- uint64_t data_size = GetApproximateDataSize();
2855
- if (UNLIKELY(data_size == 0)) {
2856
- // Hmm. Let's just split in half to avoid skewing one way or another,
2857
- // since we don't know whether we're operating on lower bound or
2858
- // upper bound.
2859
- return rep_->file_size / 2;
2860
- }
2861
-
2862
- BlockCacheLookupContext context(caller);
2863
- IndexBlockIter iiter_on_stack;
2864
- auto index_iter =
2865
- NewIndexIterator(read_options, /*disable_prefix_seek=*/true,
2866
- /*input_iter=*/&iiter_on_stack, /*get_context=*/nullptr,
2867
- /*lookup_context=*/&context);
2868
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2869
- if (index_iter != &iiter_on_stack) {
2870
- iiter_unique_ptr.reset(index_iter);
2871
- }
2872
-
2873
- index_iter->Seek(key);
2874
- uint64_t offset;
2875
- if (index_iter->status().ok()) {
2876
- offset = ApproximateDataOffsetOf(*index_iter, data_size);
2877
- } else {
2878
- // Split in half to avoid skewing one way or another,
2879
- // since we don't know whether we're operating on lower bound or
2880
- // upper bound.
2881
- return rep_->file_size / 2;
2882
- }
2883
-
2884
- // Pro-rate file metadata (incl filters) size-proportionally across data
2885
- // blocks.
2886
- double size_ratio =
2887
- static_cast<double>(offset) / static_cast<double>(data_size);
2888
- return static_cast<uint64_t>(size_ratio *
2889
- static_cast<double>(rep_->file_size));
2890
- }
2891
-
2892
- uint64_t BlockBasedTable::ApproximateSize(const ReadOptions& read_options,
2893
- const Slice& start, const Slice& end,
2894
- TableReaderCaller caller) {
2895
- assert(rep_->internal_comparator.Compare(start, end) <= 0);
2896
-
2897
- uint64_t data_size = GetApproximateDataSize();
2898
- if (UNLIKELY(data_size == 0)) {
2899
- // Hmm. Assume whole file is involved, since we have lower and upper
2900
- // bound. This likely skews the estimate if we consider that this function
2901
- // is typically called with `[start, end]` fully contained in the file's
2902
- // key-range.
2903
- return rep_->file_size;
2904
- }
2905
-
2906
- BlockCacheLookupContext context(caller);
2907
- IndexBlockIter iiter_on_stack;
2908
- auto index_iter =
2909
- NewIndexIterator(read_options, /*disable_prefix_seek=*/true,
2910
- /*input_iter=*/&iiter_on_stack, /*get_context=*/nullptr,
2911
- /*lookup_context=*/&context);
2912
- std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
2913
- if (index_iter != &iiter_on_stack) {
2914
- iiter_unique_ptr.reset(index_iter);
2915
- }
2916
-
2917
- index_iter->Seek(start);
2918
- uint64_t start_offset;
2919
- if (index_iter->status().ok()) {
2920
- start_offset = ApproximateDataOffsetOf(*index_iter, data_size);
2921
- } else {
2922
- // Assume file is involved from the start. This likely skews the estimate
2923
- // but is consistent with the above error handling.
2924
- start_offset = 0;
2925
- }
2926
-
2927
- index_iter->Seek(end);
2928
- uint64_t end_offset;
2929
- if (index_iter->status().ok()) {
2930
- end_offset = ApproximateDataOffsetOf(*index_iter, data_size);
2931
- } else {
2932
- // Assume file is involved until the end. This likely skews the estimate
2933
- // but is consistent with the above error handling.
2934
- end_offset = data_size;
2935
- }
2936
-
2937
- assert(end_offset >= start_offset);
2938
- // Pro-rate file metadata (incl filters) size-proportionally across data
2939
- // blocks.
2940
- double size_ratio = static_cast<double>(end_offset - start_offset) /
2941
- static_cast<double>(data_size);
2942
- return static_cast<uint64_t>(size_ratio *
2943
- static_cast<double>(rep_->file_size));
2944
- }
2945
-
2946
- bool BlockBasedTable::TEST_FilterBlockInCache() const {
2947
- assert(rep_ != nullptr);
2948
- return rep_->filter_type != Rep::FilterType::kNoFilter &&
2949
- TEST_BlockInCache(rep_->filter_handle);
2950
- }
2951
-
2952
- bool BlockBasedTable::TEST_IndexBlockInCache() const {
2953
- assert(rep_ != nullptr);
2954
-
2955
- return TEST_BlockInCache(rep_->index_handle);
2956
- }
2957
-
2958
- Status BlockBasedTable::GetKVPairsFromDataBlocks(
2959
- const ReadOptions& read_options, std::vector<KVPairBlock>* kv_pair_blocks) {
2960
- std::unique_ptr<InternalIteratorBase<IndexValue>> blockhandles_iter(
2961
- NewIndexIterator(read_options, /*need_upper_bound_check=*/false,
2962
- /*input_iter=*/nullptr, /*get_context=*/nullptr,
2963
- /*lookup_contex=*/nullptr));
2964
-
2965
- Status s = blockhandles_iter->status();
2966
- if (!s.ok()) {
2967
- // Cannot read Index Block
2968
- return s;
2969
- }
2970
-
2971
- for (blockhandles_iter->SeekToFirst(); blockhandles_iter->Valid();
2972
- blockhandles_iter->Next()) {
2973
- s = blockhandles_iter->status();
2974
-
2975
- if (!s.ok()) {
2976
- break;
2977
- }
2978
-
2979
- std::unique_ptr<InternalIterator> datablock_iter;
2980
- Status tmp_status;
2981
- datablock_iter.reset(NewDataBlockIterator<DataBlockIter>(
2982
- read_options, blockhandles_iter->value().handle,
2983
- /*input_iter=*/nullptr, /*type=*/BlockType::kData,
2984
- /*get_context=*/nullptr, /*lookup_context=*/nullptr,
2985
- /*prefetch_buffer=*/nullptr, /*for_compaction=*/false,
2986
- /*async_read=*/false, tmp_status, /*use_block_cache_for_lookup=*/true));
2987
- s = datablock_iter->status();
2988
-
2989
- if (!s.ok()) {
2990
- // Error reading the block - Skipped
2991
- continue;
2992
- }
2993
-
2994
- KVPairBlock kv_pair_block;
2995
- for (datablock_iter->SeekToFirst(); datablock_iter->Valid();
2996
- datablock_iter->Next()) {
2997
- s = datablock_iter->status();
2998
- if (!s.ok()) {
2999
- // Error reading the block - Skipped
3000
- break;
3001
- }
3002
- const Slice& key = datablock_iter->key();
3003
- const Slice& value = datablock_iter->value();
3004
- std::string key_copy = std::string(key.data(), key.size());
3005
- std::string value_copy = std::string(value.data(), value.size());
3006
-
3007
- kv_pair_block.push_back(
3008
- std::make_pair(std::move(key_copy), std::move(value_copy)));
3009
- }
3010
- kv_pair_blocks->push_back(std::move(kv_pair_block));
3011
- }
3012
- return Status::OK();
3013
- }
3014
-
3015
- Status BlockBasedTable::DumpTable(WritableFile* out_file) {
3016
- WritableFileStringStreamAdapter out_file_wrapper(out_file);
3017
- std::ostream out_stream(&out_file_wrapper);
3018
- // Output Footer
3019
- out_stream << "Footer Details:\n"
3020
- "--------------------------------------\n";
3021
- out_stream << " " << rep_->footer.ToString() << "\n";
3022
-
3023
- // Output MetaIndex
3024
- out_stream << "Metaindex Details:\n"
3025
- "--------------------------------------\n";
3026
- std::unique_ptr<Block> metaindex;
3027
- std::unique_ptr<InternalIterator> metaindex_iter;
3028
- // TODO: plumb Env::IOActivity, Env::IOPriority
3029
- const ReadOptions ro;
3030
- Status s = ReadMetaIndexBlock(ro, nullptr /* prefetch_buffer */, &metaindex,
3031
- &metaindex_iter);
3032
- if (s.ok()) {
3033
- for (metaindex_iter->SeekToFirst(); metaindex_iter->Valid();
3034
- metaindex_iter->Next()) {
3035
- s = metaindex_iter->status();
3036
- if (!s.ok()) {
3037
- return s;
3038
- }
3039
- if (metaindex_iter->key() == kPropertiesBlockName) {
3040
- out_stream << " Properties block handle: "
3041
- << metaindex_iter->value().ToString(true) << "\n";
3042
- } else if (metaindex_iter->key() == kCompressionDictBlockName) {
3043
- out_stream << " Compression dictionary block handle: "
3044
- << metaindex_iter->value().ToString(true) << "\n";
3045
- } else if (strstr(metaindex_iter->key().ToString().c_str(),
3046
- "filter.rocksdb.") != nullptr) {
3047
- out_stream << " Filter block handle: "
3048
- << metaindex_iter->value().ToString(true) << "\n";
3049
- } else if (metaindex_iter->key() == kRangeDelBlockName) {
3050
- out_stream << " Range deletion block handle: "
3051
- << metaindex_iter->value().ToString(true) << "\n";
3052
- }
3053
- }
3054
- out_stream << "\n";
3055
- } else {
3056
- return s;
3057
- }
3058
-
3059
- // Output TableProperties
3060
- const ROCKSDB_NAMESPACE::TableProperties* table_properties;
3061
- table_properties = rep_->table_properties.get();
3062
-
3063
- if (table_properties != nullptr) {
3064
- out_stream << "Table Properties:\n"
3065
- "--------------------------------------\n";
3066
- out_stream << " " << table_properties->ToString("\n ", ": ") << "\n";
3067
- }
3068
-
3069
- if (rep_->filter) {
3070
- out_stream << "Filter Details:\n"
3071
- "--------------------------------------\n";
3072
- out_stream << " " << rep_->filter->ToString() << "\n";
3073
- }
3074
-
3075
- // Output Index block
3076
- s = DumpIndexBlock(out_stream);
3077
- if (!s.ok()) {
3078
- return s;
3079
- }
3080
-
3081
- // Output compression dictionary
3082
- if (rep_->uncompression_dict_reader) {
3083
- CachableEntry<UncompressionDict> uncompression_dict;
3084
- s = rep_->uncompression_dict_reader->GetOrReadUncompressionDictionary(
3085
- nullptr /* prefetch_buffer */, ro, nullptr /* get_context */,
3086
- nullptr /* lookup_context */, &uncompression_dict);
3087
- if (!s.ok()) {
3088
- return s;
3089
- }
3090
-
3091
- assert(uncompression_dict.GetValue());
3092
-
3093
- const Slice& raw_dict = uncompression_dict.GetValue()->GetRawDict();
3094
- out_stream << "Compression Dictionary:\n"
3095
- "--------------------------------------\n";
3096
- out_stream << " size (bytes): " << raw_dict.size() << "\n\n";
3097
- out_stream << " HEX " << raw_dict.ToString(true) << "\n\n";
3098
- }
3099
-
3100
- // Output range deletions block
3101
- auto* range_del_iter = NewRangeTombstoneIterator(ro);
3102
- if (range_del_iter != nullptr) {
3103
- range_del_iter->SeekToFirst();
3104
- if (range_del_iter->Valid()) {
3105
- out_stream << "Range deletions:\n"
3106
- "--------------------------------------\n";
3107
- for (; range_del_iter->Valid(); range_del_iter->Next()) {
3108
- DumpKeyValue(range_del_iter->key(), range_del_iter->value(),
3109
- out_stream);
3110
- }
3111
- out_stream << "\n";
3112
- }
3113
- delete range_del_iter;
3114
- }
3115
- // Output Data blocks
3116
- s = DumpDataBlocks(out_stream);
3117
-
3118
- if (!s.ok()) {
3119
- return s;
3120
- }
3121
-
3122
- if (!out_stream.good()) {
3123
- return Status::IOError("Failed to write to output file");
3124
- }
3125
- return Status::OK();
3126
- }
3127
-
3128
- Status BlockBasedTable::DumpIndexBlock(std::ostream& out_stream) {
3129
- out_stream << "Index Details:\n"
3130
- "--------------------------------------\n";
3131
- // TODO: plumb Env::IOActivity, Env::IOPriority
3132
- const ReadOptions read_options;
3133
- std::unique_ptr<InternalIteratorBase<IndexValue>> blockhandles_iter(
3134
- NewIndexIterator(read_options, /*need_upper_bound_check=*/false,
3135
- /*input_iter=*/nullptr, /*get_context=*/nullptr,
3136
- /*lookup_contex=*/nullptr));
3137
- Status s = blockhandles_iter->status();
3138
- if (!s.ok()) {
3139
- out_stream << "Can not read Index Block \n\n";
3140
- return s;
3141
- }
3142
-
3143
- out_stream << " Block key hex dump: Data block handle\n";
3144
- out_stream << " Block key ascii\n\n";
3145
- for (blockhandles_iter->SeekToFirst(); blockhandles_iter->Valid();
3146
- blockhandles_iter->Next()) {
3147
- s = blockhandles_iter->status();
3148
- if (!s.ok()) {
3149
- break;
3150
- }
3151
- Slice key = blockhandles_iter->key();
3152
- Slice user_key;
3153
- InternalKey ikey;
3154
- if (!rep_->index_key_includes_seq) {
3155
- user_key = key;
3156
- } else {
3157
- ikey.DecodeFrom(key);
3158
- user_key = ikey.user_key();
3159
- }
3160
-
3161
- out_stream << " HEX " << user_key.ToString(true) << ": "
3162
- << blockhandles_iter->value().ToString(true,
3163
- rep_->index_has_first_key)
3164
- << " offset " << blockhandles_iter->value().handle.offset()
3165
- << " size " << blockhandles_iter->value().handle.size() << "\n";
3166
-
3167
- std::string str_key = user_key.ToString();
3168
- std::string res_key;
3169
- char cspace = ' ';
3170
- for (size_t i = 0; i < str_key.size(); i++) {
3171
- res_key.append(&str_key[i], 1);
3172
- res_key.append(1, cspace);
3173
- }
3174
- out_stream << " ASCII " << res_key << "\n";
3175
- out_stream << " ------\n";
3176
- }
3177
- out_stream << "\n";
3178
- return Status::OK();
3179
- }
3180
-
3181
- Status BlockBasedTable::DumpDataBlocks(std::ostream& out_stream) {
3182
- // TODO: plumb Env::IOActivity, Env::IOPriority
3183
- const ReadOptions read_options;
3184
- std::unique_ptr<InternalIteratorBase<IndexValue>> blockhandles_iter(
3185
- NewIndexIterator(read_options, /*need_upper_bound_check=*/false,
3186
- /*input_iter=*/nullptr, /*get_context=*/nullptr,
3187
- /*lookup_contex=*/nullptr));
3188
- Status s = blockhandles_iter->status();
3189
- if (!s.ok()) {
3190
- out_stream << "Can not read Index Block \n\n";
3191
- return s;
3192
- }
3193
-
3194
- uint64_t datablock_size_min = std::numeric_limits<uint64_t>::max();
3195
- uint64_t datablock_size_max = 0;
3196
- uint64_t datablock_size_sum = 0;
3197
-
3198
- size_t block_id = 1;
3199
- for (blockhandles_iter->SeekToFirst(); blockhandles_iter->Valid();
3200
- block_id++, blockhandles_iter->Next()) {
3201
- s = blockhandles_iter->status();
3202
- if (!s.ok()) {
3203
- break;
3204
- }
3205
-
3206
- BlockHandle bh = blockhandles_iter->value().handle;
3207
- uint64_t datablock_size = bh.size();
3208
- datablock_size_min = std::min(datablock_size_min, datablock_size);
3209
- datablock_size_max = std::max(datablock_size_max, datablock_size);
3210
- datablock_size_sum += datablock_size;
3211
-
3212
- out_stream << "Data Block # " << block_id << " @ "
3213
- << blockhandles_iter->value().handle.ToString(true) << "\n";
3214
- out_stream << "--------------------------------------\n";
3215
-
3216
- std::unique_ptr<InternalIterator> datablock_iter;
3217
- Status tmp_status;
3218
- datablock_iter.reset(NewDataBlockIterator<DataBlockIter>(
3219
- read_options, blockhandles_iter->value().handle,
3220
- /*input_iter=*/nullptr, /*type=*/BlockType::kData,
3221
- /*get_context=*/nullptr, /*lookup_context=*/nullptr,
3222
- /*prefetch_buffer=*/nullptr, /*for_compaction=*/false,
3223
- /*async_read=*/false, tmp_status, /*use_block_cache_for_lookup=*/true));
3224
- s = datablock_iter->status();
3225
-
3226
- if (!s.ok()) {
3227
- out_stream << "Error reading the block - Skipped \n\n";
3228
- continue;
3229
- }
3230
-
3231
- for (datablock_iter->SeekToFirst(); datablock_iter->Valid();
3232
- datablock_iter->Next()) {
3233
- s = datablock_iter->status();
3234
- if (!s.ok()) {
3235
- out_stream << "Error reading the block - Skipped \n";
3236
- break;
3237
- }
3238
- DumpKeyValue(datablock_iter->key(), datablock_iter->value(), out_stream);
3239
- }
3240
- out_stream << "\n";
3241
- }
3242
-
3243
- uint64_t num_datablocks = block_id - 1;
3244
- if (num_datablocks) {
3245
- double datablock_size_avg =
3246
- static_cast<double>(datablock_size_sum) / num_datablocks;
3247
- out_stream << "Data Block Summary:\n";
3248
- out_stream << "--------------------------------------\n";
3249
- out_stream << " # data blocks: " << num_datablocks << "\n";
3250
- out_stream << " min data block size: " << datablock_size_min << "\n";
3251
- out_stream << " max data block size: " << datablock_size_max << "\n";
3252
- out_stream << " avg data block size: "
3253
- << std::to_string(datablock_size_avg) << "\n";
3254
- }
3255
-
3256
- return Status::OK();
3257
- }
3258
-
3259
- void BlockBasedTable::DumpKeyValue(const Slice& key, const Slice& value,
3260
- std::ostream& out_stream) {
3261
- InternalKey ikey;
3262
- ikey.DecodeFrom(key);
3263
-
3264
- out_stream << " HEX " << ikey.user_key().ToString(true) << ": "
3265
- << value.ToString(true) << "\n";
3266
-
3267
- std::string str_key = ikey.user_key().ToString();
3268
- std::string str_value = value.ToString();
3269
- std::string res_key, res_value;
3270
- char cspace = ' ';
3271
- for (size_t i = 0; i < str_key.size(); i++) {
3272
- if (str_key[i] == '\0') {
3273
- res_key.append("\\0", 2);
3274
- } else {
3275
- res_key.append(&str_key[i], 1);
3276
- }
3277
- res_key.append(1, cspace);
3278
- }
3279
- for (size_t i = 0; i < str_value.size(); i++) {
3280
- if (str_value[i] == '\0') {
3281
- res_value.append("\\0", 2);
3282
- } else {
3283
- res_value.append(&str_value[i], 1);
3284
- }
3285
- res_value.append(1, cspace);
3286
- }
3287
-
3288
- out_stream << " ASCII " << res_key << ": " << res_value << "\n";
3289
- out_stream << " ------\n";
3290
- }
3291
-
3292
- void BlockBasedTable::MarkObsolete(uint32_t uncache_aggressiveness) {
3293
- rep_->uncache_aggressiveness.StoreRelaxed(uncache_aggressiveness);
3294
- }
3295
-
3296
- } // namespace ROCKSDB_NAMESPACE