From 13ae16c31577ef89558057d0bff3d273f27e2382 Mon Sep 17 00:00:00 2001 From: mrambacher Date: Wed, 29 Sep 2021 04:01:57 -0700 Subject: [PATCH] Cleanup includes in dbformat.h (#8930) Summary: This header file was including everything and the kitchen sink when it did not need to. This resulted in many places including this header when they needed other pieces instead. Cleaned up this header to only include what was needed and fixed up the remaining code to include what was now missing. Hopefully, this sort of code hygiene cleanup will speed up the builds... Pull Request resolved: https://github.com/facebook/rocksdb/pull/8930 Reviewed By: pdillinger Differential Revision: D31142788 Pulled By: mrambacher fbshipit-source-id: 6b45de3f300750c79f751f6227dece9cfd44085d --- db/arena_wrapped_db_iter.h | 1 - db/builder.cc | 1 - db/column_family.cc | 1 + db/compaction/compaction_iterator.cc | 1 + db/compaction/compaction_job.h | 1 - db/compaction/compaction_picker.cc | 2 ++ db/compaction/compaction_picker_fifo.cc | 2 ++ db/compaction/compaction_picker_universal.cc | 2 ++ db/db_filesnapshot.cc | 3 +++ db/db_impl/compacted_db_impl.cc | 1 + db/db_impl/db_impl.h | 1 - db/db_impl/db_impl_compaction_flush.cc | 1 + db/db_impl/db_impl_experimental.cc | 1 + db/db_impl/db_impl_files.cc | 1 + db/db_impl/db_impl_open.cc | 1 + db/db_impl/db_impl_readonly.cc | 1 + db/db_impl/db_impl_secondary.cc | 1 + db/db_impl/db_impl_secondary.h | 2 ++ db/db_impl/db_impl_write.cc | 1 + db/db_iter.h | 1 - db/db_test_util.h | 1 - db/dbformat.cc | 3 +++ db/dbformat.h | 9 ++------- db/external_sst_file_ingestion_job.cc | 1 + db/external_sst_file_ingestion_job.h | 1 - db/flush_job.h | 1 - db/forward_iterator.h | 1 - db/import_column_family_job.cc | 1 + db/import_column_family_job.h | 1 - db/lookup_key.h | 1 - db/memtable.cc | 1 + db/memtable_list.cc | 1 + db/memtable_list.h | 1 - db/merge_helper.h | 3 ++- db/output_validator.cc | 3 +++ db/output_validator.h | 3 +-- db/repair.cc | 2 ++ db/transaction_log_impl.h | 1 + db/version_edit_handler.cc | 1 + db/version_set.cc | 1 + db_stress_tool/db_stress_test_base.cc | 1 + env/env_test.cc | 1 + file/sst_file_manager_impl.cc | 1 + options/cf_options.cc | 1 + options/options.cc | 2 ++ table/block_based/block.h | 1 - table/block_based/block_based_table_builder.cc | 1 + table/block_based/block_based_table_factory.cc | 3 ++- table/block_based/block_based_table_factory.h | 6 +++++- table/block_based/block_based_table_reader.cc | 2 ++ table/block_based/block_based_table_reader.h | 1 + table/block_based/block_based_table_reader_test.cc | 1 + table/block_based/filter_block.h | 3 ++- table/block_based/filter_policy.cc | 1 + table/block_based/full_filter_block.h | 3 ++- table/block_based/partitioned_filter_block.cc | 1 + table/block_based/partitioned_filter_block.h | 4 ++-- table/block_based/uncompression_dict_reader.cc | 2 ++ table/block_fetcher_test.cc | 1 + table/cuckoo/cuckoo_table_builder_test.cc | 1 + table/cuckoo/cuckoo_table_reader.h | 1 - table/cuckoo/cuckoo_table_reader_test.cc | 1 + table/get_context.cc | 1 + table/get_context.h | 11 ++++++----- table/merging_iterator.h | 6 +++--- table/meta_blocks.cc | 1 + table/plain/plain_table_builder.cc | 3 ++- table/plain/plain_table_index.cc | 3 ++- table/plain/plain_table_index.h | 1 - table/plain/plain_table_key_coding.h | 2 +- table/plain/plain_table_reader.h | 1 - table/sst_file_writer_collectors.h | 3 ++- table/table_test.cc | 1 + .../block_cache_trace_analyzer_test.cc | 1 + tools/io_tracer_parser_test.cc | 1 + tools/ldb_cmd.cc | 1 + trace_replay/block_cache_tracer_test.cc | 1 + trace_replay/io_tracer_test.cc | 1 + util/duplicate_detector.h | 3 +++ utilities/blob_db/blob_compaction_filter.cc | 1 + utilities/blob_db/blob_db.cc | 2 ++ utilities/checkpoint/checkpoint_impl.cc | 1 + utilities/transactions/pessimistic_transaction.cc | 1 + utilities/transactions/pessimistic_transaction_db.cc | 1 + utilities/transactions/transaction_base.cc | 1 + utilities/transactions/write_prepared_txn_db.cc | 1 + utilities/transactions/write_prepared_txn_db.h | 1 + utilities/ttl/db_ttl_impl.cc | 1 + 88 files changed, 109 insertions(+), 44 deletions(-) diff --git a/db/arena_wrapped_db_iter.h b/db/arena_wrapped_db_iter.h index 3442440c1..5b8645c90 100644 --- a/db/arena_wrapped_db_iter.h +++ b/db/arena_wrapped_db_iter.h @@ -12,7 +12,6 @@ #include #include "db/db_impl/db_impl.h" #include "db/db_iter.h" -#include "db/dbformat.h" #include "db/range_del_aggregator.h" #include "memory/arena.h" #include "options/cf_options.h" diff --git a/db/builder.cc b/db/builder.cc index 0971e9dc0..c1dadc814 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -15,7 +15,6 @@ #include "db/blob/blob_file_builder.h" #include "db/compaction/compaction_iterator.h" -#include "db/dbformat.h" #include "db/event_helpers.h" #include "db/internal_stats.h" #include "db/merge_helper.h" diff --git a/db/column_family.cc b/db/column_family.cc index 51f141349..8b7ca329e 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -29,6 +29,7 @@ #include "db/version_set.h" #include "db/write_controller.h" #include "file/sst_file_manager_impl.h" +#include "logging/logging.h" #include "monitoring/thread_status_util.h" #include "options/options_helper.h" #include "port/port.h" diff --git a/db/compaction/compaction_iterator.cc b/db/compaction/compaction_iterator.cc index 918c44c9e..ed7fb9251 100644 --- a/db/compaction/compaction_iterator.cc +++ b/db/compaction/compaction_iterator.cc @@ -11,6 +11,7 @@ #include "db/blob/blob_file_builder.h" #include "db/blob/blob_index.h" #include "db/snapshot_checker.h" +#include "logging/logging.h" #include "port/likely.h" #include "rocksdb/listener.h" #include "table/internal_iterator.h" diff --git a/db/compaction/compaction_job.h b/db/compaction/compaction_job.h index 67ec2d7c7..428c847c3 100644 --- a/db/compaction/compaction_job.h +++ b/db/compaction/compaction_job.h @@ -20,7 +20,6 @@ #include "db/blob/blob_file_completion_callback.h" #include "db/column_family.h" #include "db/compaction/compaction_iterator.h" -#include "db/dbformat.h" #include "db/flush_scheduler.h" #include "db/internal_stats.h" #include "db/job_context.h" diff --git a/db/compaction/compaction_picker.cc b/db/compaction/compaction_picker.cc index fe2fea1ef..758cc626f 100644 --- a/db/compaction/compaction_picker.cc +++ b/db/compaction/compaction_picker.cc @@ -15,9 +15,11 @@ #include #include #include + #include "db/column_family.h" #include "file/filename.h" #include "logging/log_buffer.h" +#include "logging/logging.h" #include "monitoring/statistics.h" #include "test_util/sync_point.h" #include "util/random.h" diff --git a/db/compaction/compaction_picker_fifo.cc b/db/compaction/compaction_picker_fifo.cc index 01932f483..5f880fc47 100644 --- a/db/compaction/compaction_picker_fifo.cc +++ b/db/compaction/compaction_picker_fifo.cc @@ -13,8 +13,10 @@ #include #include #include + #include "db/column_family.h" #include "logging/log_buffer.h" +#include "logging/logging.h" #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { diff --git a/db/compaction/compaction_picker_universal.cc b/db/compaction/compaction_picker_universal.cc index ef3c9589d..1f96f1bea 100644 --- a/db/compaction/compaction_picker_universal.cc +++ b/db/compaction/compaction_picker_universal.cc @@ -15,9 +15,11 @@ #include #include #include + #include "db/column_family.h" #include "file/filename.h" #include "logging/log_buffer.h" +#include "logging/logging.h" #include "monitoring/statistics.h" #include "test_util/sync_point.h" #include "util/random.h" diff --git a/db/db_filesnapshot.cc b/db/db_filesnapshot.cc index 1c597ed1d..536903206 100644 --- a/db/db_filesnapshot.cc +++ b/db/db_filesnapshot.cc @@ -7,14 +7,17 @@ #ifndef ROCKSDB_LITE #include + #include #include #include + #include "db/db_impl/db_impl.h" #include "db/job_context.h" #include "db/version_set.h" #include "file/file_util.h" #include "file/filename.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" diff --git a/db/db_impl/compacted_db_impl.cc b/db/db_impl/compacted_db_impl.cc index 076ce818f..72d9c57c0 100644 --- a/db/db_impl/compacted_db_impl.cc +++ b/db/db_impl/compacted_db_impl.cc @@ -8,6 +8,7 @@ #include "db/db_impl/db_impl.h" #include "db/version_set.h" +#include "logging/logging.h" #include "table/get_context.h" #include "util/cast_util.h" diff --git a/db/db_impl/db_impl.h b/db/db_impl/db_impl.h index c2d761104..ca227c99e 100644 --- a/db/db_impl/db_impl.h +++ b/db/db_impl/db_impl.h @@ -22,7 +22,6 @@ #include "db/column_family.h" #include "db/compaction/compaction_iterator.h" #include "db/compaction/compaction_job.h" -#include "db/dbformat.h" #include "db/error_handler.h" #include "db/event_helpers.h" #include "db/external_sst_file_ingestion_job.h" diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index 590a2be8e..f85df49eb 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -14,6 +14,7 @@ #include "db/error_handler.h" #include "db/event_helpers.h" #include "file/sst_file_manager_impl.h" +#include "logging/logging.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_updater.h" diff --git a/db/db_impl/db_impl_experimental.cc b/db/db_impl/db_impl_experimental.cc index bd6da6999..ab5cdcb04 100644 --- a/db/db_impl/db_impl_experimental.cc +++ b/db/db_impl/db_impl_experimental.cc @@ -14,6 +14,7 @@ #include "db/db_impl/db_impl.h" #include "db/job_context.h" #include "db/version_set.h" +#include "logging/logging.h" #include "rocksdb/status.h" #include "util/cast_util.h" diff --git a/db/db_impl/db_impl_files.cc b/db/db_impl/db_impl_files.cc index 4eb46a2c8..a93267fbc 100644 --- a/db/db_impl/db_impl_files.cc +++ b/db/db_impl/db_impl_files.cc @@ -16,6 +16,7 @@ #include "file/file_util.h" #include "file/filename.h" #include "file/sst_file_manager_impl.h" +#include "logging/logging.h" #include "port/port.h" #include "util/autovector.h" diff --git a/db/db_impl/db_impl_open.cc b/db/db_impl/db_impl_open.cc index ee40f7e51..7de813074 100644 --- a/db/db_impl/db_impl_open.cc +++ b/db/db_impl/db_impl_open.cc @@ -16,6 +16,7 @@ #include "file/read_write_util.h" #include "file/sst_file_manager_impl.h" #include "file/writable_file_writer.h" +#include "logging/logging.h" #include "monitoring/persistent_stats_history.h" #include "options/options_helper.h" #include "rocksdb/table.h" diff --git a/db/db_impl/db_impl_readonly.cc b/db/db_impl/db_impl_readonly.cc index cb3562d3f..6970dcefd 100644 --- a/db/db_impl/db_impl_readonly.cc +++ b/db/db_impl/db_impl_readonly.cc @@ -10,6 +10,7 @@ #include "db/db_impl/db_impl.h" #include "db/db_iter.h" #include "db/merge_context.h" +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "util/cast_util.h" diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index baf385c9b..9a0b8af9f 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -10,6 +10,7 @@ #include "db/arena_wrapped_db_iter.h" #include "db/merge_context.h" #include "logging/auto_roll_logger.h" +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/configurable.h" #include "util/cast_util.h" diff --git a/db/db_impl/db_impl_secondary.h b/db/db_impl/db_impl_secondary.h index 397d22abb..8c5f05029 100644 --- a/db/db_impl/db_impl_secondary.h +++ b/db/db_impl/db_impl_secondary.h @@ -9,7 +9,9 @@ #include #include + #include "db/db_impl/db_impl.h" +#include "logging/logging.h" namespace ROCKSDB_NAMESPACE { diff --git a/db/db_impl/db_impl_write.cc b/db/db_impl/db_impl_write.cc index 814845590..fc389395e 100644 --- a/db/db_impl/db_impl_write.cc +++ b/db/db_impl/db_impl_write.cc @@ -11,6 +11,7 @@ #include "db/db_impl/db_impl.h" #include "db/error_handler.h" #include "db/event_helpers.h" +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "options/options_helper.h" #include "test_util/sync_point.h" diff --git a/db/db_iter.h b/db/db_iter.h index 52bffa55d..20a3982f5 100644 --- a/db/db_iter.h +++ b/db/db_iter.h @@ -12,7 +12,6 @@ #include #include "db/db_impl/db_impl.h" -#include "db/dbformat.h" #include "db/range_del_aggregator.h" #include "memory/arena.h" #include "options/cf_options.h" diff --git a/db/db_test_util.h b/db/db_test_util.h index 36dde492f..2dfb65327 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -22,7 +22,6 @@ #include #include "db/db_impl/db_impl.h" -#include "db/dbformat.h" #include "file/filename.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" diff --git a/db/dbformat.cc b/db/dbformat.cc index ad6ec36c6..6afdc3dc2 100644 --- a/db/dbformat.cc +++ b/db/dbformat.cc @@ -9,7 +9,10 @@ #include "db/dbformat.h" #include + #include + +#include "db/lookup_key.h" #include "monitoring/perf_context_imp.h" #include "port/port.h" #include "util/coding.h" diff --git a/db/dbformat.h b/db/dbformat.h index c3f5c5437..1d229adf3 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -9,19 +9,14 @@ #pragma once #include + #include #include #include -#include "db/lookup_key.h" -#include "db/merge_context.h" -#include "logging/logging.h" -#include "monitoring/perf_context_imp.h" + #include "rocksdb/comparator.h" -#include "rocksdb/db.h" -#include "rocksdb/filter_policy.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" -#include "rocksdb/table.h" #include "rocksdb/types.h" #include "util/coding.h" #include "util/user_comparator_wrapper.h" diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index dc1d5b3c8..575e47b09 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -17,6 +17,7 @@ #include "db/version_edit.h" #include "file/file_util.h" #include "file/random_access_file_reader.h" +#include "logging/logging.h" #include "table/merging_iterator.h" #include "table/scoped_arena_iterator.h" #include "table/sst_file_writer_collectors.h" diff --git a/db/external_sst_file_ingestion_job.h b/db/external_sst_file_ingestion_job.h index c669089d9..489c60fa1 100644 --- a/db/external_sst_file_ingestion_job.h +++ b/db/external_sst_file_ingestion_job.h @@ -9,7 +9,6 @@ #include #include "db/column_family.h" -#include "db/dbformat.h" #include "db/internal_stats.h" #include "db/snapshot_impl.h" #include "env/file_system_tracer.h" diff --git a/db/flush_job.h b/db/flush_job.h index 49d57ef79..5c5b0c47e 100644 --- a/db/flush_job.h +++ b/db/flush_job.h @@ -19,7 +19,6 @@ #include "db/blob/blob_file_completion_callback.h" #include "db/column_family.h" -#include "db/dbformat.h" #include "db/flush_scheduler.h" #include "db/internal_stats.h" #include "db/job_context.h" diff --git a/db/forward_iterator.h b/db/forward_iterator.h index 620d46781..99434d858 100644 --- a/db/forward_iterator.h +++ b/db/forward_iterator.h @@ -10,7 +10,6 @@ #include #include -#include "db/dbformat.h" #include "memory/arena.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" diff --git a/db/import_column_family_job.cc b/db/import_column_family_job.cc index 7c8c44e4e..4ddbb5c86 100644 --- a/db/import_column_family_job.cc +++ b/db/import_column_family_job.cc @@ -10,6 +10,7 @@ #include "db/version_edit.h" #include "file/file_util.h" #include "file/random_access_file_reader.h" +#include "logging/logging.h" #include "table/merging_iterator.h" #include "table/scoped_arena_iterator.h" #include "table/sst_file_writer_collectors.h" diff --git a/db/import_column_family_job.h b/db/import_column_family_job.h index 3cf4eb56e..ddf0cb96f 100644 --- a/db/import_column_family_job.h +++ b/db/import_column_family_job.h @@ -4,7 +4,6 @@ #include #include "db/column_family.h" -#include "db/dbformat.h" #include "db/external_sst_file_ingestion_job.h" #include "db/snapshot_impl.h" #include "options/db_options.h" diff --git a/db/lookup_key.h b/db/lookup_key.h index 51e5daed1..609d08daf 100644 --- a/db/lookup_key.h +++ b/db/lookup_key.h @@ -10,7 +10,6 @@ #pragma once #include #include -#include "rocksdb/db.h" #include "rocksdb/slice.h" #include "rocksdb/types.h" diff --git a/db/memtable.cc b/db/memtable.cc index 936883e24..f2803dfc1 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -21,6 +21,7 @@ #include "db/pinned_iterators_manager.h" #include "db/range_tombstone_fragmenter.h" #include "db/read_callback.h" +#include "logging/logging.h" #include "memory/arena.h" #include "memory/memory_usage.h" #include "monitoring/perf_context_imp.h" diff --git a/db/memtable_list.cc b/db/memtable_list.cc index e522d2207..4762b7f38 100644 --- a/db/memtable_list.cc +++ b/db/memtable_list.cc @@ -16,6 +16,7 @@ #include "db/range_tombstone_fragmenter.h" #include "db/version_set.h" #include "logging/log_buffer.h" +#include "logging/logging.h" #include "monitoring/thread_status_util.h" #include "rocksdb/db.h" #include "rocksdb/env.h" diff --git a/db/memtable_list.h b/db/memtable_list.h index b73b7c203..88d3e96cc 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -12,7 +12,6 @@ #include #include -#include "db/dbformat.h" #include "db/logs_with_prep_tracker.h" #include "db/memtable.h" #include "db/range_del_aggregator.h" diff --git a/db/merge_helper.h b/db/merge_helper.h index 7827babad..392934bfb 100644 --- a/db/merge_helper.h +++ b/db/merge_helper.h @@ -9,12 +9,12 @@ #include #include -#include "db/dbformat.h" #include "db/merge_context.h" #include "db/range_del_aggregator.h" #include "db/snapshot_checker.h" #include "rocksdb/compaction_filter.h" #include "rocksdb/env.h" +#include "rocksdb/merge_operator.h" #include "rocksdb/slice.h" #include "util/stop_watch.h" @@ -26,6 +26,7 @@ class Logger; class MergeOperator; class Statistics; class SystemClock; +class Version; class MergeHelper { public: diff --git a/db/output_validator.cc b/db/output_validator.cc index c36c9281e..e93e2d68c 100644 --- a/db/output_validator.cc +++ b/db/output_validator.cc @@ -5,6 +5,9 @@ // #include "db/output_validator.h" +#include "test_util/sync_point.h" +#include "util/hash.h" + namespace ROCKSDB_NAMESPACE { Status OutputValidator::Add(const Slice& key, const Slice& value) { if (enable_hash_) { diff --git a/db/output_validator.h b/db/output_validator.h index ad9000d5e..40635f9c4 100644 --- a/db/output_validator.h +++ b/db/output_validator.h @@ -5,9 +5,8 @@ // #pragma once #include "db/dbformat.h" +#include "rocksdb/slice.h" #include "rocksdb/status.h" -#include "test_util/sync_point.h" -#include "util/hash.h" namespace ROCKSDB_NAMESPACE { // A class that validates key/value that is inserted to an SST file. diff --git a/db/repair.cc b/db/repair.cc index 42b874f45..cef0f7369 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -62,6 +62,7 @@ #ifndef ROCKSDB_LITE #include + #include "db/builder.h" #include "db/db_impl/db_impl.h" #include "db/dbformat.h" @@ -73,6 +74,7 @@ #include "db/write_batch_internal.h" #include "file/filename.h" #include "file/writable_file_writer.h" +#include "logging/logging.h" #include "options/cf_options.h" #include "rocksdb/comparator.h" #include "rocksdb/db.h" diff --git a/db/transaction_log_impl.h b/db/transaction_log_impl.h index 1cea6e0b5..f9718f169 100644 --- a/db/transaction_log_impl.h +++ b/db/transaction_log_impl.h @@ -10,6 +10,7 @@ #include "db/log_reader.h" #include "db/version_set.h" #include "file/filename.h" +#include "logging/logging.h" #include "options/db_options.h" #include "port/port.h" #include "rocksdb/env.h" diff --git a/db/version_edit_handler.cc b/db/version_edit_handler.cc index 5631cda48..7e6c4e9e7 100644 --- a/db/version_edit_handler.cc +++ b/db/version_edit_handler.cc @@ -13,6 +13,7 @@ #include "db/blob/blob_file_cache.h" #include "db/blob/blob_file_reader.h" +#include "logging/logging.h" #include "monitoring/persistent_stats_history.h" namespace ROCKSDB_NAMESPACE { diff --git a/db/version_set.cc b/db/version_set.cc index 7d0a5702d..e0b38ef6f 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -40,6 +40,7 @@ #include "file/random_access_file_reader.h" #include "file/read_write_util.h" #include "file/writable_file_writer.h" +#include "logging/logging.h" #include "monitoring/file_read_sample.h" #include "monitoring/perf_context_imp.h" #include "monitoring/persistent_stats_history.h" diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 90679483f..5fffaa6d1 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -14,6 +14,7 @@ #include "db_stress_tool/db_stress_driver.h" #include "db_stress_tool/db_stress_table_properties_collector.h" #include "rocksdb/convenience.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/secondary_cache.h" #include "rocksdb/sst_file_manager.h" #include "rocksdb/types.h" diff --git a/env/env_test.cc b/env/env_test.cc index 3657e595c..48c3b9e3d 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -41,6 +41,7 @@ #include "env/env_encryption_ctr.h" #include "env/unique_id.h" #include "logging/log_buffer.h" +#include "logging/logging.h" #include "port/malloc.h" #include "port/port.h" #include "rocksdb/convenience.h" diff --git a/file/sst_file_manager_impl.cc b/file/sst_file_manager_impl.cc index 161602fa7..f7ff03cc3 100644 --- a/file/sst_file_manager_impl.cc +++ b/file/sst_file_manager_impl.cc @@ -9,6 +9,7 @@ #include #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/sst_file_manager.h" diff --git a/options/cf_options.cc b/options/cf_options.cc index 8da3930ce..c7f6538a9 100644 --- a/options/cf_options.cc +++ b/options/cf_options.cc @@ -10,6 +10,7 @@ #include #include +#include "logging/logging.h" #include "options/configurable_helper.h" #include "options/db_options.h" #include "options/options_helper.h" diff --git a/options/options.cc b/options/options.cc index 4faee64b4..2b3053fe3 100644 --- a/options/options.cc +++ b/options/options.cc @@ -12,6 +12,7 @@ #include #include +#include "logging/logging.h" #include "monitoring/statistics.h" #include "options/db_options.h" #include "options/options_helper.h" @@ -19,6 +20,7 @@ #include "rocksdb/compaction_filter.h" #include "rocksdb/comparator.h" #include "rocksdb/env.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/memtablerep.h" #include "rocksdb/merge_operator.h" #include "rocksdb/slice.h" diff --git a/table/block_based/block.h b/table/block_based/block.h index bc712b170..000f64842 100644 --- a/table/block_based/block.h +++ b/table/block_based/block.h @@ -13,7 +13,6 @@ #include #include -#include "db/dbformat.h" #include "db/pinned_iterators_manager.h" #include "port/malloc.h" #include "rocksdb/iterator.h" diff --git a/table/block_based/block_based_table_builder.cc b/table/block_based/block_based_table_builder.cc index afedc91d6..55f4d826d 100644 --- a/table/block_based/block_based_table_builder.cc +++ b/table/block_based/block_based_table_builder.cc @@ -25,6 +25,7 @@ #include "cache/cache_reservation_manager.h" #include "db/dbformat.h" #include "index_builder.h" +#include "logging/logging.h" #include "memory/memory_allocator.h" #include "rocksdb/cache.h" #include "rocksdb/comparator.h" diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc index db9d6f8d1..3df8ea77c 100644 --- a/table/block_based/block_based_table_factory.cc +++ b/table/block_based/block_based_table_factory.cc @@ -15,10 +15,11 @@ #include #include -#include "options/configurable_helper.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/cache.h" #include "rocksdb/convenience.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/flush_block_policy.h" #include "rocksdb/utilities/options_type.h" #include "table/block_based/block_based_table_builder.h" diff --git a/table/block_based/block_based_table_factory.h b/table/block_based/block_based_table_factory.h index 534746b9d..cc93a3f4d 100644 --- a/table/block_based/block_based_table_factory.h +++ b/table/block_based/block_based_table_factory.h @@ -13,15 +13,19 @@ #include #include -#include "db/dbformat.h" +#include "port/port.h" #include "rocksdb/flush_block_policy.h" #include "rocksdb/table.h" namespace ROCKSDB_NAMESPACE { +struct ColumnFamilyOptions; struct ConfigOptions; +struct DBOptions; struct EnvOptions; class BlockBasedTableBuilder; +class RandomAccessFileReader; +class WritableFileWriter; // A class used to track actual bytes written from the tail in the recent SST // file opens, and provide a suggestion for following open. diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc index 8d4ad1928..ef6d8f058 100644 --- a/table/block_based/block_based_table_reader.cc +++ b/table/block_based/block_based_table_reader.cc @@ -22,6 +22,7 @@ #include "file/file_prefetch_buffer.h" #include "file/file_util.h" #include "file/random_access_file_reader.h" +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "port/lang.h" #include "rocksdb/cache.h" @@ -32,6 +33,7 @@ #include "rocksdb/filter_policy.h" #include "rocksdb/iterator.h" #include "rocksdb/options.h" +#include "rocksdb/snapshot.h" #include "rocksdb/statistics.h" #include "rocksdb/system_clock.h" #include "rocksdb/table.h" diff --git a/table/block_based/block_based_table_reader.h b/table/block_based/block_based_table_reader.h index 287b60fd2..0c81f7995 100644 --- a/table/block_based/block_based_table_reader.h +++ b/table/block_based/block_based_table_reader.h @@ -13,6 +13,7 @@ #include "db/range_tombstone_fragmenter.h" #include "file/filename.h" +#include "table/block_based/block.h" #include "table/block_based/block_based_table_factory.h" #include "table/block_based/block_type.h" #include "table/block_based/cachable_entry.h" diff --git a/table/block_based/block_based_table_reader_test.cc b/table/block_based/block_based_table_reader_test.cc index 775f2f505..305986eca 100644 --- a/table/block_based/block_based_table_reader_test.cc +++ b/table/block_based/block_based_table_reader_test.cc @@ -10,6 +10,7 @@ #include "options/options_helper.h" #include "port/port.h" #include "port/stack_trace.h" +#include "rocksdb/db.h" #include "rocksdb/file_system.h" #include "table/block_based/block_based_table_builder.h" #include "table/block_based/block_based_table_factory.h" diff --git a/table/block_based/filter_block.h b/table/block_based/filter_block.h index 6f509c4f7..1c0b7a5fa 100644 --- a/table/block_based/filter_block.h +++ b/table/block_based/filter_block.h @@ -20,10 +20,11 @@ #include #include + #include #include #include -#include "db/dbformat.h" + #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" diff --git a/table/block_based/filter_policy.cc b/table/block_based/filter_policy.cc index 1234667d8..eb133c7e4 100644 --- a/table/block_based/filter_policy.cc +++ b/table/block_based/filter_policy.cc @@ -13,6 +13,7 @@ #include #include +#include "logging/logging.h" #include "rocksdb/slice.h" #include "table/block_based/block_based_filter_block.h" #include "table/block_based/filter_policy_internal.h" diff --git a/table/block_based/full_filter_block.h b/table/block_based/full_filter_block.h index e5f6df659..bf8e24cc9 100644 --- a/table/block_based/full_filter_block.h +++ b/table/block_based/full_filter_block.h @@ -7,11 +7,12 @@ #include #include + #include #include #include -#include "db/dbformat.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" diff --git a/table/block_based/partitioned_filter_block.cc b/table/block_based/partitioned_filter_block.cc index 61cd12587..563b677a7 100644 --- a/table/block_based/partitioned_filter_block.cc +++ b/table/block_based/partitioned_filter_block.cc @@ -8,6 +8,7 @@ #include #include "file/random_access_file_reader.h" +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "port/malloc.h" #include "port/port.h" diff --git a/table/block_based/partitioned_filter_block.h b/table/block_based/partitioned_filter_block.h index 0d0ee89e7..75891155d 100644 --- a/table/block_based/partitioned_filter_block.h +++ b/table/block_based/partitioned_filter_block.h @@ -9,17 +9,17 @@ #include #include -#include "db/dbformat.h" -#include "index_builder.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" #include "table/block_based/block.h" #include "table/block_based/filter_block_reader_common.h" #include "table/block_based/full_filter_block.h" +#include "table/block_based/index_builder.h" #include "util/autovector.h" namespace ROCKSDB_NAMESPACE { +class InternalKeyComparator; class PartitionedFilterBlockBuilder : public FullFilterBlockBuilder { public: diff --git a/table/block_based/uncompression_dict_reader.cc b/table/block_based/uncompression_dict_reader.cc index dae5ddac2..e2ef575cc 100644 --- a/table/block_based/uncompression_dict_reader.cc +++ b/table/block_based/uncompression_dict_reader.cc @@ -5,6 +5,8 @@ // #include "table/block_based/uncompression_dict_reader.h" + +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "table/block_based/block_based_table_reader.h" #include "util/compression.h" diff --git a/table/block_fetcher_test.cc b/table/block_fetcher_test.cc index 4499272b4..2056bfc52 100644 --- a/table/block_fetcher_test.cc +++ b/table/block_fetcher_test.cc @@ -10,6 +10,7 @@ #include "options/options_helper.h" #include "port/port.h" #include "port/stack_trace.h" +#include "rocksdb/db.h" #include "rocksdb/file_system.h" #include "table/block_based/binary_search_index_reader.h" #include "table/block_based/block_based_table_builder.h" diff --git a/table/cuckoo/cuckoo_table_builder_test.cc b/table/cuckoo/cuckoo_table_builder_test.cc index a86b6fb18..f3194ec93 100644 --- a/table/cuckoo/cuckoo_table_builder_test.cc +++ b/table/cuckoo/cuckoo_table_builder_test.cc @@ -14,6 +14,7 @@ #include "file/random_access_file_reader.h" #include "file/writable_file_writer.h" +#include "rocksdb/db.h" #include "rocksdb/file_system.h" #include "table/meta_blocks.h" #include "test_util/testharness.h" diff --git a/table/cuckoo/cuckoo_table_reader.h b/table/cuckoo/cuckoo_table_reader.h index 43afd4fd7..fb30e92cc 100644 --- a/table/cuckoo/cuckoo_table_reader.h +++ b/table/cuckoo/cuckoo_table_reader.h @@ -14,7 +14,6 @@ #include #include -#include "db/dbformat.h" #include "file/random_access_file_reader.h" #include "rocksdb/env.h" #include "rocksdb/options.h" diff --git a/table/cuckoo/cuckoo_table_reader_test.cc b/table/cuckoo/cuckoo_table_reader_test.cc index 1914d26f1..5547e6d27 100644 --- a/table/cuckoo/cuckoo_table_reader_test.cc +++ b/table/cuckoo/cuckoo_table_reader_test.cc @@ -19,6 +19,7 @@ int main() { #include #include "memory/arena.h" +#include "rocksdb/db.h" #include "table/cuckoo/cuckoo_table_builder.h" #include "table/cuckoo/cuckoo_table_factory.h" #include "table/cuckoo/cuckoo_table_reader.h" diff --git a/table/get_context.cc b/table/get_context.cc index 919ed4c34..80906f795 100644 --- a/table/get_context.cc +++ b/table/get_context.cc @@ -5,6 +5,7 @@ #include "table/get_context.h" +#include "db/blob//blob_fetcher.h" #include "db/merge_helper.h" #include "db/pinned_iterators_manager.h" #include "db/read_callback.h" diff --git a/table/get_context.h b/table/get_context.h index 9b2f67807..8120cfcbb 100644 --- a/table/get_context.h +++ b/table/get_context.h @@ -6,18 +6,19 @@ #pragma once #include -#include "db/blob/blob_fetcher.h" -#include "db/dbformat.h" -#include "db/merge_context.h" #include "db/read_callback.h" -#include "rocksdb/statistics.h" #include "rocksdb/types.h" -#include "table/block_based/block.h" namespace ROCKSDB_NAMESPACE { +class BlobFetcher; +class Comparator; +class Logger; class MergeContext; +class MergeOperator; class PinnedIteratorsManager; +class Statistics; class SystemClock; +struct ParsedInternalKey; // Data structure for accumulating statistics during a point lookup. At the // end of the point lookup, the corresponding ticker stats are updated. This diff --git a/table/merging_iterator.h b/table/merging_iterator.h index c4429bf58..050892292 100644 --- a/table/merging_iterator.h +++ b/table/merging_iterator.h @@ -9,14 +9,14 @@ #pragma once -#include "db/dbformat.h" +#include "rocksdb/slice.h" #include "rocksdb/types.h" namespace ROCKSDB_NAMESPACE { -class Comparator; -class Env; class Arena; +class InternalKeyComparator; + template class InternalIteratorBase; using InternalIterator = InternalIteratorBase; diff --git a/table/meta_blocks.cc b/table/meta_blocks.cc index ae42b2948..ee92dcebb 100644 --- a/table/meta_blocks.cc +++ b/table/meta_blocks.cc @@ -10,6 +10,7 @@ #include "block_fetcher.h" #include "db/table_properties_collector.h" #include "file/random_access_file_reader.h" +#include "logging/logging.h" #include "rocksdb/table.h" #include "rocksdb/table_properties.h" #include "table/block_based/block.h" diff --git a/table/plain/plain_table_builder.cc b/table/plain/plain_table_builder.cc index c3b2e4687..93edbbc23 100644 --- a/table/plain/plain_table_builder.cc +++ b/table/plain/plain_table_builder.cc @@ -8,12 +8,13 @@ #include -#include #include #include +#include #include "db/dbformat.h" #include "file/writable_file_writer.h" +#include "logging/logging.h" #include "rocksdb/comparator.h" #include "rocksdb/env.h" #include "rocksdb/filter_policy.h" diff --git a/table/plain/plain_table_index.cc b/table/plain/plain_table_index.cc index e9d1d2626..35b5fc8cb 100644 --- a/table/plain/plain_table_index.cc +++ b/table/plain/plain_table_index.cc @@ -4,10 +4,11 @@ // (found in the LICENSE.Apache file in the root directory). #ifndef ROCKSDB_LITE +#include "table/plain/plain_table_index.h" #include -#include "table/plain/plain_table_index.h" +#include "logging/logging.h" #include "util/coding.h" #include "util/hash.h" diff --git a/table/plain/plain_table_index.h b/table/plain/plain_table_index.h index 798b601db..565a4e0f6 100644 --- a/table/plain/plain_table_index.h +++ b/table/plain/plain_table_index.h @@ -10,7 +10,6 @@ #include #include -#include "db/dbformat.h" #include "memory/arena.h" #include "monitoring/histogram.h" #include "options/cf_options.h" diff --git a/table/plain/plain_table_key_coding.h b/table/plain/plain_table_key_coding.h index 1543dec5b..9cda7df32 100644 --- a/table/plain/plain_table_key_coding.h +++ b/table/plain/plain_table_key_coding.h @@ -8,7 +8,7 @@ #ifndef ROCKSDB_LITE #include -#include "db/dbformat.h" + #include "rocksdb/slice.h" #include "table/plain/plain_table_reader.h" diff --git a/table/plain/plain_table_reader.h b/table/plain/plain_table_reader.h index 98bfa59df..8e1995590 100644 --- a/table/plain/plain_table_reader.h +++ b/table/plain/plain_table_reader.h @@ -12,7 +12,6 @@ #include #include -#include "db/dbformat.h" #include "file/random_access_file_reader.h" #include "memory/arena.h" #include "rocksdb/env.h" diff --git a/table/sst_file_writer_collectors.h b/table/sst_file_writer_collectors.h index 44cd84116..54cdb1ea7 100644 --- a/table/sst_file_writer_collectors.h +++ b/table/sst_file_writer_collectors.h @@ -5,9 +5,10 @@ #pragma once #include -#include "db/dbformat.h" + #include "db/table_properties_collector.h" #include "rocksdb/types.h" +#include "util/coding.h" #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { diff --git a/table/table_test.cc b/table/table_test.cc index ad0753186..a5017acd9 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -31,6 +31,7 @@ #include "rocksdb/env.h" #include "rocksdb/file_checksum.h" #include "rocksdb/file_system.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/iterator.h" #include "rocksdb/memtablerep.h" #include "rocksdb/perf_context.h" diff --git a/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc b/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc index ee65c6076..896a6ced1 100644 --- a/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +++ b/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc @@ -18,6 +18,7 @@ int main() { #include #include +#include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/trace_reader_writer.h" diff --git a/tools/io_tracer_parser_test.cc b/tools/io_tracer_parser_test.cc index d91217341..48c0664fa 100644 --- a/tools/io_tracer_parser_test.cc +++ b/tools/io_tracer_parser_test.cc @@ -16,6 +16,7 @@ int main() { #include #include +#include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/trace_reader_writer.h" diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index 891149fc6..6f8e4fdea 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -25,6 +25,7 @@ #include "file/filename.h" #include "rocksdb/cache.h" #include "rocksdb/file_checksum.h" +#include "rocksdb/filter_policy.h" #include "rocksdb/table_properties.h" #include "rocksdb/utilities/backupable_db.h" #include "rocksdb/utilities/checkpoint.h" diff --git a/trace_replay/block_cache_tracer_test.cc b/trace_replay/block_cache_tracer_test.cc index 308de8e36..425287de5 100644 --- a/trace_replay/block_cache_tracer_test.cc +++ b/trace_replay/block_cache_tracer_test.cc @@ -5,6 +5,7 @@ #include "trace_replay/block_cache_tracer.h" +#include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/trace_reader_writer.h" diff --git a/trace_replay/io_tracer_test.cc b/trace_replay/io_tracer_test.cc index 3471c9c43..49973b40b 100644 --- a/trace_replay/io_tracer_test.cc +++ b/trace_replay/io_tracer_test.cc @@ -5,6 +5,7 @@ #include "trace_replay/io_tracer.h" +#include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/trace_reader_writer.h" diff --git a/util/duplicate_detector.h b/util/duplicate_detector.h index ce1f351db..02f6d09fa 100644 --- a/util/duplicate_detector.h +++ b/util/duplicate_detector.h @@ -5,7 +5,10 @@ #pragma once +#include + #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "util/set_comparator.h" namespace ROCKSDB_NAMESPACE { diff --git a/utilities/blob_db/blob_compaction_filter.cc b/utilities/blob_db/blob_compaction_filter.cc index fb4c4466b..86907e979 100644 --- a/utilities/blob_db/blob_compaction_filter.cc +++ b/utilities/blob_db/blob_compaction_filter.cc @@ -10,6 +10,7 @@ #include #include "db/dbformat.h" +#include "logging/logging.h" #include "rocksdb/system_clock.h" #include "test_util/sync_point.h" diff --git a/utilities/blob_db/blob_db.cc b/utilities/blob_db/blob_db.cc index b756f02c0..cbd02e68e 100644 --- a/utilities/blob_db/blob_db.cc +++ b/utilities/blob_db/blob_db.cc @@ -8,6 +8,8 @@ #include "utilities/blob_db/blob_db.h" #include + +#include "logging/logging.h" #include "utilities/blob_db/blob_db_impl.h" namespace ROCKSDB_NAMESPACE { diff --git a/utilities/checkpoint/checkpoint_impl.cc b/utilities/checkpoint/checkpoint_impl.cc index 114c3d810..8f3cd710b 100644 --- a/utilities/checkpoint/checkpoint_impl.cc +++ b/utilities/checkpoint/checkpoint_impl.cc @@ -20,6 +20,7 @@ #include "db/wal_manager.h" #include "file/file_util.h" #include "file/filename.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" diff --git a/utilities/transactions/pessimistic_transaction.cc b/utilities/transactions/pessimistic_transaction.cc index 7d4276972..e4dc2ad7a 100644 --- a/utilities/transactions/pessimistic_transaction.cc +++ b/utilities/transactions/pessimistic_transaction.cc @@ -14,6 +14,7 @@ #include "db/column_family.h" #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "rocksdb/comparator.h" #include "rocksdb/db.h" #include "rocksdb/snapshot.h" diff --git a/utilities/transactions/pessimistic_transaction_db.cc b/utilities/transactions/pessimistic_transaction_db.cc index cb5ba0330..864bb5f5f 100644 --- a/utilities/transactions/pessimistic_transaction_db.cc +++ b/utilities/transactions/pessimistic_transaction_db.cc @@ -13,6 +13,7 @@ #include #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" diff --git a/utilities/transactions/transaction_base.cc b/utilities/transactions/transaction_base.cc index 1b713acc8..eae384b1b 100644 --- a/utilities/transactions/transaction_base.cc +++ b/utilities/transactions/transaction_base.cc @@ -11,6 +11,7 @@ #include "db/column_family.h" #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "rocksdb/comparator.h" #include "rocksdb/db.h" #include "rocksdb/status.h" diff --git a/utilities/transactions/write_prepared_txn_db.cc b/utilities/transactions/write_prepared_txn_db.cc index b853e9546..7715d8d99 100644 --- a/utilities/transactions/write_prepared_txn_db.cc +++ b/utilities/transactions/write_prepared_txn_db.cc @@ -15,6 +15,7 @@ #include "db/arena_wrapped_db_iter.h" #include "db/db_impl/db_impl.h" +#include "logging/logging.h" #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" diff --git a/utilities/transactions/write_prepared_txn_db.h b/utilities/transactions/write_prepared_txn_db.h index bd7042323..623118d78 100644 --- a/utilities/transactions/write_prepared_txn_db.h +++ b/utilities/transactions/write_prepared_txn_db.h @@ -18,6 +18,7 @@ #include "db/pre_release_callback.h" #include "db/read_callback.h" #include "db/snapshot_checker.h" +#include "logging/logging.h" #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" diff --git a/utilities/ttl/db_ttl_impl.cc b/utilities/ttl/db_ttl_impl.cc index c59cc93cc..df6d50b23 100644 --- a/utilities/ttl/db_ttl_impl.cc +++ b/utilities/ttl/db_ttl_impl.cc @@ -8,6 +8,7 @@ #include "db/write_batch_internal.h" #include "file/filename.h" +#include "logging/logging.h" #include "rocksdb/convenience.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h"