diff --git a/db/malloc_stats.cc b/db/malloc_stats.cc index 2672cc0301e..0fd641630a1 100644 --- a/db/malloc_stats.cc +++ b/db/malloc_stats.cc @@ -9,7 +9,10 @@ #include "db/malloc_stats.h" +#include +#include +#include "port/jemalloc_helper.h" namespace ROCKSDB_NAMESPACE { diff --git a/db/table_cache.cc b/db/table_cache.cc index e8339d239e8..9fe744e4845 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -36,8 +36,10 @@ // WITH_COROUTINES or WITHOUT_COROUTINES is defined // clang-format off #define WITHOUT_COROUTINES +#include "db/table_cache_sync_and_async.h" #undef WITHOUT_COROUTINES #define WITH_COROUTINES +#include "db/table_cache_sync_and_async.h" #undef WITH_COROUTINES // clang-format on @@ -50,14 +52,12 @@ static Slice GetSliceForFileNumber(const uint64_t* file_number) { sizeof(*file_number)); } - void AppendVarint64(IterKey* key, uint64_t v) { char buf[10]; auto ptr = EncodeVarint64(buf, v); key->TrimAppend(key->Size(), buf, ptr - buf); } - } // anonymous namespace const int kLoadConcurency = 128; diff --git a/db/version_set.cc b/db/version_set.cc index 42a1c9004eb..c7457485b98 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -79,8 +79,10 @@ // WITH_COROUTINES or WITHOUT_COROUTINES is defined // clang-format off #define WITHOUT_COROUTINES +#include "db/version_set_sync_and_async.h" #undef WITHOUT_COROUTINES #define WITH_COROUTINES +#include "db/version_set_sync_and_async.h" #undef WITH_COROUTINES // clang-format on @@ -3980,26 +3982,25 @@ void SortFileByOverlappingRatio( ? VersionStorageInfo::kNumberFilesToSort : temp->size(); - std::partial_sort(temp->begin(), temp->begin() + num_to_sort, temp->end(), - [&](const Fsize& f1, const Fsize& f2) -> bool { - // If score is the same, pick file with smaller keys. - // This makes the algorithm more deterministic, and also - // help the trivial move case to have more files to - // extend. - if (f1.file->marked_for_compaction == - f2.file->marked_for_compaction) { - if (file_to_order[f1.file->fd.GetNumber()] == - file_to_order[f2.file->fd.GetNumber()]) { - return icmp.Compare(f1.file->smallest, - f2.file->smallest) < 0; - } - return file_to_order[f1.file->fd.GetNumber()] < - file_to_order[f2.file->fd.GetNumber()]; - } else { - return f1.file->marked_for_compaction > - f2.file->marked_for_compaction; - } - }); + std::partial_sort( + temp->begin(), temp->begin() + num_to_sort, temp->end(), + [&](const Fsize& f1, const Fsize& f2) -> bool { + // If score is the same, pick file with smaller keys. + // This makes the algorithm more deterministic, and also + // help the trivial move case to have more files to + // extend. + if (f1.file->marked_for_compaction == f2.file->marked_for_compaction) { + if (file_to_order[f1.file->fd.GetNumber()] == + file_to_order[f2.file->fd.GetNumber()]) { + return icmp.Compare(f1.file->smallest, f2.file->smallest) < 0; + } + return file_to_order[f1.file->fd.GetNumber()] < + file_to_order[f2.file->fd.GetNumber()]; + } else { + return f1.file->marked_for_compaction > + f2.file->marked_for_compaction; + } + }); } void SortFileByRoundRobin(const InternalKeyComparator& icmp, diff --git a/memory/arena_test.cc b/memory/arena_test.cc index c5e0549aa09..1547a86d5dd 100644 --- a/memory/arena_test.cc +++ b/memory/arena_test.cc @@ -12,6 +12,7 @@ #ifndef OS_WIN #include #endif +#include "port/jemalloc_helper.h" #include "port/port.h" #include "test_util/testharness.h" #include "util/random.h" diff --git a/memory/jemalloc_nodump_allocator.cc b/memory/jemalloc_nodump_allocator.cc index 61a2cda7e6d..e8353d3dd09 100644 --- a/memory/jemalloc_nodump_allocator.cc +++ b/memory/jemalloc_nodump_allocator.cc @@ -7,6 +7,7 @@ #include +#include "port/likely.h" #include "rocksdb/convenience.h" #include "rocksdb/utilities/customizable_util.h" #include "rocksdb/utilities/object_registry.h" diff --git a/options/options_settable_test.cc b/options/options_settable_test.cc index 5ee9fd43d48..a2a7c2e7840 100644 --- a/options/options_settable_test.cc +++ b/options/options_settable_test.cc @@ -7,7 +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 "options/cf_options.h" +#include "options/db_options.h" +#include "options/options_helper.h" #include "rocksdb/convenience.h" #include "test_util/testharness.h" diff --git a/port/port_posix.cc b/port/port_posix.cc index 07cd08d3c4c..f17da8316d2 100644 --- a/port/port_posix.cc +++ b/port/port_posix.cc @@ -13,6 +13,7 @@ #include #if defined(__i386__) || defined(__x86_64__) +#include #endif #include #include diff --git a/table/block_based/block_based_table_reader.cc b/table/block_based/block_based_table_reader.cc index 3043c1d9323..746b12aed27 100644 --- a/table/block_based/block_based_table_reader.cc +++ b/table/block_based/block_based_table_reader.cc @@ -117,8 +117,10 @@ INSTANTIATE_BLOCKLIKE_TEMPLATES(Block_kMetaIndex); // WITH_COROUTINES or WITHOUT_COROUTINES is defined // clang-format off #define WITHOUT_COROUTINES +#include "table/block_based/block_based_table_reader_sync_and_async.h" #undef WITHOUT_COROUTINES #define WITH_COROUTINES +#include "table/block_based/block_based_table_reader_sync_and_async.h" #undef WITH_COROUTINES // clang-format on diff --git a/util/bloom_test.cc b/util/bloom_test.cc index c7f26fd5017..10417aeeac0 100644 --- a/util/bloom_test.cc +++ b/util/bloom_test.cc @@ -21,6 +21,7 @@ int main() { #include "cache/cache_entry_roles.h" #include "cache/cache_reservation_manager.h" +#include "port/jemalloc_helper.h" #include "rocksdb/convenience.h" #include "rocksdb/filter_policy.h" #include "table/block_based/filter_policy_internal.h" diff --git a/util/crc32c_arm64.cc b/util/crc32c_arm64.cc index 7805cb74bfd..98d1c307db5 100644 --- a/util/crc32c_arm64.cc +++ b/util/crc32c_arm64.cc @@ -3,6 +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/crc32c_arm64.h" #if defined(HAVE_ARM64_CRC) diff --git a/util/xxhash.cc b/util/xxhash.cc index 6e77d90f1c3..88852c3308a 100644 --- a/util/xxhash.cc +++ b/util/xxhash.cc @@ -45,3 +45,4 @@ #endif // !defined(XXH_STATIC_LINKING_ONLY) #define XXH_IMPLEMENTATION /* access definitions */ +#include "xxhash.h"