Skip to content

Commit

Permalink
Change internal headers with duplicate names (#11408)
Browse files Browse the repository at this point in the history
Summary:
In IDE navigation I find it annoying that there are two statistics.h files (etc.) and often land on the wrong one. Here I migrate several headers to use the blah.h <- blah_impl.h <- blah.cc idiom. Although clang-format wants "blah.h" to be the top include for "blah.cc", I think overall this is an improvement.

No public API changes.

Pull Request resolved: #11408

Test Plan: existing tests

Reviewed By: ltamasi

Differential Revision: D45456696

Pulled By: pdillinger

fbshipit-source-id: 809d931253f3272c908cf5facf7e1d32fc507373
  • Loading branch information
pdillinger authored and facebook-github-bot committed May 17, 2023
1 parent 5fc57ee commit 206fdea
Show file tree
Hide file tree
Showing 60 changed files with 62 additions and 64 deletions.
2 changes: 1 addition & 1 deletion cache/clock_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "cache/secondary_cache_adapter.h"
#include "logging/logging.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/lang.h"
#include "rocksdb/env.h"
#include "util/hash.h"
Expand Down
2 changes: 1 addition & 1 deletion cache/compressed_secondary_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <cstdint>
#include <memory>

#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "monitoring/perf_context_imp.h"
#include "util/compression.h"
#include "util/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion cache/compressed_secondary_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <memory>

#include "cache/lru_cache.h"
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "rocksdb/secondary_cache.h"
#include "rocksdb/slice.h"
#include "rocksdb/status.h"
Expand Down
2 changes: 1 addition & 1 deletion cache/lru_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "cache/secondary_cache_adapter.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/lang.h"
#include "util/distributed_mutex.h"

Expand Down
2 changes: 1 addition & 1 deletion db/blob/blob_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <memory>

#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "rocksdb/advanced_cache.h"
#include "rocksdb/rocksdb_namespace.h"
#include "rocksdb/slice.h"
Expand Down
2 changes: 1 addition & 1 deletion db/blob/blob_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "db/blob/blob_log_format.h"
#include "file/file_prefetch_buffer.h"
#include "file/filename.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "options/cf_options.h"
#include "rocksdb/file_system.h"
#include "rocksdb/slice.h"
Expand Down
2 changes: 1 addition & 1 deletion db/blob/blob_log_sequential_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "db/blob/blob_log_sequential_reader.h"

#include "file/random_access_file_reader.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "util/stop_watch.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
2 changes: 1 addition & 1 deletion db/blob/blob_log_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "db/blob/blob_log_format.h"
#include "file/writable_file_writer.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/system_clock.h"
#include "test_util/sync_point.h"
#include "util/coding.h"
Expand Down
2 changes: 1 addition & 1 deletion db/blob/blob_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "db/blob/blob_contents.h"
#include "db/blob/blob_file_reader.h"
#include "db/blob/blob_log_format.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "options/cf_options.h"
#include "table/get_context.h"
#include "table/multiget_context.h"
Expand Down
4 changes: 2 additions & 2 deletions db/compaction/compaction_job_stats_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "db/write_batch_internal.h"
#include "env/mock_env.h"
#include "file/filename.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "monitoring/thread_status_util.h"
#include "port/stack_trace.h"
#include "rocksdb/cache.h"
Expand Down Expand Up @@ -54,7 +54,7 @@
#include "util/compression.h"
#include "util/hash.h"
#include "util/mutexlock.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"
#include "util/string_util.h"
#include "utilities/merge_operators.h"

Expand Down
2 changes: 1 addition & 1 deletion db/compaction/compaction_picker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "file/filename.h"
#include "logging/log_buffer.h"
#include "logging/logging.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "test_util/sync_point.h"
#include "util/random.h"
#include "util/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion db/compaction/compaction_picker_universal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "file/filename.h"
#include "logging/log_buffer.h"
#include "logging/logging.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "test_util/sync_point.h"
#include "util/random.h"
#include "util/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion db/db_impl/db_impl_open.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "rocksdb/table.h"
#include "rocksdb/wal_filter.h"
#include "test_util/sync_point.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {
Options SanitizeOptions(const std::string& dbname, const Options& src,
Expand Down
2 changes: 1 addition & 1 deletion db/db_iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "port/stack_trace.h"
#include "rocksdb/iostats_context.h"
#include "rocksdb/perf_context.h"
#include "table/block_based/flush_block_policy.h"
#include "table/block_based/flush_block_policy_impl.h"
#include "util/random.h"
#include "utilities/merge_operators/string_append/stringappend2.h"

Expand Down
2 changes: 1 addition & 1 deletion db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "util/compression.h"
#include "util/mutexlock.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"
#include "util/string_util.h"
#include "utilities/merge_operators.h"

Expand Down
4 changes: 2 additions & 2 deletions db/listener_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "db/version_set.h"
#include "db/write_batch_internal.h"
#include "file/filename.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/cache.h"
#include "rocksdb/compaction_filter.h"
#include "rocksdb/db.h"
Expand All @@ -29,7 +29,7 @@
#include "test_util/testutil.h"
#include "util/hash.h"
#include "util/mutexlock.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"
#include "util/string_util.h"
#include "utilities/merge_operators.h"

Expand Down
2 changes: 1 addition & 1 deletion db/memtable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "memory/arena.h"
#include "memory/memory_usage.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/lang.h"
#include "port/port.h"
#include "rocksdb/comparator.h"
Expand Down
2 changes: 1 addition & 1 deletion db/merge_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "db/wide/wide_column_serialization.h"
#include "logging/logging.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/likely.h"
#include "rocksdb/comparator.h"
#include "rocksdb/db.h"
Expand Down
2 changes: 1 addition & 1 deletion db/write_batch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include "db/wide/wide_column_serialization.h"
#include "db/write_batch_internal.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/lang.h"
#include "rocksdb/merge_operator.h"
#include "rocksdb/system_clock.h"
Expand Down
2 changes: 1 addition & 1 deletion env/mock_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "util/cast_util.h"
#include "util/hash.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"
#include "util/string_util.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
2 changes: 1 addition & 1 deletion file/file_prefetch_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "port/port.h"
#include "test_util/sync_point.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {

Expand Down
2 changes: 1 addition & 1 deletion file/file_prefetch_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <string>

#include "file/readahead_file_info.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/port.h"
#include "rocksdb/env.h"
#include "rocksdb/file_system.h"
Expand Down
2 changes: 1 addition & 1 deletion file/random_access_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "table/format.h"
#include "test_util/sync_point.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {
const std::array<Histograms, std::size_t(Env::IOActivity::kUnknown)>
Expand Down
2 changes: 1 addition & 1 deletion file/readahead_raf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "file/read_write_util.h"
#include "rocksdb/file_system.h"
#include "util/aligned_buffer.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion file/sequence_file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "test_util/sync_point.h"
#include "util/aligned_buffer.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {
IOStatus SequentialFileReader::Create(
Expand Down
2 changes: 1 addition & 1 deletion file/writable_file_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "test_util/sync_point.h"
#include "util/crc32c.h"
#include "util/random.h"
#include "util/rate_limiter.h"
#include "util/rate_limiter_impl.h"

namespace ROCKSDB_NAMESPACE {
IOStatus WritableFileWriter::Create(const std::shared_ptr<FileSystem>& fs,
Expand Down
2 changes: 1 addition & 1 deletion java/rocksjni/statisticsjni.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <set>
#include <string>

#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/statistics.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion monitoring/instrumented_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "port/port.h"
#include "rocksdb/statistics.h"
#include "rocksdb/system_clock.h"
Expand Down
2 changes: 1 addition & 1 deletion monitoring/perf_step_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
#pragma once
#include "monitoring/perf_level_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/system_clock.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
4 changes: 2 additions & 2 deletions monitoring/statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
#include "monitoring/statistics.h"
#include "rocksdb/statistics.h"

#include <algorithm>
#include <cinttypes>
#include <cstdio>

#include "monitoring/statistics_impl.h"
#include "rocksdb/convenience.h"
#include "rocksdb/statistics.h"
#include "rocksdb/utilities/customizable_util.h"
#include "rocksdb/utilities/options_type.h"
#include "util/string_util.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion options/customizable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "rocksdb/utilities/object_registry.h"
#include "rocksdb/utilities/options_type.h"
#include "table/block_based/filter_policy_internal.h"
#include "table/block_based/flush_block_policy.h"
#include "table/block_based/flush_block_policy_impl.h"
#include "table/mock_table.h"
#include "test_util/mock_time_env.h"
#include "test_util/testharness.h"
Expand Down
2 changes: 1 addition & 1 deletion options/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <limits>

#include "logging/logging.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "options/db_options.h"
#include "options/options_helper.h"
#include "rocksdb/cache.h"
Expand Down
2 changes: 1 addition & 1 deletion table/block_based/block_based_table_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "db/dbformat.h"
#include "index_builder.h"
#include "logging/logging.h"
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "rocksdb/cache.h"
#include "rocksdb/comparator.h"
#include "rocksdb/env.h"
Expand Down
2 changes: 1 addition & 1 deletion table/block_based/flush_block_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "rocksdb/utilities/customizable_util.h"
#include "table/block_based/block_based_table_reader.h"
#include "table/block_based/block_builder.h"
#include "table/block_based/flush_block_policy.h"
#include "table/block_based/flush_block_policy_impl.h"
#include "table/format.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion table/block_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <string>

#include "logging/logging.h"
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "monitoring/perf_context_imp.h"
#include "rocksdb/compression_type.h"
#include "rocksdb/env.h"
Expand Down
2 changes: 1 addition & 1 deletion table/block_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors.

#pragma once
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "table/block_based/block.h"
#include "table/block_based/block_type.h"
#include "table/format.h"
Expand Down
4 changes: 2 additions & 2 deletions table/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#include "block_fetcher.h"
#include "file/random_access_file_reader.h"
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "options/options_helper.h"
#include "rocksdb/env.h"
#include "rocksdb/options.h"
Expand Down
2 changes: 1 addition & 1 deletion table/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "file/file_prefetch_buffer.h"
#include "file/random_access_file_reader.h"
#include "memory/memory_allocator.h"
#include "memory/memory_allocator_impl.h"
#include "options/cf_options.h"
#include "port/malloc.h"
#include "port/port.h" // noexcept
Expand Down
2 changes: 1 addition & 1 deletion table/get_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "db/wide/wide_column_serialization.h"
#include "monitoring/file_read_sample.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/merge_operator.h"
#include "rocksdb/statistics.h"
#include "rocksdb/system_clock.h"
Expand Down
2 changes: 1 addition & 1 deletion table/persistent_cache_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <string>

#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "table/format.h"
#include "table/persistent_cache_options.h"

Expand Down
2 changes: 1 addition & 1 deletion table/persistent_cache_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>

#include "cache/cache_key.h"
#include "monitoring/statistics.h"
#include "monitoring/statistics_impl.h"
#include "rocksdb/persistent_cache.h"

namespace ROCKSDB_NAMESPACE {
Expand Down
Loading

0 comments on commit 206fdea

Please sign in to comment.