From 000b9ec217663faad1d0196b28c623149e01e024 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Fri, 31 May 2019 17:19:43 -0700 Subject: [PATCH] Move some logging related files to logging/ (#5387) Summary: Many logging related source files are under util/. It will be more structured if they are together. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5387 Differential Revision: D15579036 Pulled By: siying fbshipit-source-id: 3850134ed50b8c0bb40a0c8ae1f184fa4081303f --- CMakeLists.txt | 10 +++++----- Makefile | 4 ++-- TARGETS | 10 +++++----- db/builder.h | 2 +- db/compaction/compaction_job.cc | 4 ++-- db/compaction/compaction_job.h | 2 +- db/compaction/compaction_job_stats_test.cc | 2 +- db/compaction/compaction_picker.cc | 2 +- db/compaction/compaction_picker_fifo.cc | 2 +- db/compaction/compaction_picker_level.cc | 2 +- db/compaction/compaction_picker_test.cc | 2 +- db/compaction/compaction_picker_universal.cc | 2 +- db/db_impl/db_impl.cc | 6 +++--- db/db_impl/db_impl.h | 3 ++- db/db_impl/db_impl_secondary.cc | 2 +- db/db_iter.cc | 2 +- db/dbformat.h | 2 +- db/dbformat_test.cc | 2 +- db/event_helpers.h | 2 +- db/fault_injection_test.cc | 2 +- db/filename_test.cc | 2 +- db/flush_job.cc | 6 +++--- db/flush_job.h | 2 +- db/listener_test.cc | 2 +- db/memtable_list.cc | 2 +- db/memtable_list.h | 2 +- db/plain_table_db_test.cc | 2 +- db/version_builder_test.cc | 2 +- db/version_edit.cc | 2 +- db/version_set_test.cc | 2 +- db/wal_manager.cc | 2 +- env/env_hdfs.cc | 2 +- env/env_posix.cc | 4 ++-- env/env_test.cc | 2 +- env/io_posix.cc | 2 +- file/delete_scheduler.cc | 2 +- file/filename.cc | 2 +- java/rocksjni/write_batch.cc | 2 +- {util => logging}/auto_roll_logger.cc | 5 +++-- {util => logging}/auto_roll_logger.h | 0 {util => logging}/auto_roll_logger_test.cc | 4 ++-- {util => logging}/event_logger.cc | 4 ++-- {util => logging}/event_logger.h | 2 +- {util => logging}/event_logger_test.cc | 2 +- {util => logging}/log_buffer.cc | 2 +- {util => logging}/log_buffer.h | 0 {util => logging}/logging.h | 2 +- {env => logging}/posix_logger.h | 0 memory/arena.cc | 2 +- options/db_options.cc | 2 +- port/port_posix.cc | 4 ++-- port/util_logger.h | 2 +- port/win/port_win.cc | 2 +- src.mk | 10 +++++----- table/block_based/block.cc | 2 +- table/block_based/partitioned_filter_block_test.cc | 2 +- table/block_fetcher.cc | 2 +- table/format.cc | 2 +- test_util/transaction_test_util.cc | 2 +- tools/db_stress.cc | 2 +- util/bloom_test.cc | 2 +- util/comparator.cc | 8 ++++---- util/dynamic_bloom_test.cc | 2 +- utilities/backupable/backupable_db.cc | 2 +- utilities/blob_db/blob_db_impl.cc | 2 +- utilities/blob_db/blob_db_impl_filesnapshot.cc | 2 +- utilities/blob_db/blob_file.cc | 2 +- utilities/merge_operators/uint64add.cc | 2 +- utilities/persistent_cache/block_cache_tier.cc | 2 +- utilities/persistent_cache/block_cache_tier_file.cc | 2 +- utilities/transactions/optimistic_transaction_test.cc | 2 +- 71 files changed, 96 insertions(+), 94 deletions(-) rename {util => logging}/auto_roll_logger.cc (99%) rename {util => logging}/auto_roll_logger.h (100%) rename {util => logging}/auto_roll_logger_test.cc (99%) rename {util => logging}/event_logger.cc (96%) rename {util => logging}/event_logger.h (99%) rename {util => logging}/event_logger_test.cc (97%) rename {util => logging}/log_buffer.cc (98%) rename {util => logging}/log_buffer.h (100%) rename {util => logging}/logging.h (98%) rename {env => logging}/posix_logger.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c2fa7119..1b5f03a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -549,6 +549,9 @@ set(SOURCES file/file_util.cc file/filename.cc file/sst_file_manager_impl.cc + logging/auto_roll_logger.cc + logging/event_logger.cc + logging/log_buffer.cc memory/arena.cc memory/concurrent_arena.cc memory/jemalloc_nodump_allocator.cc @@ -620,7 +623,6 @@ set(SOURCES tools/ldb_tool.cc tools/sst_dump_tool.cc tools/trace_analyzer_tool.cc - util/auto_roll_logger.cc util/bloom.cc util/coding.cc util/compaction_job_stats_impl.cc @@ -629,11 +631,9 @@ set(SOURCES util/concurrent_task_limiter_impl.cc util/crc32c.cc util/dynamic_bloom.cc - util/event_logger.cc util/file_reader_writer.cc util/filter_policy.cc util/hash.cc - util/log_buffer.cc util/murmurhash.cc util/random.cc util/rate_limiter.cc @@ -939,6 +939,8 @@ if(WITH_TESTS) env/env_test.cc env/mock_env_test.cc file/delete_scheduler_test.cc + logging/auto_roll_logger_test.cc + logging/event_logger_test.cc memory/arena_test.cc memtable/inlineskiplist_test.cc memtable/skiplist_test.cc @@ -963,13 +965,11 @@ if(WITH_TESTS) tools/reduce_levels_test.cc tools/sst_dump_test.cc tools/trace_analyzer_test.cc - util/auto_roll_logger_test.cc util/autovector_test.cc util/bloom_test.cc util/coding_test.cc util/crc32c_test.cc util/dynamic_bloom_test.cc - util/event_logger_test.cc util/file_reader_writer_test.cc util/filelock_test.cc util/hash_test.cc diff --git a/Makefile b/Makefile index 5181154a2..080e07133 100644 --- a/Makefile +++ b/Makefile @@ -1498,7 +1498,7 @@ db_bench_tool_test: tools/db_bench_tool_test.o $(BENCHTOOLOBJECTS) $(TESTHARNESS trace_analyzer_test: tools/trace_analyzer_test.o $(LIBOBJECTS) $(ANALYZETOOLOBJECTS) $(TESTHARNESS) $(AM_LINK) -event_logger_test: util/event_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) +event_logger_test: logging/event_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) timer_queue_test: util/timer_queue_test.o $(LIBOBJECTS) $(TESTHARNESS) @@ -1519,7 +1519,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: util/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) +auto_roll_logger_test: logging/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) memtable_list_test: db/memtable_list_test.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/TARGETS b/TARGETS index edddc7b99..da4f4d9a6 100644 --- a/TARGETS +++ b/TARGETS @@ -148,6 +148,9 @@ cpp_library( "file/file_util.cc", "file/filename.cc", "file/sst_file_manager_impl.cc", + "logging/auto_roll_logger.cc", + "logging/event_logger.cc", + "logging/log_buffer.cc", "memory/arena.cc", "memory/concurrent_arena.cc", "memory/jemalloc_nodump_allocator.cc", @@ -218,7 +221,6 @@ cpp_library( "tools/ldb_cmd.cc", "tools/ldb_tool.cc", "tools/sst_dump_tool.cc", - "util/auto_roll_logger.cc", "util/bloom.cc", "util/build_version.cc", "util/coding.cc", @@ -228,11 +230,9 @@ cpp_library( "util/concurrent_task_limiter_impl.cc", "util/crc32c.cc", "util/dynamic_bloom.cc", - "util/event_logger.cc", "util/file_reader_writer.cc", "util/filter_policy.cc", "util/hash.cc", - "util/log_buffer.cc", "util/murmurhash.cc", "util/random.cc", "util/rate_limiter.cc", @@ -359,7 +359,7 @@ ROCKS_TESTS = [ ], [ "auto_roll_logger_test", - "util/auto_roll_logger_test.cc", + "logging/auto_roll_logger_test.cc", "serial", ], [ @@ -699,7 +699,7 @@ ROCKS_TESTS = [ ], [ "event_logger_test", - "util/event_logger_test.cc", + "logging/event_logger_test.cc", "serial", ], [ diff --git a/db/builder.h b/db/builder.h index 34a4bff1a..4fa56f50e 100644 --- a/db/builder.h +++ b/db/builder.h @@ -11,6 +11,7 @@ #include #include "db/range_tombstone_fragmenter.h" #include "db/table_properties_collector.h" +#include "logging/event_logger.h" #include "options/cf_options.h" #include "rocksdb/comparator.h" #include "rocksdb/env.h" @@ -20,7 +21,6 @@ #include "rocksdb/table_properties.h" #include "rocksdb/types.h" #include "table/scoped_arena_iterator.h" -#include "util/event_logger.h" namespace rocksdb { diff --git a/db/compaction/compaction_job.cc b/db/compaction/compaction_job.cc index b782c6ca7..5761345d8 100644 --- a/db/compaction/compaction_job.cc +++ b/db/compaction/compaction_job.cc @@ -40,6 +40,8 @@ #include "db/version_set.h" #include "file/filename.h" #include "file/sst_file_manager_impl.h" +#include "logging/log_buffer.h" +#include "logging/logging.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_util.h" @@ -56,8 +58,6 @@ #include "test_util/sync_point.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "util/log_buffer.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/random.h" #include "util/stop_watch.h" diff --git a/db/compaction/compaction_job.h b/db/compaction/compaction_job.h index 1387fffb1..84d38c163 100644 --- a/db/compaction/compaction_job.h +++ b/db/compaction/compaction_job.h @@ -29,6 +29,7 @@ #include "db/version_edit.h" #include "db/write_controller.h" #include "db/write_thread.h" +#include "logging/event_logger.h" #include "options/cf_options.h" #include "options/db_options.h" #include "port/port.h" @@ -40,7 +41,6 @@ #include "rocksdb/transaction_log.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" -#include "util/event_logger.h" #include "util/stop_watch.h" #include "util/thread_local.h" diff --git a/db/compaction/compaction_job_stats_test.cc b/db/compaction/compaction_job_stats_test.cc index 91310e9f1..5fb805df5 100644 --- a/db/compaction/compaction_job_stats_test.cc +++ b/db/compaction/compaction_job_stats_test.cc @@ -28,6 +28,7 @@ #include "db/write_batch_internal.h" #include "env/mock_env.h" #include "file/filename.h" +#include "logging/logging.h" #include "memtable/hash_linklist_rep.h" #include "monitoring/statistics.h" #include "monitoring/thread_status_util.h" @@ -57,7 +58,6 @@ #include "test_util/testutil.h" #include "util/compression.h" #include "util/hash.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/rate_limiter.h" #include "util/string_util.h" diff --git a/db/compaction/compaction_picker.cc b/db/compaction/compaction_picker.cc index 4276ea9cb..a03f7b46f 100644 --- a/db/compaction/compaction_picker.cc +++ b/db/compaction/compaction_picker.cc @@ -21,9 +21,9 @@ #include #include "db/column_family.h" #include "file/filename.h" +#include "logging/log_buffer.h" #include "monitoring/statistics.h" #include "test_util/sync_point.h" -#include "util/log_buffer.h" #include "util/random.h" #include "util/string_util.h" diff --git a/db/compaction/compaction_picker_fifo.cc b/db/compaction/compaction_picker_fifo.cc index ffb5a9f64..1fc6ed113 100644 --- a/db/compaction/compaction_picker_fifo.cc +++ b/db/compaction/compaction_picker_fifo.cc @@ -18,7 +18,7 @@ #include #include #include "db/column_family.h" -#include "util/log_buffer.h" +#include "logging/log_buffer.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/compaction/compaction_picker_level.cc b/db/compaction/compaction_picker_level.cc index aeb368ea2..e9653da8e 100644 --- a/db/compaction/compaction_picker_level.cc +++ b/db/compaction/compaction_picker_level.cc @@ -16,8 +16,8 @@ #include #include "db/compaction/compaction_picker_level.h" +#include "logging/log_buffer.h" #include "test_util/sync_point.h" -#include "util/log_buffer.h" namespace rocksdb { diff --git a/db/compaction/compaction_picker_test.cc b/db/compaction/compaction_picker_test.cc index bab93227a..58a0a12f0 100644 --- a/db/compaction/compaction_picker_test.cc +++ b/db/compaction/compaction_picker_test.cc @@ -12,9 +12,9 @@ #include "db/compaction/compaction_picker_level.h" #include "db/compaction/compaction_picker_universal.h" +#include "logging/logging.h" #include "test_util/testharness.h" #include "test_util/testutil.h" -#include "util/logging.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/compaction/compaction_picker_universal.cc b/db/compaction/compaction_picker_universal.cc index 465245715..e8aca00be 100644 --- a/db/compaction/compaction_picker_universal.cc +++ b/db/compaction/compaction_picker_universal.cc @@ -21,9 +21,9 @@ #include #include "db/column_family.h" #include "file/filename.h" +#include "logging/log_buffer.h" #include "monitoring/statistics.h" #include "test_util/sync_point.h" -#include "util/log_buffer.h" #include "util/random.h" #include "util/string_util.h" diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index 196e38f14..9675e727d 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -56,6 +56,9 @@ #include "file/file_util.h" #include "file/filename.h" #include "file/sst_file_manager_impl.h" +#include "logging/auto_roll_logger.h" +#include "logging/log_buffer.h" +#include "logging/logging.h" #include "memtable/hash_linklist_rep.h" #include "memtable/hash_skiplist_rep.h" #include "monitoring/iostats_context_imp.h" @@ -86,15 +89,12 @@ #include "table/two_level_iterator.h" #include "test_util/sync_point.h" #include "tools/sst_dump_tool_imp.h" -#include "util/auto_roll_logger.h" #include "util/autovector.h" #include "util/build_version.h" #include "util/coding.h" #include "util/compression.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/log_buffer.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/stop_watch.h" #include "util/string_util.h" diff --git a/db/db_impl/db_impl.h b/db/db_impl/db_impl.h index c241a36db..5461ef300 100644 --- a/db/db_impl/db_impl.h +++ b/db/db_impl/db_impl.h @@ -40,6 +40,8 @@ #include "db/wal_manager.h" #include "db/write_controller.h" #include "db/write_thread.h" +#include "db/memtable_list.h" +#include "logging/event_logger.h" #include "monitoring/instrumented_mutex.h" #include "options/db_options.h" #include "port/port.h" @@ -52,7 +54,6 @@ #include "rocksdb/write_buffer_manager.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" -#include "util/event_logger.h" #include "util/hash.h" #include "util/repeatable_thread.h" #include "util/stop_watch.h" diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index a976a5750..34364d124 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -12,8 +12,8 @@ #include "db/db_iter.h" #include "db/merge_context.h" +#include "logging/auto_roll_logger.h" #include "monitoring/perf_context_imp.h" -#include "util/auto_roll_logger.h" namespace rocksdb { diff --git a/db/db_iter.cc b/db/db_iter.cc index d953d365e..bcfed2bb0 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -17,6 +17,7 @@ #include "db/merge_helper.h" #include "db/pinned_iterators_manager.h" #include "file/filename.h" +#include "logging/logging.h" #include "memory/arena.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/env.h" @@ -25,7 +26,6 @@ #include "rocksdb/options.h" #include "table/internal_iterator.h" #include "table/iterator_wrapper.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" #include "util/trace_replay.h" diff --git a/db/dbformat.h b/db/dbformat.h index 437119fb7..dbf6ea6f3 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -14,6 +14,7 @@ #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" @@ -23,7 +24,6 @@ #include "rocksdb/table.h" #include "rocksdb/types.h" #include "util/coding.h" -#include "util/logging.h" #include "util/user_comparator_wrapper.h" namespace rocksdb { diff --git a/db/dbformat_test.cc b/db/dbformat_test.cc index f4665b06c..9ec1bc343 100644 --- a/db/dbformat_test.cc +++ b/db/dbformat_test.cc @@ -8,8 +8,8 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/dbformat.h" +#include "logging/logging.h" #include "test_util/testharness.h" -#include "util/logging.h" namespace rocksdb { diff --git a/db/event_helpers.h b/db/event_helpers.h index ea35b4b5b..88c72cd4e 100644 --- a/db/event_helpers.h +++ b/db/event_helpers.h @@ -10,9 +10,9 @@ #include "db/column_family.h" #include "db/version_edit.h" +#include "logging/event_logger.h" #include "rocksdb/listener.h" #include "rocksdb/table_properties.h" -#include "util/event_logger.h" namespace rocksdb { diff --git a/db/fault_injection_test.cc b/db/fault_injection_test.cc index 126addc80..1d18569f2 100644 --- a/db/fault_injection_test.cc +++ b/db/fault_injection_test.cc @@ -16,6 +16,7 @@ #include "db/version_set.h" #include "env/mock_env.h" #include "file/filename.h" +#include "logging/logging.h" #include "rocksdb/cache.h" #include "rocksdb/db.h" #include "rocksdb/env.h" @@ -25,7 +26,6 @@ #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" -#include "util/logging.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/db/filename_test.cc b/db/filename_test.cc index 377d128fa..bc52e0eae 100644 --- a/db/filename_test.cc +++ b/db/filename_test.cc @@ -10,9 +10,9 @@ #include "file/filename.h" #include "db/dbformat.h" +#include "logging/logging.h" #include "port/port.h" #include "test_util/testharness.h" -#include "util/logging.h" namespace rocksdb { diff --git a/db/flush_job.cc b/db/flush_job.cc index d4ae79ff2..2b2696c10 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -31,6 +31,9 @@ #include "db/version_set.h" #include "file/file_util.h" #include "file/filename.h" +#include "logging/event_logger.h" +#include "logging/log_buffer.h" +#include "logging/logging.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/perf_context_imp.h" #include "monitoring/thread_status_util.h" @@ -47,9 +50,6 @@ #include "table/two_level_iterator.h" #include "test_util/sync_point.h" #include "util/coding.h" -#include "util/event_logger.h" -#include "util/log_buffer.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/stop_watch.h" diff --git a/db/flush_job.h b/db/flush_job.h index c40819456..fdb0917bd 100644 --- a/db/flush_job.h +++ b/db/flush_job.h @@ -28,6 +28,7 @@ #include "db/version_edit.h" #include "db/write_controller.h" #include "db/write_thread.h" +#include "logging/event_logger.h" #include "monitoring/instrumented_mutex.h" #include "options/db_options.h" #include "port/port.h" @@ -37,7 +38,6 @@ #include "rocksdb/transaction_log.h" #include "table/scoped_arena_iterator.h" #include "util/autovector.h" -#include "util/event_logger.h" #include "util/stop_watch.h" #include "util/thread_local.h" diff --git a/db/listener_test.cc b/db/listener_test.cc index 5d8f6eb5e..9fbd5d0d3 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -9,6 +9,7 @@ #include "db/version_set.h" #include "db/write_batch_internal.h" #include "file/filename.h" +#include "logging/logging.h" #include "memtable/hash_linklist_rep.h" #include "monitoring/statistics.h" #include "rocksdb/cache.h" @@ -28,7 +29,6 @@ #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/hash.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/rate_limiter.h" #include "util/string_util.h" diff --git a/db/memtable_list.cc b/db/memtable_list.cc index ca5283139..045bfc9a2 100644 --- a/db/memtable_list.cc +++ b/db/memtable_list.cc @@ -17,6 +17,7 @@ #include "db/memtable.h" #include "db/range_tombstone_fragmenter.h" #include "db/version_set.h" +#include "logging/log_buffer.h" #include "monitoring/thread_status_util.h" #include "rocksdb/db.h" #include "rocksdb/env.h" @@ -24,7 +25,6 @@ #include "table/merging_iterator.h" #include "test_util/sync_point.h" #include "util/coding.h" -#include "util/log_buffer.h" namespace rocksdb { diff --git a/db/memtable_list.h b/db/memtable_list.h index a5f0c1232..a72077ff3 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -17,13 +17,13 @@ #include "db/memtable.h" #include "db/range_del_aggregator.h" #include "file/filename.h" +#include "logging/log_buffer.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/log_buffer.h" namespace rocksdb { diff --git a/db/plain_table_db_test.cc b/db/plain_table_db_test.cc index d2d0426e6..68df71768 100644 --- a/db/plain_table_db_test.cc +++ b/db/plain_table_db_test.cc @@ -16,6 +16,7 @@ #include "db/version_set.h" #include "db/write_batch_internal.h" #include "file/filename.h" +#include "logging/logging.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" #include "rocksdb/db.h" @@ -32,7 +33,6 @@ #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/hash.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" #include "utilities/merge_operators.h" diff --git a/db/version_builder_test.cc b/db/version_builder_test.cc index 630678574..3a144190c 100644 --- a/db/version_builder_test.cc +++ b/db/version_builder_test.cc @@ -6,9 +6,9 @@ #include #include "db/version_edit.h" #include "db/version_set.h" +#include "logging/logging.h" #include "test_util/testharness.h" #include "test_util/testutil.h" -#include "util/logging.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/version_edit.cc b/db/version_edit.cc index 668ff60f1..ecadf6e39 100644 --- a/db/version_edit.cc +++ b/db/version_edit.cc @@ -10,10 +10,10 @@ #include "db/version_edit.h" #include "db/version_set.h" +#include "logging/event_logger.h" #include "rocksdb/slice.h" #include "test_util/sync_point.h" #include "util/coding.h" -#include "util/event_logger.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/version_set_test.cc b/db/version_set_test.cc index 9b4072dc7..77890d826 100644 --- a/db/version_set_test.cc +++ b/db/version_set_test.cc @@ -9,10 +9,10 @@ #include "db/version_set.h" #include "db/log_writer.h" +#include "logging/logging.h" #include "table/mock_table.h" #include "test_util/testharness.h" #include "test_util/testutil.h" -#include "util/logging.h" #include "util/string_util.h" namespace rocksdb { diff --git a/db/wal_manager.cc b/db/wal_manager.cc index 2fe5305f8..71c2ffe4b 100644 --- a/db/wal_manager.cc +++ b/db/wal_manager.cc @@ -24,6 +24,7 @@ #include "db/write_batch_internal.h" #include "file/file_util.h" #include "file/filename.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/options.h" @@ -32,7 +33,6 @@ #include "util/cast_util.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" diff --git a/env/env_hdfs.cc b/env/env_hdfs.cc index 9d0354cce..5bdf03ae3 100644 --- a/env/env_hdfs.cc +++ b/env/env_hdfs.cc @@ -17,8 +17,8 @@ #include #include #include +#include "logging/logging.h" #include "rocksdb/status.h" -#include "util/logging.h" #include "util/string_util.h" #define HDFS_EXISTS 0 diff --git a/env/env_posix.cc b/env/env_posix.cc index bf1a9e0e5..7eb5b7c14 100644 --- a/env/env_posix.cc +++ b/env/env_posix.cc @@ -43,7 +43,8 @@ #include #include "env/io_posix.h" -#include "env/posix_logger.h" +#include "logging/logging.h" +#include "logging/posix_logger.h" #include "monitoring/iostats_context_imp.h" #include "monitoring/thread_status_updater.h" #include "port/port.h" @@ -52,7 +53,6 @@ #include "test_util/sync_point.h" #include "util/coding.h" #include "util/compression_context_cache.h" -#include "util/logging.h" #include "util/random.h" #include "util/string_util.h" #include "util/thread_local.h" diff --git a/env/env_test.cc b/env/env_test.cc index 615eca8b4..e8cb9b245 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -38,13 +38,13 @@ #endif #include "env/env_chroot.h" +#include "logging/log_buffer.h" #include "port/port.h" #include "rocksdb/env.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/coding.h" -#include "util/log_buffer.h" #include "util/mutexlock.h" #include "util/string_util.h" diff --git a/env/io_posix.cc b/env/io_posix.cc index 313cbd8ee..8b42a6362 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -27,7 +27,7 @@ #include #include #endif -#include "env/posix_logger.h" +#include "logging/posix_logger.h" #include "monitoring/iostats_context_imp.h" #include "port/port.h" #include "rocksdb/slice.h" diff --git a/file/delete_scheduler.cc b/file/delete_scheduler.cc index 22f28f537..b66956ca0 100644 --- a/file/delete_scheduler.cc +++ b/file/delete_scheduler.cc @@ -11,10 +11,10 @@ #include #include "file/sst_file_manager_impl.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/env.h" #include "test_util/sync_point.h" -#include "util/logging.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/file/filename.cc b/file/filename.cc index 77d9569d3..c9f22e585 100644 --- a/file/filename.cc +++ b/file/filename.cc @@ -16,10 +16,10 @@ #include #include #include +#include "logging/logging.h" #include "rocksdb/env.h" #include "test_util/sync_point.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/stop_watch.h" #include "util/string_util.h" diff --git a/java/rocksjni/write_batch.cc b/java/rocksjni/write_batch.cc index f1b77446c..c6d0b9072 100644 --- a/java/rocksjni/write_batch.cc +++ b/java/rocksjni/write_batch.cc @@ -11,6 +11,7 @@ #include "db/write_batch_internal.h" #include "include/org_rocksdb_WriteBatch.h" #include "include/org_rocksdb_WriteBatch_Handler.h" +#include "logging/logging.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/memtablerep.h" @@ -20,7 +21,6 @@ #include "rocksjni/portal.h" #include "rocksjni/writebatchhandlerjnicallback.h" #include "table/scoped_arena_iterator.h" -#include "util/logging.h" /* * Class: org_rocksdb_WriteBatch diff --git a/util/auto_roll_logger.cc b/logging/auto_roll_logger.cc similarity index 99% rename from util/auto_roll_logger.cc rename to logging/auto_roll_logger.cc index 9e8d67503..ec240f5a3 100644 --- a/util/auto_roll_logger.cc +++ b/logging/auto_roll_logger.cc @@ -3,10 +3,11 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#include "util/auto_roll_logger.h" +#include "logging/auto_roll_logger.h" + #include #include "file/filename.h" -#include "util/logging.h" +#include "logging/logging.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/util/auto_roll_logger.h b/logging/auto_roll_logger.h similarity index 100% rename from util/auto_roll_logger.h rename to logging/auto_roll_logger.h diff --git a/util/auto_roll_logger_test.cc b/logging/auto_roll_logger_test.cc similarity index 99% rename from util/auto_roll_logger_test.cc rename to logging/auto_roll_logger_test.cc index ff47719d4..cce98d374 100644 --- a/util/auto_roll_logger_test.cc +++ b/logging/auto_roll_logger_test.cc @@ -6,7 +6,7 @@ #ifndef ROCKSDB_LITE -#include "util/auto_roll_logger.h" +#include "logging/auto_roll_logger.h" #include #include #include @@ -17,11 +17,11 @@ #include #include #include +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/db.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" -#include "util/logging.h" namespace rocksdb { namespace { diff --git a/util/event_logger.cc b/logging/event_logger.cc similarity index 96% rename from util/event_logger.cc rename to logging/event_logger.cc index b488984f3..aceccdf93 100644 --- a/util/event_logger.cc +++ b/logging/event_logger.cc @@ -7,14 +7,14 @@ #define __STDC_FORMAT_MACROS #endif -#include "util/event_logger.h" +#include "logging/event_logger.h" #include #include #include #include -#include "util/logging.h" +#include "logging/logging.h" #include "util/string_util.h" namespace rocksdb { diff --git a/util/event_logger.h b/logging/event_logger.h similarity index 99% rename from util/event_logger.h rename to logging/event_logger.h index d88a6a4fe..c3a7c30c6 100644 --- a/util/event_logger.h +++ b/logging/event_logger.h @@ -10,8 +10,8 @@ #include #include +#include "logging/log_buffer.h" #include "rocksdb/env.h" -#include "util/log_buffer.h" namespace rocksdb { diff --git a/util/event_logger_test.cc b/logging/event_logger_test.cc similarity index 97% rename from util/event_logger_test.cc rename to logging/event_logger_test.cc index 1ee0c4d97..cc635d42f 100644 --- a/util/event_logger_test.cc +++ b/logging/event_logger_test.cc @@ -5,8 +5,8 @@ #include +#include "logging/event_logger.h" #include "test_util/testharness.h" -#include "util/event_logger.h" namespace rocksdb { diff --git a/util/log_buffer.cc b/logging/log_buffer.cc similarity index 98% rename from util/log_buffer.cc rename to logging/log_buffer.cc index d09e0cb00..74db11c66 100644 --- a/util/log_buffer.cc +++ b/logging/log_buffer.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/log_buffer.h" +#include "logging/log_buffer.h" #include "port/sys_time.h" #include "port/port.h" diff --git a/util/log_buffer.h b/logging/log_buffer.h similarity index 100% rename from util/log_buffer.h rename to logging/log_buffer.h diff --git a/util/logging.h b/logging/logging.h similarity index 98% rename from util/logging.h rename to logging/logging.h index a4ef31bd6..cad90a309 100644 --- a/util/logging.h +++ b/logging/logging.h @@ -19,7 +19,7 @@ inline const char* RocksLogShorterFileName(const char* file) { - // 15 is the length of "util/logging.h". + // 15 is the length of "logging/logging.h". // If the name of this file changed, please change this number, too. return file + (sizeof(__FILE__) > 15 ? sizeof(__FILE__) - 15 : 0); } diff --git a/env/posix_logger.h b/logging/posix_logger.h similarity index 100% rename from env/posix_logger.h rename to logging/posix_logger.h diff --git a/memory/arena.cc b/memory/arena.cc index b77422553..3f113e776 100644 --- a/memory/arena.cc +++ b/memory/arena.cc @@ -19,10 +19,10 @@ #include #endif #include +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/env.h" #include "test_util/sync_point.h" -#include "util/logging.h" namespace rocksdb { diff --git a/options/db_options.cc b/options/db_options.cc index e180238f4..72e348b32 100644 --- a/options/db_options.cc +++ b/options/db_options.cc @@ -11,12 +11,12 @@ #include +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/cache.h" #include "rocksdb/env.h" #include "rocksdb/sst_file_manager.h" #include "rocksdb/wal_filter.h" -#include "util/logging.h" namespace rocksdb { diff --git a/port/port_posix.cc b/port/port_posix.cc index 80081e480..f19d18ff0 100644 --- a/port/port_posix.cc +++ b/port/port_posix.cc @@ -18,11 +18,11 @@ #include #include #include -#include #include +#include #include #include -#include "util/logging.h" +#include "logging/logging.h" namespace rocksdb { diff --git a/port/util_logger.h b/port/util_logger.h index ba424705b..d2d62a987 100644 --- a/port/util_logger.h +++ b/port/util_logger.h @@ -14,7 +14,7 @@ // of what the new port_.h file must provide. #if defined(ROCKSDB_PLATFORM_POSIX) -#include "env/posix_logger.h" +#include "logging/posix_logger.h" #elif defined(OS_WIN) #include "port/win/win_logger.h" #endif diff --git a/port/win/port_win.cc b/port/win/port_win.cc index 03ba6ef42..31e65e78c 100644 --- a/port/win/port_win.cc +++ b/port/win/port_win.cc @@ -33,7 +33,7 @@ #include #endif -#include "util/logging.h" +#include "logging/logging.h" namespace rocksdb { diff --git a/src.mk b/src.mk index 5021acb96..38835f8c6 100644 --- a/src.mk +++ b/src.mk @@ -72,6 +72,9 @@ LIB_SOURCES = \ file/file_util.cc \ file/filename.cc \ file/sst_file_manager_impl.cc \ + logging/auto_roll_logger.cc \ + logging/event_logger.cc \ + logging/log_buffer.cc \ memory/arena.cc \ memory/concurrent_arena.cc \ memory/jemalloc_nodump_allocator.cc \ @@ -139,7 +142,6 @@ LIB_SOURCES = \ test_util/sync_point_impl.cc \ test_util/transaction_test_util.cc \ tools/dump/db_dump_tool.cc \ - util/auto_roll_logger.cc \ util/bloom.cc \ util/build_version.cc \ util/coding.cc \ @@ -149,11 +151,9 @@ LIB_SOURCES = \ util/concurrent_task_limiter_impl.cc \ util/crc32c.cc \ util/dynamic_bloom.cc \ - util/event_logger.cc \ util/file_reader_writer.cc \ util/filter_policy.cc \ util/hash.cc \ - util/log_buffer.cc \ util/murmurhash.cc \ util/random.cc \ util/rate_limiter.cc \ @@ -340,6 +340,8 @@ MAIN_SOURCES = \ env/env_basic_test.cc \ env/env_test.cc \ env/mock_env_test.cc \ + logging/auto_roll_logger_test.cc \ + logging/event_logger_test.cc \ memory/arena_test.cc \ memtable/inlineskiplist_test.cc \ memtable/memtablerep_bench.cc \ @@ -369,13 +371,11 @@ MAIN_SOURCES = \ tools/reduce_levels_test.cc \ tools/sst_dump_test.cc \ tools/trace_analyzer_test.cc \ - util/auto_roll_logger_test.cc \ util/autovector_test.cc \ util/bloom_test.cc \ util/coding_test.cc \ util/crc32c_test.cc \ util/dynamic_bloom_test.cc \ - util/event_logger_test.cc \ util/filelock_test.cc \ util/log_write_bench.cc \ util/rate_limiter_test.cc \ diff --git a/table/block_based/block.cc b/table/block_based/block.cc index dfc4aa3c6..6c7e46d59 100644 --- a/table/block_based/block.cc +++ b/table/block_based/block.cc @@ -15,6 +15,7 @@ #include #include +#include "logging/logging.h" #include "monitoring/perf_context_imp.h" #include "port/port.h" #include "port/stack_trace.h" @@ -23,7 +24,6 @@ #include "table/block_based/data_block_footer.h" #include "table/format.h" #include "util/coding.h" -#include "util/logging.h" namespace rocksdb { diff --git a/table/block_based/partitioned_filter_block_test.cc b/table/block_based/partitioned_filter_block_test.cc index 9a1a4d526..70e5bbd3b 100644 --- a/table/block_based/partitioned_filter_block_test.cc +++ b/table/block_based/partitioned_filter_block_test.cc @@ -11,11 +11,11 @@ #include "table/full_filter_bits_builder.h" #include "index_builder.h" +#include "logging/logging.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/coding.h" #include "util/hash.h" -#include "util/logging.h" namespace rocksdb { diff --git a/table/block_fetcher.cc b/table/block_fetcher.cc index 263abbfcf..72b567fc2 100644 --- a/table/block_fetcher.cc +++ b/table/block_fetcher.cc @@ -12,6 +12,7 @@ #include #include +#include "logging/logging.h" #include "memory/memory_allocator.h" #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" @@ -24,7 +25,6 @@ #include "util/compression.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/xxhash.h" diff --git a/table/format.cc b/table/format.cc index 3f95fd4d4..a4441fe56 100644 --- a/table/format.cc +++ b/table/format.cc @@ -13,6 +13,7 @@ #include #include "block_fetcher.h" +#include "logging/logging.h" #include "memory/memory_allocator.h" #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" @@ -24,7 +25,6 @@ #include "util/compression.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/xxhash.h" diff --git a/test_util/transaction_test_util.cc b/test_util/transaction_test_util.cc index 14d390651..3a7d9e97f 100644 --- a/test_util/transaction_test_util.cc +++ b/test_util/transaction_test_util.cc @@ -24,7 +24,7 @@ #include "db/dbformat.h" #include "db/snapshot_impl.h" -#include "util/logging.h" +#include "logging/logging.h" #include "util/random.h" #include "util/string_util.h" diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 0c828deb1..dc8f81523 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -47,6 +47,7 @@ int main() { #include "db/db_impl/db_impl.h" #include "db/version_set.h" #include "hdfs/env_hdfs.h" +#include "logging/logging.h" #include "monitoring/histogram.h" #include "options/options_helper.h" #include "port/port.h" @@ -66,7 +67,6 @@ int main() { #include "util/compression.h" #include "util/crc32c.h" #include "util/gflags_compat.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/random.h" #include "util/string_util.h" diff --git a/util/bloom_test.cc b/util/bloom_test.cc index 7a1372830..5e61f31ba 100644 --- a/util/bloom_test.cc +++ b/util/bloom_test.cc @@ -17,13 +17,13 @@ int main() { #include +#include "logging/logging.h" #include "memory/arena.h" #include "rocksdb/filter_policy.h" #include "table/full_filter_bits_builder.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/gflags_compat.h" -#include "util/logging.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; diff --git a/util/comparator.cc b/util/comparator.cc index b42c23725..eab17ebcc 100644 --- a/util/comparator.cc +++ b/util/comparator.cc @@ -7,13 +7,13 @@ // 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 "rocksdb/comparator.h" +#include #include #include -#include -#include "rocksdb/comparator.h" -#include "rocksdb/slice.h" +#include "logging/logging.h" #include "port/port.h" -#include "util/logging.h" +#include "rocksdb/slice.h" namespace rocksdb { diff --git a/util/dynamic_bloom_test.cc b/util/dynamic_bloom_test.cc index 036e01280..7ca8bb891 100644 --- a/util/dynamic_bloom_test.cc +++ b/util/dynamic_bloom_test.cc @@ -24,12 +24,12 @@ int main() { #include #include "dynamic_bloom.h" +#include "logging/logging.h" #include "memory/arena.h" #include "port/port.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "util/gflags_compat.h" -#include "util/logging.h" #include "util/stop_watch.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index dcd88ffdb..7a2e19403 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -11,6 +11,7 @@ #include "rocksdb/utilities/backupable_db.h" #include "file/filename.h" +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/rate_limiter.h" #include "rocksdb/transaction_log.h" @@ -19,7 +20,6 @@ #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/string_util.h" #include "utilities/checkpoint/checkpoint_impl.h" diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index 7f447a04a..25583fa98 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.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 "monitoring/instrumented_mutex.h" #include "monitoring/statistics.h" #include "rocksdb/convenience.h" @@ -31,7 +32,6 @@ #include "util/cast_util.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" -#include "util/logging.h" #include "util/mutexlock.h" #include "util/random.h" #include "util/stop_watch.h" diff --git a/utilities/blob_db/blob_db_impl_filesnapshot.cc b/utilities/blob_db/blob_db_impl_filesnapshot.cc index 16b9ff826..e74396a33 100644 --- a/utilities/blob_db/blob_db_impl_filesnapshot.cc +++ b/utilities/blob_db/blob_db_impl_filesnapshot.cc @@ -8,7 +8,7 @@ #include "utilities/blob_db/blob_db_impl.h" #include "file/filename.h" -#include "util/logging.h" +#include "logging/logging.h" #include "util/mutexlock.h" // BlobDBImpl methods to get snapshot of files, e.g. for replication. diff --git a/utilities/blob_db/blob_file.cc b/utilities/blob_db/blob_file.cc index 4475772d8..03cff7834 100644 --- a/utilities/blob_db/blob_file.cc +++ b/utilities/blob_db/blob_file.cc @@ -21,7 +21,7 @@ #include "db/db_impl/db_impl.h" #include "db/dbformat.h" #include "file/filename.h" -#include "util/logging.h" +#include "logging/logging.h" #include "utilities/blob_db/blob_db_impl.h" namespace rocksdb { diff --git a/utilities/merge_operators/uint64add.cc b/utilities/merge_operators/uint64add.cc index b998e1b8e..e71ecfd9a 100644 --- a/utilities/merge_operators/uint64add.cc +++ b/utilities/merge_operators/uint64add.cc @@ -5,11 +5,11 @@ #include +#include "logging/logging.h" #include "rocksdb/env.h" #include "rocksdb/merge_operator.h" #include "rocksdb/slice.h" #include "util/coding.h" -#include "util/logging.h" #include "utilities/merge_operators.h" using namespace rocksdb; diff --git a/utilities/persistent_cache/block_cache_tier.cc b/utilities/persistent_cache/block_cache_tier.cc index 5baf64772..2169f9069 100644 --- a/utilities/persistent_cache/block_cache_tier.cc +++ b/utilities/persistent_cache/block_cache_tier.cc @@ -10,9 +10,9 @@ #include #include +#include "logging/logging.h" #include "port/port.h" #include "test_util/sync_point.h" -#include "util/logging.h" #include "util/stop_watch.h" #include "utilities/persistent_cache/block_cache_tier_file.h" diff --git a/utilities/persistent_cache/block_cache_tier_file.cc b/utilities/persistent_cache/block_cache_tier_file.cc index ce6335fb5..0fb17b369 100644 --- a/utilities/persistent_cache/block_cache_tier_file.cc +++ b/utilities/persistent_cache/block_cache_tier_file.cc @@ -13,9 +13,9 @@ #include #include +#include "logging/logging.h" #include "port/port.h" #include "util/crc32c.h" -#include "util/logging.h" namespace rocksdb { diff --git a/utilities/transactions/optimistic_transaction_test.cc b/utilities/transactions/optimistic_transaction_test.cc index 4f075d0d9..5e1af2fb1 100644 --- a/utilities/transactions/optimistic_transaction_test.cc +++ b/utilities/transactions/optimistic_transaction_test.cc @@ -9,6 +9,7 @@ #include #include +#include "logging/logging.h" #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/utilities/optimistic_transaction_db.h" @@ -16,7 +17,6 @@ #include "test_util/testharness.h" #include "test_util/transaction_test_util.h" #include "util/crc32c.h" -#include "util/logging.h" #include "util/random.h" using std::string;