Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions conan.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"version": "0.5",
"requires": [
"abseil/20250127.0",
"batteries/0.71.1",
"abseil/20260107.1",
"batteries/0.72.0",
"boost/1.88.0",
"bzip2/1.0.8",
"cli11/2.5.0",
"gflags/2.2.2",
"glog/0.7.1",
"gtest/1.17.0",
"keyvcr/0.2.2",
"libbacktrace/cci.20240730",
"libbacktrace/cci.20210118",
"libfuse/3.16.2",
"libpfm4/4.13.0",
"libunwind/1.8.1",
"liburing/2.11",
"llfs/0.47.1",
"llfs/0.47.2",
"openssl/3.6.0",
"pcg-cpp/cci.20220409",
"protobuf/3.21.12",
"vqf/0.2.5",
"vqf/0.2.6",
"xxhash/0.8.3",
"yaml-cpp/0.9.0",
"zlib/1.3.1"
Expand Down Expand Up @@ -49,10 +49,7 @@
],
"boost/[>=1.84.0 <2]": [
"boost/1.88.0"
],
"batteries/[>=0.60.2 <2]": [
"batteries/0.70.2"
]
},
"config_requires": []
}
}
16 changes: 8 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class TurtleKvRecipe(ConanFile):
name = "turtle_kv"

python_requires = "cor_recipe_utils/0.19.1"
python_requires = "cor_recipe_utils/0.21.4.dev3+g0d8231b80"
python_requires_extend = "cor_recipe_utils.ConanFileBase"

settings = "os", "compiler", "build_type", "arch"
Expand Down Expand Up @@ -88,18 +88,18 @@ def requirements(self):
"force": True,
}

self.requires("abseil/20250127.0", **VISIBLE, **OVERRIDE)
self.requires("batteries/[>=0.71.1 <1]", **VISIBLE, **OVERRIDE)
self.requires("boost/1.88.0", **VISIBLE, **OVERRIDE)
self.requires("glog/0.7.1", **VISIBLE)
self.requires("llfs/[>=0.47.0 <1]", **VISIBLE)
self.requires("pcg-cpp/cci.20220409", **VISIBLE)
self.requires("abseil/[>=20260107.1]", **VISIBLE, **OVERRIDE)
self.requires("batteries/[>=0.72.0 <1]", **VISIBLE, **OVERRIDE)
self.requires("boost/[>=1.88.0 <2]", **VISIBLE, **OVERRIDE)
self.requires("glog/[>=0.7.1 <1]", **VISIBLE)
self.requires("llfs/[>=0.47.2 <1]", **VISIBLE)
self.requires("pcg-cpp/[>=cci.20220409]", **VISIBLE)
self.requires("yaml-cpp/[>=0.9.0 <1]")
self.requires("zlib/1.3.1", **OVERRIDE)

# boost/1.88.0 and ninja/1.13.2 depend (exactly) on libbacktrace/cci.20210118
#
self.requires("libbacktrace/[>=cci.20240730]", **OVERRIDE)
self.requires("libbacktrace/[>=cci.20210118]")

if platform.system() == "Linux":
if self.options.with_keyvcr:
Expand Down
2 changes: 1 addition & 1 deletion cor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cor:
cli:
version: 0.19.1
version: 0.21.4.dev3+g0d8231b80
8 changes: 8 additions & 0 deletions src/turtle_kv/core/edit_view.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//=##=##=#==#=#==#===#+==#+==========+==+=+=+=+=+=++=+++=+++++=-++++=-+++++++++++
//
// Part of the TurtleKV Project, under Apache License v2.0.
// See https://www.apache.org/licenses/LICENSE-2.0 for license information.
// SPDX short identifier: Apache-2.0
//
//+++++++++++-+-+--+----- --- -- - - - -

#pragma once

#include <turtle_kv/core/item_view.hpp>
Expand Down
5 changes: 2 additions & 3 deletions src/turtle_kv/import/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@

namespace turtle_kv {

using batt::advance_pointer;
using batt::buffer_from_struct;
using batt::byte_distance;
using batt::ConstBuffer;
using batt::make_buffer;
using batt::mutable_buffer_from_struct;
using batt::MutableBuffer;
using batt::resize_buffer;

using llfs::advance_pointer;
using llfs::byte_distance;

} // namespace turtle_kv
3 changes: 0 additions & 3 deletions src/turtle_kv/import/interval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

#include <batteries/interval.hpp>

#include <cstddef>
#include <ostream>

namespace turtle_kv {

using batt::BasicInterval;
Expand Down
1 change: 0 additions & 1 deletion src/turtle_kv/import/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace turtle_kv {

using batt::as_const_slice;
using batt::as_range;
using batt::as_seq;
using batt::as_slice;
using batt::Slice;

Expand Down
2 changes: 1 addition & 1 deletion src/turtle_kv/mem_table/mem_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ class BasicMemTable<StorageT, AllocationTrackerT>::PerOpStorageContext

// One thread will acquire a lock, others will block at this point.
//
absl::MutexLock lock{&this->mem_table_.block_list_mutex_};
absl::MutexLock lock{this->mem_table_.block_list_mutex_};

// If there are no block buffers attached to the MemTable, then we may just have to wait until
// the checkpoint update pipeline catches up. If there are block buffers attached, then its
Expand Down
4 changes: 2 additions & 2 deletions src/turtle_kv/mem_table/mem_table.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void BasicMemTable<StorageT, AllocationTrackerT>::handle_external_cache_alloc(i6
this->allocation_tracker_.allocate_external(cache_alloc_delta, overcommit);

{
absl::MutexLock lock{&this->block_list_mutex_};
absl::MutexLock lock{this->block_list_mutex_};
BATT_CHECK(this->cache_alloc_in_progress_);
this->total_cache_alloc_.subsume(std::move(alloc));
this->cache_alloc_in_progress_ = false;
Expand All @@ -417,7 +417,7 @@ void BasicMemTable<StorageT, AllocationTrackerT>::handle_external_cache_alloc(i6
} else if (cache_alloc_delta < 0) {
StatusOr<typename AllocationTracker::ExternalAllocation> alloc_to_release;
{
absl::MutexLock lock{&this->block_list_mutex_};
absl::MutexLock lock{this->block_list_mutex_};
BATT_CHECK(this->cache_alloc_in_progress_);
alloc_to_release = this->total_cache_alloc_.split(-cache_alloc_delta);
this->cache_alloc_in_progress_ = false;
Expand Down
6 changes: 3 additions & 3 deletions src/turtle_kv/mem_table/mem_table.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ TEST_F(MemTableTest, PutGet)
//
TEST_F(MemTableTest, PutUntilFull)
{
usize total_key_bytes = 0;
usize total_value_bytes = 0;
usize put_count = 0;
[[maybe_unused]] usize total_key_bytes = 0;
[[maybe_unused]] usize total_value_bytes = 0;
[[maybe_unused]] usize put_count = 0;

for (;;) {
KeyView key = this->make_random_key();
Expand Down
8 changes: 5 additions & 3 deletions src/turtle_kv/script/uniform_key_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ inline constexpr std::array<u64, 64> kHashSeeds = {
class UniformInsertKeyDistribution : public KeyDistribution
{
public:
explicit UniformInsertKeyDistribution(usize key_size) noexcept : key_buffer_(key_size)
explicit UniformInsertKeyDistribution(usize key_size, usize seed = 0) noexcept
: next_ordinal_{seed}
, key_buffer_(key_size)
{
}

Expand All @@ -48,7 +50,7 @@ class UniformInsertKeyDistribution : public KeyDistribution

std::pair<KeyView, usize> get_next(KeySet& inserted_keys) override
{
return inserted_keys.create_key(this->format_key(this->count_.fetch_add(1)));
return inserted_keys.create_key(this->format_key(this->next_ordinal_.fetch_add(1)));
}

//+++++++++++-+-+--+----- --- -- - - - -
Expand Down Expand Up @@ -77,7 +79,7 @@ class UniformInsertKeyDistribution : public KeyDistribution

//+++++++++++-+-+--+----- --- -- - - - -

std::atomic<usize> count_{0};
std::atomic<usize> next_ordinal_{0};
SmallVec<char, 64> key_buffer_;
};

Expand Down
6 changes: 4 additions & 2 deletions src/turtle_kv/tree/in_memory_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <turtle_kv/core/key_view_range.hpp>
#include <turtle_kv/core/value_view.hpp>

#include <turtle_kv/util/piecewise_filter.ipp>

#include <batteries/case_of.hpp>
#include <batteries/require.hpp>

Expand Down Expand Up @@ -116,8 +118,8 @@ using PackedSegment = PackedUpdateBuffer::Segment;
segment.page_id_slot = llfs::PageIdSlot::from_page_id(packed_segment.leaf_page_id.unpack());
segment.active_pivots = packed_segment.active_pivots.unpack();

BATT_ASSIGN_OK_RESULT(segment.filter,
packed_node.create_piecewise_filter(level_i, segment_i));
segment.filter =
PiecewiseFilter<u32>{packed_node.get_packed_filter(level_i, segment_i)};

segment.check_invariants(__FILE__, __LINE__);
}
Expand Down
11 changes: 10 additions & 1 deletion src/turtle_kv/tree/in_memory_node.test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//=##=##=#==#=#==#===#+==#+==========+==+=+=+=+=+=++=+++=+++++=-++++=-+++++++++++
//
// Part of the TurtleKV Project, under Apache License v2.0.
// See https://www.apache.org/licenses/LICENSE-2.0 for license information.
// SPDX short identifier: Apache-2.0
//
//+++++++++++-+-+--+----- --- -- - - - -

#include <turtle_kv/tree/in_memory_node.hpp>
//
#include <turtle_kv/tree/in_memory_node.hpp>
Expand All @@ -12,9 +20,10 @@
#include <turtle_kv/tree/subtree_table.hpp>
#include <turtle_kv/tree/the_key.hpp>

#include <turtle_kv/core/table.hpp>
#include <turtle_kv/core/testing/generate.hpp>

#include <turtle_kv/core/table.hpp>
#include <turtle_kv/util/piecewise_filter.ipp>

#include <turtle_kv/import/constants.hpp>
#include <turtle_kv/import/int_types.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/turtle_kv/tree/in_memory_node_merged_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <turtle_kv/core/algo/split_parts.hpp>

#include <turtle_kv/util/piecewise_filter.ipp>

#include <batteries/case_of.hpp>

namespace turtle_kv {
Expand Down
2 changes: 2 additions & 0 deletions src/turtle_kv/tree/in_memory_node_segmented_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <turtle_kv/tree/leaf_page_view.hpp>
#include <turtle_kv/tree/segmented_level_scanner.hpp>

#include <turtle_kv/util/piecewise_filter.ipp>

#include <batteries/case_of.hpp>

#include <type_traits>
Expand Down
Loading