// todo
}
-seastar::future<bufferlist> ECBackend::_read(const hobject_t& hoid,
- uint64_t off,
- uint64_t len,
- uint32_t flags)
+ECBackend::ll_read_errorator::future<ceph::bufferlist>
+ECBackend::_read(const hobject_t& hoid,
+ const uint64_t off,
+ const uint64_t len,
+ const uint32_t flags)
{
// todo
return seastar::make_ready_future<bufferlist>();
const ec_profile_t& ec_profile,
uint64_t stripe_width);
private:
- seastar::future<ceph::bufferlist> _read(const hobject_t& hoid,
- uint64_t off,
- uint64_t len,
- uint32_t flags) override;
+ ll_read_errorator::future<ceph::bufferlist> _read(const hobject_t& hoid,
+ uint64_t off,
+ uint64_t len,
+ uint32_t flags) override;
seastar::future<crimson::osd::acked_peers_t>
_submit_transaction(std::set<pg_shard_t>&& pg_shards,
const hobject_t& hoid,
// read size was trimmed to zero and it is expected to do nothing,
return seastar::make_ready_future<bufferlist>();
}
- return _read(oi.soid, offset, length, flags).then(
+ return _read(oi.soid, offset, length, flags).safe_then(
[&oi](auto&& bl) {
if (const bool is_fine = _read_verify_data(oi, bl); is_fine) {
return seastar::make_ready_future<bufferlist>(std::move(bl));
} else {
throw crimson::osd::object_corrupted{};
}
- });
+ }, ll_read_errorator::throw_as_runtime_error{});
}
seastar::future<> PGBackend::stat(
virtual void got_rep_op_reply(const MOSDRepOpReply&) {}
protected:
+ // low-level read errorator
+ using ll_read_errorator = ceph::os::FuturizedStore::read_errorator;
const shard_id_t shard;
CollectionRef coll;
crimson::os::FuturizedStore* store;
seastar::future<cached_ss_t> _load_ss(const hobject_t& oid);
SharedLRU<hobject_t, ObjectState> os_cache;
seastar::future<cached_os_t> _load_os(const hobject_t& oid);
- virtual seastar::future<bufferlist> _read(const hobject_t& hoid,
- size_t offset,
- size_t length,
- uint32_t flags) = 0;
+ virtual ll_read_errorator::future<ceph::bufferlist> _read(
+ const hobject_t& hoid,
+ size_t offset,
+ size_t length,
+ uint32_t flags) = 0;
bool maybe_create_new_object(ObjectState& os, ceph::os::Transaction& txn);
virtual seastar::future<crimson::osd::acked_peers_t>
_submit_transaction(std::set<pg_shard_t>&& pg_shards,
shard_services{shard_services}
{}
-seastar::future<bufferlist> ReplicatedBackend::_read(const hobject_t& hoid,
- uint64_t off,
- uint64_t len,
- uint32_t flags)
+ReplicatedBackend::ll_read_errorator::future<ceph::bufferlist>
+ReplicatedBackend::_read(const hobject_t& hoid,
+ const uint64_t off,
+ const uint64_t len,
+ const uint32_t flags)
{
- using read_errorator = ceph::os::FuturizedStore::read_errorator;
- return store->read(coll, ghobject_t{hoid}, off, len, flags).safe_then(
- [] (auto&& bl) { return bl; },
- read_errorator::throw_as_runtime_error{});
+ return store->read(coll, ghobject_t{hoid}, off, len, flags);
}
seastar::future<crimson::osd::acked_peers_t>
crimson::osd::ShardServices& shard_services);
void got_rep_op_reply(const MOSDRepOpReply& reply) final;
private:
- seastar::future<ceph::bufferlist> _read(const hobject_t& hoid,
- uint64_t off,
- uint64_t len,
- uint32_t flags) override;
+ ll_read_errorator::future<ceph::bufferlist> _read(const hobject_t& hoid,
+ uint64_t off,
+ uint64_t len,
+ uint32_t flags) override;
seastar::future<crimson::osd::acked_peers_t>
_submit_transaction(std::set<pg_shard_t>&& pg_shards,
const hobject_t& hoid,