From 6ef8c620d300675bb40cb66c2f1ab66289f20cf5 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Mon, 3 Apr 2017 18:27:24 -0700 Subject: [PATCH] Move auto_roll_logger and filename out of db/ Summary: It is confusing to have auto_roll_logger to stay under db/, which has nothing to do with database. Move filename together as it is a dependency. Closes https://github.com/facebook/rocksdb/pull/2080 Differential Revision: D4821141 Pulled By: siying fbshipit-source-id: ca7d768 --- CMakeLists.txt | 6 +++--- Makefile | 2 +- db/builder.cc | 2 +- db/compaction_job.cc | 4 ++-- db/compaction_job_stats_test.cc | 2 +- db/compaction_picker.cc | 2 +- db/corruption_test.cc | 10 +++++----- db/db_filesnapshot.cc | 2 +- db/db_impl.cc | 4 ++-- db/db_info_dumper.cc | 2 +- db/db_iter.cc | 2 +- db/db_test.cc | 2 +- db/db_test_util.h | 2 +- db/deletefile_test.cc | 2 +- db/fault_injection_test.cc | 2 +- db/filename_test.cc | 2 +- db/flush_job.cc | 2 +- db/listener_test.cc | 2 +- db/memtable_list.h | 2 +- db/plain_table_db_test.cc | 6 +++--- db/repair.cc | 2 +- db/table_cache.cc | 2 +- db/transaction_log_impl.h | 2 +- db/version_set.cc | 6 +++--- db/wal_manager.cc | 6 +++--- src.mk | 6 +++--- tools/ldb_cmd.cc | 2 +- tools/rdb/db_wrapper.cc | 4 ++-- tools/rdb/rdb.cc | 4 ++-- tools/write_stress.cc | 3 +-- {db => util}/auto_roll_logger.cc | 2 +- {db => util}/auto_roll_logger.h | 4 ++-- {db => util}/auto_roll_logger_test.cc | 3 +-- util/fault_injection_test_env.h | 2 +- {db => util}/filename.cc | 3 +-- {db => util}/filename.h | 0 utilities/backupable/backupable_db.cc | 8 ++++---- utilities/backupable/backupable_db_test.cc | 2 +- utilities/blob_db/blob_db.cc | 2 +- utilities/checkpoint/checkpoint.cc | 4 ++-- utilities/convenience/info_log_finder.cc | 4 ++-- utilities/date_tiered/date_tiered_db_impl.cc | 2 +- utilities/geodb/geodb_impl.cc | 7 +++---- utilities/options/options_util.cc | 2 +- utilities/ttl/db_ttl_impl.cc | 2 +- 45 files changed, 70 insertions(+), 74 deletions(-) rename {db => util}/auto_roll_logger.cc (99%) rename {db => util}/auto_roll_logger.h (99%) rename {db => util}/auto_roll_logger_test.cc (99%) rename {db => util}/filename.cc (99%) rename {db => util}/filename.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5ff07584..678a32782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,7 +281,6 @@ add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest) # Main library source code set(SOURCES - db/auto_roll_logger.cc db/builder.cc db/c.cc db/column_family.cc @@ -302,7 +301,6 @@ set(SOURCES db/event_helpers.cc db/external_sst_file_ingestion_job.cc db/experimental.cc - db/filename.cc db/file_indexer.cc db/flush_job.cc db/flush_scheduler.cc @@ -387,6 +385,7 @@ set(SOURCES util/event_logger.cc util/file_util.cc util/file_reader_writer.cc + util/filename.cc util/sst_file_manager_impl.cc util/filter_policy.cc util/hash.cc @@ -398,6 +397,7 @@ set(SOURCES util/lru_cache.cc tools/ldb_cmd.cc tools/ldb_tool.cc + util/auto_roll_logger.cc util/logging.cc util/log_buffer.cc util/memenv.cc @@ -544,7 +544,6 @@ else() endif() set(TESTS - db/auto_roll_logger_test.cc db/column_family_test.cc db/compact_files_test.cc db/compaction_iterator_test.cc @@ -618,6 +617,7 @@ set(TESTS tools/reduce_levels_test.cc tools/sst_dump_test.cc util/arena_test.cc + util/auto_roll_logger_test.cc util/autovector_test.cc util/bloom_test.cc util/cache_test.cc diff --git a/Makefile b/Makefile index 35a506f85..dc8aaf09d 100644 --- a/Makefile +++ b/Makefile @@ -1285,7 +1285,7 @@ manual_compaction_test: db/manual_compaction_test.o $(LIBOBJECTS) $(TESTHARNESS) filelock_test: util/filelock_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -auto_roll_logger_test: db/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) +auto_roll_logger_test: util/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) memtable_list_test: db/memtable_list_test.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/db/builder.cc b/db/builder.cc index 5c7557720..e0020622e 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -16,7 +16,6 @@ #include "db/compaction_iterator.h" #include "db/dbformat.h" #include "db/event_helpers.h" -#include "db/filename.h" #include "db/internal_stats.h" #include "db/merge_helper.h" #include "db/table_cache.h" @@ -29,6 +28,7 @@ #include "table/block_based_table_builder.h" #include "table/internal_iterator.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/iostats_context_imp.h" #include "util/stop_watch.h" #include "util/thread_status_util.h" diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 253081261..dcfc7aa09 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -28,7 +28,6 @@ #include "db/db_iter.h" #include "db/dbformat.h" #include "db/event_helpers.h" -#include "db/filename.h" #include "db/log_reader.h" #include "db/log_writer.h" #include "db/memtable.h" @@ -49,12 +48,13 @@ #include "table/table_builder.h" #include "util/coding.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/iostats_context_imp.h" #include "util/log_buffer.h" #include "util/logging.h" -#include "util/sst_file_manager_impl.h" #include "util/mutexlock.h" #include "util/perf_context_imp.h" +#include "util/sst_file_manager_impl.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/sync_point.h" diff --git a/db/compaction_job_stats_test.cc b/db/compaction_job_stats_test.cc index 57cde512c..00f6d37be 100644 --- a/db/compaction_job_stats_test.cc +++ b/db/compaction_job_stats_test.cc @@ -23,7 +23,6 @@ #include "db/db_impl.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/job_context.h" #include "db/version_set.h" #include "db/write_batch_internal.h" @@ -50,6 +49,7 @@ #include "table/plain_table_factory.h" #include "table/scoped_arena_iterator.h" #include "util/compression.h" +#include "util/filename.h" #include "util/hash.h" #include "util/logging.h" #include "util/mock_env.h" diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index a6fdd53cf..5d351b0c0 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -19,7 +19,7 @@ #include #include #include "db/column_family.h" -#include "db/filename.h" +#include "util/filename.h" #include "util/log_buffer.h" #include "util/random.h" #include "util/statistics.h" diff --git a/db/corruption_test.cc b/db/corruption_test.cc index 0a1052140..1a2e906be 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -11,19 +11,19 @@ #include "rocksdb/db.h" -#include #include #include +#include #include #include +#include "db/db_impl.h" +#include "db/log_format.h" +#include "db/version_set.h" #include "rocksdb/cache.h" #include "rocksdb/env.h" #include "rocksdb/table.h" #include "rocksdb/write_batch.h" -#include "db/db_impl.h" -#include "db/filename.h" -#include "db/log_format.h" -#include "db/version_set.h" +#include "util/filename.h" #include "util/logging.h" #include "util/testharness.h" #include "util/testutil.h" diff --git a/db/db_filesnapshot.cc b/db/db_filesnapshot.cc index 768be4d35..d11573404 100644 --- a/db/db_filesnapshot.cc +++ b/db/db_filesnapshot.cc @@ -18,13 +18,13 @@ #include #include #include "db/db_impl.h" -#include "db/filename.h" #include "db/job_context.h" #include "db/version_set.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "util/file_util.h" +#include "util/filename.h" #include "util/mutexlock.h" #include "util/sync_point.h" diff --git a/db/db_impl.cc b/db/db_impl.cc index 3aaceb952..a86e7d481 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -32,7 +32,6 @@ #include #include -#include "db/auto_roll_logger.h" #include "db/builder.h" #include "db/compaction_job.h" #include "db/db_info_dumper.h" @@ -40,7 +39,6 @@ #include "db/dbformat.h" #include "db/event_helpers.h" #include "db/external_sst_file_ingestion_job.h" -#include "db/filename.h" #include "db/flush_job.h" #include "db/forward_iterator.h" #include "db/job_context.h" @@ -78,6 +76,7 @@ #include "table/merging_iterator.h" #include "table/table_builder.h" #include "table/two_level_iterator.h" +#include "util/auto_roll_logger.h" #include "util/autovector.h" #include "util/build_version.h" #include "util/cf_options.h" @@ -86,6 +85,7 @@ #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/file_util.h" +#include "util/filename.h" #include "util/iostats_context_imp.h" #include "util/log_buffer.h" #include "util/logging.h" diff --git a/db/db_info_dumper.cc b/db/db_info_dumper.cc index 3b1a9b9a0..4620bc781 100644 --- a/db/db_info_dumper.cc +++ b/db/db_info_dumper.cc @@ -15,8 +15,8 @@ #include #include -#include "db/filename.h" #include "rocksdb/env.h" +#include "util/filename.h" namespace rocksdb { diff --git a/db/db_iter.cc b/db/db_iter.cc index d2a0fbbd0..e8ec9edfa 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -14,7 +14,6 @@ #include #include "db/dbformat.h" -#include "db/filename.h" #include "db/merge_context.h" #include "db/merge_helper.h" #include "db/pinned_iterators_manager.h" @@ -25,6 +24,7 @@ #include "rocksdb/options.h" #include "table/internal_iterator.h" #include "util/arena.h" +#include "util/filename.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/perf_context_imp.h" diff --git a/db/db_test.cc b/db/db_test.cc index 31f422a1c..3383aaaab 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -26,7 +26,6 @@ #include "db/db_impl.h" #include "db/db_test_util.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/job_context.h" #include "db/version_set.h" #include "db/write_batch_internal.h" @@ -57,6 +56,7 @@ #include "table/scoped_arena_iterator.h" #include "util/compression.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/hash.h" #include "util/logging.h" #include "util/mock_env.h" diff --git a/db/db_test_util.h b/db/db_test_util.h index 7aaa67056..ca4c8a7aa 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -26,7 +26,6 @@ #include "db/db_impl.h" #include "db/dbformat.h" -#include "db/filename.h" #include "memtable/hash_linklist_rep.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" @@ -45,6 +44,7 @@ #include "table/plain_table_factory.h" #include "table/scoped_arena_iterator.h" #include "util/compression.h" +#include "util/filename.h" #include "util/mock_env.h" #include "util/mutexlock.h" diff --git a/db/deletefile_test.cc b/db/deletefile_test.cc index c8257ccd8..6b694f443 100644 --- a/db/deletefile_test.cc +++ b/db/deletefile_test.cc @@ -14,12 +14,12 @@ #include #include #include "db/db_impl.h" -#include "db/filename.h" #include "db/version_set.h" #include "db/write_batch_internal.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/transaction_log.h" +#include "util/filename.h" #include "util/string_util.h" #include "util/sync_point.h" #include "util/testharness.h" diff --git a/db/fault_injection_test.cc b/db/fault_injection_test.cc index efd2de1b3..044528a32 100644 --- a/db/fault_injection_test.cc +++ b/db/fault_injection_test.cc @@ -12,7 +12,6 @@ // file data (or entire files) not protected by a "sync". #include "db/db_impl.h" -#include "db/filename.h" #include "db/log_format.h" #include "db/version_set.h" #include "rocksdb/cache.h" @@ -21,6 +20,7 @@ #include "rocksdb/table.h" #include "rocksdb/write_batch.h" #include "util/fault_injection_test_env.h" +#include "util/filename.h" #include "util/logging.h" #include "util/mock_env.h" #include "util/mutexlock.h" diff --git a/db/filename_test.cc b/db/filename_test.cc index 0f8e37e7f..bef696bb1 100644 --- a/db/filename_test.cc +++ b/db/filename_test.cc @@ -7,7 +7,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. -#include "db/filename.h" +#include "util/filename.h" #include "db/dbformat.h" #include "port/port.h" diff --git a/db/flush_job.cc b/db/flush_job.cc index bda70388a..76a7da778 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -22,7 +22,6 @@ #include "db/db_iter.h" #include "db/dbformat.h" #include "db/event_helpers.h" -#include "db/filename.h" #include "db/log_reader.h" #include "db/log_writer.h" #include "db/memtable.h" @@ -44,6 +43,7 @@ #include "util/coding.h" #include "util/event_logger.h" #include "util/file_util.h" +#include "util/filename.h" #include "util/iostats_context_imp.h" #include "util/log_buffer.h" #include "util/logging.h" diff --git a/db/listener_test.cc b/db/listener_test.cc index ebfd4beb7..881fc4fe5 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -6,7 +6,6 @@ #include "db/db_impl.h" #include "db/db_test_util.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/version_set.h" #include "db/write_batch_internal.h" #include "memtable/hash_linklist_rep.h" @@ -23,6 +22,7 @@ #include "rocksdb/table_properties.h" #include "table/block_based_table_factory.h" #include "table/plain_table_factory.h" +#include "util/filename.h" #include "util/hash.h" #include "util/logging.h" #include "util/mutexlock.h" diff --git a/db/memtable_list.h b/db/memtable_list.h index 7c969825a..332007d3b 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -12,7 +12,6 @@ #include #include "db/dbformat.h" -#include "db/filename.h" #include "db/memtable.h" #include "db/range_del_aggregator.h" #include "db/skiplist.h" @@ -21,6 +20,7 @@ #include "rocksdb/options.h" #include "rocksdb/types.h" #include "util/autovector.h" +#include "util/filename.h" #include "util/instrumented_mutex.h" #include "util/log_buffer.h" diff --git a/db/plain_table_db_test.cc b/db/plain_table_db_test.cc index 145ebdf08..0b66d225f 100644 --- a/db/plain_table_db_test.cc +++ b/db/plain_table_db_test.cc @@ -15,7 +15,6 @@ #include #include "db/db_impl.h" -#include "db/filename.h" #include "db/version_set.h" #include "db/write_batch_internal.h" #include "rocksdb/cache.h" @@ -25,12 +24,13 @@ #include "rocksdb/filter_policy.h" #include "rocksdb/slice_transform.h" #include "rocksdb/table.h" -#include "table/meta_blocks.h" #include "table/bloom_block.h" -#include "table/table_builder.h" +#include "table/meta_blocks.h" #include "table/plain_table_factory.h" #include "table/plain_table_key_coding.h" #include "table/plain_table_reader.h" +#include "table/table_builder.h" +#include "util/filename.h" #include "util/hash.h" #include "util/logging.h" #include "util/mutexlock.h" diff --git a/db/repair.cc b/db/repair.cc index 22d044076..4cfae4a05 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -68,7 +68,6 @@ #include "db/builder.h" #include "db/db_impl.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/log_reader.h" #include "db/log_writer.h" #include "db/memtable.h" @@ -83,6 +82,7 @@ #include "table/scoped_arena_iterator.h" #include "util/cf_options.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/table_cache.cc b/db/table_cache.cc index dc987b30b..7156da386 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -10,8 +10,8 @@ #include "db/table_cache.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/version_edit.h" +#include "util/filename.h" #include "rocksdb/statistics.h" #include "table/internal_iterator.h" diff --git a/db/transaction_log_impl.h b/db/transaction_log_impl.h index 6fea8decb..a901758cd 100644 --- a/db/transaction_log_impl.h +++ b/db/transaction_log_impl.h @@ -7,7 +7,6 @@ #ifndef ROCKSDB_LITE #include -#include "db/filename.h" #include "db/log_reader.h" #include "db/version_set.h" #include "port/port.h" @@ -16,6 +15,7 @@ #include "rocksdb/transaction_log.h" #include "rocksdb/types.h" #include "util/db_options.h" +#include "util/filename.h" namespace rocksdb { diff --git a/db/version_set.cc b/db/version_set.cc index 546fce8ad..5efd86a0c 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -16,14 +16,13 @@ #include #include #include +#include #include #include -#include +#include #include #include -#include #include "db/compaction.h" -#include "db/filename.h" #include "db/internal_stats.h" #include "db/log_reader.h" #include "db/log_writer.h" @@ -46,6 +45,7 @@ #include "table/two_level_iterator.h" #include "util/coding.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/logging.h" #include "util/perf_context_imp.h" #include "util/stop_watch.h" diff --git a/db/wal_manager.cc b/db/wal_manager.cc index 449d3f5ef..d0514d908 100644 --- a/db/wal_manager.cc +++ b/db/wal_manager.cc @@ -18,10 +18,9 @@ #include #include -#include "db/filename.h" -#include "db/transaction_log_impl.h" #include "db/log_reader.h" #include "db/log_writer.h" +#include "db/transaction_log_impl.h" #include "db/write_batch_internal.h" #include "port/port.h" #include "rocksdb/env.h" @@ -29,10 +28,11 @@ #include "rocksdb/write_batch.h" #include "util/coding.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/logging.h" #include "util/mutexlock.h" -#include "util/sync_point.h" #include "util/string_util.h" +#include "util/sync_point.h" namespace rocksdb { diff --git a/src.mk b/src.mk index 99699c6b6..3ca56f98c 100644 --- a/src.mk +++ b/src.mk @@ -1,6 +1,5 @@ # These are the sources from which librocksdb.a is built: LIB_SOURCES = \ - db/auto_roll_logger.cc \ db/builder.cc \ db/c.cc \ db/column_family.cc \ @@ -23,7 +22,6 @@ LIB_SOURCES = \ db/experimental.cc \ db/event_helpers.cc \ db/file_indexer.cc \ - db/filename.cc \ db/flush_job.cc \ db/flush_scheduler.cc \ db/forward_iterator.cc \ @@ -88,6 +86,7 @@ LIB_SOURCES = \ table/two_level_iterator.cc \ tools/dump/db_dump_tool.cc \ util/arena.cc \ + util/auto_roll_logger.cc \ util/bloom.cc \ util/build_version.cc \ util/cf_options.cc \ @@ -107,6 +106,7 @@ LIB_SOURCES = \ util/event_logger.cc \ util/file_util.cc \ util/file_reader_writer.cc \ + util/filename.cc \ util/filter_policy.cc \ util/hash.cc \ util/histogram.cc \ @@ -211,7 +211,6 @@ TEST_LIB_SOURCES = \ MAIN_SOURCES = \ third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc \ - db/auto_roll_logger_test.cc \ db/column_family_test.cc \ db/compaction_job_test.cc \ db/compaction_job_stats_test.cc \ @@ -283,6 +282,7 @@ MAIN_SOURCES = \ tools/reduce_levels_test.cc \ tools/sst_dump_test.cc \ util/arena_test.cc \ + util/auto_roll_logger_test.cc \ util/autovector_test.cc \ util/bloom_test.cc \ util/cache_bench.cc \ diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index 9b8195dea..5b759d38c 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -14,7 +14,6 @@ #include "db/db_impl.h" #include "db/dbformat.h" -#include "db/filename.h" #include "db/log_reader.h" #include "db/write_batch_internal.h" #include "port/dirent.h" @@ -29,6 +28,7 @@ #include "tools/ldb_cmd_impl.h" #include "tools/sst_dump_tool_imp.h" #include "util/coding.h" +#include "util/filename.h" #include "util/stderr_logger.h" #include "util/string_util.h" #include "utilities/ttl/db_ttl_impl.h" diff --git a/tools/rdb/db_wrapper.cc b/tools/rdb/db_wrapper.cc index 34725379d..1ec9da1dc 100644 --- a/tools/rdb/db_wrapper.cc +++ b/tools/rdb/db_wrapper.cc @@ -4,10 +4,10 @@ #include #include -#include "db_wrapper.h" +#include "db/_wrapper.h" #include "rocksdb/db.h" -#include "rocksdb/slice.h" #include "rocksdb/options.h" +#include "rocksdb/slice.h" namespace { void printWithBackSlashes(std::string str) { diff --git a/tools/rdb/rdb.cc b/tools/rdb/rdb.cc index 8710e4623..3619dc74e 100644 --- a/tools/rdb/rdb.cc +++ b/tools/rdb/rdb.cc @@ -2,9 +2,9 @@ #define BUILDING_NODE_EXTENSION #endif -#include #include -#include "db_wrapper.h" +#include +#include "db/_wrapper.h" using namespace v8; diff --git a/tools/write_stress.cc b/tools/write_stress.cc index 16aaf108a..ddf6243b8 100644 --- a/tools/write_stress.cc +++ b/tools/write_stress.cc @@ -66,13 +66,12 @@ int main() { #include #include -#include "db/filename.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" - +#include "util/filename.h" using GFLAGS::ParseCommandLineFlags; using GFLAGS::RegisterFlagValidator; diff --git a/db/auto_roll_logger.cc b/util/auto_roll_logger.cc similarity index 99% rename from db/auto_roll_logger.cc rename to util/auto_roll_logger.cc index 8c3d0faa1..ca28e7253 100644 --- a/db/auto_roll_logger.cc +++ b/util/auto_roll_logger.cc @@ -3,7 +3,7 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // -#include "db/auto_roll_logger.h" +#include "util/auto_roll_logger.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/db/auto_roll_logger.h b/util/auto_roll_logger.h similarity index 99% rename from db/auto_roll_logger.h rename to util/auto_roll_logger.h index 1bcf20adf..8729537b3 100644 --- a/db/auto_roll_logger.h +++ b/util/auto_roll_logger.h @@ -10,11 +10,11 @@ #include #include -#include "db/filename.h" #include "port/port.h" #include "port/util_logger.h" -#include "util/sync_point.h" +#include "util/filename.h" #include "util/mutexlock.h" +#include "util/sync_point.h" namespace rocksdb { diff --git a/db/auto_roll_logger_test.cc b/util/auto_roll_logger_test.cc similarity index 99% rename from db/auto_roll_logger_test.cc rename to util/auto_roll_logger_test.cc index 851c196e0..e1c8877bf 100644 --- a/db/auto_roll_logger_test.cc +++ b/util/auto_roll_logger_test.cc @@ -6,7 +6,7 @@ #ifndef ROCKSDB_LITE -#include "db/auto_roll_logger.h" +#include "util/auto_roll_logger.h" #include #include #include @@ -17,7 +17,6 @@ #include #include #include -#include "db/db_test_util.h" #include "port/port.h" #include "rocksdb/db.h" #include "util/logging.h" diff --git a/util/fault_injection_test_env.h b/util/fault_injection_test_env.h index db01709ea..889f93ea1 100644 --- a/util/fault_injection_test_env.h +++ b/util/fault_injection_test_env.h @@ -18,10 +18,10 @@ #include #include -#include "db/filename.h" #include "db/version_set.h" #include "rocksdb/db.h" #include "rocksdb/env.h" +#include "util/filename.h" #include "util/mock_env.h" #include "util/mutexlock.h" diff --git a/db/filename.cc b/util/filename.cc similarity index 99% rename from db/filename.cc rename to util/filename.cc index 6e48058e3..101767e20 100644 --- a/db/filename.cc +++ b/util/filename.cc @@ -10,13 +10,12 @@ #define __STDC_FORMAT_MACROS #endif -#include "db/filename.h" +#include "util/filename.h" #include #include #include #include -#include "db/dbformat.h" #include "rocksdb/env.h" #include "util/file_reader_writer.h" #include "util/logging.h" diff --git a/db/filename.h b/util/filename.h similarity index 100% rename from db/filename.h rename to util/filename.h diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index 6a5c7458b..84f03688c 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -10,16 +10,16 @@ #ifndef ROCKSDB_LITE #include "rocksdb/utilities/backupable_db.h" -#include "db/filename.h" +#include "port/port.h" +#include "rocksdb/rate_limiter.h" +#include "rocksdb/transaction_log.h" #include "util/channel.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/logging.h" #include "util/string_util.h" -#include "rocksdb/rate_limiter.h" -#include "rocksdb/transaction_log.h" -#include "port/port.h" #include "util/sync_point.h" #ifndef __STDC_FORMAT_MACROS diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index 22c93cbb0..14404db23 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -13,7 +13,6 @@ #include #include "db/db_impl.h" -#include "db/filename.h" #include "port/port.h" #include "port/stack_trace.h" #include "rocksdb/rate_limiter.h" @@ -23,6 +22,7 @@ #include "rocksdb/utilities/options_util.h" #include "util/env_chroot.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/mutexlock.h" #include "util/random.h" #include "util/stderr_logger.h" diff --git a/utilities/blob_db/blob_db.cc b/utilities/blob_db/blob_db.cc index d1e116ae1..1ea94814d 100644 --- a/utilities/blob_db/blob_db.cc +++ b/utilities/blob_db/blob_db.cc @@ -4,7 +4,6 @@ #include "utilities/blob_db/blob_db.h" #ifndef ROCKSDB_LITE -#include "db/filename.h" #include "db/write_batch_internal.h" #include "rocksdb/convenience.h" #include "rocksdb/env.h" @@ -16,6 +15,7 @@ #include "util/cf_options.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" +#include "util/filename.h" #include "util/instrumented_mutex.h" namespace rocksdb { diff --git a/utilities/checkpoint/checkpoint.cc b/utilities/checkpoint/checkpoint.cc index 840762435..fc9e16f5c 100644 --- a/utilities/checkpoint/checkpoint.cc +++ b/utilities/checkpoint/checkpoint.cc @@ -18,14 +18,14 @@ #include #include #include -#include "db/filename.h" #include "db/wal_manager.h" +#include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/transaction_log.h" #include "util/file_util.h" +#include "util/filename.h" #include "util/sync_point.h" -#include "port/port.h" namespace rocksdb { diff --git a/utilities/convenience/info_log_finder.cc b/utilities/convenience/info_log_finder.cc index ecbdd7714..e46e91ded 100644 --- a/utilities/convenience/info_log_finder.cc +++ b/utilities/convenience/info_log_finder.cc @@ -7,9 +7,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "db/filename.h" -#include "rocksdb/env.h" #include "rocksdb/utilities/info_log_finder.h" +#include "rocksdb/env.h" +#include "util/filename.h" namespace rocksdb { diff --git a/utilities/date_tiered/date_tiered_db_impl.cc b/utilities/date_tiered/date_tiered_db_impl.cc index 4b4ac6c6b..d0e2d5234 100644 --- a/utilities/date_tiered/date_tiered_db_impl.cc +++ b/utilities/date_tiered/date_tiered_db_impl.cc @@ -9,7 +9,6 @@ #include "db/db_impl.h" #include "db/db_iter.h" -#include "db/filename.h" #include "db/write_batch_internal.h" #include "rocksdb/convenience.h" #include "rocksdb/env.h" @@ -17,6 +16,7 @@ #include "rocksdb/utilities/date_tiered_db.h" #include "table/merging_iterator.h" #include "util/coding.h" +#include "util/filename.h" #include "util/instrumented_mutex.h" #include "util/options_helper.h" #include "util/string_util.h" diff --git a/utilities/geodb/geodb_impl.cc b/utilities/geodb/geodb_impl.cc index bd57ca1f9..e18fd9384 100644 --- a/utilities/geodb/geodb_impl.cc +++ b/utilities/geodb/geodb_impl.cc @@ -11,15 +11,14 @@ #define __STDC_FORMAT_MACROS #endif -#include +#include #include #include -#include -#include "db/filename.h" +#include #include "util/coding.h" +#include "util/filename.h" #include "util/string_util.h" - // // There are two types of keys. The first type of key-values // maps a geo location to the set of object ids and their values. diff --git a/utilities/options/options_util.cc b/utilities/options/options_util.cc index 2526c5690..babfcd659 100644 --- a/utilities/options/options_util.cc +++ b/utilities/options/options_util.cc @@ -7,8 +7,8 @@ #include "rocksdb/utilities/options_util.h" -#include "db/filename.h" #include "rocksdb/options.h" +#include "util/filename.h" #include "util/options_parser.h" namespace rocksdb { diff --git a/utilities/ttl/db_ttl_impl.cc b/utilities/ttl/db_ttl_impl.cc index 975fbf387..de3f2995c 100644 --- a/utilities/ttl/db_ttl_impl.cc +++ b/utilities/ttl/db_ttl_impl.cc @@ -5,13 +5,13 @@ #include "utilities/ttl/db_ttl_impl.h" -#include "db/filename.h" #include "db/write_batch_internal.h" #include "rocksdb/convenience.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" #include "rocksdb/utilities/db_ttl.h" #include "util/coding.h" +#include "util/filename.h" namespace rocksdb {