Skip to content

Commit

Permalink
Add back things to get build working
Browse files Browse the repository at this point in the history
  • Loading branch information
archang19 committed Dec 18, 2024
1 parent 9f6393f commit 7df1793
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 23 deletions.
3 changes: 3 additions & 0 deletions db/malloc_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

#include "db/malloc_stats.h"

#include <cstring>
#include <memory>

#include "port/jemalloc_helper.h"

namespace ROCKSDB_NAMESPACE {

Expand Down
4 changes: 2 additions & 2 deletions db/table_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;
Expand Down
41 changes: 21 additions & 20 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions memory/arena_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#ifndef OS_WIN
#include <sys/resource.h>
#endif
#include "port/jemalloc_helper.h"
#include "port/port.h"
#include "test_util/testharness.h"
#include "util/random.h"
Expand Down
1 change: 1 addition & 0 deletions memory/jemalloc_nodump_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <string>

#include "port/likely.h"
#include "rocksdb/convenience.h"
#include "rocksdb/utilities/customizable_util.h"
#include "rocksdb/utilities/object_registry.h"
Expand Down
4 changes: 3 additions & 1 deletion options/options_settable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions port/port_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <cassert>
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include <sched.h>
#include <sys/resource.h>
Expand Down
2 changes: 2 additions & 0 deletions table/block_based/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions util/bloom_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions util/crc32c_arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions util/xxhash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
#endif // !defined(XXH_STATIC_LINKING_ONLY)
#define XXH_IMPLEMENTATION /* access definitions */

#include "xxhash.h"

0 comments on commit 7df1793

Please sign in to comment.