shard_id,
[this, cid, next]() -> seastar::future<std::tuple<std::vector<ghobject_t>, ghobject_t>>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
fmt::println(std::cerr, "Failed to open collection: collection does not exist");
co_return std::make_tuple(std::vector<ghobject_t>(), ghobject_t::get_max());
}
- co_return co_await store->get_sharded_store().list_objects(
+ co_return co_await store->get_sharded_store()->list_objects(
coll, next, ghobject_t::get_max(), 100);
});
}
shard_id,
[this, cid, oid, start, callback]() -> seastar::future<>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
start.value(),
ObjectStore::omap_iter_seek_t::UPPER_BOUND};
}
- co_await store->get_sharded_store().omap_iterate(coll, oid, start_from, callback
+ co_await store->get_sharded_store()->omap_iterate(coll, oid, start_from, callback
).safe_then([] (auto ret) {
ceph_assert (ret == ObjectStore::omap_iter_ret_t::NEXT);
}).handle_error(
shard_id,
[this, cid, oid, key]() -> seastar::future<std::string>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
std::set<std::string> to_get;
to_get.insert(key);
- auto&& vals = co_await store->get_sharded_store().omap_get_values(
+ auto&& vals = co_await store->get_sharded_store()->omap_get_values(
coll, oid, to_get).handle_error(
crimson::os::FuturizedStore::Shard::read_errorator::assert_all{}
);
[this, cid, oid, key, value]() mutable
-> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
bl.append(value.c_str(), value.length());
omap_values[key] = std::move(bl);
txn.omap_setkeys(cid, oid, omap_values);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid, key]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
}
ceph::os::Transaction txn;
txn.omap_rmkey(cid, oid, key);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid]() -> seastar::future<std::string>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
co_return std::string();
}
- auto stat_result = co_await store->get_sharded_store().stat(coll, oid);
+ auto stat_result = co_await store->get_sharded_store()->stat(coll, oid);
uint64_t total_size = stat_result.st_size;
if (total_size == 0) {
while (offset < total_size) {
uint64_t len = std::min(max_read, total_size - offset);
- auto read_result = co_await store->get_sharded_store().read(coll, oid, offset, len).safe_then(
+ auto read_result = co_await store->get_sharded_store()->read(coll, oid, offset, len).safe_then(
[](auto&& bl) -> ceph::bufferlist {
return std::move(bl);
},
shard_id,
[this, cid, oid, data]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
bl.append(data.c_str(), data.length());
txn.write(cid, oid, 0, data.length(), bl, 0);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid]() -> seastar::future<tl::expected<FuturizedStore::Shard::attrs_t, std::string>>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
using ret_t = tl::expected<attrs_t, std::string>;
co_return co_await store->get_sharded_store()
- .get_attrs(coll, oid) // ertr::future<attrs_t>
+ ->get_attrs(coll, oid) // ertr::future<attrs_t>
.safe_then(
[](attrs_t&& a) {
return ret_t{tl::in_place, std::move(a)};
shard_id,
[this, cid, oid, key]() -> seastar::future<tl::expected<std::string, std::string>>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
co_return tl::make_unexpected(std::string("Failed to open collection: collection does not exist"));
}
using return_type = tl::expected<std::string, std::string>;
- co_return co_await store->get_sharded_store().get_attr(coll, oid, key).safe_then(
+ co_return co_await store->get_sharded_store()->get_attr(coll, oid, key).safe_then(
[](auto&& bl) {
return return_type{tl::in_place, bl.to_str()};
},
shard_id,
[this, cid, oid, key, value]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
bl.append(value.c_str(), value.length());
txn.setattr(cid, oid, key, bl);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid, key]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
ceph::os::Transaction txn;
txn.rmattr(cid, oid, key);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid, all, force]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
// First check if the object exists
try {
- [[maybe_unused]] auto stat_result = co_await store->get_sharded_store().stat(coll, oid);
+ [[maybe_unused]] auto stat_result = co_await store->get_sharded_store()->stat(coll, oid);
// Object exists, proceed with removal
} catch (const std::exception& e) {
fmt::println(std::cerr, "Object {} does not exist or stat failed: {}", oid, e.what());
txn.remove(cid, oid);
}
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
fmt::println(std::cout, "Successfully removed object {}", oid);
co_return true;
});
shard_id,
[this, cid, oid]() -> seastar::future<std::string>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
shard_id,
[this, cid, oid, size]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
ceph::os::Transaction txn;
txn.truncate(cid, oid, size);
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid, oid]() -> seastar::future<bool>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});
ceph::os::Transaction txn;
txn.rmattr(cid, oid, "data_digest");
- co_await store->get_sharded_store().do_transaction(coll, std::move(txn));
+ co_await store->get_sharded_store()->do_transaction(coll, std::move(txn));
co_return true;
});
}
shard_id,
[this, cid]() -> seastar::future<pg_info_t>
{
- auto coll = co_await store->get_sharded_store().open_collection(cid
+ auto coll = co_await store->get_sharded_store()->open_collection(cid
).handle_exception([](std::exception_ptr) {
return seastar::make_ready_future<FuturizedStore::Shard::CollectionRef>(nullptr);
});