});
}
+AlienStore::base_errorator::future<bool>
+AlienStore::exists(
+ CollectionRef ch,
+ const ghobject_t& oid)
+{
+ return seastar::with_gate(op_gate, [=, this] {
+ return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, this] {
+ auto c = static_cast<AlienCollection*>(ch.get());
+ return store->exists(c->collection, oid);
+ });
+ });
+}
+
AlienStore::mount_ertr::future<> AlienStore::mount()
{
logger().debug("{}", __func__);
mount_ertr::future<> mount() final;
seastar::future<> umount() final;
+ base_errorator::future<bool> exists(
+ CollectionRef c,
+ const ghobject_t& oid) final;
mkfs_ertr::future<> mkfs(uuid_d new_osd_fsid) final;
read_errorator::future<ceph::bufferlist> read(CollectionRef c,
const ghobject_t& oid,
return seastar::make_ready_future<std::vector<coll_core_t>>(std::move(collections));
}
+CyanStore::Shard::base_errorator::future<bool>
+CyanStore::Shard::exists(
+ CollectionRef ch,
+ const ghobject_t &oid)
+{
+ auto c = static_cast<Collection*>(ch.get());
+ if (!c->exists) {
+ return base_errorator::make_ready_future<bool>(false);
+ }
+ auto o = c->get_object(oid);
+ if (!o) {
+ return base_errorator::make_ready_future<bool>(false);
+ }
+ return base_errorator::make_ready_future<bool>(true);
+}
+
CyanStore::Shard::read_errorator::future<ceph::bufferlist>
CyanStore::Shard::read(
CollectionRef ch,
namespace crimson::os {
class CyanStore final : public FuturizedStore {
+public:
class Shard : public FuturizedStore::Shard {
public:
Shard(std::string path)
CollectionRef c,
const ghobject_t& oid) final;
+ base_errorator::future<bool> exists(
+ CollectionRef ch,
+ const ghobject_t& oid) final;
+
read_errorator::future<ceph::bufferlist> read(
CollectionRef c,
const ghobject_t& oid,
std::map<coll_t, boost::intrusive_ptr<Collection>> new_coll_map;
};
-public:
CyanStore(const std::string& path);
~CyanStore() final;
const Shard& operator=(const Shard& o) = delete;
using CollectionRef = boost::intrusive_ptr<FuturizedCollection>;
+ using base_errorator = crimson::errorator<crimson::ct_error::input_output_error>;
using read_errorator = crimson::errorator<crimson::ct_error::enoent,
crimson::ct_error::input_output_error>;
virtual read_errorator::future<ceph::bufferlist> read(
interval_set<uint64_t>& m,
uint32_t op_flags = 0) = 0;
+ virtual base_errorator::future<bool> exists(
+ CollectionRef c,
+ const ghobject_t& oid) = 0;
+
using get_attr_errorator = crimson::errorator<
crimson::ct_error::enoent,
crimson::ct_error::enodata>;
});
}
+SeaStore::Shard::base_errorator::future<bool>
+SeaStore::Shard::exists(
+ CollectionRef c,
+ const ghobject_t& oid)
+{
+ LOG_PREFIX(SeaStore::exists);
+ DEBUG("oid {}", oid);
+ return repeat_with_onode<bool>(
+ c,
+ oid,
+ Transaction::src_t::READ,
+ "oid_exists",
+ op_type_t::READ,
+ [](auto&, auto&) {
+ return seastar::make_ready_future<bool>(true);
+ }).handle_error(
+ crimson::ct_error::enoent::handle([] {
+ return seastar::make_ready_future<bool>(false);
+ }),
+ crimson::ct_error::assert_all{"unexpected error"}
+ );
+}
+
SeaStore::Shard::read_errorator::future<ceph::bufferlist>
SeaStore::Shard::readv(
CollectionRef ch,
interval_set<uint64_t>& m,
uint32_t op_flags = 0) final;
+ base_errorator::future<bool> exists(
+ CollectionRef c,
+ const ghobject_t& oid) final;
+
get_attr_errorator::future<ceph::bufferlist> get_attr(
CollectionRef c,
const ghobject_t& oid,