From 8843129ecef255a70f186e095063b4e79b2b0c73 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Thu, 30 May 2019 17:39:43 -0700 Subject: [PATCH] Move some memory related files from util/ to memory/ (#5382) Summary: Move arena, allocator, and memory tools under util to a separate memory/ directory. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5382 Differential Revision: D15564655 Pulled By: siying fbshipit-source-id: 9cd6b5d0d3d52b39606e19221fa154596e5852a5 --- CMakeLists.txt | 8 +- Makefile | 2 +- TARGETS | 10 +- cache/cache_test.cc | 2 +- db/builder.cc | 2 +- db/column_family_test.cc | 4 +- db/compact_files_test.cc | 2 +- db/compaction.cc | 2 +- db/compaction.h | 2 +- db/compaction_iterator_test.cc | 2 +- db/compaction_job.cc | 2 +- db/compaction_job_stats_test.cc | 6 +- db/compaction_job_test.cc | 4 +- db/compaction_picker.cc | 2 +- db/compaction_picker_test.cc | 4 +- db/compaction_picker_universal.cc | 2 +- db/comparator_db_test.cc | 4 +- db/corruption_test.cc | 3 +- db/cuckoo_table_db_test.cc | 2 +- db/db_compaction_test.cc | 2 +- db/db_filesnapshot.cc | 2 +- db/db_impl.cc | 2 +- db/db_impl_compaction_flush.cc | 2 +- db/db_impl_open.cc | 2 +- db/db_iter.cc | 2 +- db/db_iter.h | 2 +- db/db_iter_stress_test.cc | 2 +- db/db_iter_test.cc | 2 +- db/db_options_test.cc | 2 +- db/db_test.cc | 6 +- db/db_test_util.h | 4 +- db/db_write_test.cc | 2 +- db/dbformat_test.cc | 2 +- db/deletefile_test.cc | 2 +- db/external_sst_file_ingestion_job.cc | 2 +- db/fault_injection_test.cc | 4 +- db/file_indexer.h | 2 +- db/file_indexer_test.cc | 2 +- db/filename_test.cc | 2 +- db/flush_job.cc | 2 +- db/flush_job_test.cc | 4 +- db/forward_iterator.cc | 2 +- db/forward_iterator.h | 4 +- db/forward_iterator_bench.cc | 2 +- db/listener_test.cc | 7 +- db/log_test.cc | 4 +- db/manual_compaction_test.cc | 4 +- db/memtable.cc | 4 +- db/memtable.h | 4 +- db/memtable_list.cc | 2 +- db/memtable_list_test.cc | 2 +- db/merge_helper_test.cc | 2 +- db/merge_test.cc | 8 +- db/obsolete_files_test.cc | 2 +- db/perf_context_test.cc | 2 +- db/plain_table_db_test.cc | 4 +- db/prefix_test.cc | 2 +- db/range_del_aggregator_bench.cc | 2 +- db/table_cache.cc | 2 +- db/table_properties_collector_test.cc | 6 +- db/version_builder_test.cc | 4 +- db/version_edit.cc | 2 +- db/version_edit.h | 6 +- db/version_edit_test.cc | 2 +- db/version_set.cc | 2 +- db/version_set_test.cc | 4 +- db/wal_manager.cc | 2 +- db/wal_manager_test.cc | 4 +- db/write_batch_test.cc | 2 +- db/write_callback_test.cc | 4 +- db/write_thread.cc | 2 +- env/env.cc | 2 +- env/env_posix.cc | 2 +- env/env_test.cc | 6 +- env/io_posix.cc | 2 +- file/delete_scheduler.cc | 2 +- file/delete_scheduler_test.cc | 2 +- file/filename.cc | 2 +- file/sst_file_manager_impl.cc | 2 +- java/rocksjni/write_batch_test.cc | 2 +- {util => memory}/allocator.h | 0 {util => memory}/arena.cc | 4 +- {util => memory}/arena.h | 8 +- {util => memory}/arena_test.cc | 4 +- {util => memory}/concurrent_arena.cc | 2 +- {util => memory}/concurrent_arena.h | 4 +- {util => memory}/jemalloc_nodump_allocator.cc | 2 +- {util => memory}/jemalloc_nodump_allocator.h | 0 {util => memory}/memory_allocator.h | 0 {util => memory}/memory_usage.h | 0 memtable/alloc_tracker.cc | 4 +- memtable/hash_linklist_rep.cc | 2 +- memtable/hash_skiplist_rep.cc | 8 +- memtable/inlineskiplist.h | 2 +- memtable/inlineskiplist_test.cc | 4 +- memtable/memtablerep_bench.cc | 4 +- memtable/skiplist.h | 4 +- memtable/skiplist_test.cc | 4 +- memtable/skiplistrep.cc | 4 +- memtable/vectorrep.cc | 2 +- options/options_helper.cc | 2 +- options/options_parser.cc | 2 +- options/options_test.cc | 4 +- port/win/env_default.cc | 2 +- port/win/io_win.cc | 2 +- src.mk | 8 +- table/block_based/block.h | 4 +- .../block_based_filter_block_test.cc | 4 +- .../block_based/block_based_table_builder.cc | 5 +- table/block_based/block_based_table_builder.h | 2 +- .../block_based/block_based_table_factory.cc | 2 +- table/block_based/block_based_table_reader.cc | 178 ++++++++---------- table/block_based/block_based_table_reader.h | 24 +-- table/block_based/block_prefix_index.cc | 2 +- table/block_based/block_test.cc | 2 +- .../block_based/data_block_hash_index_test.cc | 1 - table/block_based/filter_block.h | 2 +- table/block_based/full_filter_block.h | 4 +- table/block_based/full_filter_block_test.cc | 4 +- table/block_based/index_builder.cc | 2 +- table/block_based/partitioned_filter_block.h | 2 +- .../partitioned_filter_block_test.cc | 7 +- table/block_fetcher.cc | 2 +- table/block_fetcher.h | 2 +- table/cuckoo/cuckoo_table_builder_test.cc | 4 +- table/cuckoo/cuckoo_table_reader.cc | 6 +- table/cuckoo/cuckoo_table_reader_test.cc | 6 +- table/format.cc | 2 +- table/format.h | 2 +- table/get_context.h | 2 +- table/iterator.cc | 2 +- table/merging_iterator.cc | 4 +- table/meta_blocks.cc | 2 +- table/mock_table.h | 4 +- table/plain/plain_table_builder.cc | 6 +- table/plain/plain_table_index.h | 2 +- table/plain/plain_table_key_coding.cc | 2 +- table/plain/plain_table_key_coding.h | 2 +- table/plain/plain_table_reader.cc | 8 +- table/plain/plain_table_reader.h | 4 +- table/sst_file_writer.cc | 2 +- table/table_reader_bench.cc | 4 +- table/table_test.cc | 6 +- table/two_level_iterator.cc | 2 +- tools/db_bench_tool.cc | 4 +- tools/db_bench_tool_test.cc | 2 +- tools/db_repl_stress.cc | 2 +- tools/db_stress.cc | 9 +- tools/reduce_levels_test.cc | 4 +- tools/sst_dump_test.cc | 2 +- tools/trace_analyzer_test.cc | 2 +- util/auto_roll_logger.h | 2 +- util/auto_roll_logger_test.cc | 2 +- util/autovector_test.cc | 4 +- util/bloom.cc | 2 +- util/bloom_test.cc | 6 +- util/compression.h | 2 +- util/dynamic_bloom.cc | 2 +- util/dynamic_bloom_test.cc | 6 +- util/event_logger_test.cc | 2 +- util/file_reader_writer.cc | 2 +- util/file_reader_writer.h | 2 +- util/file_reader_writer_test.cc | 2 +- util/filelock_test.cc | 4 +- util/hash_test.cc | 2 +- util/log_buffer.h | 6 +- util/log_write_bench.cc | 4 +- util/rate_limiter.cc | 2 +- util/rate_limiter_test.cc | 2 +- util/repeatable_thread_test.cc | 2 +- util/thread_local_test.cc | 4 +- utilities/backupable/backupable_db.cc | 2 +- utilities/backupable/backupable_db_test.cc | 6 +- utilities/blob_db/blob_db_impl.cc | 2 +- utilities/blob_db/blob_db_test.cc | 6 +- .../cassandra/cassandra_functional_test.cc | 4 +- utilities/cassandra/format.h | 2 +- utilities/memory/memory_test.cc | 2 +- .../string_append/stringappend_test.cc | 4 +- utilities/options/options_util_test.cc | 2 +- .../persistent_cache/block_cache_tier.cc | 2 +- utilities/persistent_cache/block_cache_tier.h | 2 +- .../block_cache_tier_file_buffer.h | 2 +- utilities/persistent_cache/hash_table_test.cc | 4 +- .../persistent_cache/persistent_cache_test.h | 4 +- .../optimistic_transaction_test.cc | 6 +- .../transactions/pessimistic_transaction.cc | 2 +- .../pessimistic_transaction_db.cc | 2 +- .../transactions/transaction_lock_mgr.cc | 2 +- utilities/transactions/transaction_test.cc | 4 +- utilities/transactions/transaction_test.h | 4 +- .../write_prepared_transaction_test.cc | 6 +- .../transactions/write_prepared_txn_db.cc | 2 +- utilities/ttl/ttl_test.cc | 2 +- .../write_batch_with_index.cc | 2 +- .../write_batch_with_index_test.cc | 6 +- 196 files changed, 397 insertions(+), 413 deletions(-) rename {util => memory}/allocator.h (100%) rename {util => memory}/arena.cc (99%) rename {util => memory}/arena.h (99%) rename {util => memory}/arena_test.cc (99%) rename {util => memory}/concurrent_arena.cc (97%) rename {util => memory}/concurrent_arena.h (99%) rename {util => memory}/jemalloc_nodump_allocator.cc (99%) rename {util => memory}/jemalloc_nodump_allocator.h (100%) rename {util => memory}/memory_allocator.h (100%) rename {util => memory}/memory_usage.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5614c83b4..c4dc2500f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -542,6 +542,9 @@ set(SOURCES file/file_util.cc file/filename.cc file/sst_file_manager_impl.cc + memory/arena.cc + memory/concurrent_arena.cc + memory/jemalloc_nodump_allocator.cc memtable/alloc_tracker.cc memtable/hash_linklist_rep.cc memtable/hash_skiplist_rep.cc @@ -610,14 +613,12 @@ set(SOURCES tools/ldb_tool.cc tools/sst_dump_tool.cc tools/trace_analyzer_tool.cc - util/arena.cc util/auto_roll_logger.cc util/bloom.cc util/coding.cc util/compaction_job_stats_impl.cc util/comparator.cc util/compression_context_cache.cc - util/concurrent_arena.cc util/concurrent_task_limiter_impl.cc util/crc32c.cc util/dynamic_bloom.cc @@ -625,7 +626,6 @@ set(SOURCES util/file_reader_writer.cc util/filter_policy.cc util/hash.cc - util/jemalloc_nodump_allocator.cc util/log_buffer.cc util/murmurhash.cc util/random.cc @@ -932,6 +932,7 @@ if(WITH_TESTS) env/env_test.cc env/mock_env_test.cc file/delete_scheduler_test.cc + memory/arena_test.cc memtable/inlineskiplist_test.cc memtable/skiplist_test.cc memtable/write_buffer_manager_test.cc @@ -955,7 +956,6 @@ if(WITH_TESTS) tools/reduce_levels_test.cc tools/sst_dump_test.cc tools/trace_analyzer_test.cc - util/arena_test.cc util/auto_roll_logger_test.cc util/autovector_test.cc util/bloom_test.cc diff --git a/Makefile b/Makefile index d41192ab2..244b929c4 100644 --- a/Makefile +++ b/Makefile @@ -1127,7 +1127,7 @@ db_sanity_test: tools/db_sanity_test.o $(LIBOBJECTS) $(TESTUTIL) db_repl_stress: tools/db_repl_stress.o $(LIBOBJECTS) $(TESTUTIL) $(AM_LINK) -arena_test: util/arena_test.o $(LIBOBJECTS) $(TESTHARNESS) +arena_test: memory/arena_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) autovector_test: util/autovector_test.o $(LIBOBJECTS) $(TESTHARNESS) diff --git a/TARGETS b/TARGETS index 70d6e2194..a59af2fa6 100644 --- a/TARGETS +++ b/TARGETS @@ -147,6 +147,9 @@ cpp_library( "file/file_util.cc", "file/filename.cc", "file/sst_file_manager_impl.cc", + "memory/arena.cc", + "memory/concurrent_arena.cc", + "memory/jemalloc_nodump_allocator.cc", "memtable/alloc_tracker.cc", "memtable/hash_linklist_rep.cc", "memtable/hash_skiplist_rep.cc", @@ -181,8 +184,8 @@ cpp_library( "table/block_based/block_based_table_reader.cc", "table/block_based/block_builder.cc", "table/block_based/block_prefix_index.cc", - "table/block_based/data_block_hash_index.cc", "table/block_based/data_block_footer.cc", + "table/block_based/data_block_hash_index.cc", "table/block_based/flush_block_policy.cc", "table/block_based/full_filter_block.cc", "table/block_based/index_builder.cc", @@ -214,7 +217,6 @@ cpp_library( "tools/ldb_cmd.cc", "tools/ldb_tool.cc", "tools/sst_dump_tool.cc", - "util/arena.cc", "util/auto_roll_logger.cc", "util/bloom.cc", "util/build_version.cc", @@ -222,7 +224,6 @@ cpp_library( "util/compaction_job_stats_impl.cc", "util/comparator.cc", "util/compression_context_cache.cc", - "util/concurrent_arena.cc", "util/concurrent_task_limiter_impl.cc", "util/crc32c.cc", "util/dynamic_bloom.cc", @@ -230,7 +231,6 @@ cpp_library( "util/file_reader_writer.cc", "util/filter_policy.cc", "util/hash.cc", - "util/jemalloc_nodump_allocator.cc", "util/log_buffer.cc", "util/murmurhash.cc", "util/random.cc", @@ -353,7 +353,7 @@ cpp_library( ROCKS_TESTS = [ [ "arena_test", - "util/arena_test.cc", + "memory/arena_test.cc", "serial", ], [ diff --git a/cache/cache_test.cc b/cache/cache_test.cc index 377ae1468..0cc3d5595 100644 --- a/cache/cache_test.cc +++ b/cache/cache_test.cc @@ -16,9 +16,9 @@ #include #include "cache/clock_cache.h" #include "cache/lru_cache.h" +#include "test_util/testharness.h" #include "util/coding.h" #include "util/string_util.h" -#include "test_util/testharness.h" namespace rocksdb { diff --git a/db/builder.cc b/db/builder.cc index 14160f64c..86aac02ab 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -32,9 +32,9 @@ #include "table/block_based/block_based_table_builder.h" #include "table/format.h" #include "table/internal_iterator.h" +#include "test_util/sync_point.h" #include "util/file_reader_writer.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/column_family_test.cc b/db/column_family_test.cc index f5d57c35b..21b3321be 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -20,12 +20,12 @@ #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" -#include "util/coding.h" #include "test_util/fault_injection_test_env.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/coding.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/compact_files_test.cc b/db/compact_files_test.cc index b97fd064e..438fdb7c9 100644 --- a/db/compact_files_test.cc +++ b/db/compact_files_test.cc @@ -14,9 +14,9 @@ #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/compaction.cc b/db/compaction.cc index 00ebd28b0..089dd6684 100644 --- a/db/compaction.cc +++ b/db/compaction.cc @@ -18,8 +18,8 @@ #include "db/column_family.h" #include "rocksdb/compaction_filter.h" -#include "util/string_util.h" #include "test_util/sync_point.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/compaction.h b/db/compaction.h index e9ded6325..598b08e7c 100644 --- a/db/compaction.h +++ b/db/compaction.h @@ -9,8 +9,8 @@ #pragma once #include "db/version_set.h" +#include "memory/arena.h" #include "options/cf_options.h" -#include "util/arena.h" #include "util/autovector.h" namespace rocksdb { diff --git a/db/compaction_iterator_test.cc b/db/compaction_iterator_test.cc index b0a553136..99bb026b5 100644 --- a/db/compaction_iterator_test.cc +++ b/db/compaction_iterator_test.cc @@ -9,9 +9,9 @@ #include #include "port/port.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 9e22e161f..92a6fab8d 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -53,6 +53,7 @@ #include "table/block_based/block_based_table_factory.h" #include "table/merging_iterator.h" #include "table/table_builder.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/file_reader_writer.h" #include "util/log_buffer.h" @@ -61,7 +62,6 @@ #include "util/random.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/compaction_job_stats_test.cc b/db/compaction_job_stats_test.cc index daf413866..35c1100f9 100644 --- a/db/compaction_job_stats_test.cc +++ b/db/compaction_job_stats_test.cc @@ -52,15 +52,15 @@ #include "table/mock_table.h" #include "table/plain/plain_table_factory.h" #include "table/scoped_arena_iterator.h" +#include "test_util/sync_point.h" +#include "test_util/testharness.h" +#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" -#include "test_util/sync_point.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators.h" #if !defined(IOS_CROSS_COMPILE) diff --git a/db/compaction_job_test.cc b/db/compaction_job_test.cc index 4608cceea..93e55b7a0 100644 --- a/db/compaction_job_test.cc +++ b/db/compaction_job_test.cc @@ -25,10 +25,10 @@ #include "rocksdb/options.h" #include "rocksdb/write_buffer_manager.h" #include "table/mock_table.h" -#include "util/file_reader_writer.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index c01f2884d..b25f6cb08 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -22,10 +22,10 @@ #include "db/column_family.h" #include "file/filename.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" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/compaction_picker_test.cc b/db/compaction_picker_test.cc index 82fc16f4f..dd33009eb 100644 --- a/db/compaction_picker_test.cc +++ b/db/compaction_picker_test.cc @@ -12,10 +12,10 @@ #include "db/compaction_picker_fifo.h" #include "db/compaction_picker_universal.h" -#include "util/logging.h" -#include "util/string_util.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_picker_universal.cc b/db/compaction_picker_universal.cc index b8d23795f..20edd3074 100644 --- a/db/compaction_picker_universal.cc +++ b/db/compaction_picker_universal.cc @@ -22,10 +22,10 @@ #include "db/column_family.h" #include "file/filename.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" -#include "test_util/sync_point.h" namespace rocksdb { namespace { diff --git a/db/comparator_db_test.cc b/db/comparator_db_test.cc index ba7042049..de55c706a 100644 --- a/db/comparator_db_test.cc +++ b/db/comparator_db_test.cc @@ -9,11 +9,11 @@ #include "memtable/stl_wrappers.h" #include "rocksdb/db.h" #include "rocksdb/env.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/hash.h" #include "util/kv_map.h" #include "util/string_util.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators.h" using std::unique_ptr; diff --git a/db/corruption_test.cc b/db/corruption_test.cc index 130821ff9..53c4d42d2 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -27,10 +27,9 @@ #include "rocksdb/write_batch.h" #include "table/block_based/block_based_table_builder.h" #include "table/meta_blocks.h" -#include "file/filename.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/cuckoo_table_db_test.cc b/db/cuckoo_table_db_test.cc index f9efbc585..6f60e2d70 100644 --- a/db/cuckoo_table_db_test.cc +++ b/db/cuckoo_table_db_test.cc @@ -11,9 +11,9 @@ #include "table/cuckoo/cuckoo_table_factory.h" #include "table/cuckoo/cuckoo_table_reader.h" #include "table/meta_blocks.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/db_compaction_test.cc b/db/db_compaction_test.cc index 623836454..3051e89cd 100644 --- a/db/db_compaction_test.cc +++ b/db/db_compaction_test.cc @@ -13,9 +13,9 @@ #include "rocksdb/concurrent_task_limiter.h" #include "rocksdb/experimental.h" #include "rocksdb/utilities/convenience.h" -#include "util/concurrent_task_limiter_impl.h" #include "test_util/fault_injection_test_env.h" #include "test_util/sync_point.h" +#include "util/concurrent_task_limiter_impl.h" namespace rocksdb { diff --git a/db/db_filesnapshot.cc b/db/db_filesnapshot.cc index a1a1c8f99..59757aeb9 100644 --- a/db/db_filesnapshot.cc +++ b/db/db_filesnapshot.cc @@ -22,8 +22,8 @@ #include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/env.h" -#include "util/mutexlock.h" #include "test_util/sync_point.h" +#include "util/mutexlock.h" namespace rocksdb { diff --git a/db/db_impl.cc b/db/db_impl.cc index ec162bb96..5534c225f 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -84,6 +84,7 @@ #include "table/multiget_context.h" #include "table/table_builder.h" #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" @@ -97,7 +98,6 @@ #include "util/mutexlock.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/sync_point.h" namespace rocksdb { const std::string kDefaultColumnFamilyName("default"); diff --git a/db/db_impl_compaction_flush.cc b/db/db_impl_compaction_flush.cc index c5cc07366..c6025a8cc 100644 --- a/db/db_impl_compaction_flush.cc +++ b/db/db_impl_compaction_flush.cc @@ -21,8 +21,8 @@ #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 "test_util/sync_point.h" +#include "util/concurrent_task_limiter_impl.h" namespace rocksdb { diff --git a/db/db_impl_open.cc b/db/db_impl_open.cc index db47d1416..5dae140c7 100644 --- a/db/db_impl_open.cc +++ b/db/db_impl_open.cc @@ -19,8 +19,8 @@ #include "options/options_helper.h" #include "rocksdb/wal_filter.h" #include "table/block_based/block_based_table_factory.h" -#include "util/rate_limiter.h" #include "test_util/sync_point.h" +#include "util/rate_limiter.h" namespace rocksdb { Options SanitizeOptions(const std::string& dbname, const Options& src) { diff --git a/db/db_iter.cc b/db/db_iter.cc index 8fc17e144..d953d365e 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 "memory/arena.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" @@ -24,7 +25,6 @@ #include "rocksdb/options.h" #include "table/internal_iterator.h" #include "table/iterator_wrapper.h" -#include "util/arena.h" #include "util/logging.h" #include "util/mutexlock.h" #include "util/string_util.h" diff --git a/db/db_iter.h b/db/db_iter.h index 8d8af3fd2..85b546c54 100644 --- a/db/db_iter.h +++ b/db/db_iter.h @@ -13,10 +13,10 @@ #include "db/db_impl.h" #include "db/dbformat.h" #include "db/range_del_aggregator.h" +#include "memory/arena.h" #include "options/cf_options.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" -#include "util/arena.h" #include "util/autovector.h" namespace rocksdb { diff --git a/db/db_iter_stress_test.cc b/db/db_iter_stress_test.cc index 8c3588e9a..b864ac4ea 100644 --- a/db/db_iter_stress_test.cc +++ b/db/db_iter_stress_test.cc @@ -8,9 +8,9 @@ #include "rocksdb/comparator.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" +#include "test_util/testharness.h" #include "util/random.h" #include "util/string_util.h" -#include "test_util/testharness.h" #include "utilities/merge_operators.h" #ifdef GFLAGS diff --git a/db/db_iter_test.cc b/db/db_iter_test.cc index 49e670abc..150388644 100644 --- a/db/db_iter_test.cc +++ b/db/db_iter_test.cc @@ -17,9 +17,9 @@ #include "rocksdb/statistics.h" #include "table/iterator_wrapper.h" #include "table/merging_iterator.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/db_options_test.cc b/db/db_options_test.cc index 37a9f1a36..b899ba18b 100644 --- a/db/db_options_test.cc +++ b/db/db_options_test.cc @@ -19,9 +19,9 @@ #include "rocksdb/convenience.h" #include "rocksdb/rate_limiter.h" #include "rocksdb/stats_history.h" -#include "util/random.h" #include "test_util/sync_point.h" #include "test_util/testutil.h" +#include "util/random.h" namespace rocksdb { diff --git a/db/db_test.cc b/db/db_test.cc index bf0babd1a..debb2ba60 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -58,14 +58,14 @@ #include "table/mock_table.h" #include "table/plain/plain_table_factory.h" #include "table/scoped_arena_iterator.h" +#include "test_util/sync_point.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/compression.h" #include "util/file_reader_writer.h" #include "util/mutexlock.h" #include "util/rate_limiter.h" #include "util/string_util.h" -#include "test_util/sync_point.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/db_test_util.h b/db/db_test_util.h index 1882cde59..2af202fad 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -46,14 +46,14 @@ #include "table/mock_table.h" #include "table/plain/plain_table_factory.h" #include "table/scoped_arena_iterator.h" -#include "util/compression.h" #include "test_util/mock_time_env.h" +#include "util/compression.h" #include "util/mutexlock.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/db_write_test.cc b/db/db_write_test.cc index 322381b38..9eca823c2 100644 --- a/db/db_write_test.cc +++ b/db/db_write_test.cc @@ -13,8 +13,8 @@ #include "port/port.h" #include "port/stack_trace.h" #include "test_util/fault_injection_test_env.h" -#include "util/string_util.h" #include "test_util/sync_point.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/dbformat_test.cc b/db/dbformat_test.cc index e3f06fe6b..f4665b06c 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 "util/logging.h" #include "test_util/testharness.h" +#include "util/logging.h" namespace rocksdb { diff --git a/db/deletefile_test.cc b/db/deletefile_test.cc index 9c67102c5..280d269f1 100644 --- a/db/deletefile_test.cc +++ b/db/deletefile_test.cc @@ -20,10 +20,10 @@ #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/transaction_log.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 26cd1127b..aec398552 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -22,9 +22,9 @@ #include "table/scoped_arena_iterator.h" #include "table/sst_file_writer_collectors.h" #include "table/table_builder.h" +#include "test_util/sync_point.h" #include "util/file_reader_writer.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/fault_injection_test.cc b/db/fault_injection_test.cc index 330df7bfe..00619d447 100644 --- a/db/fault_injection_test.cc +++ b/db/fault_injection_test.cc @@ -22,11 +22,11 @@ #include "rocksdb/table.h" #include "rocksdb/write_batch.h" #include "test_util/fault_injection_test_env.h" -#include "util/logging.h" -#include "util/mutexlock.h" #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/file_indexer.h b/db/file_indexer.h index 1bef3aab0..2091f8029 100644 --- a/db/file_indexer.h +++ b/db/file_indexer.h @@ -12,8 +12,8 @@ #include #include #include +#include "memory/arena.h" #include "port/port.h" -#include "util/arena.h" #include "util/autovector.h" namespace rocksdb { diff --git a/db/file_indexer_test.cc b/db/file_indexer_test.cc index 754cb3c46..6942aa682 100644 --- a/db/file_indexer_test.cc +++ b/db/file_indexer_test.cc @@ -7,8 +7,8 @@ // 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 #include "db/file_indexer.h" +#include #include "db/dbformat.h" #include "db/version_edit.h" #include "port/stack_trace.h" diff --git a/db/filename_test.cc b/db/filename_test.cc index dabe673d8..377d128fa 100644 --- a/db/filename_test.cc +++ b/db/filename_test.cc @@ -11,8 +11,8 @@ #include "db/dbformat.h" #include "port/port.h" -#include "util/logging.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 c8729c668..d4ae79ff2 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -45,13 +45,13 @@ #include "table/merging_iterator.h" #include "table/table_builder.h" #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" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/flush_job_test.cc b/db/flush_job_test.cc index d97ad9f0c..ef89199c9 100644 --- a/db/flush_job_test.cc +++ b/db/flush_job_test.cc @@ -13,10 +13,10 @@ #include "rocksdb/cache.h" #include "rocksdb/write_buffer_manager.h" #include "table/mock_table.h" -#include "util/file_reader_writer.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/forward_iterator.cc b/db/forward_iterator.cc index f95debec6..9e0823366 100644 --- a/db/forward_iterator.cc +++ b/db/forward_iterator.cc @@ -21,8 +21,8 @@ #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" #include "table/merging_iterator.h" -#include "util/string_util.h" #include "test_util/sync_point.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/forward_iterator.h b/db/forward_iterator.h index 146588d96..fb73f458e 100644 --- a/db/forward_iterator.h +++ b/db/forward_iterator.h @@ -10,12 +10,12 @@ #include #include +#include "db/dbformat.h" +#include "memory/arena.h" #include "rocksdb/db.h" #include "rocksdb/iterator.h" #include "rocksdb/options.h" -#include "db/dbformat.h" #include "table/internal_iterator.h" -#include "util/arena.h" namespace rocksdb { diff --git a/db/forward_iterator_bench.cc b/db/forward_iterator_bench.cc index 9d6851dab..17b0ca165 100644 --- a/db/forward_iterator_bench.cc +++ b/db/forward_iterator_bench.cc @@ -34,8 +34,8 @@ int main() { return 0; } #include "rocksdb/db.h" #include "rocksdb/status.h" #include "rocksdb/table.h" -#include "util/gflags_compat.h" #include "test_util/testharness.h" +#include "util/gflags_compat.h" const int MAX_SHARDS = 100000; diff --git a/db/listener_test.cc b/db/listener_test.cc index 881534a1f..81a0fa176 100644 --- a/db/listener_test.cc +++ b/db/listener_test.cc @@ -24,15 +24,14 @@ #include "rocksdb/table_properties.h" #include "table/block_based/block_based_table_factory.h" #include "table/plain/plain_table_factory.h" -#include "file/filename.h" +#include "test_util/sync_point.h" +#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" -#include "test_util/sync_point.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators.h" #ifndef ROCKSDB_LITE diff --git a/db/log_test.cc b/db/log_test.cc index 5b159acf2..be7a3cbe7 100644 --- a/db/log_test.cc +++ b/db/log_test.cc @@ -10,12 +10,12 @@ #include "db/log_reader.h" #include "db/log_writer.h" #include "rocksdb/env.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/random.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" namespace rocksdb { namespace log { diff --git a/db/manual_compaction_test.cc b/db/manual_compaction_test.cc index 35e5019ca..1a69a89de 100644 --- a/db/manual_compaction_test.cc +++ b/db/manual_compaction_test.cc @@ -8,12 +8,12 @@ #include #include -#include "rocksdb/db.h" +#include "port/port.h" #include "rocksdb/compaction_filter.h" +#include "rocksdb/db.h" #include "rocksdb/slice.h" #include "rocksdb/write_batch.h" #include "test_util/testharness.h" -#include "port/port.h" using namespace rocksdb; diff --git a/db/memtable.cc b/db/memtable.cc index 0c706115d..46acbbfa6 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -19,6 +19,8 @@ #include "db/pinned_iterators_manager.h" #include "db/range_tombstone_fragmenter.h" #include "db/read_callback.h" +#include "memory/arena.h" +#include "memory/memory_usage.h" #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" #include "port/port.h" @@ -31,10 +33,8 @@ #include "table/internal_iterator.h" #include "table/iterator_wrapper.h" #include "table/merging_iterator.h" -#include "util/arena.h" #include "util/autovector.h" #include "util/coding.h" -#include "util/memory_usage.h" #include "util/mutexlock.h" #include "util/util.h" diff --git a/db/memtable.h b/db/memtable.h index 709e2061e..6b8c4141f 100644 --- a/db/memtable.h +++ b/db/memtable.h @@ -19,13 +19,13 @@ #include "db/range_tombstone_fragmenter.h" #include "db/read_callback.h" #include "db/version_edit.h" +#include "memory/allocator.h" +#include "memory/concurrent_arena.h" #include "monitoring/instrumented_mutex.h" #include "options/cf_options.h" #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/memtablerep.h" -#include "util/allocator.h" -#include "util/concurrent_arena.h" #include "util/dynamic_bloom.h" #include "util/hash.h" diff --git a/db/memtable_list.cc b/db/memtable_list.cc index b50b58a1a..2b4ac6b84 100644 --- a/db/memtable_list.cc +++ b/db/memtable_list.cc @@ -22,9 +22,9 @@ #include "rocksdb/env.h" #include "rocksdb/iterator.h" #include "table/merging_iterator.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/log_buffer.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/memtable_list_test.cc b/db/memtable_list_test.cc index 59da8af16..f55fbdc50 100644 --- a/db/memtable_list_test.cc +++ b/db/memtable_list_test.cc @@ -13,9 +13,9 @@ #include "rocksdb/db.h" #include "rocksdb/status.h" #include "rocksdb/write_buffer_manager.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/merge_helper_test.cc b/db/merge_helper_test.cc index dc3624af5..3386f9bd0 100644 --- a/db/merge_helper_test.cc +++ b/db/merge_helper_test.cc @@ -9,9 +9,9 @@ #include "db/merge_helper.h" #include "rocksdb/comparator.h" -#include "util/coding.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/coding.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/merge_test.cc b/db/merge_test.cc index d3dadaa5d..13c35d2c0 100644 --- a/db/merge_test.cc +++ b/db/merge_test.cc @@ -7,6 +7,9 @@ #include #include +#include "db/db_impl.h" +#include "db/dbformat.h" +#include "db/write_batch_internal.h" #include "port/stack_trace.h" #include "rocksdb/cache.h" #include "rocksdb/comparator.h" @@ -14,11 +17,8 @@ #include "rocksdb/env.h" #include "rocksdb/merge_operator.h" #include "rocksdb/utilities/db_ttl.h" -#include "db/dbformat.h" -#include "db/db_impl.h" -#include "db/write_batch_internal.h" -#include "utilities/merge_operators.h" #include "test_util/testharness.h" +#include "utilities/merge_operators.h" namespace rocksdb { diff --git a/db/obsolete_files_test.cc b/db/obsolete_files_test.cc index c6e7d6af0..655c659b4 100644 --- a/db/obsolete_files_test.cc +++ b/db/obsolete_files_test.cc @@ -20,10 +20,10 @@ #include "rocksdb/db.h" #include "rocksdb/env.h" #include "rocksdb/transaction_log.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" using std::cerr; using std::cout; diff --git a/db/perf_context_test.cc b/db/perf_context_test.cc index 42d592862..94eabff7f 100644 --- a/db/perf_context_test.cc +++ b/db/perf_context_test.cc @@ -17,9 +17,9 @@ #include "rocksdb/memtablerep.h" #include "rocksdb/perf_context.h" #include "rocksdb/slice_transform.h" +#include "test_util/testharness.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/testharness.h" #include "utilities/merge_operators.h" bool FLAGS_random_key = false; diff --git a/db/plain_table_db_test.cc b/db/plain_table_db_test.cc index bfeb54243..a73dd3cb4 100644 --- a/db/plain_table_db_test.cc +++ b/db/plain_table_db_test.cc @@ -29,12 +29,12 @@ #include "table/plain/plain_table_key_coding.h" #include "table/plain/plain_table_reader.h" #include "table/table_builder.h" +#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 "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators.h" using std::unique_ptr; diff --git a/db/prefix_test.cc b/db/prefix_test.cc index e8290e76b..3f2e794a6 100644 --- a/db/prefix_test.cc +++ b/db/prefix_test.cc @@ -26,12 +26,12 @@ int main() { #include "rocksdb/perf_context.h" #include "rocksdb/slice_transform.h" #include "rocksdb/table.h" +#include "test_util/testharness.h" #include "util/coding.h" #include "util/gflags_compat.h" #include "util/random.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/testharness.h" #include "utilities/merge_operators.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; diff --git a/db/range_del_aggregator_bench.cc b/db/range_del_aggregator_bench.cc index 54a86169b..97ba6ca4f 100644 --- a/db/range_del_aggregator_bench.cc +++ b/db/range_del_aggregator_bench.cc @@ -23,10 +23,10 @@ int main() { #include "db/range_tombstone_fragmenter.h" #include "rocksdb/comparator.h" #include "rocksdb/env.h" +#include "test_util/testutil.h" #include "util/coding.h" #include "util/random.h" #include "util/stop_watch.h" -#include "test_util/testutil.h" #include "util/gflags_compat.h" diff --git a/db/table_cache.cc b/db/table_cache.cc index 4efd3fdf7..14c0169c1 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -22,10 +22,10 @@ #include "table/multiget_context.h" #include "table/table_builder.h" #include "table/table_reader.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/file_reader_writer.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/table_properties_collector_test.cc b/db/table_properties_collector_test.cc index 0705cc032..e818f4614 100644 --- a/db/table_properties_collector_test.cc +++ b/db/table_properties_collector_test.cc @@ -13,16 +13,16 @@ #include "db/dbformat.h" #include "db/table_properties_collector.h" -#include "table/meta_blocks.h" #include "options/cf_options.h" #include "rocksdb/table.h" #include "table/block_based/block_based_table_factory.h" +#include "table/meta_blocks.h" #include "table/plain/plain_table_factory.h" #include "table/table_builder.h" -#include "util/coding.h" -#include "util/file_reader_writer.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/coding.h" +#include "util/file_reader_writer.h" namespace rocksdb { diff --git a/db/version_builder_test.cc b/db/version_builder_test.cc index 5c3bd686b..630678574 100644 --- a/db/version_builder_test.cc +++ b/db/version_builder_test.cc @@ -6,10 +6,10 @@ #include #include "db/version_edit.h" #include "db/version_set.h" -#include "util/logging.h" -#include "util/string_util.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 018517a13..668ff60f1 100644 --- a/db/version_edit.cc +++ b/db/version_edit.cc @@ -11,10 +11,10 @@ #include "db/version_set.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" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/version_edit.h b/db/version_edit.h index ee6499cdc..471b4e095 100644 --- a/db/version_edit.h +++ b/db/version_edit.h @@ -10,12 +10,12 @@ #pragma once #include #include +#include #include #include -#include -#include "rocksdb/cache.h" #include "db/dbformat.h" -#include "util/arena.h" +#include "memory/arena.h" +#include "rocksdb/cache.h" #include "util/autovector.h" namespace rocksdb { diff --git a/db/version_edit_test.cc b/db/version_edit_test.cc index 5f1ae98ba..23c63b7ca 100644 --- a/db/version_edit_test.cc +++ b/db/version_edit_test.cc @@ -8,9 +8,9 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/version_edit.h" -#include "util/coding.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/coding.h" namespace rocksdb { diff --git a/db/version_set.cc b/db/version_set.cc index 864fc9753..5d0529d27 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -48,11 +48,11 @@ #include "table/plain/plain_table_factory.h" #include "table/table_reader.h" #include "table/two_level_iterator.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/file_reader_writer.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "util/user_comparator_wrapper.h" namespace rocksdb { diff --git a/db/version_set_test.cc b/db/version_set_test.cc index 41c27fdab..9b4072dc7 100644 --- a/db/version_set_test.cc +++ b/db/version_set_test.cc @@ -10,10 +10,10 @@ #include "db/version_set.h" #include "db/log_writer.h" #include "table/mock_table.h" -#include "util/logging.h" -#include "util/string_util.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 20b5780c8..2fe5305f8 100644 --- a/db/wal_manager.cc +++ b/db/wal_manager.cc @@ -28,13 +28,13 @@ #include "rocksdb/env.h" #include "rocksdb/options.h" #include "rocksdb/write_batch.h" +#include "test_util/sync_point.h" #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" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/db/wal_manager_test.cc b/db/wal_manager_test.cc index b1478e26e..c0c47b0c3 100644 --- a/db/wal_manager_test.cc +++ b/db/wal_manager_test.cc @@ -19,10 +19,10 @@ #include "db/wal_manager.h" #include "env/mock_env.h" #include "table/mock_table.h" -#include "util/file_reader_writer.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/write_batch_test.cc b/db/write_batch_test.cc index 88c525229..5de602cee 100644 --- a/db/write_batch_test.cc +++ b/db/write_batch_test.cc @@ -18,8 +18,8 @@ #include "rocksdb/utilities/write_batch_with_index.h" #include "rocksdb/write_buffer_manager.h" #include "table/scoped_arena_iterator.h" -#include "util/string_util.h" #include "test_util/testharness.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/db/write_callback_test.cc b/db/write_callback_test.cc index dbb4759fa..aa3d077c4 100644 --- a/db/write_callback_test.cc +++ b/db/write_callback_test.cc @@ -13,12 +13,12 @@ #include "db/db_impl.h" #include "db/write_callback.h" +#include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/write_batch.h" -#include "port/port.h" -#include "util/random.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/random.h" using std::string; diff --git a/db/write_thread.cc b/db/write_thread.cc index 872d32ca8..5ee943904 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -9,8 +9,8 @@ #include "db/column_family.h" #include "monitoring/perf_context_imp.h" #include "port/port.h" -#include "util/random.h" #include "test_util/sync_point.h" +#include "util/random.h" namespace rocksdb { diff --git a/env/env.cc b/env/env.cc index dcf79fb7f..e5e0e99c0 100644 --- a/env/env.cc +++ b/env/env.cc @@ -10,11 +10,11 @@ #include "rocksdb/env.h" #include +#include "memory/arena.h" #include "options/db_options.h" #include "port/port.h" #include "port/sys_time.h" #include "rocksdb/options.h" -#include "util/arena.h" #include "util/autovector.h" namespace rocksdb { diff --git a/env/env_posix.cc b/env/env_posix.cc index 3f75dd689..bf1a9e0e5 100644 --- a/env/env_posix.cc +++ b/env/env_posix.cc @@ -49,12 +49,12 @@ #include "port/port.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" +#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 "test_util/sync_point.h" #include "util/thread_local.h" #include "util/threadpool_imp.h" diff --git a/env/env_test.cc b/env/env_test.cc index 852a99c1a..615eca8b4 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -40,13 +40,13 @@ #include "env/env_chroot.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" -#include "test_util/sync_point.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #ifdef OS_LINUX static const size_t kPageSize = sysconf(_SC_PAGESIZE); diff --git a/env/io_posix.cc b/env/io_posix.cc index 27198b1f9..313cbd8ee 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -31,9 +31,9 @@ #include "monitoring/iostats_context_imp.h" #include "port/port.h" #include "rocksdb/slice.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #if defined(OS_LINUX) && !defined(F_SET_RW_HINT) #define F_LINUX_SPECIFIC_BASE 1024 diff --git a/file/delete_scheduler.cc b/file/delete_scheduler.cc index 44e3110d5..22f28f537 100644 --- a/file/delete_scheduler.cc +++ b/file/delete_scheduler.cc @@ -13,9 +13,9 @@ #include "file/sst_file_manager_impl.h" #include "port/port.h" #include "rocksdb/env.h" +#include "test_util/sync_point.h" #include "util/logging.h" #include "util/mutexlock.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/file/delete_scheduler_test.cc b/file/delete_scheduler_test.cc index 122a5d617..510753b3b 100644 --- a/file/delete_scheduler_test.cc +++ b/file/delete_scheduler_test.cc @@ -16,10 +16,10 @@ #include "file/sst_file_manager_impl.h" #include "rocksdb/env.h" #include "rocksdb/options.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" #ifndef ROCKSDB_LITE diff --git a/file/filename.cc b/file/filename.cc index ed19b4109..a8fb78005 100644 --- a/file/filename.cc +++ b/file/filename.cc @@ -17,11 +17,11 @@ #include #include #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" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/file/sst_file_manager_impl.cc b/file/sst_file_manager_impl.cc index 9b7278c7d..d63170452 100644 --- a/file/sst_file_manager_impl.cc +++ b/file/sst_file_manager_impl.cc @@ -16,8 +16,8 @@ #include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/sst_file_manager.h" -#include "util/mutexlock.h" #include "test_util/sync_point.h" +#include "util/mutexlock.h" namespace rocksdb { diff --git a/java/rocksjni/write_batch_test.cc b/java/rocksjni/write_batch_test.cc index 9d5de9a2f..c6b8a9239 100644 --- a/java/rocksjni/write_batch_test.cc +++ b/java/rocksjni/write_batch_test.cc @@ -22,8 +22,8 @@ #include "rocksdb/write_buffer_manager.h" #include "rocksjni/portal.h" #include "table/scoped_arena_iterator.h" -#include "util/string_util.h" #include "test_util/testharness.h" +#include "util/string_util.h" /* * Class: org_rocksdb_WriteBatchTest diff --git a/util/allocator.h b/memory/allocator.h similarity index 100% rename from util/allocator.h rename to memory/allocator.h diff --git a/util/arena.cc b/memory/arena.cc similarity index 99% rename from util/arena.cc rename to memory/arena.cc index 67e8a4db7..b77422553 100644 --- a/util/arena.cc +++ b/memory/arena.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/arena.h" +#include "memory/arena.h" #ifdef ROCKSDB_MALLOC_USABLE_SIZE #ifdef OS_FREEBSD #include @@ -21,8 +21,8 @@ #include #include "port/port.h" #include "rocksdb/env.h" -#include "util/logging.h" #include "test_util/sync_point.h" +#include "util/logging.h" namespace rocksdb { diff --git a/util/arena.h b/memory/arena.h similarity index 99% rename from util/arena.h rename to memory/arena.h index dc64154c8..fd97f57e1 100644 --- a/util/arena.h +++ b/memory/arena.h @@ -15,12 +15,12 @@ #ifndef OS_WIN #include #endif -#include -#include -#include #include #include -#include "util/allocator.h" +#include +#include +#include +#include "memory/allocator.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/util/arena_test.cc b/memory/arena_test.cc similarity index 99% rename from util/arena_test.cc rename to memory/arena_test.cc index 052f2a6d5..18296d307 100644 --- a/util/arena_test.cc +++ b/memory/arena_test.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. See the AUTHORS file for names of contributors. -#include "util/arena.h" -#include "util/random.h" +#include "memory/arena.h" #include "test_util/testharness.h" +#include "util/random.h" namespace rocksdb { diff --git a/util/concurrent_arena.cc b/memory/concurrent_arena.cc similarity index 97% rename from util/concurrent_arena.cc rename to memory/concurrent_arena.cc index cef77d7e7..722eb3b60 100644 --- a/util/concurrent_arena.cc +++ b/memory/concurrent_arena.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/concurrent_arena.h" +#include "memory/concurrent_arena.h" #include #include "port/port.h" #include "util/random.h" diff --git a/util/concurrent_arena.h b/memory/concurrent_arena.h similarity index 99% rename from util/concurrent_arena.h rename to memory/concurrent_arena.h index a6191100f..6b41ab024 100644 --- a/util/concurrent_arena.h +++ b/memory/concurrent_arena.h @@ -11,9 +11,9 @@ #include #include #include +#include "memory/allocator.h" +#include "memory/arena.h" #include "port/likely.h" -#include "util/allocator.h" -#include "util/arena.h" #include "util/core_local.h" #include "util/mutexlock.h" #include "util/thread_local.h" diff --git a/util/jemalloc_nodump_allocator.cc b/memory/jemalloc_nodump_allocator.cc similarity index 99% rename from util/jemalloc_nodump_allocator.cc rename to memory/jemalloc_nodump_allocator.cc index cdd08e932..1f58351be 100644 --- a/util/jemalloc_nodump_allocator.cc +++ b/memory/jemalloc_nodump_allocator.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/jemalloc_nodump_allocator.h" +#include "memory/jemalloc_nodump_allocator.h" #include #include diff --git a/util/jemalloc_nodump_allocator.h b/memory/jemalloc_nodump_allocator.h similarity index 100% rename from util/jemalloc_nodump_allocator.h rename to memory/jemalloc_nodump_allocator.h diff --git a/util/memory_allocator.h b/memory/memory_allocator.h similarity index 100% rename from util/memory_allocator.h rename to memory/memory_allocator.h diff --git a/util/memory_usage.h b/memory/memory_usage.h similarity index 100% rename from util/memory_usage.h rename to memory/memory_usage.h diff --git a/memtable/alloc_tracker.cc b/memtable/alloc_tracker.cc index a1fa4938c..ddd40aa05 100644 --- a/memtable/alloc_tracker.cc +++ b/memtable/alloc_tracker.cc @@ -8,9 +8,9 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include +#include "memory/allocator.h" +#include "memory/arena.h" #include "rocksdb/write_buffer_manager.h" -#include "util/allocator.h" -#include "util/arena.h" namespace rocksdb { diff --git a/memtable/hash_linklist_rep.cc b/memtable/hash_linklist_rep.cc index 878d23383..e347abe6e 100644 --- a/memtable/hash_linklist_rep.cc +++ b/memtable/hash_linklist_rep.cc @@ -10,13 +10,13 @@ #include #include #include "db/memtable.h" +#include "memory/arena.h" #include "memtable/skiplist.h" #include "monitoring/histogram.h" #include "port/port.h" #include "rocksdb/memtablerep.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" -#include "util/arena.h" #include "util/hash.h" namespace rocksdb { diff --git a/memtable/hash_skiplist_rep.cc b/memtable/hash_skiplist_rep.cc index d02919cd4..5c74657cd 100644 --- a/memtable/hash_skiplist_rep.cc +++ b/memtable/hash_skiplist_rep.cc @@ -9,14 +9,14 @@ #include +#include "db/memtable.h" +#include "memory/arena.h" +#include "memtable/skiplist.h" +#include "port/port.h" #include "rocksdb/memtablerep.h" -#include "util/arena.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" -#include "port/port.h" #include "util/murmurhash.h" -#include "db/memtable.h" -#include "memtable/skiplist.h" namespace rocksdb { namespace { diff --git a/memtable/inlineskiplist.h b/memtable/inlineskiplist.h index 1ef8f2b6d..c3adb2ddb 100644 --- a/memtable/inlineskiplist.h +++ b/memtable/inlineskiplist.h @@ -46,10 +46,10 @@ #include #include #include +#include "memory/allocator.h" #include "port/likely.h" #include "port/port.h" #include "rocksdb/slice.h" -#include "util/allocator.h" #include "util/coding.h" #include "util/random.h" diff --git a/memtable/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc index a2f62d530..9670f3fc6 100644 --- a/memtable/inlineskiplist_test.cc +++ b/memtable/inlineskiplist_test.cc @@ -10,11 +10,11 @@ #include "memtable/inlineskiplist.h" #include #include +#include "memory/concurrent_arena.h" #include "rocksdb/env.h" -#include "util/concurrent_arena.h" +#include "test_util/testharness.h" #include "util/hash.h" #include "util/random.h" -#include "test_util/testharness.h" namespace rocksdb { diff --git a/memtable/memtablerep_bench.cc b/memtable/memtablerep_bench.cc index ae1990965..003d59b2a 100644 --- a/memtable/memtablerep_bench.cc +++ b/memtable/memtablerep_bench.cc @@ -28,6 +28,7 @@ int main() { #include "db/dbformat.h" #include "db/memtable.h" +#include "memory/arena.h" #include "port/port.h" #include "port/stack_trace.h" #include "rocksdb/comparator.h" @@ -35,11 +36,10 @@ int main() { #include "rocksdb/options.h" #include "rocksdb/slice_transform.h" #include "rocksdb/write_buffer_manager.h" -#include "util/arena.h" +#include "test_util/testutil.h" #include "util/gflags_compat.h" #include "util/mutexlock.h" #include "util/stop_watch.h" -#include "test_util/testutil.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; using GFLAGS_NAMESPACE::RegisterFlagValidator; diff --git a/memtable/skiplist.h b/memtable/skiplist.h index 47a89034e..275daa794 100644 --- a/memtable/skiplist.h +++ b/memtable/skiplist.h @@ -32,10 +32,10 @@ #pragma once #include -#include #include +#include +#include "memory/allocator.h" #include "port/port.h" -#include "util/allocator.h" #include "util/random.h" namespace rocksdb { diff --git a/memtable/skiplist_test.cc b/memtable/skiplist_test.cc index 054e3c9df..33cc19b2d 100644 --- a/memtable/skiplist_test.cc +++ b/memtable/skiplist_test.cc @@ -9,11 +9,11 @@ #include "memtable/skiplist.h" #include +#include "memory/arena.h" #include "rocksdb/env.h" -#include "util/arena.h" +#include "test_util/testharness.h" #include "util/hash.h" #include "util/random.h" -#include "test_util/testharness.h" namespace rocksdb { diff --git a/memtable/skiplistrep.cc b/memtable/skiplistrep.cc index 32870b127..3955217cc 100644 --- a/memtable/skiplistrep.cc +++ b/memtable/skiplistrep.cc @@ -3,10 +3,10 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). // -#include "memtable/inlineskiplist.h" #include "db/memtable.h" +#include "memory/arena.h" +#include "memtable/inlineskiplist.h" #include "rocksdb/memtablerep.h" -#include "util/arena.h" namespace rocksdb { namespace { diff --git a/memtable/vectorrep.cc b/memtable/vectorrep.cc index 827ab8a5d..e7acc94ad 100644 --- a/memtable/vectorrep.cc +++ b/memtable/vectorrep.cc @@ -12,8 +12,8 @@ #include #include -#include "util/arena.h" #include "db/memtable.h" +#include "memory/arena.h" #include "memtable/stl_wrappers.h" #include "port/port.h" #include "util/mutexlock.h" diff --git a/options/options_helper.cc b/options/options_helper.cc index 0b531a6ec..388256abd 100644 --- a/options/options_helper.cc +++ b/options/options_helper.cc @@ -10,7 +10,6 @@ #include #include -#include "table/plain/plain_table_factory.h" #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" #include "rocksdb/convenience.h" @@ -23,6 +22,7 @@ #include "rocksdb/table.h" #include "rocksdb/utilities/object_registry.h" #include "table/block_based/block_based_table_factory.h" +#include "table/plain/plain_table_factory.h" #include "util/cast_util.h" #include "util/string_util.h" diff --git a/options/options_parser.cc b/options/options_parser.cc index 9ae3dfb27..d5b0c25a3 100644 --- a/options/options_parser.cc +++ b/options/options_parser.cc @@ -16,10 +16,10 @@ #include "options/options_helper.h" #include "rocksdb/convenience.h" #include "rocksdb/db.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/file_reader_writer.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "port/port.h" diff --git a/options/options_test.cc b/options/options_test.cc index 704b2db80..429b607e4 100644 --- a/options/options_test.cc +++ b/options/options_test.cc @@ -27,11 +27,11 @@ #include "rocksdb/memtablerep.h" #include "rocksdb/utilities/leveldb_options.h" #include "rocksdb/utilities/object_registry.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/random.h" #include "util/stderr_logger.h" #include "util/string_util.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" #include "utilities/merge_operators/bytesxor.h" #ifndef GFLAGS diff --git a/port/win/env_default.cc b/port/win/env_default.cc index db64878bc..584a524cf 100644 --- a/port/win/env_default.cc +++ b/port/win/env_default.cc @@ -11,8 +11,8 @@ #include #include "port/win/env_win.h" -#include "util/compression_context_cache.h" #include "test_util/sync_point.h" +#include "util/compression_context_cache.h" #include "util/thread_local.h" namespace rocksdb { diff --git a/port/win/io_win.cc b/port/win/io_win.cc index 15d1e7114..6fbf6fc63 100644 --- a/port/win/io_win.cc +++ b/port/win/io_win.cc @@ -10,9 +10,9 @@ #include "port/win/io_win.h" #include "monitoring/iostats_context_imp.h" +#include "test_util/sync_point.h" #include "util/aligned_buffer.h" #include "util/coding.h" -#include "test_util/sync_point.h" namespace rocksdb { namespace port { diff --git a/src.mk b/src.mk index a0f4043bf..c1ab36b8a 100644 --- a/src.mk +++ b/src.mk @@ -71,6 +71,9 @@ LIB_SOURCES = \ file/file_util.cc \ file/filename.cc \ file/sst_file_manager_impl.cc \ + memory/arena.cc \ + memory/concurrent_arena.cc \ + memory/jemalloc_nodump_allocator.cc \ memtable/alloc_tracker.cc \ memtable/hash_linklist_rep.cc \ memtable/hash_skiplist_rep.cc \ @@ -135,7 +138,6 @@ LIB_SOURCES = \ test_util/sync_point_impl.cc \ test_util/transaction_test_util.cc \ tools/dump/db_dump_tool.cc \ - util/arena.cc \ util/auto_roll_logger.cc \ util/bloom.cc \ util/build_version.cc \ @@ -143,7 +145,6 @@ LIB_SOURCES = \ util/compaction_job_stats_impl.cc \ util/comparator.cc \ util/compression_context_cache.cc \ - util/concurrent_arena.cc \ util/concurrent_task_limiter_impl.cc \ util/crc32c.cc \ util/dynamic_bloom.cc \ @@ -151,7 +152,6 @@ LIB_SOURCES = \ util/file_reader_writer.cc \ util/filter_policy.cc \ util/hash.cc \ - util/jemalloc_nodump_allocator.cc \ util/log_buffer.cc \ util/murmurhash.cc \ util/random.cc \ @@ -339,6 +339,7 @@ MAIN_SOURCES = \ env/env_basic_test.cc \ env/env_test.cc \ env/mock_env_test.cc \ + memory/arena_test.cc \ memtable/inlineskiplist_test.cc \ memtable/memtablerep_bench.cc \ memtable/skiplist_test.cc \ @@ -367,7 +368,6 @@ MAIN_SOURCES = \ tools/reduce_levels_test.cc \ tools/sst_dump_test.cc \ tools/trace_analyzer_test.cc \ - util/arena_test.cc \ util/auto_roll_logger_test.cc \ util/autovector_test.cc \ util/bloom_test.cc \ diff --git a/table/block_based/block.h b/table/block_based/block.h index 8bf6f5356..3c54389b0 100644 --- a/table/block_based/block.h +++ b/table/block_based/block.h @@ -22,16 +22,16 @@ #include "db/dbformat.h" #include "db/pinned_iterators_manager.h" -#include "table/format.h" #include "rocksdb/iterator.h" #include "rocksdb/options.h" #include "rocksdb/statistics.h" #include "rocksdb/table.h" #include "table/block_based/block_prefix_index.h" #include "table/block_based/data_block_hash_index.h" +#include "table/format.h" #include "table/internal_iterator.h" -#include "util/random.h" #include "test_util/sync_point.h" +#include "util/random.h" namespace rocksdb { diff --git a/table/block_based/block_based_filter_block_test.cc b/table/block_based/block_based_filter_block_test.cc index 8d074275c..e0ca57f1c 100644 --- a/table/block_based/block_based_filter_block_test.cc +++ b/table/block_based/block_based_filter_block_test.cc @@ -10,11 +10,11 @@ #include "table/block_based/block_based_filter_block.h" #include "rocksdb/filter_policy.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/coding.h" #include "util/hash.h" #include "util/string_util.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" namespace rocksdb { diff --git a/table/block_based/block_based_table_builder.cc b/table/block_based/block_based_table_builder.cc index 034c6b238..9769e394f 100644 --- a/table/block_based/block_based_table_builder.cc +++ b/table/block_based/block_based_table_builder.cc @@ -31,9 +31,9 @@ #include "rocksdb/table.h" #include "table/block_based/block.h" +#include "table/block_based/block_based_filter_block.h" #include "table/block_based/block_based_table_factory.h" #include "table/block_based/block_based_table_reader.h" -#include "table/block_based/block_based_filter_block.h" #include "table/block_based/block_builder.h" #include "table/block_based/filter_block.h" #include "table/block_based/full_filter_block.h" @@ -41,15 +41,14 @@ #include "table/format.h" #include "table/table_builder.h" +#include "memory/memory_allocator.h" #include "util/coding.h" #include "util/compression.h" #include "util/crc32c.h" -#include "util/memory_allocator.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/xxhash.h" - namespace rocksdb { extern const std::string kHashIndexPrefixesBlock; diff --git a/table/block_based/block_based_table_builder.h b/table/block_based/block_based_table_builder.h index 0c580b445..a1ef38891 100644 --- a/table/block_based/block_based_table_builder.h +++ b/table/block_based/block_based_table_builder.h @@ -14,11 +14,11 @@ #include #include -#include "table/meta_blocks.h" #include "rocksdb/flush_block_policy.h" #include "rocksdb/listener.h" #include "rocksdb/options.h" #include "rocksdb/status.h" +#include "table/meta_blocks.h" #include "table/table_builder.h" #include "util/compression.h" diff --git a/table/block_based/block_based_table_factory.cc b/table/block_based/block_based_table_factory.cc index 609679394..121cc916e 100644 --- a/table/block_based/block_based_table_factory.cc +++ b/table/block_based/block_based_table_factory.cc @@ -23,8 +23,8 @@ #include "rocksdb/cache.h" #include "rocksdb/convenience.h" #include "rocksdb/flush_block_policy.h" -#include "table/block_based/block_based_table_factory.h" #include "table/block_based/block_based_table_builder.h" +#include "table/block_based/block_based_table_factory.h" #include "table/block_based/block_based_table_reader.h" #include "table/format.h" #include "util/mutexlock.h" diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc index 725ecdb4e..944a1fde4 100644 --- a/table/block_based/block_based_table_reader.cc +++ b/table/block_based/block_based_table_reader.cc @@ -15,10 +15,10 @@ #include #include -#include "table/block_fetcher.h" -#include "table/meta_blocks.h" #include "db/dbformat.h" #include "db/pinned_iterators_manager.h" +#include "table/block_fetcher.h" +#include "table/meta_blocks.h" #include "rocksdb/cache.h" #include "rocksdb/comparator.h" @@ -45,12 +45,12 @@ #include "table/two_level_iterator.h" #include "monitoring/perf_context_imp.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/stop_watch.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "util/xxhash.h" namespace rocksdb { @@ -202,19 +202,18 @@ bool PrefixExtractorChanged(const TableProperties* table_properties, // it is owned by the reader or stored in the cache, or whether it is pinned // in the cache or not. class BlockBasedTable::IndexReaderCommon : public BlockBasedTable::IndexReader { -public: - IndexReaderCommon(BlockBasedTable* t, - CachableEntry&& index_block) - : table_(t) - , index_block_(std::move(index_block)) - { + public: + IndexReaderCommon(BlockBasedTable* t, CachableEntry&& index_block) + : table_(t), index_block_(std::move(index_block)) { assert(table_ != nullptr); } -protected: + protected: static Status ReadIndexBlock(BlockBasedTable* table, - FilePrefetchBuffer* prefetch_buffer, const ReadOptions& read_options, - GetContext* get_context, CachableEntry* index_block); + FilePrefetchBuffer* prefetch_buffer, + const ReadOptions& read_options, + GetContext* get_context, + CachableEntry* index_block); BlockBasedTable* table() const { return table_; } @@ -230,7 +229,7 @@ protected: assert(table_->get_rep() != nullptr); const TableProperties* const properties = - table_->get_rep()->table_properties.get(); + table_->get_rep()->table_properties.get(); return properties == nullptr || !properties->index_key_is_user_key; } @@ -240,7 +239,7 @@ protected: assert(table_->get_rep() != nullptr); const TableProperties* const properties = - table_->get_rep()->table_properties.get(); + table_->get_rep()->table_properties.get(); return properties == nullptr || !properties->index_value_is_delta_encoded; } @@ -251,20 +250,20 @@ protected: size_t ApproximateIndexBlockMemoryUsage() const { assert(!index_block_.GetOwnValue() || index_block_.GetValue() != nullptr); - return index_block_.GetOwnValue() ? - index_block_.GetValue()->ApproximateMemoryUsage() : 0; + return index_block_.GetOwnValue() + ? index_block_.GetValue()->ApproximateMemoryUsage() + : 0; } -private: + private: BlockBasedTable* table_; CachableEntry index_block_; }; Status BlockBasedTable::IndexReaderCommon::ReadIndexBlock( - BlockBasedTable* table, FilePrefetchBuffer* prefetch_buffer, - const ReadOptions& read_options, GetContext* get_context, - CachableEntry* index_block) { - + BlockBasedTable* table, FilePrefetchBuffer* prefetch_buffer, + const ReadOptions& read_options, GetContext* get_context, + CachableEntry* index_block) { PERF_TIMER_GUARD(read_index_block_nanos); assert(table != nullptr); @@ -275,27 +274,27 @@ Status BlockBasedTable::IndexReaderCommon::ReadIndexBlock( assert(rep != nullptr); constexpr bool is_index = true; - const Status s = BlockBasedTable::RetrieveBlock(prefetch_buffer, - rep, read_options, rep->footer.index_handle(), - UncompressionDict::GetEmptyDict(), index_block, is_index, get_context); + const Status s = BlockBasedTable::RetrieveBlock( + prefetch_buffer, rep, read_options, rep->footer.index_handle(), + UncompressionDict::GetEmptyDict(), index_block, is_index, get_context); return s; } Status BlockBasedTable::IndexReaderCommon::GetOrReadIndexBlock( - const ReadOptions& read_options, GetContext* get_context, - CachableEntry* index_block) const { - + const ReadOptions& read_options, GetContext* get_context, + CachableEntry* index_block) const { assert(index_block != nullptr); if (!index_block_.IsEmpty()) { - *index_block = CachableEntry(index_block_.GetValue(), - nullptr /* cache */, nullptr /* cache_handle */, false /* own_value */); + *index_block = + CachableEntry(index_block_.GetValue(), nullptr /* cache */, + nullptr /* cache_handle */, false /* own_value */); return Status::OK(); } - return ReadIndexBlock(table_, nullptr /* prefetch_buffer */, - read_options, get_context, index_block); + return ReadIndexBlock(table_, nullptr /* prefetch_buffer */, read_options, + get_context, index_block); } // Index that allows binary search lookup in a two-level index structure. @@ -335,10 +334,9 @@ class PartitionIndexReader : public BlockBasedTable::IndexReaderCommon { InternalIteratorBase* NewIterator( const ReadOptions& read_options, bool /* disable_prefix_seek */, IndexBlockIter* iter, GetContext* get_context) override { - CachableEntry index_block; - const Status s = GetOrReadIndexBlock(read_options, get_context, - &index_block); + const Status s = + GetOrReadIndexBlock(read_options, get_context, &index_block); if (!s.ok()) { if (iter != nullptr) { iter->Invalidate(s); @@ -403,7 +401,8 @@ class PartitionIndexReader : public BlockBasedTable::IndexReaderCommon { if (!s.ok()) { ROCKS_LOG_WARN(rep->ioptions.info_log, "Error retrieving top-level index block while trying to " - "cache index partitions: %s", s.ToString().c_str()); + "cache index partitions: %s", + s.ToString().c_str()); return; } @@ -474,10 +473,8 @@ class PartitionIndexReader : public BlockBasedTable::IndexReaderCommon { } private: - PartitionIndexReader(BlockBasedTable* t, - CachableEntry&& index_block) - : IndexReaderCommon(t, std::move(index_block)) - {} + PartitionIndexReader(BlockBasedTable* t, CachableEntry&& index_block) + : IndexReaderCommon(t, std::move(index_block)) {} std::unordered_map> partition_map_; }; @@ -521,8 +518,8 @@ class BinarySearchIndexReader : public BlockBasedTable::IndexReaderCommon { const ReadOptions& read_options, bool /* disable_prefix_seek */, IndexBlockIter* iter, GetContext* get_context) override { CachableEntry index_block; - const Status s = GetOrReadIndexBlock(read_options, get_context, - &index_block); + const Status s = + GetOrReadIndexBlock(read_options, get_context, &index_block); if (!s.ok()) { if (iter != nullptr) { iter->Invalidate(s); @@ -558,8 +555,7 @@ class BinarySearchIndexReader : public BlockBasedTable::IndexReaderCommon { private: BinarySearchIndexReader(BlockBasedTable* t, CachableEntry&& index_block) - : IndexReaderCommon(t, std::move(index_block)) - {} + : IndexReaderCommon(t, std::move(index_block)) {} }; // Index that leverages an internal hash table to quicken the lookup for a given @@ -620,7 +616,7 @@ class HashIndexReader : public BlockBasedTable::IndexReaderCommon { const ImmutableCFOptions& ioptions = rep->ioptions; const PersistentCacheOptions& cache_options = rep->persistent_cache_options; MemoryAllocator* const memory_allocator = - GetMemoryAllocator(rep->table_options); + GetMemoryAllocator(rep->table_options); // Read contents for the blocks BlockContents prefixes_contents; @@ -661,8 +657,8 @@ class HashIndexReader : public BlockBasedTable::IndexReaderCommon { const ReadOptions& read_options, bool disable_prefix_seek, IndexBlockIter* iter, GetContext* get_context) override { CachableEntry index_block; - const Status s = GetOrReadIndexBlock(read_options, get_context, - &index_block); + const Status s = + GetOrReadIndexBlock(read_options, get_context, &index_block); if (!s.ok()) { if (iter != nullptr) { iter->Invalidate(s); @@ -673,8 +669,8 @@ class HashIndexReader : public BlockBasedTable::IndexReaderCommon { } Statistics* kNullStats = nullptr; - const bool total_order_seek = read_options.total_order_seek || - disable_prefix_seek; + const bool total_order_seek = + read_options.total_order_seek || disable_prefix_seek; // We don't return pinned data from index blocks, so no need // to set `block_contents_pinned`. auto it = index_block.GetValue()->NewIterator( @@ -703,10 +699,8 @@ class HashIndexReader : public BlockBasedTable::IndexReaderCommon { } private: - HashIndexReader(BlockBasedTable* t, - CachableEntry&& index_block) - : IndexReaderCommon(t, std::move(index_block)) - {} + HashIndexReader(BlockBasedTable* t, CachableEntry&& index_block) + : IndexReaderCommon(t, std::move(index_block)) {} std::unique_ptr prefix_index_; }; @@ -1439,7 +1433,6 @@ Status BlockBasedTable::GetDataBlockFromCache( const ReadOptions& read_options, CachableEntry* block, const UncompressionDict& uncompression_dict, size_t read_amp_bytes_per_bit, bool is_index, GetContext* get_context) { - assert(block); assert(block->IsEmpty()); @@ -1933,7 +1926,6 @@ BlockBasedTable::GetUncompressionDict(Rep* rep, InternalIteratorBase* BlockBasedTable::NewIndexIterator( const ReadOptions& read_options, bool disable_prefix_seek, IndexBlockIter* input_iter, GetContext* get_context) { - assert(rep_ != nullptr); assert(rep_->index_reader != nullptr); @@ -1963,11 +1955,11 @@ TBlockIter* BlockBasedTable::NewDataBlockIterator( const bool no_io = (ro.read_tier == kBlockCacheTier); auto uncompression_dict_storage = - GetUncompressionDict(rep, prefetch_buffer, no_io, get_context); + GetUncompressionDict(rep, prefetch_buffer, no_io, get_context); const UncompressionDict& uncompression_dict = - uncompression_dict_storage.GetValue() == nullptr - ? UncompressionDict::GetEmptyDict() - : *uncompression_dict_storage.GetValue(); + uncompression_dict_storage.GetValue() == nullptr + ? UncompressionDict::GetEmptyDict() + : *uncompression_dict_storage.GetValue(); CachableEntry block; s = RetrieveBlock(prefetch_buffer, rep, ro, handle, uncompression_dict, @@ -1988,12 +1980,13 @@ TBlockIter* BlockBasedTable::NewDataBlockIterator( // 2. it's pointing to immortal source. If own_bytes is true then we are // not reading data from the original source, whether immortal or not. // Otherwise, the block is pinned iff the source is immortal. - const bool block_contents_pinned = block.IsCached() || - (!block.GetValue()->own_bytes() && rep->immortal_table); + const bool block_contents_pinned = + block.IsCached() || + (!block.GetValue()->own_bytes() && rep->immortal_table); iter = block.GetValue()->NewIterator( - &rep->internal_comparator, rep->internal_comparator.user_comparator(), - iter, rep->ioptions.statistics, kTotalOrderSeek, key_includes_seq, - index_key_is_full, block_contents_pinned); + &rep->internal_comparator, rep->internal_comparator.user_comparator(), + iter, rep->ioptions.statistics, kTotalOrderSeek, key_includes_seq, + index_key_is_full, block_contents_pinned); if (!block.IsCached()) { if (!ro.fill_cache && rep->cache_key_prefix_size != 0) { @@ -2015,7 +2008,7 @@ TBlockIter* BlockBasedTable::NewDataBlockIterator( char* end = EncodeVarint64(cache_key + kExtraCacheKeyPrefix, next_cache_key_id_++); assert(end - cache_key <= - static_cast(kExtraCacheKeyPrefix + kMaxVarint64Length)); + static_cast(kExtraCacheKeyPrefix + kMaxVarint64Length)); const Slice unique_key(cache_key, static_cast(end - cache_key)); s = block_cache->Insert(unique_key, nullptr, block.GetValue()->ApproximateMemoryUsage(), @@ -2066,11 +2059,11 @@ Status BlockBasedTable::MaybeReadBlockAndLoadToCache( compressed_cache_key); } - s = GetDataBlockFromCache(key, ckey, block_cache, block_cache_compressed, - rep, ro, block_entry, uncompression_dict, - !is_index ? - rep->table_options.read_amp_bytes_per_bit : 0, - is_index, get_context); + s = GetDataBlockFromCache( + key, ckey, block_cache, block_cache_compressed, rep, ro, block_entry, + uncompression_dict, + !is_index ? rep->table_options.read_amp_bytes_per_bit : 0, is_index, + get_context); // Can't find the block from the cache. If I/O is allowed, read from the // file. @@ -2119,7 +2112,6 @@ Status BlockBasedTable::RetrieveBlock( FilePrefetchBuffer* prefetch_buffer, const Rep* rep, const ReadOptions& ro, const BlockHandle& handle, const UncompressionDict& uncompression_dict, CachableEntry* block_entry, bool is_index, GetContext* get_context) { - assert(rep); assert(block_entry); assert(block_entry->IsEmpty()); @@ -2127,15 +2119,15 @@ Status BlockBasedTable::RetrieveBlock( Status s; if (!is_index || rep->table_options.cache_index_and_filter_blocks) { s = MaybeReadBlockAndLoadToCache(prefetch_buffer, rep, ro, handle, - uncompression_dict, block_entry, - is_index, get_context); + uncompression_dict, block_entry, is_index, + get_context); if (!s.ok()) { return s; } if (block_entry->GetValue() != nullptr) { - assert (s.ok()); + assert(s.ok()); return s; } } @@ -2151,16 +2143,14 @@ Status BlockBasedTable::RetrieveBlock( { StopWatch sw(rep->ioptions.env, rep->ioptions.statistics, - READ_BLOCK_GET_MICROS); - s = ReadBlockFromFile(rep->file.get(), prefetch_buffer, rep->footer, ro, - handle, &block, rep->ioptions, - rep->blocks_maybe_compressed, - rep->blocks_maybe_compressed, uncompression_dict, - rep->persistent_cache_options, - rep->get_global_seqno(is_index), - !is_index ? - rep->table_options.read_amp_bytes_per_bit : 0, - GetMemoryAllocator(rep->table_options)); + READ_BLOCK_GET_MICROS); + s = ReadBlockFromFile( + rep->file.get(), prefetch_buffer, rep->footer, ro, handle, &block, + rep->ioptions, rep->blocks_maybe_compressed, + rep->blocks_maybe_compressed, uncompression_dict, + rep->persistent_cache_options, rep->get_global_seqno(is_index), + !is_index ? rep->table_options.read_amp_bytes_per_bit : 0, + GetMemoryAllocator(rep->table_options)); } if (!s.ok()) { @@ -2756,9 +2746,8 @@ Status BlockBasedTable::Get(const ReadOptions& read_options, const Slice& key, need_upper_bound_check = PrefixExtractorChanged( rep_->table_properties.get(), prefix_extractor); } - auto iiter = - NewIndexIterator(read_options, need_upper_bound_check, &iiter_on_stack, - get_context); + auto iiter = NewIndexIterator(read_options, need_upper_bound_check, + &iiter_on_stack, get_context); std::unique_ptr> iiter_unique_ptr; if (iiter != &iiter_on_stack) { iiter_unique_ptr.reset(iiter); @@ -2877,9 +2866,9 @@ void BlockBasedTable::MultiGet(const ReadOptions& read_options, need_upper_bound_check = PrefixExtractorChanged( rep_->table_properties.get(), prefix_extractor); } - auto iiter = NewIndexIterator( - read_options, need_upper_bound_check, &iiter_on_stack, - sst_file_range.begin()->get_context); + auto iiter = + NewIndexIterator(read_options, need_upper_bound_check, &iiter_on_stack, + sst_file_range.begin()->get_context); std::unique_ptr> iiter_unique_ptr; if (iiter != &iiter_on_stack) { iiter_unique_ptr.reset(iiter); @@ -3105,9 +3094,9 @@ bool BlockBasedTable::TEST_BlockInCache(const BlockHandle& handle) const { } char cache_key_storage[kMaxCacheKeyPrefixSize + kMaxVarint64Length]; - Slice cache_key = GetCacheKey(rep_->cache_key_prefix, - rep_->cache_key_prefix_size, handle, - cache_key_storage); + Slice cache_key = + GetCacheKey(rep_->cache_key_prefix, rep_->cache_key_prefix_size, handle, + cache_key_storage); Cache::Handle* const cache_handle = cache->Lookup(cache_key); if (cache_handle == nullptr) { @@ -3187,9 +3176,8 @@ Status BlockBasedTable::CreateIndexReader( ROCKS_LOG_WARN(rep_->ioptions.info_log, "Unable to read the metaindex block." " Fall back to binary search index."); - return BinarySearchIndexReader::Create(this, prefetch_buffer, - use_cache, prefetch, pin, - index_reader); + return BinarySearchIndexReader::Create( + this, prefetch_buffer, use_cache, prefetch, pin, index_reader); } meta_index_iter = meta_iter_guard.get(); } diff --git a/table/block_based/block_based_table_reader.h b/table/block_based/block_based_table_reader.h index 6d265ba75..3af617fec 100644 --- a/table/block_based/block_based_table_reader.h +++ b/table/block_based/block_based_table_reader.h @@ -263,12 +263,12 @@ class BlockBasedTable : public TableReader { // Similar to the above, with one crucial difference: it will retrieve the // block from the file even if there are no caches configured (assuming the // read options allow I/O). - static Status RetrieveBlock( - FilePrefetchBuffer* prefetch_buffer, const Rep* rep, - const ReadOptions& ro, const BlockHandle& handle, - const UncompressionDict& uncompression_dict, - CachableEntry* block_entry, bool is_index, - GetContext* get_context); + static Status RetrieveBlock(FilePrefetchBuffer* prefetch_buffer, + const Rep* rep, const ReadOptions& ro, + const BlockHandle& handle, + const UncompressionDict& uncompression_dict, + CachableEntry* block_entry, bool is_index, + GetContext* get_context); // For the following two functions: // if `no_io == true`, we will not try to read filter/index from sst file @@ -310,8 +310,8 @@ class BlockBasedTable : public TableReader { static Status GetDataBlockFromCache( const Slice& block_cache_key, const Slice& compressed_block_cache_key, Cache* block_cache, Cache* block_cache_compressed, const Rep* rep, - const ReadOptions& read_options, - CachableEntry* block, const UncompressionDict& uncompression_dict, + const ReadOptions& read_options, CachableEntry* block, + const UncompressionDict& uncompression_dict, size_t read_amp_bytes_per_bit, bool is_index = false, GetContext* get_context = nullptr); @@ -351,10 +351,10 @@ class BlockBasedTable : public TableReader { // Optionally, user can pass a preloaded meta_index_iter for the index that // need to access extra meta blocks for index construction. This parameter // helps avoid re-reading meta index block if caller already created one. - Status CreateIndexReader( - FilePrefetchBuffer* prefetch_buffer, - InternalIterator* preloaded_meta_index_iter, bool use_cache, - bool prefetch, bool pin, IndexReader** index_reader); + Status CreateIndexReader(FilePrefetchBuffer* prefetch_buffer, + InternalIterator* preloaded_meta_index_iter, + bool use_cache, bool prefetch, bool pin, + IndexReader** index_reader); bool FullFilterKeyMayMatch( const ReadOptions& read_options, FilterBlockReader* filter, diff --git a/table/block_based/block_prefix_index.cc b/table/block_based/block_prefix_index.cc index 0050f1f1e..6e24f17cf 100644 --- a/table/block_based/block_prefix_index.cc +++ b/table/block_based/block_prefix_index.cc @@ -7,10 +7,10 @@ #include +#include "memory/arena.h" #include "rocksdb/comparator.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" -#include "util/arena.h" #include "util/coding.h" #include "util/hash.h" diff --git a/table/block_based/block_test.cc b/table/block_based/block_test.cc index a4c567888..2dab4627c 100644 --- a/table/block_based/block_test.cc +++ b/table/block_based/block_test.cc @@ -23,9 +23,9 @@ #include "table/block_based/block.h" #include "table/block_based/block_builder.h" #include "table/format.h" -#include "util/random.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/random.h" namespace rocksdb { diff --git a/table/block_based/data_block_hash_index_test.cc b/table/block_based/data_block_hash_index_test.cc index 204e92ecb..5ec093871 100644 --- a/table/block_based/data_block_hash_index_test.cc +++ b/table/block_based/data_block_hash_index_test.cc @@ -3,7 +3,6 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). - #include #include #include diff --git a/table/block_based/filter_block.h b/table/block_based/filter_block.h index 8b01214c7..378cdacff 100644 --- a/table/block_based/filter_block.h +++ b/table/block_based/filter_block.h @@ -24,11 +24,11 @@ #include #include #include "db/dbformat.h" -#include "table/format.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" #include "rocksdb/table.h" +#include "table/format.h" #include "table/multiget_context.h" #include "util/hash.h" diff --git a/table/block_based/full_filter_block.h b/table/block_based/full_filter_block.h index 3e5d82733..61df028c9 100644 --- a/table/block_based/full_filter_block.h +++ b/table/block_based/full_filter_block.h @@ -11,12 +11,12 @@ #include #include +#include "db/dbformat.h" #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/slice_transform.h" -#include "db/dbformat.h" -#include "util/hash.h" #include "table/block_based/filter_block.h" +#include "util/hash.h" namespace rocksdb { diff --git a/table/block_based/full_filter_block_test.cc b/table/block_based/full_filter_block_test.cc index 8b99f54b0..82c43b34e 100644 --- a/table/block_based/full_filter_block_test.cc +++ b/table/block_based/full_filter_block_test.cc @@ -7,11 +7,11 @@ #include "rocksdb/filter_policy.h" #include "table/full_filter_bits_builder.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/coding.h" #include "util/hash.h" #include "util/string_util.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" namespace rocksdb { diff --git a/table/block_based/index_builder.cc b/table/block_based/index_builder.cc index f11ecd4f4..738b9e3e0 100644 --- a/table/block_based/index_builder.cc +++ b/table/block_based/index_builder.cc @@ -17,8 +17,8 @@ #include "rocksdb/comparator.h" #include "rocksdb/flush_block_policy.h" -#include "table/format.h" #include "table/block_based/partitioned_filter_block.h" +#include "table/format.h" // Without anonymous namespace here, we fail the warning -Wmissing-prototypes namespace rocksdb { diff --git a/table/block_based/partitioned_filter_block.h b/table/block_based/partitioned_filter_block.h index 735f1c6e3..6860bf82f 100644 --- a/table/block_based/partitioned_filter_block.h +++ b/table/block_based/partitioned_filter_block.h @@ -15,8 +15,8 @@ #include "rocksdb/slice_transform.h" #include "table/block_based/block.h" #include "table/block_based/block_based_table_reader.h" -#include "table/block_based/full_filter_block.h" #include "table/block_based/cachable_entry.h" +#include "table/block_based/full_filter_block.h" #include "util/autovector.h" namespace rocksdb { diff --git a/table/block_based/partitioned_filter_block_test.cc b/table/block_based/partitioned_filter_block_test.cc index 2bcafa977..9a1a4d526 100644 --- a/table/block_based/partitioned_filter_block_test.cc +++ b/table/block_based/partitioned_filter_block_test.cc @@ -3,20 +3,19 @@ // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). - #include #include "rocksdb/filter_policy.h" -#include "table/full_filter_bits_builder.h" #include "table/block_based/partitioned_filter_block.h" +#include "table/full_filter_bits_builder.h" #include "index_builder.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/coding.h" #include "util/hash.h" #include "util/logging.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" namespace rocksdb { diff --git a/table/block_fetcher.cc b/table/block_fetcher.cc index 6c6637029..263abbfcf 100644 --- a/table/block_fetcher.cc +++ b/table/block_fetcher.cc @@ -12,6 +12,7 @@ #include #include +#include "memory/memory_allocator.h" #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" #include "rocksdb/env.h" @@ -24,7 +25,6 @@ #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/logging.h" -#include "util/memory_allocator.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/xxhash.h" diff --git a/table/block_fetcher.h b/table/block_fetcher.h index 56b74b504..6451d6d2a 100644 --- a/table/block_fetcher.h +++ b/table/block_fetcher.h @@ -8,9 +8,9 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #pragma once +#include "memory/memory_allocator.h" #include "table/block_based/block.h" #include "table/format.h" -#include "util/memory_allocator.h" namespace rocksdb { diff --git a/table/cuckoo/cuckoo_table_builder_test.cc b/table/cuckoo/cuckoo_table_builder_test.cc index 1467e2a8d..f9d46c03b 100644 --- a/table/cuckoo/cuckoo_table_builder_test.cc +++ b/table/cuckoo/cuckoo_table_builder_test.cc @@ -10,11 +10,11 @@ #include #include -#include "table/meta_blocks.h" #include "table/cuckoo/cuckoo_table_builder.h" -#include "util/file_reader_writer.h" +#include "table/meta_blocks.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" namespace rocksdb { extern const uint64_t kCuckooTableMagicNumber; diff --git a/table/cuckoo/cuckoo_table_reader.cc b/table/cuckoo/cuckoo_table_reader.cc index 72885be94..905528e9b 100644 --- a/table/cuckoo/cuckoo_table_reader.cc +++ b/table/cuckoo/cuckoo_table_reader.cc @@ -15,13 +15,13 @@ #include #include #include +#include "memory/arena.h" #include "rocksdb/iterator.h" #include "rocksdb/table.h" -#include "table/internal_iterator.h" -#include "table/meta_blocks.h" #include "table/cuckoo/cuckoo_table_factory.h" #include "table/get_context.h" -#include "util/arena.h" +#include "table/internal_iterator.h" +#include "table/meta_blocks.h" #include "util/coding.h" namespace rocksdb { diff --git a/table/cuckoo/cuckoo_table_reader_test.cc b/table/cuckoo/cuckoo_table_reader_test.cc index 71e231336..681e0dfdf 100644 --- a/table/cuckoo/cuckoo_table_reader_test.cc +++ b/table/cuckoo/cuckoo_table_reader_test.cc @@ -22,17 +22,17 @@ int main() { #include #include +#include "memory/arena.h" #include "table/cuckoo/cuckoo_table_builder.h" #include "table/cuckoo/cuckoo_table_factory.h" #include "table/cuckoo/cuckoo_table_reader.h" #include "table/get_context.h" #include "table/meta_blocks.h" -#include "util/arena.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/gflags_compat.h" #include "util/random.h" #include "util/string_util.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; using GFLAGS_NAMESPACE::SetUsageMessage; diff --git a/table/format.cc b/table/format.cc index 1adcce6f3..3f95fd4d4 100644 --- a/table/format.cc +++ b/table/format.cc @@ -13,6 +13,7 @@ #include #include "block_fetcher.h" +#include "memory/memory_allocator.h" #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" #include "rocksdb/env.h" @@ -24,7 +25,6 @@ #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/logging.h" -#include "util/memory_allocator.h" #include "util/stop_watch.h" #include "util/string_util.h" #include "util/xxhash.h" diff --git a/table/format.h b/table/format.h index 84242303e..baad78070 100644 --- a/table/format.h +++ b/table/format.h @@ -22,11 +22,11 @@ #include "rocksdb/status.h" #include "rocksdb/table.h" +#include "memory/memory_allocator.h" #include "options/cf_options.h" #include "port/port.h" // noexcept #include "table/persistent_cache_options.h" #include "util/file_reader_writer.h" -#include "util/memory_allocator.h" namespace rocksdb { diff --git a/table/get_context.h b/table/get_context.h index 8df343b36..ddce33fb3 100644 --- a/table/get_context.h +++ b/table/get_context.h @@ -4,8 +4,8 @@ // (found in the LICENSE.Apache file in the root directory). #pragma once -#include #include +#include #include "db/merge_context.h" #include "db/read_callback.h" #include "rocksdb/env.h" diff --git a/table/iterator.cc b/table/iterator.cc index 0475b9d13..97a0cef5e 100644 --- a/table/iterator.cc +++ b/table/iterator.cc @@ -8,9 +8,9 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "rocksdb/iterator.h" +#include "memory/arena.h" #include "table/internal_iterator.h" #include "table/iterator_wrapper.h" -#include "util/arena.h" namespace rocksdb { diff --git a/table/merging_iterator.cc b/table/merging_iterator.cc index 85a2fcc03..1a0d4df89 100644 --- a/table/merging_iterator.cc +++ b/table/merging_iterator.cc @@ -12,6 +12,7 @@ #include #include "db/dbformat.h" #include "db/pinned_iterators_manager.h" +#include "memory/arena.h" #include "monitoring/perf_context_imp.h" #include "rocksdb/comparator.h" #include "rocksdb/iterator.h" @@ -19,11 +20,10 @@ #include "table/internal_iterator.h" #include "table/iter_heap.h" #include "table/iterator_wrapper.h" -#include "util/arena.h" +#include "test_util/sync_point.h" #include "util/autovector.h" #include "util/heap.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" namespace rocksdb { // Without anonymous namespace here, we fail the warning -Wmissing-prototypes diff --git a/table/meta_blocks.cc b/table/meta_blocks.cc index 9d56c5b9c..341a11855 100644 --- a/table/meta_blocks.cc +++ b/table/meta_blocks.cc @@ -16,9 +16,9 @@ #include "table/internal_iterator.h" #include "table/persistent_cache_helper.h" #include "table/table_properties_internal.h" +#include "test_util/sync_point.h" #include "util/coding.h" #include "util/file_reader_writer.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/table/mock_table.h b/table/mock_table.h index f99941863..42e28266d 100644 --- a/table/mock_table.h +++ b/table/mock_table.h @@ -12,16 +12,16 @@ #include #include -#include "util/kv_map.h" #include "port/port.h" #include "rocksdb/comparator.h" #include "rocksdb/table.h" #include "table/internal_iterator.h" #include "table/table_builder.h" #include "table/table_reader.h" -#include "util/mutexlock.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/kv_map.h" +#include "util/mutexlock.h" namespace rocksdb { namespace mock { diff --git a/table/plain/plain_table_builder.cc b/table/plain/plain_table_builder.cc index 6160d7afd..4d50d8176 100644 --- a/table/plain/plain_table_builder.cc +++ b/table/plain/plain_table_builder.cc @@ -12,18 +12,18 @@ #include #include +#include "db/dbformat.h" #include "rocksdb/comparator.h" #include "rocksdb/env.h" #include "rocksdb/filter_policy.h" #include "rocksdb/options.h" #include "rocksdb/table.h" -#include "table/plain/plain_table_factory.h" -#include "db/dbformat.h" #include "table/block_based/block_builder.h" #include "table/bloom_block.h" -#include "table/plain/plain_table_index.h" #include "table/format.h" #include "table/meta_blocks.h" +#include "table/plain/plain_table_factory.h" +#include "table/plain/plain_table_index.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" diff --git a/table/plain/plain_table_index.h b/table/plain/plain_table_index.h index 1457fd00d..7c8ed1953 100644 --- a/table/plain/plain_table_index.h +++ b/table/plain/plain_table_index.h @@ -11,10 +11,10 @@ #include #include "db/dbformat.h" +#include "memory/arena.h" #include "monitoring/histogram.h" #include "options/cf_options.h" #include "rocksdb/options.h" -#include "util/arena.h" #include "util/hash.h" #include "util/murmurhash.h" diff --git a/table/plain/plain_table_key_coding.cc b/table/plain/plain_table_key_coding.cc index 9c4b614b5..c84f337eb 100644 --- a/table/plain/plain_table_key_coding.cc +++ b/table/plain/plain_table_key_coding.cc @@ -9,8 +9,8 @@ #include #include #include "db/dbformat.h" -#include "table/plain/plain_table_reader.h" #include "table/plain/plain_table_factory.h" +#include "table/plain/plain_table_reader.h" #include "util/file_reader_writer.h" namespace rocksdb { diff --git a/table/plain/plain_table_key_coding.h b/table/plain/plain_table_key_coding.h index 26af3f6d8..5f65d5a65 100644 --- a/table/plain/plain_table_key_coding.h +++ b/table/plain/plain_table_key_coding.h @@ -8,8 +8,8 @@ #ifndef ROCKSDB_LITE #include -#include "rocksdb/slice.h" #include "db/dbformat.h" +#include "rocksdb/slice.h" #include "table/plain/plain_table_reader.h" // The file contains three helper classes of PlainTable format, diff --git a/table/plain/plain_table_reader.cc b/table/plain/plain_table_reader.cc index b4aad5587..38852059b 100644 --- a/table/plain/plain_table_reader.cc +++ b/table/plain/plain_table_reader.cc @@ -20,19 +20,19 @@ #include "rocksdb/statistics.h" #include "table/block_based/block.h" -#include "table/bloom_block.h" #include "table/block_based/filter_block.h" +#include "table/bloom_block.h" #include "table/format.h" +#include "table/get_context.h" #include "table/internal_iterator.h" #include "table/meta_blocks.h" -#include "table/two_level_iterator.h" #include "table/plain/plain_table_factory.h" #include "table/plain/plain_table_key_coding.h" -#include "table/get_context.h" +#include "table/two_level_iterator.h" +#include "memory/arena.h" #include "monitoring/histogram.h" #include "monitoring/perf_context_imp.h" -#include "util/arena.h" #include "util/coding.h" #include "util/dynamic_bloom.h" #include "util/hash.h" diff --git a/table/plain/plain_table_reader.h b/table/plain/plain_table_reader.h index ec6e6a7fe..6c1c12ab8 100644 --- a/table/plain/plain_table_reader.h +++ b/table/plain/plain_table_reader.h @@ -13,15 +13,15 @@ #include #include "db/dbformat.h" +#include "memory/arena.h" #include "rocksdb/env.h" #include "rocksdb/iterator.h" #include "rocksdb/slice_transform.h" #include "rocksdb/table.h" #include "rocksdb/table_properties.h" -#include "table/table_reader.h" #include "table/plain/plain_table_factory.h" #include "table/plain/plain_table_index.h" -#include "util/arena.h" +#include "table/table_reader.h" #include "util/dynamic_bloom.h" #include "util/file_reader_writer.h" diff --git a/table/sst_file_writer.cc b/table/sst_file_writer.cc index 69993492d..b53f3161e 100644 --- a/table/sst_file_writer.cc +++ b/table/sst_file_writer.cc @@ -11,8 +11,8 @@ #include "rocksdb/table.h" #include "table/block_based/block_based_table_builder.h" #include "table/sst_file_writer_collectors.h" -#include "util/file_reader_writer.h" #include "test_util/sync_point.h" +#include "util/file_reader_writer.h" namespace rocksdb { diff --git a/table/table_reader_bench.cc b/table/table_reader_bench.cc index f2ae016c1..822c2294b 100644 --- a/table/table_reader_bench.cc +++ b/table/table_reader_bench.cc @@ -22,10 +22,10 @@ int main() { #include "table/internal_iterator.h" #include "table/plain/plain_table_factory.h" #include "table/table_builder.h" -#include "util/file_reader_writer.h" -#include "util/gflags_compat.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" +#include "util/gflags_compat.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; using GFLAGS_NAMESPACE::SetUsageMessage; diff --git a/table/table_test.cc b/table/table_test.cc index 372443b53..c59c9d8c3 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -46,12 +46,12 @@ #include "table/plain/plain_table_factory.h" #include "table/scoped_arena_iterator.h" #include "table/sst_file_writer_collectors.h" -#include "util/compression.h" -#include "util/random.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/compression.h" +#include "util/random.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" namespace rocksdb { diff --git a/table/two_level_iterator.cc b/table/two_level_iterator.cc index ba883763e..7ff73cd4e 100644 --- a/table/two_level_iterator.cc +++ b/table/two_level_iterator.cc @@ -9,11 +9,11 @@ #include "table/two_level_iterator.h" #include "db/pinned_iterators_manager.h" +#include "memory/arena.h" #include "rocksdb/options.h" #include "rocksdb/table.h" #include "table/block_based/block.h" #include "table/format.h" -#include "util/arena.h" namespace rocksdb { diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 12caa2809..30aafb660 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -60,6 +60,8 @@ #include "rocksdb/utilities/transaction.h" #include "rocksdb/utilities/transaction_db.h" #include "rocksdb/write_batch.h" +#include "test_util/testutil.h" +#include "test_util/transaction_test_util.h" #include "util/cast_util.h" #include "util/compression.h" #include "util/crc32c.h" @@ -68,8 +70,6 @@ #include "util/random.h" #include "util/stderr_logger.h" #include "util/string_util.h" -#include "test_util/testutil.h" -#include "test_util/transaction_test_util.h" #include "util/xxhash.h" #include "utilities/blob_db/blob_db.h" #include "utilities/merge_operators.h" diff --git a/tools/db_bench_tool_test.cc b/tools/db_bench_tool_test.cc index 52a1f9b91..4eb5472ac 100644 --- a/tools/db_bench_tool_test.cc +++ b/tools/db_bench_tool_test.cc @@ -10,9 +10,9 @@ #include "rocksdb/db_bench_tool.h" #include "options/options_parser.h" #include "rocksdb/utilities/options_util.h" -#include "util/random.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/random.h" #ifdef GFLAGS #include "util/gflags_compat.h" diff --git a/tools/db_repl_stress.cc b/tools/db_repl_stress.cc index 41ae4c276..c7ad71738 100644 --- a/tools/db_repl_stress.cc +++ b/tools/db_repl_stress.cc @@ -18,8 +18,8 @@ int main() { #include "db/write_batch_internal.h" #include "rocksdb/db.h" #include "rocksdb/types.h" -#include "util/gflags_compat.h" #include "test_util/testutil.h" +#include "util/gflags_compat.h" // Run a thread to perform Put's. // Another thread uses GetUpdatesSince API to keep getting the updates. diff --git a/tools/db_stress.cc b/tools/db_stress.cc index b9ab1a2df..c112cb348 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -1977,8 +1977,9 @@ class StressTest { } // Check if the multiget batch crossed the ops_per_open boundary. If it // did, then we should vote to reopen - if (i != 0 && (i % ops_per_open == 0 || - i % ops_per_open < (i - multiget_batch_size) % ops_per_open)) { + if (i != 0 && + (i % ops_per_open == 0 || + i % ops_per_open < (i - multiget_batch_size) % ops_per_open)) { { thread->stats.FinishedSingleOp(); MutexLock l(thread->shared->GetMutex()); @@ -2173,7 +2174,7 @@ class StressTest { snap_state); } while (!thread->snapshot_queue.empty() && - i >= thread->snapshot_queue.front().first) { + i >= thread->snapshot_queue.front().first) { auto snap_state = thread->snapshot_queue.front().second; assert(snap_state.snapshot); // Note: this is unsafe as the cf might be dropped concurrently. But it @@ -2202,7 +2203,7 @@ class StressTest { // number of ops multiget_batch_size = static_cast( std::min(static_cast(thread->rand.Uniform(64)), - FLAGS_ops_per_thread - i - 1)); + FLAGS_ops_per_thread - i - 1)); // If its the last iteration, ensure that multiget_batch_size is 1 multiget_batch_size = std::max(multiget_batch_size, 1); rand_keys = GenerateNKeys(thread, multiget_batch_size, i); diff --git a/tools/reduce_levels_test.cc b/tools/reduce_levels_test.cc index a76416b6c..3aa0e3cf3 100644 --- a/tools/reduce_levels_test.cc +++ b/tools/reduce_levels_test.cc @@ -10,10 +10,10 @@ #include "db/version_set.h" #include "rocksdb/db.h" #include "rocksdb/utilities/ldb_cmd.h" -#include "tools/ldb_cmd_impl.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "tools/ldb_cmd_impl.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/tools/sst_dump_test.cc b/tools/sst_dump_test.cc index ea27f3c8d..d3b1f0e58 100644 --- a/tools/sst_dump_test.cc +++ b/tools/sst_dump_test.cc @@ -15,9 +15,9 @@ #include "rocksdb/filter_policy.h" #include "table/block_based/block_based_table_factory.h" #include "table/table_builder.h" -#include "util/file_reader_writer.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" namespace rocksdb { diff --git a/tools/trace_analyzer_test.cc b/tools/trace_analyzer_test.cc index 2f31c5d82..7c242f60f 100644 --- a/tools/trace_analyzer_test.cc +++ b/tools/trace_analyzer_test.cc @@ -27,9 +27,9 @@ int main() { #include "rocksdb/env.h" #include "rocksdb/status.h" #include "rocksdb/trace_reader_writer.h" -#include "tools/trace_analyzer_tool.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "tools/trace_analyzer_tool.h" #include "util/trace_replay.h" namespace rocksdb { diff --git a/util/auto_roll_logger.h b/util/auto_roll_logger.h index 5a2049b64..a5b2139fc 100644 --- a/util/auto_roll_logger.h +++ b/util/auto_roll_logger.h @@ -13,8 +13,8 @@ #include "file/filename.h" #include "port/port.h" #include "port/util_logger.h" -#include "util/mutexlock.h" #include "test_util/sync_point.h" +#include "util/mutexlock.h" namespace rocksdb { diff --git a/util/auto_roll_logger_test.cc b/util/auto_roll_logger_test.cc index 3adbdbb13..87de5ed5b 100644 --- a/util/auto_roll_logger_test.cc +++ b/util/auto_roll_logger_test.cc @@ -19,9 +19,9 @@ #include #include "port/port.h" #include "rocksdb/db.h" -#include "util/logging.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/logging.h" namespace rocksdb { namespace { diff --git a/util/autovector_test.cc b/util/autovector_test.cc index edb7af9ea..6b1b36e8d 100644 --- a/util/autovector_test.cc +++ b/util/autovector_test.cc @@ -9,10 +9,10 @@ #include #include "rocksdb/env.h" -#include "util/autovector.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/autovector.h" +#include "util/string_util.h" using std::cout; using std::endl; diff --git a/util/bloom.cc b/util/bloom.cc index bedf4a658..953a42fa2 100644 --- a/util/bloom.cc +++ b/util/bloom.cc @@ -11,8 +11,8 @@ #include "rocksdb/slice.h" #include "table/block_based/block_based_filter_block.h" -#include "table/full_filter_bits_builder.h" #include "table/block_based/full_filter_block.h" +#include "table/full_filter_bits_builder.h" #include "util/coding.h" #include "util/hash.h" diff --git a/util/bloom_test.cc b/util/bloom_test.cc index 87cd9da55..7a1372830 100644 --- a/util/bloom_test.cc +++ b/util/bloom_test.cc @@ -17,13 +17,13 @@ int main() { #include +#include "memory/arena.h" #include "rocksdb/filter_policy.h" #include "table/full_filter_bits_builder.h" -#include "util/arena.h" -#include "util/gflags_compat.h" -#include "util/logging.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/compression.h b/util/compression.h index b901ceb35..aa8af7449 100644 --- a/util/compression.h +++ b/util/compression.h @@ -20,11 +20,11 @@ #endif // ROCKSDB_MALLOC_USABLE_SIZE #include +#include "memory/memory_allocator.h" #include "rocksdb/options.h" #include "rocksdb/table.h" #include "util/coding.h" #include "util/compression_context_cache.h" -#include "util/memory_allocator.h" #include "util/string_util.h" #ifdef SNAPPY diff --git a/util/dynamic_bloom.cc b/util/dynamic_bloom.cc index 8e90efd89..4dfccb0bf 100644 --- a/util/dynamic_bloom.cc +++ b/util/dynamic_bloom.cc @@ -7,9 +7,9 @@ #include +#include "memory/allocator.h" #include "port/port.h" #include "rocksdb/slice.h" -#include "util/allocator.h" #include "util/hash.h" namespace rocksdb { diff --git a/util/dynamic_bloom_test.cc b/util/dynamic_bloom_test.cc index a8a7000f6..036e01280 100644 --- a/util/dynamic_bloom_test.cc +++ b/util/dynamic_bloom_test.cc @@ -24,13 +24,13 @@ int main() { #include #include "dynamic_bloom.h" +#include "memory/arena.h" #include "port/port.h" -#include "util/arena.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" -#include "test_util/testharness.h" -#include "test_util/testutil.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; diff --git a/util/event_logger_test.cc b/util/event_logger_test.cc index 16c6c59f7..1ee0c4d97 100644 --- a/util/event_logger_test.cc +++ b/util/event_logger_test.cc @@ -5,8 +5,8 @@ #include -#include "util/event_logger.h" #include "test_util/testharness.h" +#include "util/event_logger.h" namespace rocksdb { diff --git a/util/file_reader_writer.cc b/util/file_reader_writer.cc index 3003a1eba..2c4e0a39f 100644 --- a/util/file_reader_writer.cc +++ b/util/file_reader_writer.cc @@ -15,9 +15,9 @@ #include "monitoring/histogram.h" #include "monitoring/iostats_context_imp.h" #include "port/port.h" +#include "test_util/sync_point.h" #include "util/random.h" #include "util/rate_limiter.h" -#include "test_util/sync_point.h" namespace rocksdb { diff --git a/util/file_reader_writer.h b/util/file_reader_writer.h index 317c1d6c7..5ec332fc7 100644 --- a/util/file_reader_writer.h +++ b/util/file_reader_writer.h @@ -15,8 +15,8 @@ #include "rocksdb/env.h" #include "rocksdb/listener.h" #include "rocksdb/rate_limiter.h" -#include "util/aligned_buffer.h" #include "test_util/sync_point.h" +#include "util/aligned_buffer.h" namespace rocksdb { diff --git a/util/file_reader_writer_test.cc b/util/file_reader_writer_test.cc index 18bb65a72..a4a9458d6 100644 --- a/util/file_reader_writer_test.cc +++ b/util/file_reader_writer_test.cc @@ -6,9 +6,9 @@ #include "util/file_reader_writer.h" #include #include -#include "util/random.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/random.h" namespace rocksdb { diff --git a/util/filelock_test.cc b/util/filelock_test.cc index bd0fc7c42..3244563d7 100644 --- a/util/filelock_test.cc +++ b/util/filelock_test.cc @@ -6,10 +6,10 @@ #include "rocksdb/status.h" #include "rocksdb/env.h" -#include #include -#include "util/coding.h" +#include #include "test_util/testharness.h" +#include "util/coding.h" namespace rocksdb { diff --git a/util/hash_test.cc b/util/hash_test.cc index 6618c5a4b..8973f926b 100644 --- a/util/hash_test.cc +++ b/util/hash_test.cc @@ -9,8 +9,8 @@ #include -#include "util/hash.h" #include "test_util/testharness.h" +#include "util/hash.h" // The hash algorithm is part of the file format, for example for the Bloom // filters. Test that the hash values are stable for a set of random strings of diff --git a/util/log_buffer.h b/util/log_buffer.h index e356b93a7..16fb24311 100644 --- a/util/log_buffer.h +++ b/util/log_buffer.h @@ -5,11 +5,11 @@ #pragma once +#include +#include "memory/arena.h" +#include "port/sys_time.h" #include "rocksdb/env.h" -#include "util/arena.h" #include "util/autovector.h" -#include "port/sys_time.h" -#include namespace rocksdb { diff --git a/util/log_write_bench.cc b/util/log_write_bench.cc index dd5322151..9efa43f8a 100644 --- a/util/log_write_bench.cc +++ b/util/log_write_bench.cc @@ -13,10 +13,10 @@ int main() { #include "monitoring/histogram.h" #include "rocksdb/env.h" -#include "util/file_reader_writer.h" -#include "util/gflags_compat.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/file_reader_writer.h" +#include "util/gflags_compat.h" using GFLAGS_NAMESPACE::ParseCommandLineFlags; using GFLAGS_NAMESPACE::SetUsageMessage; diff --git a/util/rate_limiter.cc b/util/rate_limiter.cc index 93665837f..0ee06a121 100644 --- a/util/rate_limiter.cc +++ b/util/rate_limiter.cc @@ -11,8 +11,8 @@ #include "monitoring/statistics.h" #include "port/port.h" #include "rocksdb/env.h" -#include "util/aligned_buffer.h" #include "test_util/sync_point.h" +#include "util/aligned_buffer.h" namespace rocksdb { diff --git a/util/rate_limiter_test.cc b/util/rate_limiter_test.cc index 3316a75b5..d9f17cc3a 100644 --- a/util/rate_limiter_test.cc +++ b/util/rate_limiter_test.cc @@ -19,9 +19,9 @@ #include "db/db_test_util.h" #include "rocksdb/env.h" -#include "util/random.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/random.h" namespace rocksdb { diff --git a/util/repeatable_thread_test.cc b/util/repeatable_thread_test.cc index 29af340d7..8a993e369 100644 --- a/util/repeatable_thread_test.cc +++ b/util/repeatable_thread_test.cc @@ -7,9 +7,9 @@ #include #include "db/db_test_util.h" -#include "util/repeatable_thread.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/repeatable_thread.h" class RepeatableThreadTest : public testing::Test { public: diff --git a/util/thread_local_test.cc b/util/thread_local_test.cc index 787638138..9926c3917 100644 --- a/util/thread_local_test.cc +++ b/util/thread_local_test.cc @@ -7,12 +7,12 @@ #include #include -#include "rocksdb/env.h" #include "port/port.h" -#include "util/autovector.h" +#include "rocksdb/env.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/autovector.h" #include "util/thread_local.h" namespace rocksdb { diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index 816c9718b..dcd88ffdb 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -14,13 +14,13 @@ #include "port/port.h" #include "rocksdb/rate_limiter.h" #include "rocksdb/transaction_log.h" +#include "test_util/sync_point.h" #include "util/channel.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" #include "util/logging.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "utilities/checkpoint/checkpoint_impl.h" #ifndef __STDC_FORMAT_MACROS diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index c7377064f..05006d6a3 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -22,14 +22,14 @@ #include "rocksdb/types.h" #include "rocksdb/utilities/backupable_db.h" #include "rocksdb/utilities/options_util.h" +#include "test_util/sync_point.h" +#include "test_util/testharness.h" +#include "test_util/testutil.h" #include "util/file_reader_writer.h" #include "util/mutexlock.h" #include "util/random.h" #include "util/stderr_logger.h" #include "util/string_util.h" -#include "test_util/sync_point.h" -#include "test_util/testharness.h" -#include "test_util/testutil.h" namespace rocksdb { diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index a93169c30..04b7eb73e 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -27,6 +27,7 @@ #include "table/block_based/block_based_table_builder.h" #include "table/block_based/block_builder.h" #include "table/meta_blocks.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/crc32c.h" #include "util/file_reader_writer.h" @@ -34,7 +35,6 @@ #include "util/mutexlock.h" #include "util/random.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" #include "util/timer_queue.h" #include "utilities/blob_db/blob_compaction_filter.h" #include "utilities/blob_db/blob_db_iterator.h" diff --git a/utilities/blob_db/blob_db_test.cc b/utilities/blob_db/blob_db_test.cc index 19dce3f87..19b8b0c72 100644 --- a/utilities/blob_db/blob_db_test.cc +++ b/utilities/blob_db/blob_db_test.cc @@ -18,12 +18,12 @@ #include "file/sst_file_manager_impl.h" #include "port/port.h" #include "rocksdb/utilities/debug.h" -#include "util/cast_util.h" #include "test_util/fault_injection_test_env.h" -#include "util/random.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" +#include "util/cast_util.h" +#include "util/random.h" +#include "util/string_util.h" #include "utilities/blob_db/blob_db.h" #include "utilities/blob_db/blob_db_impl.h" #include "utilities/blob_db/blob_index.h" diff --git a/utilities/cassandra/cassandra_functional_test.cc b/utilities/cassandra/cassandra_functional_test.cc index 347846d07..431ef6979 100644 --- a/utilities/cassandra/cassandra_functional_test.cc +++ b/utilities/cassandra/cassandra_functional_test.cc @@ -4,16 +4,16 @@ // (found in the LICENSE.Apache file in the root directory). #include -#include "rocksdb/db.h" #include "db/db_impl.h" +#include "rocksdb/db.h" #include "rocksdb/merge_operator.h" #include "rocksdb/utilities/db_ttl.h" #include "test_util/testharness.h" #include "util/random.h" -#include "utilities/merge_operators.h" #include "utilities/cassandra/cassandra_compaction_filter.h" #include "utilities/cassandra/merge_operator.h" #include "utilities/cassandra/test_utils.h" +#include "utilities/merge_operators.h" using namespace rocksdb; diff --git a/utilities/cassandra/format.h b/utilities/cassandra/format.h index 562c1aff3..b7f6e32f6 100644 --- a/utilities/cassandra/format.h +++ b/utilities/cassandra/format.h @@ -56,8 +56,8 @@ #pragma once #include -#include #include +#include #include "rocksdb/merge_operator.h" #include "rocksdb/slice.h" #include "test_util/testharness.h" diff --git a/utilities/memory/memory_test.cc b/utilities/memory/memory_test.cc index 224f7886b..29903d460 100644 --- a/utilities/memory/memory_test.cc +++ b/utilities/memory/memory_test.cc @@ -11,9 +11,9 @@ #include "rocksdb/utilities/memory_util.h" #include "rocksdb/utilities/stackable_db.h" #include "table/block_based/block_based_table_factory.h" -#include "util/string_util.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/string_util.h" namespace rocksdb { diff --git a/utilities/merge_operators/string_append/stringappend_test.cc b/utilities/merge_operators/string_append/stringappend_test.cc index 160bd347b..f0b83f621 100644 --- a/utilities/merge_operators/string_append/stringappend_test.cc +++ b/utilities/merge_operators/string_append/stringappend_test.cc @@ -12,11 +12,11 @@ #include "rocksdb/db.h" #include "rocksdb/merge_operator.h" #include "rocksdb/utilities/db_ttl.h" +#include "test_util/testharness.h" +#include "util/random.h" #include "utilities/merge_operators.h" #include "utilities/merge_operators/string_append/stringappend.h" #include "utilities/merge_operators/string_append/stringappend2.h" -#include "test_util/testharness.h" -#include "util/random.h" using namespace rocksdb; diff --git a/utilities/options/options_util_test.cc b/utilities/options/options_util_test.cc index 342db4902..5b8015152 100644 --- a/utilities/options/options_util_test.cc +++ b/utilities/options/options_util_test.cc @@ -17,9 +17,9 @@ #include "rocksdb/db.h" #include "rocksdb/table.h" #include "rocksdb/utilities/options_util.h" -#include "util/random.h" #include "test_util/testharness.h" #include "test_util/testutil.h" +#include "util/random.h" #ifndef GFLAGS bool FLAGS_enable_print = false; diff --git a/utilities/persistent_cache/block_cache_tier.cc b/utilities/persistent_cache/block_cache_tier.cc index 775ef29cf..5baf64772 100644 --- a/utilities/persistent_cache/block_cache_tier.cc +++ b/utilities/persistent_cache/block_cache_tier.cc @@ -11,9 +11,9 @@ #include #include "port/port.h" +#include "test_util/sync_point.h" #include "util/logging.h" #include "util/stop_watch.h" -#include "test_util/sync_point.h" #include "utilities/persistent_cache/block_cache_tier_file.h" namespace rocksdb { diff --git a/utilities/persistent_cache/block_cache_tier.h b/utilities/persistent_cache/block_cache_tier.h index 670463a87..00dd9a173 100644 --- a/utilities/persistent_cache/block_cache_tier.h +++ b/utilities/persistent_cache/block_cache_tier.h @@ -27,10 +27,10 @@ #include "utilities/persistent_cache/block_cache_tier_metadata.h" #include "utilities/persistent_cache/persistent_cache_util.h" +#include "memory/arena.h" #include "memtable/skiplist.h" #include "monitoring/histogram.h" #include "port/port.h" -#include "util/arena.h" #include "util/coding.h" #include "util/crc32c.h" #include "util/mutexlock.h" diff --git a/utilities/persistent_cache/block_cache_tier_file_buffer.h b/utilities/persistent_cache/block_cache_tier_file_buffer.h index 9d9465c6c..e4f8f5ba4 100644 --- a/utilities/persistent_cache/block_cache_tier_file_buffer.h +++ b/utilities/persistent_cache/block_cache_tier_file_buffer.h @@ -9,7 +9,7 @@ #include #include "include/rocksdb/comparator.h" -#include "util/arena.h" +#include "memory/arena.h" #include "util/mutexlock.h" namespace rocksdb { diff --git a/utilities/persistent_cache/hash_table_test.cc b/utilities/persistent_cache/hash_table_test.cc index 51ad211e9..9cc153497 100644 --- a/utilities/persistent_cache/hash_table_test.cc +++ b/utilities/persistent_cache/hash_table_test.cc @@ -9,9 +9,9 @@ #include #include "db/db_test_util.h" -#include "util/arena.h" -#include "util/random.h" +#include "memory/arena.h" #include "test_util/testharness.h" +#include "util/random.h" #include "utilities/persistent_cache/hash_table.h" #include "utilities/persistent_cache/hash_table_evictable.h" diff --git a/utilities/persistent_cache/persistent_cache_test.h b/utilities/persistent_cache/persistent_cache_test.h index 6d15d13b6..29c334442 100644 --- a/utilities/persistent_cache/persistent_cache_test.h +++ b/utilities/persistent_cache/persistent_cache_test.h @@ -19,10 +19,10 @@ #include #include "db/db_test_util.h" +#include "memory/arena.h" +#include "port/port.h" #include "rocksdb/cache.h" #include "table/block_based/block_builder.h" -#include "port/port.h" -#include "util/arena.h" #include "test_util/testharness.h" #include "utilities/persistent_cache/volatile_tier_impl.h" diff --git a/utilities/transactions/optimistic_transaction_test.cc b/utilities/transactions/optimistic_transaction_test.cc index e3105a213..4f075d0d9 100644 --- a/utilities/transactions/optimistic_transaction_test.cc +++ b/utilities/transactions/optimistic_transaction_test.cc @@ -9,15 +9,15 @@ #include #include +#include "port/port.h" #include "rocksdb/db.h" #include "rocksdb/utilities/optimistic_transaction_db.h" #include "rocksdb/utilities/transaction.h" +#include "test_util/testharness.h" +#include "test_util/transaction_test_util.h" #include "util/crc32c.h" #include "util/logging.h" #include "util/random.h" -#include "test_util/testharness.h" -#include "test_util/transaction_test_util.h" -#include "port/port.h" using std::string; diff --git a/utilities/transactions/pessimistic_transaction.cc b/utilities/transactions/pessimistic_transaction.cc index fd9da17aa..93d75a835 100644 --- a/utilities/transactions/pessimistic_transaction.cc +++ b/utilities/transactions/pessimistic_transaction.cc @@ -19,9 +19,9 @@ #include "rocksdb/snapshot.h" #include "rocksdb/status.h" #include "rocksdb/utilities/transaction_db.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "utilities/transactions/pessimistic_transaction_db.h" #include "utilities/transactions/transaction_util.h" diff --git a/utilities/transactions/pessimistic_transaction_db.cc b/utilities/transactions/pessimistic_transaction_db.cc index 95c88594c..8920f85fb 100644 --- a/utilities/transactions/pessimistic_transaction_db.cc +++ b/utilities/transactions/pessimistic_transaction_db.cc @@ -20,9 +20,9 @@ #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/mutexlock.h" -#include "test_util/sync_point.h" #include "utilities/transactions/pessimistic_transaction.h" #include "utilities/transactions/transaction_db_mutex_impl.h" #include "utilities/transactions/write_prepared_txn_db.h" diff --git a/utilities/transactions/transaction_lock_mgr.cc b/utilities/transactions/transaction_lock_mgr.cc index 173e012d8..757b77fde 100644 --- a/utilities/transactions/transaction_lock_mgr.cc +++ b/utilities/transactions/transaction_lock_mgr.cc @@ -23,9 +23,9 @@ #include "monitoring/perf_context_imp.h" #include "rocksdb/slice.h" #include "rocksdb/utilities/transaction_db_mutex.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/hash.h" -#include "test_util/sync_point.h" #include "util/thread_local.h" #include "utilities/transactions/pessimistic_transaction_db.h" diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index d183401f4..0750b249b 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -24,12 +24,12 @@ #include "rocksdb/utilities/transaction_db.h" #include "table/mock_table.h" #include "test_util/fault_injection_test_env.h" -#include "util/random.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "test_util/transaction_test_util.h" +#include "util/random.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" #include "utilities/merge_operators/string_append/stringappend.h" #include "utilities/transactions/pessimistic_transaction_db.h" diff --git a/utilities/transactions/transaction_test.h b/utilities/transactions/transaction_test.h index 8dfa6b053..22dc208f5 100644 --- a/utilities/transactions/transaction_test.h +++ b/utilities/transactions/transaction_test.h @@ -22,12 +22,12 @@ #include "rocksdb/utilities/transaction_db.h" #include "table/mock_table.h" #include "test_util/fault_injection_test_env.h" -#include "util/random.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "test_util/transaction_test_util.h" +#include "util/random.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" #include "utilities/merge_operators/string_append/stringappend.h" #include "utilities/transactions/pessimistic_transaction_db.h" diff --git a/utilities/transactions/write_prepared_transaction_test.cc b/utilities/transactions/write_prepared_transaction_test.cc index 5287cca20..c0a7e2780 100644 --- a/utilities/transactions/write_prepared_transaction_test.cc +++ b/utilities/transactions/write_prepared_transaction_test.cc @@ -28,13 +28,13 @@ #include "rocksdb/utilities/transaction_db.h" #include "table/mock_table.h" #include "test_util/fault_injection_test_env.h" -#include "util/mutexlock.h" -#include "util/random.h" -#include "util/string_util.h" #include "test_util/sync_point.h" #include "test_util/testharness.h" #include "test_util/testutil.h" #include "test_util/transaction_test_util.h" +#include "util/mutexlock.h" +#include "util/random.h" +#include "util/string_util.h" #include "utilities/merge_operators.h" #include "utilities/merge_operators/string_append/stringappend.h" #include "utilities/transactions/pessimistic_transaction_db.h" diff --git a/utilities/transactions/write_prepared_txn_db.cc b/utilities/transactions/write_prepared_txn_db.cc index 0508a596e..b4a71f5ea 100644 --- a/utilities/transactions/write_prepared_txn_db.cc +++ b/utilities/transactions/write_prepared_txn_db.cc @@ -21,10 +21,10 @@ #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/utilities/transaction_db.h" +#include "test_util/sync_point.h" #include "util/cast_util.h" #include "util/mutexlock.h" #include "util/string_util.h" -#include "test_util/sync_point.h" #include "utilities/transactions/pessimistic_transaction.h" #include "utilities/transactions/transaction_db_mutex_impl.h" diff --git a/utilities/ttl/ttl_test.cc b/utilities/ttl/ttl_test.cc index c7d8f52aa..38c6affab 100644 --- a/utilities/ttl/ttl_test.cc +++ b/utilities/ttl/ttl_test.cc @@ -9,8 +9,8 @@ #include #include "rocksdb/compaction_filter.h" #include "rocksdb/utilities/db_ttl.h" -#include "util/string_util.h" #include "test_util/testharness.h" +#include "util/string_util.h" #ifndef OS_WIN #include #endif diff --git a/utilities/write_batch_with_index/write_batch_with_index.cc b/utilities/write_batch_with_index/write_batch_with_index.cc index adec3475c..0f8f6c1d6 100644 --- a/utilities/write_batch_with_index/write_batch_with_index.cc +++ b/utilities/write_batch_with_index/write_batch_with_index.cc @@ -13,11 +13,11 @@ #include "db/db_impl.h" #include "db/merge_context.h" #include "db/merge_helper.h" +#include "memory/arena.h" #include "memtable/skiplist.h" #include "options/db_options.h" #include "rocksdb/comparator.h" #include "rocksdb/iterator.h" -#include "util/arena.h" #include "util/cast_util.h" #include "util/string_util.h" #include "utilities/write_batch_with_index/write_batch_with_index_internal.h" diff --git a/utilities/write_batch_with_index/write_batch_with_index_test.cc b/utilities/write_batch_with_index/write_batch_with_index_test.cc index f8875d9ac..3e0a33c35 100644 --- a/utilities/write_batch_with_index/write_batch_with_index_test.cc +++ b/utilities/write_batch_with_index/write_batch_with_index_test.cc @@ -9,14 +9,14 @@ #ifndef ROCKSDB_LITE -#include +#include "rocksdb/utilities/write_batch_with_index.h" #include +#include #include "db/column_family.h" #include "port/stack_trace.h" -#include "rocksdb/utilities/write_batch_with_index.h" +#include "test_util/testharness.h" #include "util/random.h" #include "util/string_util.h" -#include "test_util/testharness.h" #include "utilities/merge_operators.h" #include "utilities/merge_operators/string_append/stringappend.h"