diff --git a/CMakeLists.txt b/CMakeLists.txt index 5614c83b44..c4dc2500fb 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 d41192ab2e..244b929c41 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 70d6e21941..a59af2fa69 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 377ae14687..0cc3d55950 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 14160f64c7..86aac02ab7 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 f5d57c35b7..21b3321bea 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 b97fd064e7..438fdb7c96 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 00ebd28b08..089dd66848 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 e9ded63250..598b08e7c6 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 b0a553136a..99bb026b5a 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 9e22e161f2..92a6fab8da 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 daf4138669..35c1100f99 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 4608cceeac..93e55b7a03 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 c01f2884d4..b25f6cb089 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 82fc16f4f5..dd33009eb1 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 b8d23795fb..20edd30748 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 ba7042049c..de55c706ab 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 130821ff99..53c4d42d28 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 f9efbc5850..6f60e2d703 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 623836454d..3051e89cd3 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 a1a1c8f99d..59757aeb9f 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 ec162bb961..5534c225f4 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 c5cc073666..c6025a8cc5 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 db47d14165..5dae140c7e 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 8fc17e1446..d953d365e0 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 8d8af3fd29..85b546c544 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 8c3588e9ab..b864ac4eae 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 49e670abc2..1503886443 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 37a9f1a365..b899ba18b4 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 bf0babd1a3..debb2ba603 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 1882cde59d..2af202fad9 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 322381b386..9eca823c2b 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 e3f06fe6b6..f4665b06ca 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 9c67102c5f..280d269f1c 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 26cd1127b9..aec398552c 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 330df7bfe4..00619d447d 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 1bef3aab0c..2091f80292 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 754cb3c465..6942aa682d 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 dabe673d84..377d128fae 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 c8729c6684..d4ae79ff29 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 d97ad9f0c2..ef89199c98 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 f95debec62..9e0823366d 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 146588d961..fb73f458ed 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 9d6851dab1..17b0ca1654 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 881534a1f1..81a0fa1767 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 5b159acf21..be7a3cbe7c 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 35e5019ca7..1a69a89dea 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 0c706115de..46acbbfa61 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 709e2061e5..6b8c4141f5 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 b50b58a1af..2b4ac6b84d 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 59da8af166..f55fbdc501 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 dc3624af53..3386f9bd06 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 d3dadaa5d3..13c35d2c01 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 c6e7d6af07..655c659b44 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 42d592862c..94eabff7ff 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 bfeb54243d..a73dd3cb43 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 e8290e76bc..3f2e794a6c 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 54a86169b2..97ba6ca4f8 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 4efd3fdf75..14c0169c11 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 0705cc032f..e818f46142 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 5c3bd686b1..6306785742 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 018517a138..668ff60f10 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 ee6499cdc3..471b4e095a 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 5f1ae98ba4..23c63b7cae 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 864fc97535..5d0529d270 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 41c27fdab6..9b4072dc77 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 20b5780c87..2fe5305f8d 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 b1478e26e5..c0c47b0c34 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 88c5252291..5de602cee8 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 dbb4759fa0..aa3d077c40 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 872d32ca81..5ee9439048 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 dcf79fb7fe..e5e0e99c0a 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 3f75dd6893..bf1a9e0e5c 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 852a99c1ad..615eca8b40 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 27198b1f97..313cbd8eee 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 44e3110d5e..22f28f5375 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 122a5d6177..510753b3b4 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 ed19b4109f..a8fb780054 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 9b7278c7d5..d63170452c 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 9d5de9a2f8..c6b8a92390 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 67e8a4db78..b774225535 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 dc64154c85..fd97f57e1e 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 052f2a6d5d..18296d307d 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 cef77d7e75..722eb3b60b 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 a6191100fd..6b41ab0247 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 cdd08e932e..1f58351bef 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 a1fa4938c5..ddd40aa059 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 878d233835..e347abe6e6 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 d02919cd4e..5c74657cd3 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 1ef8f2b6db..c3adb2ddbd 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 a2f62d5304..9670f3fc64 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 ae19909656..003d59b2a8 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 47a89034eb..275daa7940 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 054e3c9df0..33cc19b2d3 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 32870b127d..3955217cce 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 827ab8a5d2..e7acc94ad6 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 0b531a6ec5..388256abd9 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 9ae3dfb278..d5b0c25a32 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 704b2db802..429b607e4f 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 db64878bc0..584a524cf8 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 15d1e71141..6fbf6fc630 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 a0f4043bf7..c1ab36b8a6 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 8bf6f53561..3c54389b08 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 8d074275ce..e0ca57f1c5 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 034c6b238f..9769e394f8 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 0c580b445d..a1ef388911 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 609679394e..121cc916e2 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 725ecdb4e3..944a1fde43 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 6d265ba755..3af617fecf 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 0050f1f1e5..6e24f17cf6 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 a4c5678881..2dab4627cb 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 204e92ecbe..5ec0938714 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 8b01214c7e..378cdacfff 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 3e5d82733b..61df028c92 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 8b99f54b03..82c43b34ed 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 f11ecd4f4b..738b9e3e09 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 735f1c6e3e..6860bf82fe 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 2bcafa9771..9a1a4d526f 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 6c66370290..263abbfcf8 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 56b74b5042..6451d6d2ac 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 1467e2a8d1..f9d46c03bd 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 72885be940..905528e9bb 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 71e231336c..681e0dfdf3 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 1adcce6f3f..3f95fd4d44 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 84242303ec..baad78070c 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 8df343b365..ddce33fb3b 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 0475b9d134..97a0cef5e0 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 85a2fcc032..1a0d4df899 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 9d56c5b9c2..341a118557 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 f99941863a..42e28266d9 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 6160d7afd9..4d50d81764 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 1457fd00d8..7c8ed1953b 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 9c4b614b54..c84f337eb4 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 26af3f6d8b..5f65d5a656 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 b4aad55876..38852059bf 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 ec6e6a7feb..6c1c12ab8b 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 69993492d4..b53f3161e3 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 f2ae016c10..822c2294bb 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 372443b536..c59c9d8c33 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 ba883763e9..7ff73cd4e4 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 12caa2809a..30aafb6606 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 52a1f9b91e..4eb5472ace 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 41ae4c2761..c7ad71738f 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 b9ab1a2df1..c112cb348f 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 a76416b6c1..3aa0e3cf36 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 ea27f3c8d4..d3b1f0e581 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 2f31c5d824..7c242f60f2 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 5a2049b640..a5b2139fca 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 3adbdbb136..87de5ed5b9 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 edb7af9eaf..6b1b36e8d1 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 bedf4a6583..953a42fa21 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 87cd9da556..7a13728308 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 b901ceb351..aa8af74499 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 8e90efd89a..4dfccb0bf3 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 a8a7000f64..036e012800 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 16c6c59f70..1ee0c4d978 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 3003a1ebac..2c4e0a39f6 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 317c1d6c78..5ec332fc7a 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 18bb65a72b..a4a9458d64 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 bd0fc7c422..3244563d7c 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 6618c5a4bc..8973f926bc 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 e356b93a74..16fb243117 100644 --- a/util/log_buffer.h +++ b/util/log_buffer.h @@ -5,11 +5,11 @@ #pragma once -#include "rocksdb/env.h" -#include "util/arena.h" -#include "util/autovector.h" -#include "port/sys_time.h" #include +#include "memory/arena.h" +#include "port/sys_time.h" +#include "rocksdb/env.h" +#include "util/autovector.h" namespace rocksdb { diff --git a/util/log_write_bench.cc b/util/log_write_bench.cc index dd5322151e..9efa43f8a3 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 93665837fc..0ee06a121b 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 3316a75b57..d9f17cc3ac 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 29af340d7c..8a993e3699 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 787638138c..9926c39174 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 816c9718b2..dcd88ffdb8 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 c7377064f8..05006d6a3e 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 a93169c30c..04b7eb73e2 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 19dce3f87d..19b8b0c727 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 347846d075..431ef69792 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 562c1aff3f..b7f6e32f6b 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 224f7886bf..29903d460f 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 160bd347bd..f0b83f621e 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 342db49028..5b8015152f 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 775ef29cf8..5baf64772c 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 670463a87f..00dd9a173e 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 9d9465c6ca..e4f8f5ba4b 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 51ad211e92..9cc1534973 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 6d15d13b69..29c334442c 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 e3105a2139..4f075d0d9f 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 fd9da17aac..93d75a8357 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 95c88594ca..8920f85fb7 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 173e012d88..757b77fde4 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 d183401f42..0750b249bb 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 8dfa6b053c..22dc208f52 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 5287cca203..c0a7e27805 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 0508a596e4..b4a71f5ea6 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 c7d8f52aa5..38c6affab8 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 adec3475cd..0f8f6c1d62 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 f8875d9ac1..3e0a33c352 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"