rocksdb-native 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.c +92 -10
- package/index.js +9 -0
- package/lib/batch.js +11 -1
- package/lib/iterator.js +3 -1
- package/lib/snapshot.js +21 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/rocksdb-native.bare +0 -0
- package/prebuilds/darwin-arm64/rocksdb-native.node +0 -0
- package/prebuilds/darwin-x64/rocksdb-native.bare +0 -0
- package/prebuilds/darwin-x64/rocksdb-native.node +0 -0
- package/prebuilds/linux-arm64/rocksdb-native.bare +0 -0
- package/prebuilds/linux-arm64/rocksdb-native.node +0 -0
- package/prebuilds/linux-x64/rocksdb-native.bare +0 -0
- package/prebuilds/linux-x64/rocksdb-native.node +0 -0
- package/prebuilds/win32-x64/rocksdb-native.bare +0 -0
- package/prebuilds/win32-x64/rocksdb-native.node +0 -0
- package/vendor/librocksdb/include/rocksdb.h +38 -4
- package/vendor/librocksdb/src/rocksdb.cc +114 -14
- package/vendor/librocksdb/vendor/rocksdb/CMakeLists.txt +21 -4
- package/vendor/librocksdb/vendor/rocksdb/cache/secondary_cache_adapter.cc +6 -3
- package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.cc +4 -4
- package/vendor/librocksdb/vendor/rocksdb/db/arena_wrapped_db_iter.h +4 -2
- package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.cc +20 -0
- package/vendor/librocksdb/vendor/rocksdb/db/attribute_group_iterator_impl.h +83 -0
- package/vendor/librocksdb/vendor/rocksdb/db/builder.cc +9 -5
- package/vendor/librocksdb/vendor/rocksdb/db/builder.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/c.cc +231 -6
- package/vendor/librocksdb/vendor/rocksdb/db/c_test.c +202 -2
- package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.cc +47 -0
- package/vendor/librocksdb/vendor/rocksdb/db/coalescing_iterator.h +79 -0
- package/vendor/librocksdb/vendor/rocksdb/db/column_family.cc +28 -0
- package/vendor/librocksdb/vendor/rocksdb/db/column_family.h +17 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.cc +8 -1
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction.h +11 -9
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.cc +50 -23
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_iterator.h +13 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.cc +22 -25
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_job.h +2 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.cc +8 -1
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_outputs.h +1 -0
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.cc +40 -17
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker.h +20 -14
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_level.cc +11 -6
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +77 -24
- package/vendor/librocksdb/vendor/rocksdb/db/compaction/compaction_service_job.cc +2 -0
- package/vendor/librocksdb/vendor/rocksdb/db/convenience.cc +3 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_filesnapshot.cc +125 -31
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.cc +457 -231
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl.h +172 -73
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +152 -133
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_debug.cc +5 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_files.cc +58 -52
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.cc +348 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_follower.h +54 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_open.cc +136 -117
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +4 -3
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_secondary.h +7 -6
- package/vendor/librocksdb/vendor/rocksdb/db/db_impl/db_impl_write.cc +134 -80
- package/vendor/librocksdb/vendor/rocksdb/db/db_iter.cc +11 -0
- package/vendor/librocksdb/vendor/rocksdb/db/db_test2.cc +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.cc +11 -1
- package/vendor/librocksdb/vendor/rocksdb/db/db_test_util.h +11 -7
- package/vendor/librocksdb/vendor/rocksdb/db/dbformat.cc +19 -4
- package/vendor/librocksdb/vendor/rocksdb/db/dbformat.h +3 -2
- package/vendor/librocksdb/vendor/rocksdb/db/error_handler.cc +34 -39
- package/vendor/librocksdb/vendor/rocksdb/db/error_handler.h +3 -4
- package/vendor/librocksdb/vendor/rocksdb/db/event_helpers.cc +6 -3
- package/vendor/librocksdb/vendor/rocksdb/db/experimental.cc +3 -2
- package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +76 -18
- package/vendor/librocksdb/vendor/rocksdb/db/external_sst_file_ingestion_job.h +11 -0
- package/vendor/librocksdb/vendor/rocksdb/db/flush_job.cc +37 -5
- package/vendor/librocksdb/vendor/rocksdb/db/flush_job.h +14 -0
- package/vendor/librocksdb/vendor/rocksdb/db/import_column_family_job.cc +49 -45
- package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.cc +60 -1
- package/vendor/librocksdb/vendor/rocksdb/db/internal_stats.h +20 -1
- package/vendor/librocksdb/vendor/rocksdb/db/log_reader.cc +15 -6
- package/vendor/librocksdb/vendor/rocksdb/db/log_writer.cc +59 -10
- package/vendor/librocksdb/vendor/rocksdb/db/log_writer.h +8 -0
- package/vendor/librocksdb/vendor/rocksdb/db/memtable.cc +24 -40
- package/vendor/librocksdb/vendor/rocksdb/db/memtable.h +10 -10
- package/vendor/librocksdb/vendor/rocksdb/db/memtable_list.cc +9 -8
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator_impl.h +296 -0
- package/vendor/librocksdb/vendor/rocksdb/db/range_tombstone_fragmenter.h +8 -10
- package/vendor/librocksdb/vendor/rocksdb/db/repair.cc +4 -3
- package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.cc +30 -0
- package/vendor/librocksdb/vendor/rocksdb/db/seqno_to_time_mapping.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/db/table_cache.cc +17 -2
- package/vendor/librocksdb/vendor/rocksdb/db/table_cache.h +9 -1
- package/vendor/librocksdb/vendor/rocksdb/db/table_properties_collector.h +9 -2
- package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.cc +3 -3
- package/vendor/librocksdb/vendor/rocksdb/db/transaction_log_impl.h +7 -7
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit.cc +0 -1
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.cc +39 -5
- package/vendor/librocksdb/vendor/rocksdb/db/version_edit_handler.h +24 -15
- package/vendor/librocksdb/vendor/rocksdb/db/version_set.cc +117 -64
- package/vendor/librocksdb/vendor/rocksdb/db/version_set.h +27 -10
- package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.cc +37 -29
- package/vendor/librocksdb/vendor/rocksdb/db/wal_manager.h +6 -5
- package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns.cc +2 -3
- package/vendor/librocksdb/vendor/rocksdb/db/wide/wide_columns_helper.cc +6 -0
- package/vendor/librocksdb/vendor/rocksdb/db/write_batch.cc +89 -31
- package/vendor/librocksdb/vendor/rocksdb/db/write_thread.cc +53 -5
- package/vendor/librocksdb/vendor/rocksdb/db/write_thread.h +36 -4
- package/vendor/librocksdb/vendor/rocksdb/env/composite_env_wrapper.h +21 -0
- package/vendor/librocksdb/vendor/rocksdb/env/env.cc +15 -0
- package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.cc +331 -0
- package/vendor/librocksdb/vendor/rocksdb/env/fs_on_demand.h +139 -0
- package/vendor/librocksdb/vendor/rocksdb/env/io_posix.cc +8 -6
- package/vendor/librocksdb/vendor/rocksdb/env/io_posix.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.cc +130 -27
- package/vendor/librocksdb/vendor/rocksdb/file/delete_scheduler.h +61 -8
- package/vendor/librocksdb/vendor/rocksdb/file/file_util.cc +25 -4
- package/vendor/librocksdb/vendor/rocksdb/file/file_util.h +15 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sequence_file_reader.h +9 -4
- package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.cc +18 -0
- package/vendor/librocksdb/vendor/rocksdb/file/sst_file_manager_impl.h +31 -4
- package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.cc +40 -38
- package/vendor/librocksdb/vendor/rocksdb/file/writable_file_writer.h +48 -15
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/advanced_options.h +12 -3
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/attribute_groups.h +114 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/c.h +90 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/cache.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/comparator.h +27 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/db.h +71 -12
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/env.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/experimental.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/file_system.h +14 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator.h +9 -71
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/iterator_base.h +90 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/listener.h +21 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/options.h +125 -12
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/perf_context.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/sst_file_reader.h +11 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table.h +6 -6
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/table_properties.h +19 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/transaction_log.h +12 -6
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/types.h +12 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/universal_compaction.h +31 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/user_write_callback.h +29 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +4 -2
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +0 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +24 -7
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +4 -4
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +24 -5
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +46 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction.h +42 -17
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/types_util.h +36 -0
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +71 -3
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/version.h +2 -2
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/wide_columns.h +87 -72
- package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/write_batch_base.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/memory/memory_allocator.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/options/cf_options.cc +13 -2
- package/vendor/librocksdb/vendor/rocksdb/options/cf_options.h +6 -2
- package/vendor/librocksdb/vendor/rocksdb/options/db_options.cc +27 -1
- package/vendor/librocksdb/vendor/rocksdb/options/db_options.h +10 -3
- package/vendor/librocksdb/vendor/rocksdb/options/options.cc +3 -0
- package/vendor/librocksdb/vendor/rocksdb/options/options_helper.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/port/jemalloc_helper.h +2 -2
- package/vendor/librocksdb/vendor/rocksdb/port/stack_trace.cc +1 -0
- package/vendor/librocksdb/vendor/rocksdb/port/win/port_win.cc +3 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_builder.cc +47 -31
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_factory.cc +15 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +37 -18
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_iterator.h +10 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.cc +102 -41
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader.h +15 -7
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +1 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +5 -6
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_cache.h +31 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/block_prefetcher.cc +6 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/cachable_entry.h +10 -5
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block.h +34 -28
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +17 -11
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_block_reader_common.h +5 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/filter_policy.cc +12 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.cc +37 -30
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/full_filter_block.h +11 -13
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/hash_index_reader.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.cc +62 -53
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_builder.h +60 -38
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.cc +14 -9
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/index_reader_common.h +4 -1
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +135 -94
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_filter_block.h +52 -46
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +51 -13
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/partitioned_index_reader.h +2 -0
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +3 -11
- package/vendor/librocksdb/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +2 -3
- package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.cc +8 -10
- package/vendor/librocksdb/vendor/rocksdb/table/block_fetcher.h +2 -1
- package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.cc +9 -10
- package/vendor/librocksdb/vendor/rocksdb/table/compaction_merging_iterator.h +3 -2
- package/vendor/librocksdb/vendor/rocksdb/table/format.cc +1 -2
- package/vendor/librocksdb/vendor/rocksdb/table/iterator.cc +4 -0
- package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.cc +18 -13
- package/vendor/librocksdb/vendor/rocksdb/table/merging_iterator.h +5 -3
- package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.cc +18 -4
- package/vendor/librocksdb/vendor/rocksdb/table/meta_blocks.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/table/plain/plain_table_builder.cc +2 -2
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_dumper.cc +6 -6
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_reader.cc +24 -2
- package/vendor/librocksdb/vendor/rocksdb/table/sst_file_writer_collectors.h +3 -1
- package/vendor/librocksdb/vendor/rocksdb/table/table_builder.h +8 -7
- package/vendor/librocksdb/vendor/rocksdb/table/table_iterator.h +69 -0
- package/vendor/librocksdb/vendor/rocksdb/table/table_reader.h +9 -0
- package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.cc +25 -0
- package/vendor/librocksdb/vendor/rocksdb/test_util/testutil.h +12 -0
- package/vendor/librocksdb/vendor/rocksdb/tools/db_bench_tool.cc +32 -0
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd.cc +618 -124
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_cmd_impl.h +19 -1
- package/vendor/librocksdb/vendor/rocksdb/tools/ldb_tool.cc +9 -0
- package/vendor/librocksdb/vendor/rocksdb/util/aligned_storage.h +24 -0
- package/vendor/librocksdb/vendor/rocksdb/util/autovector.h +4 -0
- package/vendor/librocksdb/vendor/rocksdb/util/comparator.cc +12 -0
- package/vendor/librocksdb/vendor/rocksdb/util/filter_bench.cc +1 -1
- package/vendor/librocksdb/vendor/rocksdb/util/random.cc +2 -1
- package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.cc +3 -4
- package/vendor/librocksdb/vendor/rocksdb/util/stderr_logger.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/util/udt_util.cc +33 -0
- package/vendor/librocksdb/vendor/rocksdb/util/udt_util.h +7 -0
- package/vendor/librocksdb/vendor/rocksdb/util/write_batch_util.h +5 -0
- package/vendor/librocksdb/vendor/rocksdb/util/xxhash.h +36 -29
- package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +3 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +20 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.cc +29 -9
- package/vendor/librocksdb/vendor/rocksdb/utilities/cache_dump_load_impl.h +14 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/debug.cc +16 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.cc +677 -248
- package/vendor/librocksdb/vendor/rocksdb/utilities/fault_injection_fs.h +325 -158
- package/vendor/librocksdb/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +1 -8
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.cc +144 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_for_tiering_collector.h +45 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +12 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +3 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +116 -20
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +33 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +78 -13
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +33 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.cc +106 -7
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_base.h +68 -10
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_test.h +7 -3
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.cc +8 -5
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/transaction_util.h +7 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +18 -12
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +4 -4
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +17 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +11 -9
- package/vendor/librocksdb/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +2 -1
- package/vendor/librocksdb/vendor/rocksdb/utilities/types_util.cc +88 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +313 -14
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +7 -0
- package/vendor/librocksdb/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +1 -1
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator.cc +0 -102
- package/vendor/librocksdb/vendor/rocksdb/db/multi_cf_iterator.h +0 -159
|
@@ -105,6 +105,16 @@ extern const WideColumns kNoWideColumns;
|
|
|
105
105
|
// wide-column queries.
|
|
106
106
|
class PinnableWideColumns {
|
|
107
107
|
public:
|
|
108
|
+
PinnableWideColumns() = default;
|
|
109
|
+
|
|
110
|
+
PinnableWideColumns(const PinnableWideColumns&) = delete;
|
|
111
|
+
PinnableWideColumns& operator=(const PinnableWideColumns&) = delete;
|
|
112
|
+
|
|
113
|
+
PinnableWideColumns(PinnableWideColumns&&);
|
|
114
|
+
PinnableWideColumns& operator=(PinnableWideColumns&&);
|
|
115
|
+
|
|
116
|
+
~PinnableWideColumns() = default;
|
|
117
|
+
|
|
108
118
|
const WideColumns& columns() const { return columns_; }
|
|
109
119
|
size_t serialized_size() const { return value_.size(); }
|
|
110
120
|
|
|
@@ -121,6 +131,7 @@ class PinnableWideColumns {
|
|
|
121
131
|
void Reset();
|
|
122
132
|
|
|
123
133
|
private:
|
|
134
|
+
void Move(PinnableWideColumns&& other);
|
|
124
135
|
void CopyValue(const Slice& value);
|
|
125
136
|
void PinOrCopyValue(const Slice& value, Cleanable* cleanable);
|
|
126
137
|
void MoveValue(PinnableSlice&& value);
|
|
@@ -133,6 +144,42 @@ class PinnableWideColumns {
|
|
|
133
144
|
WideColumns columns_;
|
|
134
145
|
};
|
|
135
146
|
|
|
147
|
+
inline void PinnableWideColumns::Reset() {
|
|
148
|
+
value_.Reset();
|
|
149
|
+
columns_.clear();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
inline void PinnableWideColumns::Move(PinnableWideColumns&& other) {
|
|
153
|
+
assert(columns_.empty());
|
|
154
|
+
|
|
155
|
+
if (other.columns_.empty()) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const char* const data = other.value_.data();
|
|
160
|
+
const bool is_plain_value =
|
|
161
|
+
other.columns_.size() == 1 &&
|
|
162
|
+
other.columns_.front().name() == kDefaultWideColumnName &&
|
|
163
|
+
other.columns_.front().value() == other.value_;
|
|
164
|
+
|
|
165
|
+
MoveValue(std::move(other.value_));
|
|
166
|
+
|
|
167
|
+
if (value_.data() == data) {
|
|
168
|
+
columns_ = std::move(other.columns_);
|
|
169
|
+
} else {
|
|
170
|
+
if (is_plain_value) {
|
|
171
|
+
CreateIndexForPlainValue();
|
|
172
|
+
} else {
|
|
173
|
+
const Status s = CreateIndexForWideColumns();
|
|
174
|
+
assert(s.ok());
|
|
175
|
+
|
|
176
|
+
s.PermitUncheckedError();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
other.Reset();
|
|
181
|
+
}
|
|
182
|
+
|
|
136
183
|
inline void PinnableWideColumns::CopyValue(const Slice& value) {
|
|
137
184
|
value_.PinSelf(value);
|
|
138
185
|
}
|
|
@@ -186,28 +233,61 @@ inline void PinnableWideColumns::SetPlainValue(std::string&& value) {
|
|
|
186
233
|
|
|
187
234
|
inline Status PinnableWideColumns::SetWideColumnValue(const Slice& value) {
|
|
188
235
|
CopyValue(value);
|
|
189
|
-
|
|
236
|
+
|
|
237
|
+
const Status s = CreateIndexForWideColumns();
|
|
238
|
+
if (!s.ok()) {
|
|
239
|
+
Reset();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return s;
|
|
190
243
|
}
|
|
191
244
|
|
|
192
245
|
inline Status PinnableWideColumns::SetWideColumnValue(const Slice& value,
|
|
193
246
|
Cleanable* cleanable) {
|
|
194
247
|
PinOrCopyValue(value, cleanable);
|
|
195
|
-
|
|
248
|
+
|
|
249
|
+
const Status s = CreateIndexForWideColumns();
|
|
250
|
+
if (!s.ok()) {
|
|
251
|
+
Reset();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return s;
|
|
196
255
|
}
|
|
197
256
|
|
|
198
257
|
inline Status PinnableWideColumns::SetWideColumnValue(PinnableSlice&& value) {
|
|
199
258
|
MoveValue(std::move(value));
|
|
200
|
-
|
|
259
|
+
|
|
260
|
+
const Status s = CreateIndexForWideColumns();
|
|
261
|
+
if (!s.ok()) {
|
|
262
|
+
Reset();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return s;
|
|
201
266
|
}
|
|
202
267
|
|
|
203
268
|
inline Status PinnableWideColumns::SetWideColumnValue(std::string&& value) {
|
|
204
269
|
MoveValue(std::move(value));
|
|
205
|
-
|
|
270
|
+
|
|
271
|
+
const Status s = CreateIndexForWideColumns();
|
|
272
|
+
if (!s.ok()) {
|
|
273
|
+
Reset();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return s;
|
|
206
277
|
}
|
|
207
278
|
|
|
208
|
-
inline
|
|
209
|
-
|
|
210
|
-
|
|
279
|
+
inline PinnableWideColumns::PinnableWideColumns(PinnableWideColumns&& other) {
|
|
280
|
+
Move(std::move(other));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
inline PinnableWideColumns& PinnableWideColumns::operator=(
|
|
284
|
+
PinnableWideColumns&& other) {
|
|
285
|
+
if (this != &other) {
|
|
286
|
+
Reset();
|
|
287
|
+
Move(std::move(other));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return *this;
|
|
211
291
|
}
|
|
212
292
|
|
|
213
293
|
inline bool operator==(const PinnableWideColumns& lhs,
|
|
@@ -220,69 +300,4 @@ inline bool operator!=(const PinnableWideColumns& lhs,
|
|
|
220
300
|
return !(lhs == rhs);
|
|
221
301
|
}
|
|
222
302
|
|
|
223
|
-
// Class representing attribute group. Attribute group is a logical grouping of
|
|
224
|
-
// wide-column entities by leveraging Column Families.
|
|
225
|
-
// Used in Write Path
|
|
226
|
-
class AttributeGroup {
|
|
227
|
-
public:
|
|
228
|
-
ColumnFamilyHandle* column_family() const { return column_family_; }
|
|
229
|
-
const WideColumns& columns() const { return columns_; }
|
|
230
|
-
WideColumns& columns() { return columns_; }
|
|
231
|
-
|
|
232
|
-
explicit AttributeGroup(ColumnFamilyHandle* column_family,
|
|
233
|
-
const WideColumns& columns)
|
|
234
|
-
: column_family_(column_family), columns_(columns) {}
|
|
235
|
-
|
|
236
|
-
private:
|
|
237
|
-
ColumnFamilyHandle* column_family_;
|
|
238
|
-
WideColumns columns_;
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
inline bool operator==(const AttributeGroup& lhs, const AttributeGroup& rhs) {
|
|
242
|
-
return lhs.column_family() == rhs.column_family() &&
|
|
243
|
-
lhs.columns() == rhs.columns();
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// A collection of Attribute Groups.
|
|
247
|
-
using AttributeGroups = std::vector<AttributeGroup>;
|
|
248
|
-
|
|
249
|
-
// An empty set of Attribute Groups.
|
|
250
|
-
extern const AttributeGroups kNoAttributeGroups;
|
|
251
|
-
|
|
252
|
-
// Used in Read Path. Wide-columns returned from the query are pinnable.
|
|
253
|
-
class PinnableAttributeGroup {
|
|
254
|
-
public:
|
|
255
|
-
ColumnFamilyHandle* column_family() const { return column_family_; }
|
|
256
|
-
const Status& status() const { return status_; }
|
|
257
|
-
const WideColumns& columns() const { return columns_.columns(); }
|
|
258
|
-
|
|
259
|
-
explicit PinnableAttributeGroup(ColumnFamilyHandle* column_family)
|
|
260
|
-
: column_family_(column_family), status_(Status::OK()) {}
|
|
261
|
-
|
|
262
|
-
void SetStatus(const Status& status);
|
|
263
|
-
void SetColumns(PinnableWideColumns&& columns);
|
|
264
|
-
|
|
265
|
-
void Reset();
|
|
266
|
-
|
|
267
|
-
private:
|
|
268
|
-
ColumnFamilyHandle* column_family_;
|
|
269
|
-
Status status_;
|
|
270
|
-
PinnableWideColumns columns_;
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
inline void PinnableAttributeGroup::SetStatus(const Status& status) {
|
|
274
|
-
status_ = status;
|
|
275
|
-
}
|
|
276
|
-
inline void PinnableAttributeGroup::SetColumns(PinnableWideColumns&& columns) {
|
|
277
|
-
columns_ = std::move(columns);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
inline void PinnableAttributeGroup::Reset() {
|
|
281
|
-
SetStatus(Status::OK());
|
|
282
|
-
columns_.Reset();
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// A collection of Pinnable Attribute Groups.
|
|
286
|
-
using PinnableAttributeGroups = std::vector<PinnableAttributeGroup>;
|
|
287
|
-
|
|
288
303
|
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -239,6 +239,10 @@ static std::unordered_map<std::string, OptionTypeInfo>
|
|
|
239
239
|
{offsetof(class CompactionOptionsUniversal, compression_size_percent),
|
|
240
240
|
OptionType::kInt, OptionVerificationType::kNormal,
|
|
241
241
|
OptionTypeFlags::kMutable}},
|
|
242
|
+
{"max_read_amp",
|
|
243
|
+
{offsetof(class CompactionOptionsUniversal, max_read_amp),
|
|
244
|
+
OptionType::kInt, OptionVerificationType::kNormal,
|
|
245
|
+
OptionTypeFlags::kMutable}},
|
|
242
246
|
{"stop_style",
|
|
243
247
|
{offsetof(class CompactionOptionsUniversal, stop_style),
|
|
244
248
|
OptionType::kCompactionStopStyle, OptionVerificationType::kNormal,
|
|
@@ -519,6 +523,10 @@ static std::unordered_map<std::string, OptionTypeInfo>
|
|
|
519
523
|
{offsetof(struct MutableCFOptions, bottommost_file_compaction_delay),
|
|
520
524
|
OptionType::kUInt32T, OptionVerificationType::kNormal,
|
|
521
525
|
OptionTypeFlags::kMutable}},
|
|
526
|
+
{"uncache_aggressiveness",
|
|
527
|
+
{offsetof(struct MutableCFOptions, uncache_aggressiveness),
|
|
528
|
+
OptionType::kUInt32T, OptionVerificationType::kNormal,
|
|
529
|
+
OptionTypeFlags::kMutable}},
|
|
522
530
|
{"block_protection_bytes_per_key",
|
|
523
531
|
{offsetof(struct MutableCFOptions, block_protection_bytes_per_key),
|
|
524
532
|
OptionType::kUInt8T, OptionVerificationType::kNormal,
|
|
@@ -1118,11 +1126,12 @@ void MutableCFOptions::Dump(Logger* log) const {
|
|
|
1118
1126
|
report_bg_io_stats);
|
|
1119
1127
|
ROCKS_LOG_INFO(log, " compression: %d",
|
|
1120
1128
|
static_cast<int>(compression));
|
|
1121
|
-
ROCKS_LOG_INFO(log,
|
|
1122
|
-
" experimental_mempurge_threshold: %f",
|
|
1129
|
+
ROCKS_LOG_INFO(log, " experimental_mempurge_threshold: %f",
|
|
1123
1130
|
experimental_mempurge_threshold);
|
|
1124
1131
|
ROCKS_LOG_INFO(log, " bottommost_file_compaction_delay: %" PRIu32,
|
|
1125
1132
|
bottommost_file_compaction_delay);
|
|
1133
|
+
ROCKS_LOG_INFO(log, " uncache_aggressiveness: %" PRIu32,
|
|
1134
|
+
uncache_aggressiveness);
|
|
1126
1135
|
|
|
1127
1136
|
// Universal Compaction Options
|
|
1128
1137
|
ROCKS_LOG_INFO(log, "compaction_options_universal.size_ratio : %d",
|
|
@@ -1137,6 +1146,8 @@ void MutableCFOptions::Dump(Logger* log) const {
|
|
|
1137
1146
|
ROCKS_LOG_INFO(log,
|
|
1138
1147
|
"compaction_options_universal.compression_size_percent : %d",
|
|
1139
1148
|
compaction_options_universal.compression_size_percent);
|
|
1149
|
+
ROCKS_LOG_INFO(log, "compaction_options_universal.max_read_amp: %d",
|
|
1150
|
+
compaction_options_universal.max_read_amp);
|
|
1140
1151
|
ROCKS_LOG_INFO(log, "compaction_options_universal.stop_style : %d",
|
|
1141
1152
|
compaction_options_universal.stop_style);
|
|
1142
1153
|
ROCKS_LOG_INFO(
|
|
@@ -173,7 +173,8 @@ struct MutableCFOptions {
|
|
|
173
173
|
compression_per_level(options.compression_per_level),
|
|
174
174
|
memtable_max_range_deletions(options.memtable_max_range_deletions),
|
|
175
175
|
bottommost_file_compaction_delay(
|
|
176
|
-
options.bottommost_file_compaction_delay)
|
|
176
|
+
options.bottommost_file_compaction_delay),
|
|
177
|
+
uncache_aggressiveness(options.uncache_aggressiveness) {
|
|
177
178
|
RefreshDerivedOptions(options.num_levels, options.compaction_style);
|
|
178
179
|
}
|
|
179
180
|
|
|
@@ -223,7 +224,9 @@ struct MutableCFOptions {
|
|
|
223
224
|
memtable_protection_bytes_per_key(0),
|
|
224
225
|
block_protection_bytes_per_key(0),
|
|
225
226
|
sample_for_compression(0),
|
|
226
|
-
memtable_max_range_deletions(0)
|
|
227
|
+
memtable_max_range_deletions(0),
|
|
228
|
+
bottommost_file_compaction_delay(0),
|
|
229
|
+
uncache_aggressiveness(0) {}
|
|
227
230
|
|
|
228
231
|
explicit MutableCFOptions(const Options& options);
|
|
229
232
|
|
|
@@ -319,6 +322,7 @@ struct MutableCFOptions {
|
|
|
319
322
|
std::vector<CompressionType> compression_per_level;
|
|
320
323
|
uint32_t memtable_max_range_deletions;
|
|
321
324
|
uint32_t bottommost_file_compaction_delay;
|
|
325
|
+
uint32_t uncache_aggressiveness;
|
|
322
326
|
|
|
323
327
|
// Derived options
|
|
324
328
|
// Per-level target file size.
|
|
@@ -37,6 +37,7 @@ static std::unordered_map<std::string, WALRecoveryMode>
|
|
|
37
37
|
|
|
38
38
|
static std::unordered_map<std::string, CacheTier> cache_tier_string_map = {
|
|
39
39
|
{"kVolatileTier", CacheTier::kVolatileTier},
|
|
40
|
+
{"kVolatileCompressedTier", CacheTier::kVolatileCompressedTier},
|
|
40
41
|
{"kNonVolatileBlockTier", CacheTier::kNonVolatileBlockTier}};
|
|
41
42
|
|
|
42
43
|
static std::unordered_map<std::string, InfoLogLevel> info_log_level_string_map =
|
|
@@ -387,6 +388,10 @@ static std::unordered_map<std::string, OptionTypeInfo>
|
|
|
387
388
|
{offsetof(struct ImmutableDBOptions, wal_compression),
|
|
388
389
|
OptionType::kCompressionType, OptionVerificationType::kNormal,
|
|
389
390
|
OptionTypeFlags::kNone}},
|
|
391
|
+
{"background_close_inactive_wals",
|
|
392
|
+
{offsetof(struct ImmutableDBOptions, background_close_inactive_wals),
|
|
393
|
+
OptionType::kBoolean, OptionVerificationType::kNormal,
|
|
394
|
+
OptionTypeFlags::kNone}},
|
|
390
395
|
{"seq_per_batch",
|
|
391
396
|
{0, OptionType::kBoolean, OptionVerificationType::kDeprecated,
|
|
392
397
|
OptionTypeFlags::kNone}},
|
|
@@ -558,6 +563,19 @@ static std::unordered_map<std::string, OptionTypeInfo>
|
|
|
558
563
|
{offsetof(struct ImmutableDBOptions, enforce_single_del_contracts),
|
|
559
564
|
OptionType::kBoolean, OptionVerificationType::kNormal,
|
|
560
565
|
OptionTypeFlags::kNone}},
|
|
566
|
+
{"follower_refresh_catchup_period_ms",
|
|
567
|
+
{offsetof(struct ImmutableDBOptions,
|
|
568
|
+
follower_refresh_catchup_period_ms),
|
|
569
|
+
OptionType::kUInt64T, OptionVerificationType::kNormal,
|
|
570
|
+
OptionTypeFlags::kNone}},
|
|
571
|
+
{"follower_catchup_retry_count",
|
|
572
|
+
{offsetof(struct ImmutableDBOptions, follower_catchup_retry_count),
|
|
573
|
+
OptionType::kUInt64T, OptionVerificationType::kNormal,
|
|
574
|
+
OptionTypeFlags::kNone}},
|
|
575
|
+
{"follower_catchup_retry_wait_ms",
|
|
576
|
+
{offsetof(struct ImmutableDBOptions, follower_catchup_retry_wait_ms),
|
|
577
|
+
OptionType::kUInt64T, OptionVerificationType::kNormal,
|
|
578
|
+
OptionTypeFlags::kNone}},
|
|
561
579
|
};
|
|
562
580
|
|
|
563
581
|
const std::string OptionsHelper::kDBOptionsName = "DBOptions";
|
|
@@ -741,6 +759,7 @@ ImmutableDBOptions::ImmutableDBOptions(const DBOptions& options)
|
|
|
741
759
|
two_write_queues(options.two_write_queues),
|
|
742
760
|
manual_wal_flush(options.manual_wal_flush),
|
|
743
761
|
wal_compression(options.wal_compression),
|
|
762
|
+
background_close_inactive_wals(options.background_close_inactive_wals),
|
|
744
763
|
atomic_flush(options.atomic_flush),
|
|
745
764
|
avoid_unnecessary_blocking_io(options.avoid_unnecessary_blocking_io),
|
|
746
765
|
persist_stats_to_disk(options.persist_stats_to_disk),
|
|
@@ -755,7 +774,11 @@ ImmutableDBOptions::ImmutableDBOptions(const DBOptions& options)
|
|
|
755
774
|
checksum_handoff_file_types(options.checksum_handoff_file_types),
|
|
756
775
|
lowest_used_cache_tier(options.lowest_used_cache_tier),
|
|
757
776
|
compaction_service(options.compaction_service),
|
|
758
|
-
enforce_single_del_contracts(options.enforce_single_del_contracts)
|
|
777
|
+
enforce_single_del_contracts(options.enforce_single_del_contracts),
|
|
778
|
+
follower_refresh_catchup_period_ms(
|
|
779
|
+
options.follower_refresh_catchup_period_ms),
|
|
780
|
+
follower_catchup_retry_count(options.follower_catchup_retry_count),
|
|
781
|
+
follower_catchup_retry_wait_ms(options.follower_catchup_retry_wait_ms) {
|
|
759
782
|
fs = env->GetFileSystem();
|
|
760
783
|
clock = env->GetSystemClock().get();
|
|
761
784
|
logger = info_log.get();
|
|
@@ -903,6 +926,9 @@ void ImmutableDBOptions::Dump(Logger* log) const {
|
|
|
903
926
|
manual_wal_flush);
|
|
904
927
|
ROCKS_LOG_HEADER(log, " Options.wal_compression: %d",
|
|
905
928
|
wal_compression);
|
|
929
|
+
ROCKS_LOG_HEADER(log,
|
|
930
|
+
" Options.background_close_inactive_wals: %d",
|
|
931
|
+
background_close_inactive_wals);
|
|
906
932
|
ROCKS_LOG_HEADER(log, " Options.atomic_flush: %d", atomic_flush);
|
|
907
933
|
ROCKS_LOG_HEADER(log,
|
|
908
934
|
" Options.avoid_unnecessary_blocking_io: %d",
|
|
@@ -84,6 +84,7 @@ struct ImmutableDBOptions {
|
|
|
84
84
|
bool two_write_queues;
|
|
85
85
|
bool manual_wal_flush;
|
|
86
86
|
CompressionType wal_compression;
|
|
87
|
+
bool background_close_inactive_wals;
|
|
87
88
|
bool atomic_flush;
|
|
88
89
|
bool avoid_unnecessary_blocking_io;
|
|
89
90
|
bool persist_stats_to_disk;
|
|
@@ -97,13 +98,19 @@ struct ImmutableDBOptions {
|
|
|
97
98
|
std::string db_host_id;
|
|
98
99
|
FileTypeSet checksum_handoff_file_types;
|
|
99
100
|
CacheTier lowest_used_cache_tier;
|
|
100
|
-
|
|
101
|
+
std::shared_ptr<CompactionService> compaction_service;
|
|
102
|
+
bool enforce_single_del_contracts;
|
|
103
|
+
uint64_t follower_refresh_catchup_period_ms;
|
|
104
|
+
uint64_t follower_catchup_retry_count;
|
|
105
|
+
uint64_t follower_catchup_retry_wait_ms;
|
|
106
|
+
|
|
107
|
+
// Beginning convenience/helper objects that are not part of the base
|
|
108
|
+
// DBOptions
|
|
101
109
|
std::shared_ptr<FileSystem> fs;
|
|
102
110
|
SystemClock* clock;
|
|
103
111
|
Statistics* stats;
|
|
104
112
|
Logger* logger;
|
|
105
|
-
|
|
106
|
-
bool enforce_single_del_contracts;
|
|
113
|
+
// End of convenience/helper objects.
|
|
107
114
|
|
|
108
115
|
bool IsWalDirSameAsDBPath() const;
|
|
109
116
|
bool IsWalDirSameAsDBPath(const std::string& path) const;
|
|
@@ -360,6 +360,9 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
|
|
|
360
360
|
ROCKS_LOG_HEADER(log,
|
|
361
361
|
"Options.compaction_options_universal.stop_style: %s",
|
|
362
362
|
str_compaction_stop_style.c_str());
|
|
363
|
+
ROCKS_LOG_HEADER(log,
|
|
364
|
+
"Options.compaction_options_universal.max_read_amp: %d",
|
|
365
|
+
compaction_options_universal.max_read_amp);
|
|
363
366
|
ROCKS_LOG_HEADER(
|
|
364
367
|
log, "Options.compaction_options_fifo.max_table_files_size: %" PRIu64,
|
|
365
368
|
compaction_options_fifo.max_table_files_size);
|
|
@@ -274,6 +274,7 @@ void UpdateColumnFamilyOptions(const MutableCFOptions& moptions,
|
|
|
274
274
|
cf_opts->last_level_temperature = moptions.last_level_temperature;
|
|
275
275
|
cf_opts->default_write_temperature = moptions.default_write_temperature;
|
|
276
276
|
cf_opts->memtable_max_range_deletions = moptions.memtable_max_range_deletions;
|
|
277
|
+
cf_opts->uncache_aggressiveness = moptions.uncache_aggressiveness;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
void UpdateColumnFamilyOptions(const ImmutableCFOptions& ioptions,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
#pragma once
|
|
7
7
|
|
|
8
8
|
#if defined(__clang__) && defined(__GLIBC__)
|
|
9
|
-
// glibc's `posix_memalign()` declaration specifies `
|
|
9
|
+
// glibc's `posix_memalign()` declaration specifies `noexcept` while clang's
|
|
10
10
|
// declaration does not. There is a hack in clang to make its re-declaration
|
|
11
11
|
// compatible with glibc's if they are declared consecutively. That hack breaks
|
|
12
12
|
// if yet another `posix_memalign()` declaration comes between glibc's and
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// declarations both come before "jemalloc.h"'s `posix_memalign()` declaration.
|
|
15
15
|
//
|
|
16
16
|
// This problem could also be avoided if "jemalloc.h"'s `posix_memalign()`
|
|
17
|
-
// declaration did not specify `
|
|
17
|
+
// declaration did not specify `noexcept` when built with clang.
|
|
18
18
|
#include <mm_malloc.h>
|
|
19
19
|
#endif
|
|
20
20
|
|
|
@@ -101,8 +101,9 @@ bool CondVar::TimedWait(uint64_t abs_time_us) {
|
|
|
101
101
|
std::unique_lock<std::mutex> lk(mu_->getLock(), std::adopt_lock);
|
|
102
102
|
|
|
103
103
|
// Work around https://github.com/microsoft/STL/issues/369
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
// std::condition_variable_any::wait_for had a fix, but
|
|
105
|
+
// std::condition_variable still doesn't have a fix in STL yet
|
|
106
|
+
#if defined(_MSC_VER)
|
|
106
107
|
if (relTimeUs == std::chrono::microseconds::zero()) {
|
|
107
108
|
lk.unlock();
|
|
108
109
|
lk.lock();
|
|
@@ -44,9 +44,8 @@ InternalIteratorBase<IndexValue>* BinarySearchIndexReader::NewIterator(
|
|
|
44
44
|
IndexBlockIter* iter, GetContext* get_context,
|
|
45
45
|
BlockCacheLookupContext* lookup_context) {
|
|
46
46
|
const BlockBasedTable::Rep* rep = table()->get_rep();
|
|
47
|
-
const bool no_io = (read_options.read_tier == kBlockCacheTier);
|
|
48
47
|
CachableEntry<Block> index_block;
|
|
49
|
-
const Status s = GetOrReadIndexBlock(
|
|
48
|
+
const Status s = GetOrReadIndexBlock(get_context, lookup_context,
|
|
50
49
|
&index_block, read_options);
|
|
51
50
|
if (!s.ok()) {
|
|
52
51
|
if (iter != nullptr) {
|
|
@@ -293,9 +293,10 @@ struct BlockBasedTableBuilder::Rep {
|
|
|
293
293
|
|
|
294
294
|
InternalKeySliceTransform internal_prefix_transform;
|
|
295
295
|
std::unique_ptr<IndexBuilder> index_builder;
|
|
296
|
+
std::string index_separator_scratch;
|
|
296
297
|
PartitionedIndexBuilder* p_index_builder_ = nullptr;
|
|
297
298
|
|
|
298
|
-
std::string
|
|
299
|
+
std::string last_ikey; // Internal key or empty (unset)
|
|
299
300
|
const Slice* first_key_in_next_block = nullptr;
|
|
300
301
|
CompressionType compression_type;
|
|
301
302
|
uint64_t sample_for_compression;
|
|
@@ -582,8 +583,10 @@ struct BlockBasedTableBuilder::Rep {
|
|
|
582
583
|
assert(factory);
|
|
583
584
|
|
|
584
585
|
std::unique_ptr<InternalTblPropColl> collector{
|
|
585
|
-
factory->CreateInternalTblPropColl(
|
|
586
|
-
|
|
586
|
+
factory->CreateInternalTblPropColl(
|
|
587
|
+
tbo.column_family_id, tbo.level_at_creation,
|
|
588
|
+
tbo.ioptions.num_levels,
|
|
589
|
+
tbo.last_level_inclusive_max_seqno_threshold)};
|
|
587
590
|
if (collector) {
|
|
588
591
|
table_properties_collectors.emplace_back(std::move(collector));
|
|
589
592
|
}
|
|
@@ -626,6 +629,14 @@ struct BlockBasedTableBuilder::Rep {
|
|
|
626
629
|
} else {
|
|
627
630
|
base_context_checksum = 0;
|
|
628
631
|
}
|
|
632
|
+
|
|
633
|
+
if (alignment > 0 && compression_type != kNoCompression) {
|
|
634
|
+
// With better sanitization in `CompactionPicker::CompactFiles()`, we
|
|
635
|
+
// would not need to handle this case here and could change it to an
|
|
636
|
+
// assertion instead.
|
|
637
|
+
SetStatus(Status::InvalidArgument(
|
|
638
|
+
"Enable block_align, but compression enabled"));
|
|
639
|
+
}
|
|
629
640
|
}
|
|
630
641
|
|
|
631
642
|
Rep(const Rep&) = delete;
|
|
@@ -987,24 +998,24 @@ BlockBasedTableBuilder::~BlockBasedTableBuilder() {
|
|
|
987
998
|
delete rep_;
|
|
988
999
|
}
|
|
989
1000
|
|
|
990
|
-
void BlockBasedTableBuilder::Add(const Slice&
|
|
1001
|
+
void BlockBasedTableBuilder::Add(const Slice& ikey, const Slice& value) {
|
|
991
1002
|
Rep* r = rep_;
|
|
992
1003
|
assert(rep_->state != Rep::State::kClosed);
|
|
993
1004
|
if (!ok()) {
|
|
994
1005
|
return;
|
|
995
1006
|
}
|
|
996
|
-
ValueType value_type = ExtractValueType(
|
|
1007
|
+
ValueType value_type = ExtractValueType(ikey);
|
|
997
1008
|
if (IsValueType(value_type)) {
|
|
998
1009
|
#ifndef NDEBUG
|
|
999
1010
|
if (r->props.num_entries > r->props.num_range_deletions) {
|
|
1000
|
-
assert(r->internal_comparator.Compare(
|
|
1011
|
+
assert(r->internal_comparator.Compare(ikey, Slice(r->last_ikey)) > 0);
|
|
1001
1012
|
}
|
|
1002
1013
|
#endif // !NDEBUG
|
|
1003
1014
|
|
|
1004
|
-
auto should_flush = r->flush_block_policy->Update(
|
|
1015
|
+
auto should_flush = r->flush_block_policy->Update(ikey, value);
|
|
1005
1016
|
if (should_flush) {
|
|
1006
1017
|
assert(!r->data_block.empty());
|
|
1007
|
-
r->first_key_in_next_block = &
|
|
1018
|
+
r->first_key_in_next_block = &ikey;
|
|
1008
1019
|
Flush();
|
|
1009
1020
|
if (r->state == Rep::State::kBuffered) {
|
|
1010
1021
|
bool exceeds_buffer_limit =
|
|
@@ -1039,8 +1050,9 @@ void BlockBasedTableBuilder::Add(const Slice& key, const Slice& value) {
|
|
|
1039
1050
|
if (r->IsParallelCompressionEnabled()) {
|
|
1040
1051
|
r->pc_rep->curr_block_keys->Clear();
|
|
1041
1052
|
} else {
|
|
1042
|
-
r->index_builder->AddIndexEntry(
|
|
1043
|
-
r->pending_handle
|
|
1053
|
+
r->index_builder->AddIndexEntry(r->last_ikey, &ikey,
|
|
1054
|
+
r->pending_handle,
|
|
1055
|
+
&r->index_separator_scratch);
|
|
1044
1056
|
}
|
|
1045
1057
|
}
|
|
1046
1058
|
}
|
|
@@ -1049,27 +1061,28 @@ void BlockBasedTableBuilder::Add(const Slice& key, const Slice& value) {
|
|
|
1049
1061
|
// builder after being added to index builder.
|
|
1050
1062
|
if (r->state == Rep::State::kUnbuffered) {
|
|
1051
1063
|
if (r->IsParallelCompressionEnabled()) {
|
|
1052
|
-
r->pc_rep->curr_block_keys->PushBack(
|
|
1064
|
+
r->pc_rep->curr_block_keys->PushBack(ikey);
|
|
1053
1065
|
} else {
|
|
1054
1066
|
if (r->filter_builder != nullptr) {
|
|
1055
1067
|
r->filter_builder->Add(
|
|
1056
|
-
ExtractUserKeyAndStripTimestamp(
|
|
1068
|
+
ExtractUserKeyAndStripTimestamp(ikey, r->ts_sz));
|
|
1057
1069
|
}
|
|
1058
1070
|
}
|
|
1059
1071
|
}
|
|
1060
1072
|
|
|
1061
|
-
r->data_block.AddWithLastKey(
|
|
1062
|
-
r->
|
|
1073
|
+
r->data_block.AddWithLastKey(ikey, value, r->last_ikey);
|
|
1074
|
+
r->last_ikey.assign(ikey.data(), ikey.size());
|
|
1075
|
+
assert(!r->last_ikey.empty());
|
|
1063
1076
|
if (r->state == Rep::State::kBuffered) {
|
|
1064
1077
|
// Buffered keys will be replayed from data_block_buffers during
|
|
1065
1078
|
// `Finish()` once compression dictionary has been finalized.
|
|
1066
1079
|
} else {
|
|
1067
1080
|
if (!r->IsParallelCompressionEnabled()) {
|
|
1068
|
-
r->index_builder->OnKeyAdded(
|
|
1081
|
+
r->index_builder->OnKeyAdded(ikey);
|
|
1069
1082
|
}
|
|
1070
1083
|
}
|
|
1071
1084
|
// TODO offset passed in is not accurate for parallel compression case
|
|
1072
|
-
NotifyCollectTableCollectorsOnAdd(
|
|
1085
|
+
NotifyCollectTableCollectorsOnAdd(ikey, value, r->get_offset(),
|
|
1073
1086
|
r->table_properties_collectors,
|
|
1074
1087
|
r->ioptions.logger);
|
|
1075
1088
|
|
|
@@ -1083,9 +1096,9 @@ void BlockBasedTableBuilder::Add(const Slice& key, const Slice& value) {
|
|
|
1083
1096
|
if (r->ts_sz > 0 && !r->persist_user_defined_timestamps) {
|
|
1084
1097
|
persisted_end = StripTimestampFromUserKey(value, r->ts_sz);
|
|
1085
1098
|
}
|
|
1086
|
-
r->range_del_block.Add(
|
|
1099
|
+
r->range_del_block.Add(ikey, persisted_end);
|
|
1087
1100
|
// TODO offset passed in is not accurate for parallel compression case
|
|
1088
|
-
NotifyCollectTableCollectorsOnAdd(
|
|
1101
|
+
NotifyCollectTableCollectorsOnAdd(ikey, value, r->get_offset(),
|
|
1089
1102
|
r->table_properties_collectors,
|
|
1090
1103
|
r->ioptions.logger);
|
|
1091
1104
|
} else {
|
|
@@ -1097,7 +1110,7 @@ void BlockBasedTableBuilder::Add(const Slice& key, const Slice& value) {
|
|
|
1097
1110
|
}
|
|
1098
1111
|
|
|
1099
1112
|
r->props.num_entries++;
|
|
1100
|
-
r->props.raw_key_size +=
|
|
1113
|
+
r->props.raw_key_size += ikey.size();
|
|
1101
1114
|
if (!r->persist_user_defined_timestamps) {
|
|
1102
1115
|
r->props.raw_key_size -= r->ts_sz;
|
|
1103
1116
|
}
|
|
@@ -1475,14 +1488,15 @@ void BlockBasedTableBuilder::BGWorkWriteMaybeCompressedBlock() {
|
|
|
1475
1488
|
++r->props.num_data_blocks;
|
|
1476
1489
|
|
|
1477
1490
|
if (block_rep->first_key_in_next_block == nullptr) {
|
|
1478
|
-
r->index_builder->AddIndexEntry(
|
|
1479
|
-
r->pending_handle
|
|
1491
|
+
r->index_builder->AddIndexEntry(block_rep->keys->Back(), nullptr,
|
|
1492
|
+
r->pending_handle,
|
|
1493
|
+
&r->index_separator_scratch);
|
|
1480
1494
|
} else {
|
|
1481
1495
|
Slice first_key_in_next_block =
|
|
1482
1496
|
Slice(*block_rep->first_key_in_next_block);
|
|
1483
|
-
r->index_builder->AddIndexEntry(
|
|
1484
|
-
|
|
1485
|
-
|
|
1497
|
+
r->index_builder->AddIndexEntry(
|
|
1498
|
+
block_rep->keys->Back(), &first_key_in_next_block, r->pending_handle,
|
|
1499
|
+
&r->index_separator_scratch);
|
|
1486
1500
|
}
|
|
1487
1501
|
|
|
1488
1502
|
r->pc_rep->ReapBlock(block_rep);
|
|
@@ -1566,9 +1580,10 @@ void BlockBasedTableBuilder::WriteFilterBlock(
|
|
|
1566
1580
|
// See FilterBlockBuilder::Finish() for more on the difference in
|
|
1567
1581
|
// transferred filter data payload among different FilterBlockBuilder
|
|
1568
1582
|
// subtypes.
|
|
1569
|
-
std::unique_ptr<const char[]>
|
|
1570
|
-
Slice filter_content
|
|
1571
|
-
|
|
1583
|
+
std::unique_ptr<const char[]> filter_owner;
|
|
1584
|
+
Slice filter_content;
|
|
1585
|
+
s = rep_->filter_builder->Finish(filter_block_handle, &filter_content,
|
|
1586
|
+
&filter_owner);
|
|
1572
1587
|
|
|
1573
1588
|
assert(s.ok() || s.IsIncomplete() || s.IsCorruption());
|
|
1574
1589
|
if (s.IsCorruption()) {
|
|
@@ -1977,9 +1992,9 @@ void BlockBasedTableBuilder::EnterUnbuffered() {
|
|
|
1977
1992
|
Slice* first_key_in_next_block_ptr = &first_key_in_next_block;
|
|
1978
1993
|
|
|
1979
1994
|
iter->SeekToLast();
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1995
|
+
r->index_builder->AddIndexEntry(
|
|
1996
|
+
iter->key(), first_key_in_next_block_ptr, r->pending_handle,
|
|
1997
|
+
&r->index_separator_scratch);
|
|
1983
1998
|
}
|
|
1984
1999
|
}
|
|
1985
2000
|
std::swap(iter, next_block_iter);
|
|
@@ -2015,7 +2030,8 @@ Status BlockBasedTableBuilder::Finish() {
|
|
|
2015
2030
|
// block, we will finish writing all index entries first.
|
|
2016
2031
|
if (ok() && !empty_data_block) {
|
|
2017
2032
|
r->index_builder->AddIndexEntry(
|
|
2018
|
-
|
|
2033
|
+
r->last_ikey, nullptr /* no next data block */, r->pending_handle,
|
|
2034
|
+
&r->index_separator_scratch);
|
|
2019
2035
|
}
|
|
2020
2036
|
}
|
|
2021
2037
|
|