tl::expected<ceph::timespan, boost::system::error_code>
check_watch(uint64_t cookie);
- using NotifySig = void(boost::system::error_code, ceph::buffer::list);
+ using NotifySig =
+ void(boost::system::error_code,
+ boost::container::flat_map<std::pair<std::uint64_t, std::uint64_t>,
+ ceph::buffer::list> reply_map,
+ boost::container::flat_set<std::pair<std::uint64_t, std::uint64_t>>
+ missed_set);
using NotifyComp = boost::asio::any_completion_handler<NotifySig>;
template<boost::asio::completion_token_for<NotifySig> CompletionToken>
auto notify(Object o, IOContext ioc, ceph::buffer::list bl,
if ((acked && finished) || res) {
objecter->linger_cancel(op);
ceph_assert(c);
- asio::dispatch(asio::append(std::move(c), res, std::move(rbl)));
+ bc::flat_map<std::pair<uint64_t, uint64_t>, buffer::list> reply_map;
+ bc::flat_set<std::pair<uint64_t, uint64_t>> missed_set;
+ auto p = rbl.cbegin();
+ decode(reply_map, p);
+ decode(missed_set, p);
+ asio::dispatch(asio::append(std::move(c), res, std::move(reply_map),
+ std::move(missed_set)));
}
}
};
std::vector<neorados::ObjWatcher> watchers;
co_await execute(notify_oid, ReadOp{}.list_watchers(&watchers));
EXPECT_EQ(1u, watchers.size());
- auto reply = co_await rados().notify(notify_oid, pool(), {}, {},
- asio::use_awaitable);
- std::map<std::pair<uint64_t, uint64_t>, buffer::list> reply_map;
- std::set<std::pair<uint64_t, uint64_t>> missed_set;
- auto p = reply.cbegin();
- decode(reply_map, p);
- decode(missed_set, p);
+ auto [reply_map, missed_set]
+ = co_await rados().notify(notify_oid, pool(), {}, {},
+ asio::use_awaitable);
EXPECT_EQ(1u, notify_cookies.size());
EXPECT_EQ(1u, notify_cookies.count(handle));
EXPECT_EQ(1u, reply_map.size());
EXPECT_EQ(1u, watchers.size());
auto notify = [](neorados::RADOS& r, neorados::IOContext ioc)
-> asio::awaitable<void> {
- auto reply = co_await r.notify(oid, ioc, {}, {}, asio::use_awaitable);
- std::map<std::pair<uint64_t, uint64_t>, buffer::list> reply_map;
- std::set<std::pair<uint64_t, uint64_t>> missed_set;
- auto p = reply.cbegin();
- decode(reply_map, p);
- decode(missed_set, p);
+ auto [reply_map, missed_set]
+ = co_await r.notify(oid, ioc, {}, {}, asio::use_awaitable);
+
EXPECT_EQ(1u, reply_map.size());
EXPECT_EQ(5u, reply_map.begin()->second.length());
EXPECT_EQ(0, strncmp("reply", reply_map.begin()->second.c_str(), 5));