summaryrefslogtreecommitdiffstats
path: root/src/crimson
diff options
context:
space:
mode:
authorYuri Weinstein <yweinste@redhat.com>2025-01-13 14:32:04 +0100
committerGitHub <noreply@github.com>2025-01-13 14:32:04 +0100
commit89f42f150095b38926fc09f65c0eefa9dd7ebda2 (patch)
tree009bf7455422c70221c79f40e868a20ce5d6fc61 /src/crimson
parentMerge pull request #61000 from MaxKellermann/no_boost (diff)
parentos, test: make omap_iterate obligatory for ObjectStores (diff)
downloadceph-89f42f150095b38926fc09f65c0eefa9dd7ebda2.tar.xz
ceph-89f42f150095b38926fc09f65c0eefa9dd7ebda2.zip
Merge pull request #60278 from rzarzynski/wip-os-fastomapiter
os, osd: bring the lightweight OMAP iteration Reviewed-by: Casey Bodley <cbodley@redhat.com> Reviewed-by: Matan Breizman <Matan.Brz@gmail.com> Reviewed-by: Mark Kogan <mkogan@redhat.com> Reviewed-by: Adam Kupczyk <akupczyk@redhat.com> Reviewed-by: Samuel Just <sjust@redhat.com>
Diffstat (limited to 'src/crimson')
-rw-r--r--src/crimson/os/alienstore/alien_store.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc
index a9c69f4660e..db6decd84f9 100644
--- a/src/crimson/os/alienstore/alien_store.cc
+++ b/src/crimson/os/alienstore/alien_store.cc
@@ -435,8 +435,21 @@ auto AlienStore::omap_get_values(CollectionRef ch,
return do_with_op_gate(omap_values_t{}, [=, this] (auto &values) {
return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, this, &values] {
auto c = static_cast<AlienCollection*>(ch.get());
- return store->omap_get_values(c->collection, oid, start,
- reinterpret_cast<map<string, bufferlist>*>(&values));
+ return store->omap_iterate(
+ c->collection, oid,
+ ObjectStore::omap_iter_seek_t{
+ .seek_position = start.value_or(std::string{}),
+ // FIXME: classical OSDs begins iteration from LOWER_BOUND
+ // (or UPPER_BOUND if filter_prefix > start). However, these
+ // bits are not implemented yet
+ .seek_type = ObjectStore::omap_iter_seek_t::UPPER_BOUND
+ },
+ [&values]
+ (std::string_view key, std::string_view value) mutable {
+ values[std::string{key}].append(value);
+ // FIXME: there is limit on number of entries yet
+ return ObjectStore::omap_iter_ret_t::NEXT;
+ });
}).then([&values] (int r)
-> read_errorator::future<std::tuple<bool, omap_values_t>> {
if (r == -ENOENT) {