Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: change map type for _db in kvstore #18499

Merged
merged 1 commit into from
May 15, 2024
Merged
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
8 changes: 5 additions & 3 deletions src/v/storage/kvstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

#pragma once
#include "base/seastarx.h"
#include "bytes/bytes.h"
#include "bytes/iobuf.h"
#include "container/chunked_hash_map.h"
#include "metrics/metrics.h"
#include "storage/fwd.h"
#include "storage/ntp_config.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to remove the btree include further down?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed!

Expand All @@ -26,8 +28,6 @@
#include <seastar/core/gate.hh>
#include <seastar/core/timer.hh>

#include <absl/container/btree_map.h>

namespace storage {

/**
Expand Down Expand Up @@ -91,6 +91,8 @@ struct kvstore_config {

class kvstore {
public:
using map_t = chunked_hash_map<bytes, iobuf>;

enum class key_space : int8_t {
testing = 0,
consensus = 1,
Expand Down Expand Up @@ -164,7 +166,7 @@ class kvstore {
// Protect _db and _next_offset across asynchronous mutations.
mutex _db_mut{"kvstore::db_mut"};
model::offset _next_offset;
absl::btree_map<bytes, iobuf, bytes_type_cmp> _db;
map_t _db;
std::optional<ntp_sanitizer_config> _ntp_sanitizer_config;

ss::future<> put(key_space ks, bytes key, std::optional<iobuf> value);
Expand Down
Loading