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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
//
|
|
3
|
+
// This source code is licensed under both the GPLv2 (found in the
|
|
4
|
+
// COPYING file in the root directory) and Apache 2.0 License
|
|
5
|
+
// (found in the LICENSE.Apache file in the root directory).
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "rocksdb/status.h"
|
|
10
|
+
|
|
11
|
+
namespace ROCKSDB_NAMESPACE {
|
|
12
|
+
|
|
13
|
+
// Custom callback functions to support users to plug in logic while data is
|
|
14
|
+
// being written to the DB. It's intended for better synchronization between
|
|
15
|
+
// concurrent writes. Note that these callbacks are in the write's critical path
|
|
16
|
+
// It's desirable to keep them fast and minimum to not affect the write's
|
|
17
|
+
// latency. These callbacks may be called in the context of a different thread.
|
|
18
|
+
class UserWriteCallback {
|
|
19
|
+
public:
|
|
20
|
+
virtual ~UserWriteCallback() {}
|
|
21
|
+
|
|
22
|
+
// This function will be called after the write is enqueued.
|
|
23
|
+
virtual void OnWriteEnqueued() = 0;
|
|
24
|
+
|
|
25
|
+
// This function will be called after wal write finishes if it applies.
|
|
26
|
+
virtual void OnWalWriteFinish() = 0;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -67,6 +67,10 @@ class CacheDumpReader {
|
|
|
67
67
|
// dump or load process related control variables can be added here.
|
|
68
68
|
struct CacheDumpOptions {
|
|
69
69
|
SystemClock* clock;
|
|
70
|
+
// Deadline for dumper or loader in microseconds
|
|
71
|
+
std::chrono::microseconds deadline = std::chrono::microseconds::zero();
|
|
72
|
+
// Max size bytes for dumper or loader
|
|
73
|
+
uint64_t max_size_bytes = 0;
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
// NOTE that: this class is EXPERIMENTAL! May be changed in the future!
|
|
@@ -32,8 +32,10 @@ class Checkpoint {
|
|
|
32
32
|
// same filesystem as the database, and copied otherwise.
|
|
33
33
|
// (2) other required files (like MANIFEST) are always copied.
|
|
34
34
|
// log_size_for_flush: if the total log file size is equal or larger than
|
|
35
|
-
// this value, then a flush is triggered for all the column families.
|
|
36
|
-
//
|
|
35
|
+
// this value, then a flush is triggered for all the column families.
|
|
36
|
+
// The archived log size will not be included when calculating the total log
|
|
37
|
+
// size.
|
|
38
|
+
// The default value is 0, which means flush is always triggered. If you move
|
|
37
39
|
// away from the default, the checkpoint may not contain up-to-date data
|
|
38
40
|
// if WAL writing is not always enabled.
|
|
39
41
|
// Flush will always trigger if it is 2PC.
|
|
@@ -83,7 +83,7 @@ class EnvMirror : public EnvWrapper {
|
|
|
83
83
|
std::sort(ar.begin(), ar.end());
|
|
84
84
|
std::sort(br.begin(), br.end());
|
|
85
85
|
if (!as.ok() || ar != br) {
|
|
86
|
-
assert(
|
|
86
|
+
assert(nullptr == "getchildren results don't match");
|
|
87
87
|
}
|
|
88
88
|
*r = ar;
|
|
89
89
|
return as;
|
|
@@ -35,6 +35,7 @@ class LDBCommand {
|
|
|
35
35
|
static const std::string ARG_DB;
|
|
36
36
|
static const std::string ARG_PATH;
|
|
37
37
|
static const std::string ARG_SECONDARY_PATH;
|
|
38
|
+
static const std::string ARG_LEADER_PATH;
|
|
38
39
|
static const std::string ARG_HEX;
|
|
39
40
|
static const std::string ARG_KEY_HEX;
|
|
40
41
|
static const std::string ARG_VALUE_HEX;
|
|
@@ -72,6 +73,7 @@ class LDBCommand {
|
|
|
72
73
|
static const std::string ARG_PREPOPULATE_BLOB_CACHE;
|
|
73
74
|
static const std::string ARG_DECODE_BLOB_INDEX;
|
|
74
75
|
static const std::string ARG_DUMP_UNCOMPRESSED_BLOBS;
|
|
76
|
+
static const std::string ARG_READ_TIMESTAMP;
|
|
75
77
|
|
|
76
78
|
struct ParsedParams {
|
|
77
79
|
std::string cmd;
|
|
@@ -82,6 +84,10 @@ class LDBCommand {
|
|
|
82
84
|
|
|
83
85
|
static LDBCommand* SelectCommand(const ParsedParams& parsed_parms);
|
|
84
86
|
|
|
87
|
+
static void ParseSingleParam(const std::string& param,
|
|
88
|
+
ParsedParams& parsed_params,
|
|
89
|
+
std::vector<std::string>& cmd_tokens);
|
|
90
|
+
|
|
85
91
|
static LDBCommand* InitFromCmdLineArgs(
|
|
86
92
|
const std::vector<std::string>& args, const Options& options,
|
|
87
93
|
const LDBOptions& ldb_options,
|
|
@@ -155,10 +161,12 @@ class LDBCommand {
|
|
|
155
161
|
// with this secondary path. When running against a database opened by
|
|
156
162
|
// another process, ldb wll leave the source directory completely intact.
|
|
157
163
|
std::string secondary_path_;
|
|
164
|
+
std::string leader_path_;
|
|
158
165
|
std::string column_family_name_;
|
|
159
166
|
DB* db_;
|
|
160
167
|
DBWithTTL* db_ttl_;
|
|
161
168
|
std::map<std::string, ColumnFamilyHandle*> cf_handles_;
|
|
169
|
+
std::map<uint32_t, const Comparator*> ucmps_;
|
|
162
170
|
|
|
163
171
|
/**
|
|
164
172
|
* true implies that this command can work if the db is opened in read-only
|
|
@@ -190,6 +198,9 @@ class LDBCommand {
|
|
|
190
198
|
|
|
191
199
|
bool create_if_missing_;
|
|
192
200
|
|
|
201
|
+
/** Encoded user provided uint64_t read timestamp. */
|
|
202
|
+
std::string read_timestamp_;
|
|
203
|
+
|
|
193
204
|
/**
|
|
194
205
|
* Map of options passed on the command-line.
|
|
195
206
|
*/
|
|
@@ -220,17 +231,19 @@ class LDBCommand {
|
|
|
220
231
|
ColumnFamilyHandle* GetCfHandle();
|
|
221
232
|
|
|
222
233
|
static std::string PrintKeyValue(const std::string& key,
|
|
234
|
+
const std::string& timestamp,
|
|
223
235
|
const std::string& value, bool is_key_hex,
|
|
224
|
-
bool is_value_hex);
|
|
236
|
+
bool is_value_hex, const Comparator* ucmp);
|
|
225
237
|
|
|
226
238
|
static std::string PrintKeyValue(const std::string& key,
|
|
227
|
-
const std::string&
|
|
239
|
+
const std::string& timestamp,
|
|
240
|
+
const std::string& value, bool is_hex,
|
|
241
|
+
const Comparator* ucmp);
|
|
228
242
|
|
|
229
|
-
static std::string PrintKeyValueOrWideColumns(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
bool is_value_hex);
|
|
243
|
+
static std::string PrintKeyValueOrWideColumns(
|
|
244
|
+
const Slice& key, const Slice& timestamp, const Slice& value,
|
|
245
|
+
const WideColumns& wide_columns, bool is_key_hex, bool is_value_hex,
|
|
246
|
+
const Comparator* ucmp);
|
|
234
247
|
|
|
235
248
|
/**
|
|
236
249
|
* Return true if the specified flag is present in the specified flags vector
|
|
@@ -275,6 +288,10 @@ class LDBCommand {
|
|
|
275
288
|
bool ParseBooleanOption(const std::map<std::string, std::string>& options,
|
|
276
289
|
const std::string& option, bool default_val);
|
|
277
290
|
|
|
291
|
+
/* Populate `ropts.timestamp` from command line flag --read_timestamp */
|
|
292
|
+
Status MaybePopulateReadTimestamp(ColumnFamilyHandle* cfh, ReadOptions& ropts,
|
|
293
|
+
Slice* read_timestamp);
|
|
294
|
+
|
|
278
295
|
Options options_;
|
|
279
296
|
std::vector<ColumnFamilyDescriptor> column_families_;
|
|
280
297
|
ConfigOptions config_options_;
|
package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h
CHANGED
|
@@ -15,10 +15,10 @@ namespace ROCKSDB_NAMESPACE {
|
|
|
15
15
|
// Multiple column families is not supported.
|
|
16
16
|
// It is best-effort. No guarantee to succeed.
|
|
17
17
|
// A full compaction may be executed.
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
18
|
+
// WARNING: using this to migrate from non-FIFO to FIFO compaction
|
|
19
|
+
// with `Options::compaction_options_fifo.max_table_files_size` > 0 can cause
|
|
20
|
+
// the whole DB to be dropped right after migration if the migrated data is
|
|
21
|
+
// larger than `max_table_files_size`
|
|
22
22
|
Status OptionChangeMigration(std::string dbname, const Options& old_opts,
|
|
23
23
|
const Options& new_opts);
|
|
24
24
|
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -103,12 +103,18 @@ class StackableDB : public DB {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
using DB::GetEntity;
|
|
106
|
+
|
|
106
107
|
Status GetEntity(const ReadOptions& options,
|
|
107
108
|
ColumnFamilyHandle* column_family, const Slice& key,
|
|
108
109
|
PinnableWideColumns* columns) override {
|
|
109
110
|
return db_->GetEntity(options, column_family, key, columns);
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
Status GetEntity(const ReadOptions& options, const Slice& key,
|
|
114
|
+
PinnableAttributeGroups* result) override {
|
|
115
|
+
return db_->GetEntity(options, key, result);
|
|
116
|
+
}
|
|
117
|
+
|
|
112
118
|
using DB::GetMergeOperands;
|
|
113
119
|
Status GetMergeOperands(const ReadOptions& options,
|
|
114
120
|
ColumnFamilyHandle* column_family, const Slice& key,
|
|
@@ -147,6 +153,12 @@ class StackableDB : public DB {
|
|
|
147
153
|
statuses, sorted_input);
|
|
148
154
|
}
|
|
149
155
|
|
|
156
|
+
void MultiGetEntity(const ReadOptions& options, size_t num_keys,
|
|
157
|
+
const Slice* keys,
|
|
158
|
+
PinnableAttributeGroups* results) override {
|
|
159
|
+
db_->MultiGetEntity(options, num_keys, keys, results);
|
|
160
|
+
}
|
|
161
|
+
|
|
150
162
|
using DB::IngestExternalFile;
|
|
151
163
|
Status IngestExternalFile(ColumnFamilyHandle* column_family,
|
|
152
164
|
const std::vector<std::string>& external_files,
|
|
@@ -259,11 +271,18 @@ class StackableDB : public DB {
|
|
|
259
271
|
return db_->NewIterators(options, column_families, iterators);
|
|
260
272
|
}
|
|
261
273
|
|
|
262
|
-
using DB::
|
|
263
|
-
std::unique_ptr<Iterator>
|
|
274
|
+
using DB::NewCoalescingIterator;
|
|
275
|
+
std::unique_ptr<Iterator> NewCoalescingIterator(
|
|
276
|
+
const ReadOptions& options,
|
|
277
|
+
const std::vector<ColumnFamilyHandle*>& column_families) override {
|
|
278
|
+
return db_->NewCoalescingIterator(options, column_families);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
using DB::NewAttributeGroupIterator;
|
|
282
|
+
std::unique_ptr<AttributeGroupIterator> NewAttributeGroupIterator(
|
|
264
283
|
const ReadOptions& options,
|
|
265
284
|
const std::vector<ColumnFamilyHandle*>& column_families) override {
|
|
266
|
-
return db_->
|
|
285
|
+
return db_->NewAttributeGroupIterator(options, column_families);
|
|
267
286
|
}
|
|
268
287
|
|
|
269
288
|
const Snapshot* GetSnapshot() override { return db_->GetSnapshot(); }
|
|
@@ -482,12 +501,12 @@ class StackableDB : public DB {
|
|
|
482
501
|
return db_->GetFullHistoryTsLow(column_family, ts_low);
|
|
483
502
|
}
|
|
484
503
|
|
|
485
|
-
Status GetSortedWalFiles(
|
|
504
|
+
Status GetSortedWalFiles(VectorWalPtr& files) override {
|
|
486
505
|
return db_->GetSortedWalFiles(files);
|
|
487
506
|
}
|
|
488
507
|
|
|
489
508
|
Status GetCurrentWalFile(
|
|
490
|
-
std::unique_ptr<
|
|
509
|
+
std::unique_ptr<WalFile>* current_log_file) override {
|
|
491
510
|
return db_->GetCurrentWalFile(current_log_file);
|
|
492
511
|
}
|
|
493
512
|
|
package/vendor/librocksdb/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h
CHANGED
|
@@ -84,4 +84,50 @@ std::shared_ptr<CompactOnDeletionCollectorFactory>
|
|
|
84
84
|
NewCompactOnDeletionCollectorFactory(size_t sliding_window_size,
|
|
85
85
|
size_t deletion_trigger,
|
|
86
86
|
double deletion_ratio = 0);
|
|
87
|
+
|
|
88
|
+
// A factory of a table property collector that marks a SST file as
|
|
89
|
+
// need-compaction when for the tiering use case, it observes, among all the
|
|
90
|
+
// data entries, the ratio of entries that are already eligible to be placed on
|
|
91
|
+
// the last level but are not yet on the last level is equal to or higher than
|
|
92
|
+
// the configured `compaction_trigger_ratio_`.
|
|
93
|
+
// 1) Setting the ratio to be equal to or smaller than 0 disables this collector
|
|
94
|
+
// 2) Setting the ratio to be within (0, 1] will write the number of
|
|
95
|
+
// observed eligible entries into a user property and marks a file as
|
|
96
|
+
// need-compaction when aforementioned condition is met.
|
|
97
|
+
// 3) Setting the ratio to be higher than 1 can be used to just writes the user
|
|
98
|
+
// table property, and not mark any file as need compaction.
|
|
99
|
+
// For a column family that does not enable tiering feature, even if an
|
|
100
|
+
// effective configuration is provided, this collector is still disabled.
|
|
101
|
+
class CompactForTieringCollectorFactory
|
|
102
|
+
: public TablePropertiesCollectorFactory {
|
|
103
|
+
public:
|
|
104
|
+
// @param compaction_trigger_ratio: the triggering threshold for the ratio of
|
|
105
|
+
// eligible entries to the total number of entries. See class documentation
|
|
106
|
+
// for what entry is eligible.
|
|
107
|
+
CompactForTieringCollectorFactory(double compaction_trigger_ratio);
|
|
108
|
+
|
|
109
|
+
~CompactForTieringCollectorFactory() {}
|
|
110
|
+
|
|
111
|
+
TablePropertiesCollector* CreateTablePropertiesCollector(
|
|
112
|
+
TablePropertiesCollectorFactory::Context context) override;
|
|
113
|
+
|
|
114
|
+
void SetCompactionTriggerRatio(double new_ratio) {
|
|
115
|
+
compaction_trigger_ratio_.store(new_ratio);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
double GetCompactionTriggerRatio() const {
|
|
119
|
+
return compaction_trigger_ratio_.load();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static const char* kClassName() { return "CompactForTieringCollector"; }
|
|
123
|
+
const char* Name() const override { return kClassName(); }
|
|
124
|
+
|
|
125
|
+
std::string ToString() const override;
|
|
126
|
+
|
|
127
|
+
private:
|
|
128
|
+
std::atomic<double> compaction_trigger_ratio_;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
std::shared_ptr<CompactForTieringCollectorFactory>
|
|
132
|
+
NewCompactForTieringCollectorFactory(double compaction_trigger_ratio);
|
|
87
133
|
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
#pragma once
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
#include <limits>
|
|
10
9
|
#include <string>
|
|
11
10
|
#include <vector>
|
|
@@ -165,7 +164,7 @@ class Transaction {
|
|
|
165
164
|
virtual void SetSnapshot() = 0;
|
|
166
165
|
|
|
167
166
|
// Similar to SetSnapshot(), but will not change the current snapshot
|
|
168
|
-
// until Put/Merge/Delete/GetForUpdate/MultigetForUpdate is called.
|
|
167
|
+
// until Put/PutEntity/Merge/Delete/GetForUpdate/MultigetForUpdate is called.
|
|
169
168
|
// By calling this function, the transaction will essentially call
|
|
170
169
|
// SetSnapshot() for you right before performing the next write/GetForUpdate.
|
|
171
170
|
//
|
|
@@ -268,10 +267,10 @@ class Transaction {
|
|
|
268
267
|
// points.
|
|
269
268
|
virtual void SetSavePoint() = 0;
|
|
270
269
|
|
|
271
|
-
// Undo all operations in this transaction (Put, Merge, Delete,
|
|
272
|
-
// since the most recent call to SetSavePoint() and removes the
|
|
273
|
-
// SetSavePoint().
|
|
274
|
-
//
|
|
270
|
+
// Undo all operations in this transaction (Put, PutEntity, Merge, Delete,
|
|
271
|
+
// PutLogData) since the most recent call to SetSavePoint() and removes the
|
|
272
|
+
// most recent SetSavePoint(). If there is no previous call to SetSavePoint(),
|
|
273
|
+
// returns Status::NotFound()
|
|
275
274
|
virtual Status RollbackToSavePoint() = 0;
|
|
276
275
|
|
|
277
276
|
// Pop the most recent save point.
|
|
@@ -318,6 +317,10 @@ class Transaction {
|
|
|
318
317
|
return s;
|
|
319
318
|
}
|
|
320
319
|
|
|
320
|
+
virtual Status GetEntity(const ReadOptions& options,
|
|
321
|
+
ColumnFamilyHandle* column_family, const Slice& key,
|
|
322
|
+
PinnableWideColumns* columns) = 0;
|
|
323
|
+
|
|
321
324
|
virtual std::vector<Status> MultiGet(
|
|
322
325
|
const ReadOptions& options,
|
|
323
326
|
const std::vector<ColumnFamilyHandle*>& column_family,
|
|
@@ -354,6 +357,12 @@ class Transaction {
|
|
|
354
357
|
}
|
|
355
358
|
}
|
|
356
359
|
|
|
360
|
+
virtual void MultiGetEntity(const ReadOptions& options,
|
|
361
|
+
ColumnFamilyHandle* column_family,
|
|
362
|
+
size_t num_keys, const Slice* keys,
|
|
363
|
+
PinnableWideColumns* results, Status* statuses,
|
|
364
|
+
bool sorted_input = false) = 0;
|
|
365
|
+
|
|
357
366
|
// Read this key and ensure that this transaction will only
|
|
358
367
|
// be able to be committed if this key is not written outside this
|
|
359
368
|
// transaction after it has first been read (or after the snapshot if a
|
|
@@ -434,6 +443,13 @@ class Transaction {
|
|
|
434
443
|
}
|
|
435
444
|
}
|
|
436
445
|
|
|
446
|
+
virtual Status GetEntityForUpdate(const ReadOptions& read_options,
|
|
447
|
+
ColumnFamilyHandle* column_family,
|
|
448
|
+
const Slice& key,
|
|
449
|
+
PinnableWideColumns* columns,
|
|
450
|
+
bool exclusive = true,
|
|
451
|
+
bool do_validate = true) = 0;
|
|
452
|
+
|
|
437
453
|
virtual std::vector<Status> MultiGetForUpdate(
|
|
438
454
|
const ReadOptions& options,
|
|
439
455
|
const std::vector<ColumnFamilyHandle*>& column_family,
|
|
@@ -461,9 +477,9 @@ class Transaction {
|
|
|
461
477
|
virtual Iterator* GetIterator(const ReadOptions& read_options,
|
|
462
478
|
ColumnFamilyHandle* column_family) = 0;
|
|
463
479
|
|
|
464
|
-
// Put, Merge, Delete, and SingleDelete behave similarly to the
|
|
465
|
-
// functions in WriteBatch, but will also do conflict checking
|
|
466
|
-
// keys being written.
|
|
480
|
+
// Put, PutEntity, Merge, Delete, and SingleDelete behave similarly to the
|
|
481
|
+
// corresponding functions in WriteBatch, but will also do conflict checking
|
|
482
|
+
// on the keys being written.
|
|
467
483
|
//
|
|
468
484
|
// assume_tracked=true expects the key be already tracked. More
|
|
469
485
|
// specifically, it means the the key was previous tracked in the same
|
|
@@ -489,6 +505,10 @@ class Transaction {
|
|
|
489
505
|
const bool assume_tracked = false) = 0;
|
|
490
506
|
virtual Status Put(const SliceParts& key, const SliceParts& value) = 0;
|
|
491
507
|
|
|
508
|
+
virtual Status PutEntity(ColumnFamilyHandle* column_family, const Slice& key,
|
|
509
|
+
const WideColumns& columns,
|
|
510
|
+
bool assume_tracked = false) = 0;
|
|
511
|
+
|
|
492
512
|
virtual Status Merge(ColumnFamilyHandle* column_family, const Slice& key,
|
|
493
513
|
const Slice& value,
|
|
494
514
|
const bool assume_tracked = false) = 0;
|
|
@@ -528,6 +548,10 @@ class Transaction {
|
|
|
528
548
|
virtual Status PutUntracked(const SliceParts& key,
|
|
529
549
|
const SliceParts& value) = 0;
|
|
530
550
|
|
|
551
|
+
virtual Status PutEntityUntracked(ColumnFamilyHandle* column_family,
|
|
552
|
+
const Slice& key,
|
|
553
|
+
const WideColumns& columns) = 0;
|
|
554
|
+
|
|
531
555
|
virtual Status MergeUntracked(ColumnFamilyHandle* column_family,
|
|
532
556
|
const Slice& key, const Slice& value) = 0;
|
|
533
557
|
virtual Status MergeUntracked(const Slice& key, const Slice& value) = 0;
|
|
@@ -556,18 +580,18 @@ class Transaction {
|
|
|
556
580
|
// Similar to WriteBatch::PutLogData
|
|
557
581
|
virtual void PutLogData(const Slice& blob) = 0;
|
|
558
582
|
|
|
559
|
-
// By default, all Put/Merge/Delete operations will be indexed in
|
|
560
|
-
// transaction so that Get/GetForUpdate/GetIterator can search for these
|
|
583
|
+
// By default, all Put/PutEntity/Merge/Delete operations will be indexed in
|
|
584
|
+
// the transaction so that Get/GetForUpdate/GetIterator can search for these
|
|
561
585
|
// keys.
|
|
562
586
|
//
|
|
563
587
|
// If the caller does not want to fetch the keys about to be written,
|
|
564
588
|
// they may want to avoid indexing as a performance optimization.
|
|
565
589
|
// Calling DisableIndexing() will turn off indexing for all future
|
|
566
|
-
// Put/Merge/Delete operations until EnableIndexing() is called.
|
|
590
|
+
// Put/PutEntity/Merge/Delete operations until EnableIndexing() is called.
|
|
567
591
|
//
|
|
568
|
-
// If a key is Put/Merge/
|
|
569
|
-
// is
|
|
570
|
-
// undefined.
|
|
592
|
+
// If a key is written (using Put/PutEntity/Merge/Delete) after
|
|
593
|
+
// DisableIndexing is called and then is fetched via
|
|
594
|
+
// Get/GetForUpdate/GetIterator, the result of the fetch is undefined.
|
|
571
595
|
virtual void DisableIndexing() = 0;
|
|
572
596
|
virtual void EnableIndexing() = 0;
|
|
573
597
|
|
|
@@ -578,9 +602,10 @@ class Transaction {
|
|
|
578
602
|
// number of keys that need to be checked for conflicts at commit time.
|
|
579
603
|
virtual uint64_t GetNumKeys() const = 0;
|
|
580
604
|
|
|
581
|
-
// Returns the number of
|
|
582
|
-
// transaction so far.
|
|
605
|
+
// Returns the number of Put/PutEntity/Delete/Merge operations that have been
|
|
606
|
+
// applied to this transaction so far.
|
|
583
607
|
virtual uint64_t GetNumPuts() const = 0;
|
|
608
|
+
virtual uint64_t GetNumPutEntities() const = 0;
|
|
584
609
|
virtual uint64_t GetNumDeletes() const = 0;
|
|
585
610
|
virtual uint64_t GetNumMerges() const = 0;
|
|
586
611
|
|
|
@@ -235,6 +235,11 @@ struct TransactionDBOptions {
|
|
|
235
235
|
const Slice& /*key*/)>
|
|
236
236
|
rollback_deletion_type_callback;
|
|
237
237
|
|
|
238
|
+
// A flag to control for the whole DB whether user-defined timestamp based
|
|
239
|
+
// validation are enabled when applicable. Only WriteCommittedTxn support
|
|
240
|
+
// user-defined timestamps so this option only applies in this case.
|
|
241
|
+
bool enable_udt_validation = true;
|
|
242
|
+
|
|
238
243
|
private:
|
|
239
244
|
// 128 entries
|
|
240
245
|
// Should the default value change, please also update wp_snapshot_cache_bits
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
//
|
|
3
|
+
// This source code is licensed under both the GPLv2 (found in the
|
|
4
|
+
// COPYING file in the root directory) and Apache 2.0 License
|
|
5
|
+
// (found in the LICENSE.Apache file in the root directory).
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "rocksdb/comparator.h"
|
|
10
|
+
#include "rocksdb/slice.h"
|
|
11
|
+
#include "rocksdb/status.h"
|
|
12
|
+
#include "rocksdb/types.h"
|
|
13
|
+
|
|
14
|
+
namespace ROCKSDB_NAMESPACE {
|
|
15
|
+
|
|
16
|
+
// Given a user key, creates the internal key used for `Seek` operation for a
|
|
17
|
+
// raw table iterator. The internal key is stored in `buf`.
|
|
18
|
+
// `comparator` should be the same as the `Options.comparator` used to create
|
|
19
|
+
// the column family or the `SstFileWriter`.
|
|
20
|
+
Status GetInternalKeyForSeek(const Slice& user_key,
|
|
21
|
+
const Comparator* comparator, std::string* buf);
|
|
22
|
+
|
|
23
|
+
// Given a user key, creates the internal key used for `SeekForPrev` operation
|
|
24
|
+
// for a raw table iterator. The internal key is stored in `buf`.
|
|
25
|
+
// `comparator`: see doc for `GetInternalKeyForSeek`.
|
|
26
|
+
Status GetInternalKeyForSeekForPrev(const Slice& user_key,
|
|
27
|
+
const Comparator* comparator,
|
|
28
|
+
std::string* buf);
|
|
29
|
+
|
|
30
|
+
// Util method that takes an internal key and parse it to get `ParsedEntryInfo`.
|
|
31
|
+
// Such an internal key usually comes from a table iterator.
|
|
32
|
+
// `comparator`: see doc for `GetInternalKeyForSeek`.
|
|
33
|
+
Status ParseEntry(const Slice& internal_key, const Comparator* comparator,
|
|
34
|
+
ParsedEntryInfo* parsed_entry);
|
|
35
|
+
|
|
36
|
+
} // namespace ROCKSDB_NAMESPACE
|
|
@@ -130,7 +130,7 @@ class WriteBatchWithIndex : public WriteBatchBase {
|
|
|
130
130
|
"Cannot call this method without attribute groups");
|
|
131
131
|
}
|
|
132
132
|
return Status::NotSupported(
|
|
133
|
-
"PutEntity not supported by WriteBatchWithIndex");
|
|
133
|
+
"PutEntity with AttributeGroups not supported by WriteBatchWithIndex");
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
using WriteBatchBase::Merge;
|
|
@@ -268,7 +268,28 @@ class WriteBatchWithIndex : public WriteBatchBase {
|
|
|
268
268
|
ColumnFamilyHandle* column_family, const Slice& key,
|
|
269
269
|
PinnableSlice* value);
|
|
270
270
|
|
|
271
|
-
//
|
|
271
|
+
// Similar to DB::GetEntity() but also reads writes from this batch.
|
|
272
|
+
//
|
|
273
|
+
// This method queries the batch for the key and if the result can be
|
|
274
|
+
// determined based on the batch alone, it is returned (assuming the key is
|
|
275
|
+
// found, in the form of a wide-column entity). If the batch does not contain
|
|
276
|
+
// enough information to determine the result (the key is not present in the
|
|
277
|
+
// batch at all or a merge is in progress), the DB is queried and the result
|
|
278
|
+
// is merged with the entries from the batch if necessary.
|
|
279
|
+
//
|
|
280
|
+
// Setting read_options.snapshot will affect what is read from the DB
|
|
281
|
+
// but will NOT change which keys are read from the batch (the keys in
|
|
282
|
+
// this batch do not yet belong to any snapshot and will be fetched
|
|
283
|
+
// regardless).
|
|
284
|
+
Status GetEntityFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
285
|
+
ColumnFamilyHandle* column_family,
|
|
286
|
+
const Slice& key,
|
|
287
|
+
PinnableWideColumns* columns) {
|
|
288
|
+
constexpr ReadCallback* callback = nullptr;
|
|
289
|
+
|
|
290
|
+
return GetEntityFromBatchAndDB(db, read_options, column_family, key,
|
|
291
|
+
columns, callback);
|
|
292
|
+
}
|
|
272
293
|
|
|
273
294
|
void MultiGetFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
274
295
|
ColumnFamilyHandle* column_family,
|
|
@@ -276,7 +297,31 @@ class WriteBatchWithIndex : public WriteBatchBase {
|
|
|
276
297
|
PinnableSlice* values, Status* statuses,
|
|
277
298
|
bool sorted_input);
|
|
278
299
|
|
|
279
|
-
//
|
|
300
|
+
// Similar to DB::MultiGetEntity() but also reads writes from this batch.
|
|
301
|
+
//
|
|
302
|
+
// For each key, this method queries the batch and if the result can be
|
|
303
|
+
// determined based on the batch alone, it is returned in the appropriate
|
|
304
|
+
// PinnableWideColumns object (assuming the key is found). For all keys for
|
|
305
|
+
// which the batch does not contain enough information to determine the result
|
|
306
|
+
// (the key is not present in the batch at all or a merge is in progress), the
|
|
307
|
+
// DB is queried and the result is merged with the entries from the batch if
|
|
308
|
+
// necessary.
|
|
309
|
+
//
|
|
310
|
+
// Setting read_options.snapshot will affect what is read from the DB
|
|
311
|
+
// but will NOT change which keys are read from the batch (the keys in
|
|
312
|
+
// this batch do not yet belong to any snapshot and will be fetched
|
|
313
|
+
// regardless).
|
|
314
|
+
void MultiGetEntityFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
315
|
+
ColumnFamilyHandle* column_family,
|
|
316
|
+
size_t num_keys, const Slice* keys,
|
|
317
|
+
PinnableWideColumns* results,
|
|
318
|
+
Status* statuses, bool sorted_input) {
|
|
319
|
+
constexpr ReadCallback* callback = nullptr;
|
|
320
|
+
|
|
321
|
+
MultiGetEntityFromBatchAndDB(db, read_options, column_family, num_keys,
|
|
322
|
+
keys, results, statuses, sorted_input,
|
|
323
|
+
callback);
|
|
324
|
+
}
|
|
280
325
|
|
|
281
326
|
// Records the state of the batch for future calls to RollbackToSavePoint().
|
|
282
327
|
// May be called multiple times to set multiple save points.
|
|
@@ -314,11 +359,23 @@ class WriteBatchWithIndex : public WriteBatchBase {
|
|
|
314
359
|
// last sub-batch.
|
|
315
360
|
size_t SubBatchCnt();
|
|
316
361
|
|
|
362
|
+
void MergeAcrossBatchAndDBImpl(ColumnFamilyHandle* column_family,
|
|
363
|
+
const Slice& key,
|
|
364
|
+
const PinnableWideColumns& existing,
|
|
365
|
+
const MergeContext& merge_context,
|
|
366
|
+
std::string* value,
|
|
367
|
+
PinnableWideColumns* columns, Status* status);
|
|
317
368
|
void MergeAcrossBatchAndDB(ColumnFamilyHandle* column_family,
|
|
318
369
|
const Slice& key,
|
|
319
370
|
const PinnableWideColumns& existing,
|
|
320
371
|
const MergeContext& merge_context,
|
|
321
372
|
PinnableSlice* value, Status* status);
|
|
373
|
+
void MergeAcrossBatchAndDB(ColumnFamilyHandle* column_family,
|
|
374
|
+
const Slice& key,
|
|
375
|
+
const PinnableWideColumns& existing,
|
|
376
|
+
const MergeContext& merge_context,
|
|
377
|
+
PinnableWideColumns* columns, Status* status);
|
|
378
|
+
|
|
322
379
|
Status GetFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
323
380
|
ColumnFamilyHandle* column_family, const Slice& key,
|
|
324
381
|
PinnableSlice* value, ReadCallback* callback);
|
|
@@ -327,6 +384,17 @@ class WriteBatchWithIndex : public WriteBatchBase {
|
|
|
327
384
|
const size_t num_keys, const Slice* keys,
|
|
328
385
|
PinnableSlice* values, Status* statuses,
|
|
329
386
|
bool sorted_input, ReadCallback* callback);
|
|
387
|
+
Status GetEntityFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
388
|
+
ColumnFamilyHandle* column_family,
|
|
389
|
+
const Slice& key, PinnableWideColumns* columns,
|
|
390
|
+
ReadCallback* callback);
|
|
391
|
+
void MultiGetEntityFromBatchAndDB(DB* db, const ReadOptions& read_options,
|
|
392
|
+
ColumnFamilyHandle* column_family,
|
|
393
|
+
size_t num_keys, const Slice* keys,
|
|
394
|
+
PinnableWideColumns* results,
|
|
395
|
+
Status* statuses, bool sorted_input,
|
|
396
|
+
ReadCallback* callback);
|
|
397
|
+
|
|
330
398
|
struct Rep;
|
|
331
399
|
std::unique_ptr<Rep> rep;
|
|
332
400
|
};
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// NOTE: in 'main' development branch, this should be the *next*
|
|
13
13
|
// minor or major version number planned for release.
|
|
14
14
|
#define ROCKSDB_MAJOR 9
|
|
15
|
-
#define ROCKSDB_MINOR
|
|
16
|
-
#define ROCKSDB_PATCH
|
|
15
|
+
#define ROCKSDB_MINOR 6
|
|
16
|
+
#define ROCKSDB_PATCH 0
|
|
17
17
|
|
|
18
18
|
// Do not use these. We made the mistake of declaring macros starting with
|
|
19
19
|
// double underscore. Now we have to live with our choice. We'll deprecate these
|