diff options
author | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2024-11-05 16:15:29 +0100 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2024-12-17 20:17:49 +0100 |
commit | 3c2b4bbcf5109288dc3720772e68dae1ea85c61e (patch) | |
tree | 82d8106ed448bd9f5748b9d8fc2c6211156e52d5 /src/crimson | |
parent | os/bluestore: reduce dependencies of omap_iterate()'s loop on Onode (diff) | |
download | ceph-3c2b4bbcf5109288dc3720772e68dae1ea85c61e.tar.xz ceph-3c2b4bbcf5109288dc3720772e68dae1ea85c61e.zip |
crimson, os: put AlienStore::omap_get_values() on top of OS::omap_iterate()
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src/crimson')
-rw-r--r-- | src/crimson/os/alienstore/alien_store.cc | 17 |
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 3fd2bb1fd15..e3b840f7f2c 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -429,8 +429,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) { |