return seastar::make_ready_future<ceph::bufferptr>(found->second);
} else {
return seastar::make_exception_future<ceph::bufferptr>(
- EnoentException(fmt::format("attr does not exist: {}/{}", oid, name)));
+ EnodataException(fmt::format("attr does not exist: {}/{}", oid, name)));
}
}
class FuturizedStore {
public:
+ // TODO: replace with the ceph::errorator concept
template <class ConcreteExceptionT>
class Exception : public std::logic_error {
public:
struct EnoentException : public Exception<EnoentException> {
using Exception<EnoentException>::Exception;
};
+ struct EnodataException : public Exception<EnodataException> {
+ using Exception<EnodataException>::Exception;
+ };
static std::unique_ptr<FuturizedStore> create(const std::string& type,
const std::string& data);
FuturizedStore() = default;
invalid_argument() : error(std::errc::invalid_argument) {}
};
+struct no_message_available : public error {
+ no_message_available() : error(std::errc::no_message_available) {}
+};
+
// FIXME: error handling
struct operation_not_supported : public error {
operation_not_supported()
name = "_" + aname;
bp.copy(osd_op.op.xattr.value_len, val);
}
+ logger().debug("setxattr on obj={} for attr={}", os.oi.soid, name);
txn.setattr(coll->get_cid(), ghobject_t{os.oi.soid}, name, val);
return seastar::now();
bp.copy(osd_op.op.xattr.name_len, aname);
name = "_" + aname;
}
+ logger().debug("getxattr on obj={} for attr={}", os.oi.soid, name);
return getxattr(os.oi.soid, name).then([&osd_op] (ceph::bufferptr val) {
osd_op.outdata.clear();
osd_op.outdata.push_back(std::move(val));
osd_op.op.xattr.value_len = osd_op.outdata.length();
//ctx->delta_stats.num_rd_kb += shift_round_up(osd_op.outdata.length(), 10);
}).handle_exception_type(
- [] (ceph::os::FuturizedStore::EnoentException& e) {
+ [] (ceph::os::FuturizedStore::EnoentException&) {
return seastar::make_exception_future<>(ceph::osd::object_not_found{});
+ }).handle_exception_type(
+ [] (ceph::os::FuturizedStore::EnodataException&) {
+ return seastar::make_exception_future<>(ceph::osd::no_message_available{});
});
//ctx->delta_stats.num_rd++;
}