return seastar::make_ready_future<bufferlist>(std::move(bl));
}
+seastar::future<ceph::bufferptr> CyanStore::get_attr(CollectionRef c,
+ const ghobject_t& oid,
+ std::string_view name)
+{
+ logger().info("{} {} {}",
+ __func__, c->cid, oid);
+ auto o = c->get_object(oid);
+ if (!o) {
+ throw std::runtime_error(fmt::format("object does not exist: {}", oid));
+ }
+ if (auto found = o->xattr.find(name); found != o->xattr.end()) {
+ return seastar::make_ready_future<ceph::bufferptr>(found->second);
+ } else {
+ throw std::runtime_error(fmt::format("attr does not exist: {}/{}",
+ oid, name));
+ }
+}
+
+seastar::future<CyanStore::attrs_t> CyanStore::get_attrs(CollectionRef c,
+ const ghobject_t& oid)
+{
+ logger().info("{} {} {}",
+ __func__, c->cid, oid);
+ auto o = c->get_object(oid);
+ if (!o) {
+ throw std::runtime_error(fmt::format("object does not exist: {}", oid));
+ }
+ return seastar::make_ready_future<attrs_t>(o->xattr);
+}
+
seastar::future<CyanStore::omap_values_t>
CyanStore::omap_get_values(CollectionRef c,
const ghobject_t& oid,
uint64_t offset,
size_t len,
uint32_t op_flags = 0);
+ seastar::future<ceph::bufferptr> get_attr(CollectionRef c,
+ const ghobject_t& oid,
+ std::string_view name);
+ using attrs_t = std::map<std::string, ceph::bufferptr, std::less<>>;
+ seastar::future<attrs_t> get_attrs(CollectionRef c, const ghobject_t& oid);
using omap_values_t = std::map<std::string,bufferlist, std::less<>>;
seastar::future<omap_values_t> omap_get_values(
CollectionRef c,