From 545d20604084993174f1c0680deeff33bc67a553 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Wed, 29 May 2019 20:44:08 -0700 Subject: [PATCH] Move some file related files outside util/ (#5375) Summary: util/ means for lower level libraries, so it's a good idea to move the files which requires knowledge to DB out. Create a file/ and move some files there. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5375 Differential Revision: D15550935 Pulled By: siying fbshipit-source-id: 61a9715dcde5386eebfb43e93f847bba1ae0d3f2 --- CMakeLists.txt | 10 +++++----- Makefile | 2 +- TARGETS | 10 +++++----- db/builder.cc | 2 +- db/column_family.cc | 2 +- db/compaction_job.cc | 4 ++-- db/compaction_job_stats_test.cc | 2 +- db/compaction_picker.cc | 2 +- db/compaction_picker_universal.cc | 2 +- db/corruption_test.cc | 2 +- db/db_filesnapshot.cc | 4 ++-- db/db_impl.cc | 6 +++--- db/db_impl_compaction_flush.cc | 2 +- db/db_impl_files.cc | 4 ++-- db/db_impl_open.cc | 2 +- db/db_info_dumper.cc | 2 +- db/db_iter.cc | 2 +- db/db_sst_test.cc | 2 +- db/db_test.cc | 2 +- db/db_test_util.h | 2 +- db/deletefile_test.cc | 2 +- db/error_handler.cc | 2 +- db/external_sst_file_ingestion_job.cc | 2 +- db/external_sst_file_test.cc | 2 +- db/fault_injection_test.cc | 2 +- db/filename_test.cc | 2 +- db/flush_job.cc | 4 ++-- db/listener_test.cc | 2 +- db/memtable_list.h | 2 +- db/obsolete_files_test.cc | 2 +- db/plain_table_db_test.cc | 2 +- db/repair.cc | 2 +- db/repair_test.cc | 2 +- db/table_cache.cc | 2 +- db/transaction_log_impl.h | 2 +- db/version_set.cc | 2 +- db/wal_manager.cc | 4 ++-- {util => file}/delete_scheduler.cc | 4 ++-- {util => file}/delete_scheduler.h | 0 {util => file}/delete_scheduler_test.cc | 4 ++-- {util => file}/file_util.cc | 4 ++-- {util => file}/file_util.h | 2 +- {util => file}/filename.cc | 2 +- {util => file}/filename.h | 0 {util => file}/sst_file_manager_impl.cc | 2 +- {util => file}/sst_file_manager_impl.h | 2 +- src.mk | 8 ++++---- tools/ldb_cmd.cc | 2 +- tools/write_stress.cc | 2 +- util/auto_roll_logger.h | 2 +- util/fault_injection_test_env.h | 2 +- utilities/backupable/backupable_db.cc | 2 +- utilities/backupable/backupable_db_test.cc | 2 +- utilities/blob_db/blob_db_impl.cc | 6 +++--- utilities/blob_db/blob_db_impl_filesnapshot.cc | 2 +- utilities/blob_db/blob_db_test.cc | 4 ++-- utilities/blob_db/blob_file.cc | 2 +- utilities/checkpoint/checkpoint_impl.cc | 4 ++-- utilities/checkpoint/checkpoint_impl.h | 2 +- utilities/convenience/info_log_finder.cc | 2 +- utilities/options/options_util.cc | 2 +- utilities/ttl/db_ttl_impl.cc | 2 +- 62 files changed, 85 insertions(+), 85 deletions(-) rename {util => file}/delete_scheduler.cc (99%) rename {util => file}/delete_scheduler.h (100%) rename {util => file}/delete_scheduler_test.cc (99%) rename {util => file}/file_util.cc (97%) rename {util => file}/file_util.h (97%) rename {util => file}/filename.cc (99%) rename {util => file}/filename.h (100%) rename {util => file}/sst_file_manager_impl.cc (99%) rename {util => file}/sst_file_manager_impl.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb0c089f2..4d74152d9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -538,6 +538,10 @@ set(SOURCES env/env_encryption.cc env/env_hdfs.cc env/mock_env.cc + file/delete_scheduler.cc + file/file_util.cc + file/filename.cc + file/sst_file_manager_impl.cc memtable/alloc_tracker.cc memtable/hash_linklist_rep.cc memtable/hash_skiplist_rep.cc @@ -612,12 +616,9 @@ set(SOURCES util/concurrent_arena.cc util/concurrent_task_limiter_impl.cc util/crc32c.cc - util/delete_scheduler.cc util/dynamic_bloom.cc util/event_logger.cc util/file_reader_writer.cc - util/file_util.cc - util/filename.cc util/filter_policy.cc util/hash.cc util/jemalloc_nodump_allocator.cc @@ -626,7 +627,6 @@ set(SOURCES util/random.cc util/rate_limiter.cc util/slice.cc - util/sst_file_manager_impl.cc util/status.cc util/string_util.cc util/sync_point.cc @@ -931,6 +931,7 @@ if(WITH_TESTS) env/env_basic_test.cc env/env_test.cc env/mock_env_test.cc + file/delete_scheduler_test.cc memtable/inlineskiplist_test.cc memtable/skiplist_test.cc memtable/write_buffer_manager_test.cc @@ -959,7 +960,6 @@ if(WITH_TESTS) util/bloom_test.cc util/coding_test.cc util/crc32c_test.cc - util/delete_scheduler_test.cc util/dynamic_bloom_test.cc util/event_logger_test.cc util/file_reader_writer_test.cc diff --git a/Makefile b/Makefile index ee20a41bb1..ec0a04ed10 100644 --- a/Makefile +++ b/Makefile @@ -1369,7 +1369,7 @@ fault_injection_test: db/fault_injection_test.o $(LIBOBJECTS) $(TESTHARNESS) rate_limiter_test: util/rate_limiter_test.o db/db_test_util.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -delete_scheduler_test: util/delete_scheduler_test.o $(LIBOBJECTS) $(TESTHARNESS) +delete_scheduler_test: file/delete_scheduler_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) filename_test: db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/TARGETS b/TARGETS index 073c977e5a..7d27151572 100644 --- a/TARGETS +++ b/TARGETS @@ -143,6 +143,10 @@ cpp_library( "env/env_posix.cc", "env/io_posix.cc", "env/mock_env.cc", + "file/delete_scheduler.cc", + "file/file_util.cc", + "file/filename.cc", + "file/sst_file_manager_impl.cc", "memtable/alloc_tracker.cc", "memtable/hash_linklist_rep.cc", "memtable/hash_skiplist_rep.cc", @@ -218,12 +222,9 @@ cpp_library( "util/concurrent_arena.cc", "util/concurrent_task_limiter_impl.cc", "util/crc32c.cc", - "util/delete_scheduler.cc", "util/dynamic_bloom.cc", "util/event_logger.cc", "util/file_reader_writer.cc", - "util/file_util.cc", - "util/filename.cc", "util/filter_policy.cc", "util/hash.cc", "util/jemalloc_nodump_allocator.cc", @@ -232,7 +233,6 @@ cpp_library( "util/random.cc", "util/rate_limiter.cc", "util/slice.cc", - "util/sst_file_manager_impl.cc", "util/status.cc", "util/string_util.cc", "util/sync_point.cc", @@ -663,7 +663,7 @@ ROCKS_TESTS = [ ], [ "delete_scheduler_test", - "util/delete_scheduler_test.cc", + "file/delete_scheduler_test.cc", "serial", ], [ diff --git a/db/builder.cc b/db/builder.cc index 7f2fd72a19..b42ac187ef 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -21,6 +21,7 @@ #include "db/range_del_aggregator.h" #include "db/table_cache.h" #include "db/version_edit.h" +#include "file/filename.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/thread_status_util.h" #include "rocksdb/db.h" @@ -32,7 +33,6 @@ #include "table/format.h" #include "table/internal_iterator.h" #include "util/file_reader_writer.h" -#include "util/filename.h" #include "util/stop_watch.h" #include "util/sync_point.h" diff --git a/db/column_family.cc b/db/column_family.cc index 4592c945f2..325610b884 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -29,6 +29,7 @@ #include "db/table_properties_collector.h" #include "db/version_set.h" #include "db/write_controller.h" +#include "file/sst_file_manager_impl.h" #include "memtable/hash_skiplist_rep.h" #include "monitoring/thread_status_util.h" #include "options/options_helper.h" @@ -36,7 +37,6 @@ #include "table/merging_iterator.h" #include "util/autovector.h" #include "util/compression.h" -#include "util/sst_file_manager_impl.h" namespace rocksdb { diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 44fb385d1b..7d2015e562 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -38,6 +38,8 @@ #include "db/merge_helper.h" #include "db/range_del_aggregator.h" #include "db/version_set.h" +#include "file/filename.h" +#include "file/sst_file_manager_impl.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_util.h" @@ -53,12 +55,10 @@ #include "table/table_builder.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "util/filename.h" #include "util/log_buffer.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/random.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 48e883bc6c..5ca6bf4a33 100644 --- a/db/compaction_job_stats_test.cc +++ b/db/compaction_job_stats_test.cc @@ -27,6 +27,7 @@ #include "db/version_set.h" #include "db/write_batch_internal.h" #include "env/mock_env.h" +#include "file/filename.h" #include "memtable/hash_linklist_rep.h" #include "monitoring/statistics.h" #include "monitoring/thread_status_util.h" @@ -52,7 +53,6 @@ #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/mutexlock.h" diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index 4bd8ff0e33..f500def41e 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -20,8 +20,8 @@ #include #include #include "db/column_family.h" +#include "file/filename.h" #include "monitoring/statistics.h" -#include "util/filename.h" #include "util/log_buffer.h" #include "util/random.h" #include "util/string_util.h" diff --git a/db/compaction_picker_universal.cc b/db/compaction_picker_universal.cc index 9291178585..c25ae94fa1 100644 --- a/db/compaction_picker_universal.cc +++ b/db/compaction_picker_universal.cc @@ -20,8 +20,8 @@ #include #include #include "db/column_family.h" +#include "file/filename.h" #include "monitoring/statistics.h" -#include "util/filename.h" #include "util/log_buffer.h" #include "util/random.h" #include "util/string_util.h" diff --git a/db/corruption_test.cc b/db/corruption_test.cc index 1ccb1aa2b0..ba97ca1502 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -19,6 +19,7 @@ #include "db/db_impl.h" #include "db/log_format.h" #include "db/version_set.h" +#include "file/filename.h" #include "rocksdb/cache.h" #include "rocksdb/convenience.h" #include "rocksdb/env.h" @@ -26,7 +27,6 @@ #include "rocksdb/write_batch.h" #include "table/block_based_table_builder.h" #include "table/meta_blocks.h" -#include "util/filename.h" #include "util/string_util.h" #include "util/testharness.h" #include "util/testutil.h" diff --git a/db/db_filesnapshot.cc b/db/db_filesnapshot.cc index ace0befb6d..5b630e2163 100644 --- a/db/db_filesnapshot.cc +++ b/db/db_filesnapshot.cc @@ -17,11 +17,11 @@ #include "db/db_impl.h" #include "db/job_context.h" #include "db/version_set.h" +#include "file/file_util.h" +#include "file/filename.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 3ec9e2ab2d..e7ed186646 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -53,6 +53,9 @@ #include "db/version_set.h" #include "db/write_batch_internal.h" #include "db/write_callback.h" +#include "file/file_util.h" +#include "file/filename.h" +#include "file/sst_file_manager_impl.h" #include "memtable/hash_linklist_rep.h" #include "memtable/hash_skiplist_rep.h" #include "monitoring/iostats_context_imp.h" @@ -89,12 +92,9 @@ #include "util/compression.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/file_util.h" -#include "util/filename.h" #include "util/log_buffer.h" #include "util/logging.h" #include "util/mutexlock.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/db_impl_compaction_flush.cc b/db/db_impl_compaction_flush.cc index 38c69dfc1e..1e39bdd427 100644 --- a/db/db_impl_compaction_flush.cc +++ b/db/db_impl_compaction_flush.cc @@ -16,12 +16,12 @@ #include "db/builder.h" #include "db/error_handler.h" #include "db/event_helpers.h" +#include "file/sst_file_manager_impl.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_updater.h" #include "monitoring/thread_status_util.h" #include "util/concurrent_task_limiter_impl.h" -#include "util/sst_file_manager_impl.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/db/db_impl_files.cc b/db/db_impl_files.cc index b16cf87947..64c6dc9687 100644 --- a/db/db_impl_files.cc +++ b/db/db_impl_files.cc @@ -16,8 +16,8 @@ #include #include "db/event_helpers.h" #include "db/memtable_list.h" -#include "util/file_util.h" -#include "util/sst_file_manager_impl.h" +#include "file/file_util.h" +#include "file/sst_file_manager_impl.h" namespace rocksdb { diff --git a/db/db_impl_open.cc b/db/db_impl_open.cc index 66104d0ba2..4240b2012d 100644 --- a/db/db_impl_open.cc +++ b/db/db_impl_open.cc @@ -15,11 +15,11 @@ #include "db/builder.h" #include "db/error_handler.h" +#include "file/sst_file_manager_impl.h" #include "options/options_helper.h" #include "rocksdb/wal_filter.h" #include "table/block_based_table_factory.h" #include "util/rate_limiter.h" -#include "util/sst_file_manager_impl.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/db/db_info_dumper.cc b/db/db_info_dumper.cc index 31050d20a2..be85357c2e 100644 --- a/db/db_info_dumper.cc +++ b/db/db_info_dumper.cc @@ -15,8 +15,8 @@ #include #include +#include "file/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 a606e3acd6..8fc17e1446 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -16,6 +16,7 @@ #include "db/merge_context.h" #include "db/merge_helper.h" #include "db/pinned_iterators_manager.h" +#include "file/filename.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" @@ -24,7 +25,6 @@ #include "table/internal_iterator.h" #include "table/iterator_wrapper.h" #include "util/arena.h" -#include "util/filename.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" diff --git a/db/db_sst_test.cc b/db/db_sst_test.cc index 9003ed6b1a..815aed23e0 100644 --- a/db/db_sst_test.cc +++ b/db/db_sst_test.cc @@ -8,10 +8,10 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/db_test_util.h" +#include "file/sst_file_manager_impl.h" #include "port/port.h" #include "port/stack_trace.h" #include "rocksdb/sst_file_manager.h" -#include "util/sst_file_manager_impl.h" namespace rocksdb { diff --git a/db/db_test.cc b/db/db_test.cc index 8a112e48fc..7864a7e2c6 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -31,6 +31,7 @@ #include "db/version_set.h" #include "db/write_batch_internal.h" #include "env/mock_env.h" +#include "file/filename.h" #include "memtable/hash_linklist_rep.h" #include "monitoring/thread_status_util.h" #include "port/port.h" @@ -59,7 +60,6 @@ #include "table/scoped_arena_iterator.h" #include "util/compression.h" #include "util/file_reader_writer.h" -#include "util/filename.h" #include "util/mutexlock.h" #include "util/rate_limiter.h" #include "util/string_util.h" diff --git a/db/db_test_util.h b/db/db_test_util.h index f5d7fd1a75..81186bfb9a 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -27,6 +27,7 @@ #include "db/db_impl.h" #include "db/dbformat.h" #include "env/mock_env.h" +#include "file/filename.h" #include "memtable/hash_linklist_rep.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" @@ -45,7 +46,6 @@ #include "table/plain_table_factory.h" #include "table/scoped_arena_iterator.h" #include "util/compression.h" -#include "util/filename.h" #include "util/mock_time_env.h" #include "util/mutexlock.h" diff --git a/db/deletefile_test.cc b/db/deletefile_test.cc index 54bab84792..81ff8d0b99 100644 --- a/db/deletefile_test.cc +++ b/db/deletefile_test.cc @@ -16,10 +16,10 @@ #include "db/db_impl.h" #include "db/version_set.h" #include "db/write_batch_internal.h" +#include "file/filename.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/error_handler.cc b/db/error_handler.cc index afec14edcb..140fb4850f 100644 --- a/db/error_handler.cc +++ b/db/error_handler.cc @@ -6,7 +6,7 @@ #include "db/error_handler.h" #include "db/db_impl.h" #include "db/event_helpers.h" -#include "util/sst_file_manager_impl.h" +#include "file/sst_file_manager_impl.h" namespace rocksdb { diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 588ac5110a..7bfc64f77c 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -17,12 +17,12 @@ #include #include "db/version_edit.h" +#include "file/file_util.h" #include "table/merging_iterator.h" #include "table/scoped_arena_iterator.h" #include "table/sst_file_writer_collectors.h" #include "table/table_builder.h" #include "util/file_reader_writer.h" -#include "util/file_util.h" #include "util/stop_watch.h" #include "util/sync_point.h" diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc index 3850a2a031..0a0994f0ea 100644 --- a/db/external_sst_file_test.cc +++ b/db/external_sst_file_test.cc @@ -7,11 +7,11 @@ #include #include "db/db_test_util.h" +#include "file/filename.h" #include "port/port.h" #include "port/stack_trace.h" #include "rocksdb/sst_file_writer.h" #include "util/fault_injection_test_env.h" -#include "util/filename.h" #include "util/testutil.h" namespace rocksdb { diff --git a/db/fault_injection_test.cc b/db/fault_injection_test.cc index 53de312c01..1bfaa29945 100644 --- a/db/fault_injection_test.cc +++ b/db/fault_injection_test.cc @@ -15,13 +15,13 @@ #include "db/log_format.h" #include "db/version_set.h" #include "env/mock_env.h" +#include "file/filename.h" #include "rocksdb/cache.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #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/mutexlock.h" #include "util/sync_point.h" diff --git a/db/filename_test.cc b/db/filename_test.cc index d6bde52834..869469f3f0 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 "util/filename.h" +#include "file/filename.h" #include "db/dbformat.h" #include "port/port.h" diff --git a/db/flush_job.cc b/db/flush_job.cc index 21c1ff3a74..46915ca13a 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -29,6 +29,8 @@ #include "db/merge_context.h" #include "db/range_tombstone_fragmenter.h" #include "db/version_set.h" +#include "file/file_util.h" +#include "file/filename.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_util.h" @@ -45,8 +47,6 @@ #include "table/two_level_iterator.h" #include "util/coding.h" #include "util/event_logger.h" -#include "util/file_util.h" -#include "util/filename.h" #include "util/log_buffer.h" #include "util/logging.h" #include "util/mutexlock.h" diff --git a/db/listener_test.cc b/db/listener_test.cc index 56968d8f80..6b716a1d4b 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -8,6 +8,7 @@ #include "db/dbformat.h" #include "db/version_set.h" #include "db/write_batch_internal.h" +#include "file/filename.h" #include "memtable/hash_linklist_rep.h" #include "monitoring/statistics.h" #include "rocksdb/cache.h" @@ -23,7 +24,6 @@ #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 5df35660a4..a5f0c12329 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -16,13 +16,13 @@ #include "db/logs_with_prep_tracker.h" #include "db/memtable.h" #include "db/range_del_aggregator.h" +#include "file/filename.h" #include "monitoring/instrumented_mutex.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" #include "rocksdb/options.h" #include "rocksdb/types.h" #include "util/autovector.h" -#include "util/filename.h" #include "util/log_buffer.h" namespace rocksdb { diff --git a/db/obsolete_files_test.cc b/db/obsolete_files_test.cc index 52175a07b7..6bf2acf851 100644 --- a/db/obsolete_files_test.cc +++ b/db/obsolete_files_test.cc @@ -16,10 +16,10 @@ #include "db/db_impl.h" #include "db/version_set.h" #include "db/write_batch_internal.h" +#include "file/filename.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/plain_table_db_test.cc b/db/plain_table_db_test.cc index 8a08cf9fed..ef770c2e50 100644 --- a/db/plain_table_db_test.cc +++ b/db/plain_table_db_test.cc @@ -15,6 +15,7 @@ #include "db/db_impl.h" #include "db/version_set.h" #include "db/write_batch_internal.h" +#include "file/filename.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" #include "rocksdb/db.h" @@ -28,7 +29,6 @@ #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 2715adcf12..577c122bcf 100644 --- a/db/repair.cc +++ b/db/repair.cc @@ -74,6 +74,7 @@ #include "db/table_cache.h" #include "db/version_edit.h" #include "db/write_batch_internal.h" +#include "file/filename.h" #include "options/cf_options.h" #include "rocksdb/comparator.h" #include "rocksdb/db.h" @@ -82,7 +83,6 @@ #include "rocksdb/write_buffer_manager.h" #include "table/scoped_arena_iterator.h" #include "util/file_reader_writer.h" -#include "util/filename.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/repair_test.cc b/db/repair_test.cc index 3422532da4..1851cde0df 100644 --- a/db/repair_test.cc +++ b/db/repair_test.cc @@ -11,10 +11,10 @@ #include "db/db_impl.h" #include "db/db_test_util.h" +#include "file/file_util.h" #include "rocksdb/comparator.h" #include "rocksdb/db.h" #include "rocksdb/transaction_log.h" -#include "util/file_util.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/table_cache.cc b/db/table_cache.cc index 06255d6a35..01724dfc5c 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -12,7 +12,7 @@ #include "db/dbformat.h" #include "db/range_tombstone_fragmenter.h" #include "db/version_edit.h" -#include "util/filename.h" +#include "file/filename.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/statistics.h" diff --git a/db/transaction_log_impl.h b/db/transaction_log_impl.h index 6382b61a5b..68ba620714 100644 --- a/db/transaction_log_impl.h +++ b/db/transaction_log_impl.h @@ -9,13 +9,13 @@ #include "db/log_reader.h" #include "db/version_set.h" +#include "file/filename.h" #include "options/db_options.h" #include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/options.h" #include "rocksdb/transaction_log.h" #include "rocksdb/types.h" -#include "util/filename.h" namespace rocksdb { diff --git a/db/version_set.cc b/db/version_set.cc index 5723c6d925..c10eb9f7ac 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -33,6 +33,7 @@ #include "db/pinned_iterators_manager.h" #include "db/table_cache.h" #include "db/version_builder.h" +#include "file/filename.h" #include "monitoring/file_read_sample.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/env.h" @@ -49,7 +50,6 @@ #include "table/two_level_iterator.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "util/filename.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/sync_point.h" diff --git a/db/wal_manager.cc b/db/wal_manager.cc index 62511819e4..cce714750e 100644 --- a/db/wal_manager.cc +++ b/db/wal_manager.cc @@ -22,6 +22,8 @@ #include "db/log_writer.h" #include "db/transaction_log_impl.h" #include "db/write_batch_internal.h" +#include "file/file_util.h" +#include "file/filename.h" #include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/options.h" @@ -29,8 +31,6 @@ #include "util/cast_util.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "util/file_util.h" -#include "util/filename.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" diff --git a/util/delete_scheduler.cc b/file/delete_scheduler.cc similarity index 99% rename from util/delete_scheduler.cc rename to file/delete_scheduler.cc index f5ee284489..41ec84376b 100644 --- a/util/delete_scheduler.cc +++ b/file/delete_scheduler.cc @@ -5,16 +5,16 @@ #ifndef ROCKSDB_LITE -#include "util/delete_scheduler.h" +#include "file/delete_scheduler.h" #include #include +#include "file/sst_file_manager_impl.h" #include "port/port.h" #include "rocksdb/env.h" #include "util/logging.h" #include "util/mutexlock.h" -#include "util/sst_file_manager_impl.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/util/delete_scheduler.h b/file/delete_scheduler.h similarity index 100% rename from util/delete_scheduler.h rename to file/delete_scheduler.h diff --git a/util/delete_scheduler_test.cc b/file/delete_scheduler_test.cc similarity index 99% rename from util/delete_scheduler_test.cc rename to file/delete_scheduler_test.cc index 0d8e354b9c..c8544004cd 100644 --- a/util/delete_scheduler_test.cc +++ b/file/delete_scheduler_test.cc @@ -12,10 +12,10 @@ #include #include +#include "file/delete_scheduler.h" +#include "file/sst_file_manager_impl.h" #include "rocksdb/env.h" #include "rocksdb/options.h" -#include "util/delete_scheduler.h" -#include "util/sst_file_manager_impl.h" #include "util/string_util.h" #include "util/sync_point.h" #include "util/testharness.h" diff --git a/util/file_util.cc b/file/file_util.cc similarity index 97% rename from util/file_util.cc rename to file/file_util.cc index ba1b4744bb..0364f83402 100644 --- a/util/file_util.cc +++ b/file/file_util.cc @@ -3,13 +3,13 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#include "util/file_util.h" +#include "file/file_util.h" #include #include +#include "file/sst_file_manager_impl.h" #include "rocksdb/env.h" -#include "util/sst_file_manager_impl.h" #include "util/file_reader_writer.h" namespace rocksdb { diff --git a/util/file_util.h b/file/file_util.h similarity index 97% rename from util/file_util.h rename to file/file_util.h index c3b365c8bc..9116c1fecf 100644 --- a/util/file_util.h +++ b/file/file_util.h @@ -6,11 +6,11 @@ #pragma once #include +#include "file/filename.h" #include "options/db_options.h" #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/types.h" -#include "util/filename.h" namespace rocksdb { // use_fsync maps to options.use_fsync, which determines the way that diff --git a/util/filename.cc b/file/filename.cc similarity index 99% rename from util/filename.cc rename to file/filename.cc index 32289aecb4..0a48dc78c3 100644 --- a/util/filename.cc +++ b/file/filename.cc @@ -10,7 +10,7 @@ #define __STDC_FORMAT_MACROS #endif -#include "util/filename.h" +#include "file/filename.h" #include #include diff --git a/util/filename.h b/file/filename.h similarity index 100% rename from util/filename.h rename to file/filename.h diff --git a/util/sst_file_manager_impl.cc b/file/sst_file_manager_impl.cc similarity index 99% rename from util/sst_file_manager_impl.cc rename to file/sst_file_manager_impl.cc index d85b9c960d..86bcb2d19c 100644 --- a/util/sst_file_manager_impl.cc +++ b/file/sst_file_manager_impl.cc @@ -3,7 +3,7 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). -#include "util/sst_file_manager_impl.h" +#include "file/sst_file_manager_impl.h" #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS diff --git a/util/sst_file_manager_impl.h b/file/sst_file_manager_impl.h similarity index 99% rename from util/sst_file_manager_impl.h rename to file/sst_file_manager_impl.h index 211b4fa716..b506ece279 100644 --- a/util/sst_file_manager_impl.h +++ b/file/sst_file_manager_impl.h @@ -13,8 +13,8 @@ #include "db/compaction.h" #include "db/error_handler.h" +#include "file/delete_scheduler.h" #include "rocksdb/sst_file_manager.h" -#include "util/delete_scheduler.h" namespace rocksdb { diff --git a/src.mk b/src.mk index e3fe5632f8..2541b9fd12 100644 --- a/src.mk +++ b/src.mk @@ -67,6 +67,10 @@ LIB_SOURCES = \ env/env_posix.cc \ env/io_posix.cc \ env/mock_env.cc \ + file/delete_scheduler.cc \ + file/file_util.cc \ + file/filename.cc \ + file/sst_file_manager_impl.cc \ memtable/alloc_tracker.cc \ memtable/hash_linklist_rep.cc \ memtable/hash_skiplist_rep.cc \ @@ -139,12 +143,9 @@ LIB_SOURCES = \ util/concurrent_arena.cc \ util/concurrent_task_limiter_impl.cc \ util/crc32c.cc \ - util/delete_scheduler.cc \ util/dynamic_bloom.cc \ util/event_logger.cc \ util/file_reader_writer.cc \ - util/file_util.cc \ - util/filename.cc \ util/filter_policy.cc \ util/hash.cc \ util/jemalloc_nodump_allocator.cc \ @@ -153,7 +154,6 @@ LIB_SOURCES = \ util/random.cc \ util/rate_limiter.cc \ util/slice.cc \ - util/sst_file_manager_impl.cc \ util/status.cc \ util/string_util.cc \ util/sync_point.cc \ diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index d05ae4a581..10e9a495d2 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -16,6 +16,7 @@ #include "db/dbformat.h" #include "db/log_reader.h" #include "db/write_batch_internal.h" +#include "file/filename.h" #include "port/port_dirent.h" #include "rocksdb/cache.h" #include "rocksdb/table_properties.h" @@ -31,7 +32,6 @@ #include "tools/sst_dump_tool_imp.h" #include "util/cast_util.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/write_stress.cc b/tools/write_stress.cc index ddb1d0aed0..8cde31e6b8 100644 --- a/tools/write_stress.cc +++ b/tools/write_stress.cc @@ -67,12 +67,12 @@ int main() { #include #include +#include "file/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" #include "util/gflags_compat.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; diff --git a/util/auto_roll_logger.h b/util/auto_roll_logger.h index 64fce4d63e..24f4714b4f 100644 --- a/util/auto_roll_logger.h +++ b/util/auto_roll_logger.h @@ -10,9 +10,9 @@ #include #include +#include "file/filename.h" #include "port/port.h" #include "port/util_logger.h" -#include "util/filename.h" #include "util/mutexlock.h" #include "util/sync_point.h" diff --git a/util/fault_injection_test_env.h b/util/fault_injection_test_env.h index a39e5b71e9..d962acfd58 100644 --- a/util/fault_injection_test_env.h +++ b/util/fault_injection_test_env.h @@ -19,9 +19,9 @@ #include "db/version_set.h" #include "env/mock_env.h" +#include "file/filename.h" #include "rocksdb/db.h" #include "rocksdb/env.h" -#include "util/filename.h" #include "util/mutexlock.h" #include "util/random.h" diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index b7c15c3915..149eb911f7 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -10,6 +10,7 @@ #ifndef ROCKSDB_LITE #include "rocksdb/utilities/backupable_db.h" +#include "file/filename.h" #include "port/port.h" #include "rocksdb/rate_limiter.h" #include "rocksdb/transaction_log.h" @@ -17,7 +18,6 @@ #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 "util/sync_point.h" diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index 1548203dd0..e4abd96e95 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -14,6 +14,7 @@ #include "db/db_impl.h" #include "env/env_chroot.h" +#include "file/filename.h" #include "port/port.h" #include "port/stack_trace.h" #include "rocksdb/rate_limiter.h" @@ -22,7 +23,6 @@ #include "rocksdb/utilities/backupable_db.h" #include "rocksdb/utilities/options_util.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_impl.cc b/utilities/blob_db/blob_db_impl.cc index 5dcddc214c..9f3839370e 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -12,6 +12,9 @@ #include "db/db_impl.h" #include "db/write_batch_internal.h" +#include "file/file_util.h" +#include "file/filename.h" +#include "file/sst_file_manager_impl.h" #include "monitoring/instrumented_mutex.h" #include "monitoring/statistics.h" #include "rocksdb/convenience.h" @@ -26,12 +29,9 @@ #include "util/cast_util.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/file_util.h" -#include "util/filename.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/random.h" -#include "util/sst_file_manager_impl.h" #include "util/stop_watch.h" #include "util/sync_point.h" #include "util/timer_queue.h" diff --git a/utilities/blob_db/blob_db_impl_filesnapshot.cc b/utilities/blob_db/blob_db_impl_filesnapshot.cc index 8effe88c0a..16b9ff826e 100644 --- a/utilities/blob_db/blob_db_impl_filesnapshot.cc +++ b/utilities/blob_db/blob_db_impl_filesnapshot.cc @@ -7,7 +7,7 @@ #include "utilities/blob_db/blob_db_impl.h" -#include "util/filename.h" +#include "file/filename.h" #include "util/logging.h" #include "util/mutexlock.h" diff --git a/utilities/blob_db/blob_db_test.cc b/utilities/blob_db/blob_db_test.cc index afb953df9c..e24ba1d983 100644 --- a/utilities/blob_db/blob_db_test.cc +++ b/utilities/blob_db/blob_db_test.cc @@ -14,13 +14,13 @@ #include #include "db/db_test_util.h" +#include "file/file_util.h" +#include "file/sst_file_manager_impl.h" #include "port/port.h" #include "rocksdb/utilities/debug.h" #include "util/cast_util.h" #include "util/fault_injection_test_env.h" -#include "util/file_util.h" #include "util/random.h" -#include "util/sst_file_manager_impl.h" #include "util/string_util.h" #include "util/sync_point.h" #include "util/testharness.h" diff --git a/utilities/blob_db/blob_file.cc b/utilities/blob_db/blob_file.cc index 3bcbd04873..e14307d44c 100644 --- a/utilities/blob_db/blob_file.cc +++ b/utilities/blob_db/blob_file.cc @@ -19,7 +19,7 @@ #include "db/column_family.h" #include "db/db_impl.h" #include "db/dbformat.h" -#include "util/filename.h" +#include "file/filename.h" #include "util/logging.h" #include "utilities/blob_db/blob_db_impl.h" diff --git a/utilities/checkpoint/checkpoint_impl.cc b/utilities/checkpoint/checkpoint_impl.cc index 9863ac1d56..920f9bf535 100644 --- a/utilities/checkpoint/checkpoint_impl.cc +++ b/utilities/checkpoint/checkpoint_impl.cc @@ -21,13 +21,13 @@ #include #include "db/wal_manager.h" +#include "file/file_util.h" +#include "file/filename.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/transaction_log.h" #include "rocksdb/utilities/checkpoint.h" -#include "util/file_util.h" -#include "util/filename.h" #include "util/sync_point.h" namespace rocksdb { diff --git a/utilities/checkpoint/checkpoint_impl.h b/utilities/checkpoint/checkpoint_impl.h index a85fde59b6..d26a9f66bf 100644 --- a/utilities/checkpoint/checkpoint_impl.h +++ b/utilities/checkpoint/checkpoint_impl.h @@ -9,8 +9,8 @@ #include "rocksdb/utilities/checkpoint.h" #include +#include "file/filename.h" #include "rocksdb/db.h" -#include "util/filename.h" namespace rocksdb { diff --git a/utilities/convenience/info_log_finder.cc b/utilities/convenience/info_log_finder.cc index 72c4a6275a..3e59996163 100644 --- a/utilities/convenience/info_log_finder.cc +++ b/utilities/convenience/info_log_finder.cc @@ -8,8 +8,8 @@ // found in the LICENSE file. #include "rocksdb/utilities/info_log_finder.h" +#include "file/filename.h" #include "rocksdb/env.h" -#include "util/filename.h" namespace rocksdb { diff --git a/utilities/options/options_util.cc b/utilities/options/options_util.cc index 3975eadd75..561e925ebb 100644 --- a/utilities/options/options_util.cc +++ b/utilities/options/options_util.cc @@ -7,9 +7,9 @@ #include "rocksdb/utilities/options_util.h" +#include "file/filename.h" #include "options/options_parser.h" #include "rocksdb/options.h" -#include "util/filename.h" namespace rocksdb { Status LoadOptionsFromFile(const std::string& file_name, Env* env, diff --git a/utilities/ttl/db_ttl_impl.cc b/utilities/ttl/db_ttl_impl.cc index 1952e6188d..47049a1358 100644 --- a/utilities/ttl/db_ttl_impl.cc +++ b/utilities/ttl/db_ttl_impl.cc @@ -7,12 +7,12 @@ #include "utilities/ttl/db_ttl_impl.h" #include "db/write_batch_internal.h" +#include "file/filename.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 {