]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: add FuturizedStore to encapsulate cyanstore 28358/head
authorchunmei Liu <chunmei.liu@intel.com>
Tue, 4 Jun 2019 03:18:20 +0000 (20:18 -0700)
committerchunmei Liu <chunmei.liu@intel.com>
Tue, 4 Jun 2019 22:07:07 +0000 (15:07 -0700)
only add encapsulation. alien store will be implement later.
exception handling will be implement later.

Signed-off-by: chunmei Liu <chunmei.liu@intel.com>
22 files changed:
src/crimson/os/CMakeLists.txt
src/crimson/os/cyan_store.cc
src/crimson/os/cyan_store.h
src/crimson/os/futurized_store.cc [new file with mode: 0644]
src/crimson/os/futurized_store.h [new file with mode: 0644]
src/crimson/osd/ec_backend.cc
src/crimson/osd/ec_backend.h
src/crimson/osd/osd.cc
src/crimson/osd/osd.h
src/crimson/osd/osd_meta.cc
src/crimson/osd/osd_meta.h
src/crimson/osd/pg.cc
src/crimson/osd/pg.h
src/crimson/osd/pg_backend.cc
src/crimson/osd/pg_backend.h
src/crimson/osd/pg_meta.cc
src/crimson/osd/pg_meta.h
src/crimson/osd/replicated_backend.cc
src/crimson/osd/replicated_backend.h
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h
src/osd/PGLog.h

index 6362148bd5767c1977f3e7a90cfac5d35f19fdcb..38b352449c0c98f96e0b103a9bbad06e0e2317a1 100644 (file)
@@ -2,6 +2,7 @@ add_library(crimson-os
   cyan_store.cc
   cyan_collection.cc
   cyan_object.cc
+  futurized_store.cc
   ${PROJECT_SOURCE_DIR}/src/os/Transaction.cc)
 target_link_libraries(crimson-os
   crimson)
index 93770897b1c84b8f75bd16fd67ef8f1a0e1c1a22..79102f0f6f5a3eed3979bde9909a1a58e6c5bb54 100644 (file)
@@ -215,7 +215,7 @@ seastar::future<CyanStore::attrs_t> CyanStore::get_attrs(CollectionRef c,
 seastar::future<CyanStore::omap_values_t>
 CyanStore::omap_get_values(CollectionRef c,
                            const ghobject_t& oid,
-                           std::vector<std::string>&& keys)
+                           const omap_keys_t& keys)
 {
   logger().debug("{} {} {}",
                 __func__, c->cid, oid);
@@ -344,7 +344,7 @@ seastar::future<> CyanStore::do_transaction(CollectionRef ch,
       {
        const coll_t &cid = i.get_cid(op->cid);
        const ghobject_t &oid = i.get_oid(op->oid);
-       std::set<std::string> keys;
+       omap_keys_t keys;
        i.decode_keyset(keys);
        r = _omap_rmkeys(cid, oid, keys);
       }
@@ -492,7 +492,7 @@ int CyanStore::_omap_set_header(
 int CyanStore::_omap_rmkeys(
   const coll_t& cid,
   const ghobject_t& oid,
-  const std::set<std::string> &aset)
+  const omap_keys_t& aset)
 {
   logger().debug(
     "{} {} {} {} keys",
index 0faed53342db26f0eb58473edbb6210f03a7e0e3..4da2373b968efa92f4643096263727a76c52e5d9 100644 (file)
 #include "osd/osd_types.h"
 #include "include/uuid.h"
 
+#include "futurized_store.h"
+
 namespace ceph::os {
 
 class Collection;
 class Transaction;
 
 // a just-enough store for reading/writing the superblock
-class CyanStore {
+class CyanStore final : public FuturizedStore {
   constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32;
 
   const std::string path;
@@ -32,81 +34,54 @@ class CyanStore {
   uuid_d osd_fsid;
 
 public:
-  template <class ConcreteExceptionT>
-  class Exception : public std::logic_error {
-  public:
-    using std::logic_error::logic_error;
-
-    // Throwing an exception isn't the sole way to signalize an error
-    // with it. This approach nicely fits cold, infrequent issues but
-    // when applied to a hot one (like ENOENT on write path), it will
-    // likely hurt performance.
-    // Alternative approach for hot errors is to create exception_ptr
-    // on our own and place it in the future via make_exception_future.
-    // When ::handle_exception is called, handler would inspect stored
-    // exception whether it's hot-or-cold before rethrowing it.
-    // The main advantage is both types flow through very similar path
-    // based on future::handle_exception.
-    static bool is_class_of(const std::exception_ptr& ep) {
-      // Seastar offers hacks for making throwing lock-less but stack
-      // unwinding still can be a problem so painful to justify going
-      // with non-standard, obscure things like this one.
-      return *ep.__cxa_exception_type() == typeid(ConcreteExceptionT);
-    }
-  };
-
-  struct EnoentException : public Exception<EnoentException> {
-    using Exception<EnoentException>::Exception;
-  };
 
   CyanStore(const std::string& path);
-  ~CyanStore();
+  ~CyanStore() final;
 
-  seastar::future<> mount();
-  seastar::future<> umount();
+  seastar::future<> mount() final;
+  seastar::future<> umount() final;
 
-  seastar::future<> mkfs();
+  seastar::future<> mkfs() final;
   seastar::future<ceph::bufferlist> read(CollectionRef c,
                                   const ghobject_t& oid,
                                   uint64_t offset,
                                   size_t len,
-                                  uint32_t op_flags = 0);
+                                  uint32_t op_flags = 0) final;
   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);
+                                           std::string_view name) final;
+  seastar::future<attrs_t> get_attrs(CollectionRef c,
+                                     const ghobject_t& oid) final;
 
-  using omap_values_t = std::map<std::string,ceph::bufferlist, std::less<>>;
   seastar::future<omap_values_t> omap_get_values(
     CollectionRef c,
     const ghobject_t& oid,
-    std::vector<std::string>&& keys);
+    const omap_keys_t& keys) final;
 
   seastar::future<std::vector<ghobject_t>, ghobject_t> list_objects(
     CollectionRef c,
     const ghobject_t& start,
     const ghobject_t& end,
-    uint64_t limit);
+    uint64_t limit) final;
 
   /// Retrieves paged set of values > start (if present)
   seastar::future<bool, omap_values_t> omap_get_values(
     CollectionRef c,           ///< [in] collection
     const ghobject_t &oid,     ///< [in] oid
     const std::optional<std::string> &start ///< [in] start, empty for begin
-    ); ///< @return <done, values> values.empty() iff done
+    ) final; ///< @return <done, values> values.empty() iff done
 
-  CollectionRef create_new_collection(const coll_t& cid);
-  CollectionRef open_collection(const coll_t& cid);
-  std::vector<coll_t> list_collections();
+  CollectionRef create_new_collection(const coll_t& cid) final;
+  CollectionRef open_collection(const coll_t& cid) final;
+  std::vector<coll_t> list_collections() final;
 
   seastar::future<> do_transaction(CollectionRef ch,
-                                  Transaction&& txn);
+                                  Transaction&& txn) final;
 
   void write_meta(const std::string& key,
-                 const std::string& value);
-  int read_meta(const std::string& key, std::string* value);
-  uuid_d get_fsid() const;
+                 const std::string& value) final;
+  int read_meta(const std::string& key, std::string* value) final;
+  uuid_d get_fsid() const final;
 
 private:
   int _remove(const coll_t& cid, const ghobject_t& oid);
@@ -125,7 +100,7 @@ private:
   int _omap_rmkeys(
     const coll_t& cid,
     const ghobject_t& oid,
-    const std::set<std::string> &aset);
+    const omap_keys_t& aset);
   int _omap_rmkeyrange(
     const coll_t& cid,
     const ghobject_t& oid,
diff --git a/src/crimson/os/futurized_store.cc b/src/crimson/os/futurized_store.cc
new file mode 100644 (file)
index 0000000..e6883b3
--- /dev/null
@@ -0,0 +1,16 @@
+#include "futurized_store.h"
+#include "cyan_store.h"
+
+namespace ceph::os {
+
+std::unique_ptr<FuturizedStore> FuturizedStore::create(const std::string& type,
+                                       const std::string& data)
+{
+  if (type == "memstore") {
+    return std::make_unique<ceph::os::CyanStore>(data);
+  }
+
+  return nullptr;
+}
+
+}
diff --git a/src/crimson/os/futurized_store.h b/src/crimson/os/futurized_store.h
new file mode 100644 (file)
index 0000000..49ad867
--- /dev/null
@@ -0,0 +1,108 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include <string>
+#include <unordered_map>
+#include <map>
+#include <typeinfo>
+#include <vector>
+
+#include <seastar/core/future.hh>
+
+#include "include/buffer_fwd.h"
+#include "include/uuid.h"
+#include "osd/osd_types.h"
+
+namespace ceph::os {
+
+class Collection;
+class Transaction;
+
+class FuturizedStore {
+
+public:
+  template <class ConcreteExceptionT>
+  class Exception : public std::logic_error {
+  public:
+    using std::logic_error::logic_error;
+
+    // Throwing an exception isn't the sole way to signalize an error
+    // with it. This approach nicely fits cold, infrequent issues but
+    // when applied to a hot one (like ENOENT on write path), it will
+    // likely hurt performance.
+    // Alternative approach for hot errors is to create exception_ptr
+    // on our own and place it in the future via make_exception_future.
+    // When ::handle_exception is called, handler would inspect stored
+    // exception whether it's hot-or-cold before rethrowing it.
+    // The main advantage is both types flow through very similar path
+    // based on future::handle_exception.
+    static bool is_class_of(const std::exception_ptr& ep) {
+      // Seastar offers hacks for making throwing lock-less but stack
+      // unwinding still can be a problem so painful to justify going
+      // with non-standard, obscure things like this one.
+      return *ep.__cxa_exception_type() == typeid(ConcreteExceptionT);
+    }
+  };
+
+  struct EnoentException : public Exception<EnoentException> {
+    using Exception<EnoentException>::Exception;
+  };
+  static std::unique_ptr<FuturizedStore> create(const std::string& type,
+                                                const std::string& data);
+  FuturizedStore() = default;
+  virtual ~FuturizedStore() = default;
+
+  // no copying
+  explicit FuturizedStore(const FuturizedStore& o) = delete;
+  const FuturizedStore& operator=(const FuturizedStore& o) = delete;
+
+  virtual seastar::future<> mount() = 0;
+  virtual seastar::future<> umount() = 0;
+
+  virtual seastar::future<> mkfs() = 0;
+  using CollectionRef = boost::intrusive_ptr<Collection>;
+  virtual seastar::future<ceph::bufferlist> read(CollectionRef c,
+                                  const ghobject_t& oid,
+                                  uint64_t offset,
+                                  size_t len,
+                                  uint32_t op_flags = 0) = 0;
+  virtual seastar::future<ceph::bufferptr> get_attr(CollectionRef c,
+                                           const ghobject_t& oid,
+                                           std::string_view name) = 0;
+
+  using attrs_t = std::map<std::string, ceph::bufferptr, std::less<>>;
+  virtual seastar::future<attrs_t> get_attrs(CollectionRef c,
+                                             const ghobject_t& oid) = 0;
+  using omap_values_t = std::map<std::string, bufferlist, std::less<>>;
+  using omap_keys_t = std::set<std::string>;
+  virtual seastar::future<omap_values_t> omap_get_values(
+                                         CollectionRef c,
+                                         const ghobject_t& oid,
+                                         const omap_keys_t& keys) = 0;
+  virtual seastar::future<std::vector<ghobject_t>, ghobject_t> list_objects(
+                                         CollectionRef c,
+                                         const ghobject_t& start,
+                                         const ghobject_t& end,
+                                         uint64_t limit) = 0;
+  virtual seastar::future<bool, omap_values_t> omap_get_values(
+    CollectionRef c,           ///< [in] collection
+    const ghobject_t &oid,     ///< [in] oid
+    const std::optional<std::string> &start ///< [in] start, empty for begin
+    ) = 0; ///< @return <done, values> values.empty() iff done
+
+  virtual CollectionRef create_new_collection(const coll_t& cid) = 0;
+  virtual CollectionRef open_collection(const coll_t& cid) = 0;
+  virtual std::vector<coll_t> list_collections() = 0;
+
+  virtual seastar::future<> do_transaction(CollectionRef ch,
+                                  Transaction&& txn) = 0;
+
+  virtual void write_meta(const std::string& key,
+                 const std::string& value) = 0;
+  virtual int read_meta(const std::string& key, std::string* value) = 0;
+  virtual uuid_d get_fsid() const  = 0;
+};
+
+}
index 510679efa915daad261389debde856d0f77d8bfe..66f8dbdff7f841c9e871a4941fa3f080f2f6cbce 100644 (file)
@@ -3,7 +3,7 @@
 
 ECBackend::ECBackend(shard_id_t shard,
                      ECBackend::CollectionRef coll,
-                     ceph::os::CyanStore* store,
+                     ceph::os::FuturizedStore* store,
                      const ec_profile_t&,
                      uint64_t)
   : PGBackend{shard, coll, store}
index 6849c2adf2d427fef6517fd41a4293451a5a4c35..4bf6b113a79c74600c80c88c947b1d03b84b8bcb 100644 (file)
@@ -13,7 +13,7 @@ class ECBackend : public PGBackend
 {
 public:
   ECBackend(shard_id_t shard,
-           CollectionRef, ceph::os::CyanStore*,
+           CollectionRef, ceph::os::FuturizedStore*,
            const ec_profile_t& ec_profile,
            uint64_t stripe_width);
 private:
@@ -22,5 +22,5 @@ private:
                                          uint64_t len,
                                          uint32_t flags) override;
   CollectionRef coll;
-  ceph::os::CyanStore* store;
+  ceph::os::FuturizedStore* store;
 };
index 3258b70826f8902ea77deaf8c8d97845e4f012a9..330b02bc094714a6876b69cb02e57abdd952e5cf 100644 (file)
@@ -24,7 +24,7 @@
 #include "crimson/net/Messenger.h"
 #include "crimson/os/cyan_collection.h"
 #include "crimson/os/cyan_object.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 #include "os/Transaction.h"
 #include "crimson/osd/heartbeat.h"
 #include "crimson/osd/osd_meta.h"
@@ -42,7 +42,7 @@ namespace {
 }
 
 using ceph::common::local_conf;
-using ceph::os::CyanStore;
+using ceph::os::FuturizedStore;
 
 OSD::OSD(int id, uint32_t nonce,
          ceph::net::Messenger& cluster_msgr,
@@ -58,7 +58,8 @@ OSD::OSD(int id, uint32_t nonce,
     mgrc{new ceph::mgr::Client{public_msgr, *this}},
     heartbeat{new Heartbeat{*this, *monc, hb_front_msgr, hb_back_msgr}},
     heartbeat_timer{[this] { update_heartbeat_peers(); }},
-    store{std::make_unique<ceph::os::CyanStore>(
+    store{ceph::os::FuturizedStore::create(
+      local_conf().get_val<std::string>("osd_objectstore"),
       local_conf().get_val<std::string>("osd_data"))},
     shard_services{cluster_msgr, public_msgr, *monc, *mgrc, *store}
 {
index bcab1788108aeb84fe8a85caf74a3abbeb686f9a..f8582f791813bcf113781f0ba36e3af19cb82b7c 100644 (file)
@@ -44,7 +44,7 @@ namespace ceph::net {
 }
 
 namespace ceph::os {
-  class CyanStore;
+  class FuturizedStore;
   struct Collection;
   class Transaction;
 }
@@ -74,7 +74,7 @@ class OSD : public ceph::net::Dispatcher,
   SimpleLRU<epoch_t, bufferlist, false> map_bl_cache;
   cached_map_t osdmap;
   // TODO: use a wrapper for ObjectStore
-  std::unique_ptr<ceph::os::CyanStore> store;
+  std::unique_ptr<ceph::os::FuturizedStore> store;
   std::unique_ptr<OSDMeta> meta_coll;
 
   OSDState state;
index e81455c68c21aebc4f596b6d924fadf3d9a5ee11..f8a270a833c50edf3bfab2e0b143eb7942d904da 100644 (file)
@@ -3,7 +3,7 @@
 #include <fmt/format.h>
 
 #include "crimson/os/cyan_collection.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 #include "os/Transaction.h"
 
 void OSDMeta::create(ceph::os::Transaction& t)
index 936d954815f1be2885d6a35da464b9272305458f..613e393df56ffafccac5e765cfb5e0384fe2eec2 100644 (file)
@@ -9,7 +9,7 @@
 #include "osd/osd_types.h"
 
 namespace ceph::os {
-  class CyanStore;
+  class FuturizedStore;
   class Collection;
   class Transaction;
 }
@@ -19,12 +19,12 @@ namespace ceph::os {
 class OSDMeta {
   template<typename T> using Ref = boost::intrusive_ptr<T>;
 
-  ceph::os::CyanStore* store;
+  ceph::os::FuturizedStore* store;
   Ref<ceph::os::Collection> coll;
 
 public:
   OSDMeta(Ref<ceph::os::Collection> coll,
-          ceph::os::CyanStore* store)
+          ceph::os::FuturizedStore* store)
     : store{store}, coll{coll}
   {}
 
index 3b182c24ffaafde198ea49ca2b756ceee02afeeb..dc26142ae034087ddc7c011c6dc47737ec516278 100644 (file)
@@ -27,7 +27,7 @@
 #include "crimson/net/Connection.h"
 #include "crimson/net/Messenger.h"
 #include "crimson/os/cyan_collection.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 #include "os/Transaction.h"
 #include "crimson/osd/exceptions.h"
 #include "crimson/osd/pg_meta.h"
@@ -150,7 +150,7 @@ void PG::init(
     new_acting_primary, history, pi, backfill, t);
 }
 
-seastar::future<> PG::read_state(ceph::os::CyanStore* store)
+seastar::future<> PG::read_state(ceph::os::FuturizedStore* store)
 {
   coll_ref = store->open_collection(coll_t(pgid));
   return PGMeta{store, pgid}.load().then(
index 211fc77053c4f2984863bb16c4355f7a77c54870..109a09ee8d5c74f67b19303696f851fea7d30f1a 100644 (file)
@@ -33,7 +33,7 @@ namespace ceph::net {
 }
 
 namespace ceph::os {
-  class CyanStore;
+  class FuturizedStore;
 }
 
 class PG : public boost::intrusive_ref_counter<
@@ -385,7 +385,7 @@ public:
     bool backfill,
     ObjectStore::Transaction &t);
 
-  seastar::future<> read_state(ceph::os::CyanStore* store);
+  seastar::future<> read_state(ceph::os::FuturizedStore* store);
 
   void do_peering_event(
     const boost::statechart::event_base &evt,
index e2e27b45b04a9280da67007030bcd1588109a685..0065a6e800476a9d84497e364b5bd6adfe44c362 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "crimson/os/cyan_collection.h"
 #include "crimson/os/cyan_object.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 #include "replicated_backend.h"
 #include "ec_backend.h"
 #include "exceptions.h"
@@ -25,7 +25,7 @@ namespace {
 std::unique_ptr<PGBackend> PGBackend::create(const spg_t pgid,
                                              const pg_pool_t& pool,
                                             ceph::os::CollectionRef coll,
-                                             ceph::os::CyanStore* store,
+                                             ceph::os::FuturizedStore* store,
                                              const ec_profile_t& ec_profile)
 {
   switch (pool.type) {
@@ -43,7 +43,7 @@ std::unique_ptr<PGBackend> PGBackend::create(const spg_t pgid,
 
 PGBackend::PGBackend(shard_id_t shard,
                      CollectionRef coll,
-                     ceph::os::CyanStore* store)
+                     ceph::os::FuturizedStore* store)
   : shard{shard},
     coll{coll},
     store{store}
@@ -109,7 +109,7 @@ PGBackend::_load_os(const hobject_t& oid)
                          OI_ATTR).then_wrapped([oid, this](auto fut) {
     if (fut.failed()) {
       auto ep = std::move(fut).get_exception();
-      if (!ceph::os::CyanStore::EnoentException::is_class_of(ep)) {
+      if (!ceph::os::FuturizedStore::EnoentException::is_class_of(ep)) {
         std::rethrow_exception(ep);
       }
       return seastar::make_ready_future<cached_os_t>(
@@ -138,7 +138,7 @@ PGBackend::_load_ss(const hobject_t& oid)
     std::unique_ptr<SnapSet> snapset;
     if (fut.failed()) {
       auto ep = std::move(fut).get_exception();
-      if (!ceph::os::CyanStore::EnoentException::is_class_of(ep)) {
+      if (!ceph::os::FuturizedStore::EnoentException::is_class_of(ep)) {
         std::rethrow_exception(ep);
       } else {
         snapset = std::make_unique<SnapSet>();
index a0d16bb24f41a4a8d94a0abfbeef0652df5b2799..75f5c30334b032049218b0df85c636b880a67fe8 100644 (file)
@@ -8,7 +8,8 @@
 #include <string>
 #include <boost/smart_ptr/local_shared_ptr.hpp>
 
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
+#include "crimson/os/cyan_collection.h"
 #include "crimson/common/shared_lru.h"
 #include "os/Transaction.h"
 #include "osd/osd_types.h"
@@ -23,12 +24,12 @@ protected:
   using ec_profile_t = std::map<std::string, std::string>;
 
 public:
-  PGBackend(shard_id_t shard, CollectionRef coll, ceph::os::CyanStore* store);
+  PGBackend(shard_id_t shard, CollectionRef coll, ceph::os::FuturizedStore* store);
   virtual ~PGBackend() = default;
   static std::unique_ptr<PGBackend> create(const spg_t pgid,
                                           const pg_pool_t& pool,
                                           ceph::os::CollectionRef coll,
-                                          ceph::os::CyanStore* store,
+                                          ceph::os::FuturizedStore* store,
                                           const ec_profile_t& ec_profile);
   using cached_os_t = boost::local_shared_ptr<ObjectState>;
   seastar::future<cached_os_t> get_object_state(const hobject_t& oid);
@@ -57,7 +58,7 @@ public:
 protected:
   const shard_id_t shard;
   CollectionRef coll;
-  ceph::os::CyanStore* store;
+  ceph::os::FuturizedStore* store;
 
 private:
   using cached_ss_t = boost::local_shared_ptr<SnapSet>;
index 979f38f661308495985b38aef5daa0a7c77f90c6..391b3182668f5eb392fdd0a078aa3ab5211dbb66 100644 (file)
@@ -3,21 +3,20 @@
 #include <string_view>
 
 #include "crimson/os/cyan_collection.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 
 // prefix pgmeta_oid keys with _ so that PGLog::read_log_and_missing() can
 // easily skip them
+using ceph::os::FuturizedStore;
 
-using ceph::os::CyanStore;
-
-PGMeta::PGMeta(CyanStore* store, spg_t pgid)
+PGMeta::PGMeta(FuturizedStore* store, spg_t pgid)
   : store{store},
     pgid{pgid}
 {}
 
 namespace {
   template<typename T>
-  std::optional<T> find_value(const CyanStore::omap_values_t& values,
+  std::optional<T> find_value(const FuturizedStore::omap_values_t& values,
                               string_view key)
   {
     auto found = values.find(key);
@@ -33,10 +32,11 @@ namespace {
 seastar::future<epoch_t> PGMeta::get_epoch()
 {
   auto ch = store->open_collection(coll_t{pgid});
+  std::set<std::string> keys{infover_key.data(), 
+                             epoch_key.data()};
   return store->omap_get_values(ch,
                                 pgid.make_pgmeta_oid(),
-                                {string{infover_key},
-                                 string{epoch_key}}).then(
+                                keys).then(
     [](auto&& values) {
       {
         // sanity check
@@ -57,12 +57,13 @@ seastar::future<epoch_t> PGMeta::get_epoch()
 seastar::future<pg_info_t, PastIntervals> PGMeta::load()
 {
   auto ch = store->open_collection(coll_t{pgid});
+  std::set<std::string> keys{infover_key.data(),
+                             info_key.data(),
+                             biginfo_key.data(),
+                             fastinfo_key.data()};
   return store->omap_get_values(ch,
                                 pgid.make_pgmeta_oid(),
-                                {string{infover_key},
-                                 string{info_key},
-                                 string{biginfo_key},
-                                 string{fastinfo_key}}).then(
+                                keys).then(
     [this](auto&& values) {
       {
         // sanity check
index 10f2234a7922f36e41e563f9c1819610cb96ac63..7baacca89edf92a6c52875b35a95280903907181 100644 (file)
@@ -7,16 +7,16 @@
 #include "osd/osd_types.h"
 
 namespace ceph::os {
-  class CyanStore;
+  class FuturizedStore;
 }
 
 /// PG related metadata
 class PGMeta
 {
-  ceph::os::CyanStore* store;
+  ceph::os::FuturizedStore* store;
   const spg_t pgid;
 public:
-  PGMeta(ceph::os::CyanStore *store, spg_t pgid);
+  PGMeta(ceph::os::FuturizedStore *store, spg_t pgid);
   seastar::future<epoch_t> get_epoch();
   seastar::future<pg_info_t, PastIntervals> load();
 };
index 81c09c4b320ccb9074baf379e2a6e133f076549f..2a6b9b7fc6e85ba81ff43aa13ae9b77e54a4e6e3 100644 (file)
@@ -2,11 +2,11 @@
 
 #include "crimson/os/cyan_collection.h"
 #include "crimson/os/cyan_object.h"
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 
 ReplicatedBackend::ReplicatedBackend(shard_id_t shard,
                                      ReplicatedBackend::CollectionRef coll,
-                                     ceph::os::CyanStore* store)
+                                     ceph::os::FuturizedStore* store)
   : PGBackend{shard, coll, store}
 {}
 
index 0a91e03b8582fe7256bdd008f274fc15e2c13945..e96060f948f15f9a96e1950b6dfe5eaf003fe697 100644 (file)
@@ -14,7 +14,7 @@ class ReplicatedBackend : public PGBackend
 public:
   ReplicatedBackend(shard_id_t shard,
                    CollectionRef coll,
-                   ceph::os::CyanStore* store);
+                   ceph::os::FuturizedStore* store);
 private:
   seastar::future<ceph::bufferlist> _read(const hobject_t& hoid,
                                          uint64_t off,
index e36c03c2271c6d8ce32239308ae795df004f4e3f..9d4c9984205d4e4838e7148fd67c5f25a374af3e 100644 (file)
@@ -31,7 +31,7 @@ ShardServices::ShardServices(
   ceph::net::Messenger &public_msgr,
   ceph::mon::Client &monc,
   ceph::mgr::Client &mgrc,
-  ceph::os::CyanStore &store)
+  ceph::os::FuturizedStore &store)
     : cluster_msgr(cluster_msgr),
       public_msgr(public_msgr),
       monc(monc),
index 719c27e2778d3f9111e7e02a77f60955cf46803f..fa3c72b1b0b8c089b249ed80082125c026baafd4 100644 (file)
@@ -22,7 +22,7 @@ namespace ceph::mon {
 }
 
 namespace ceph::os {
-  class CyanStore;
+  class FuturizedStore;
 }
 
 class PerfCounters;
@@ -40,7 +40,7 @@ class ShardServices {
   ceph::net::Messenger &public_msgr;
   ceph::mon::Client &monc;
   ceph::mgr::Client &mgrc;
-  ceph::os::CyanStore &store;
+  ceph::os::FuturizedStore &store;
 
   CephContext cct;
 
@@ -53,14 +53,14 @@ public:
     ceph::net::Messenger &public_msgr,
     ceph::mon::Client &monc,
     ceph::mgr::Client &mgrc,
-    ceph::os::CyanStore &store);
+    ceph::os::FuturizedStore &store);
 
   seastar::future<> send_to_osd(
     int peer,
     MessageRef m,
     epoch_t from_epoch);
 
-  ceph::os::CyanStore &get_store() {
+  ceph::os::FuturizedStore &get_store() {
     return store;
   }
 
index 622c34a10ec74217b8e3b249b8276f754da9f684..77bbc8ba62457902d6b265db878d0d2b53f3d65c 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifdef WITH_SEASTAR
 #include <seastar/core/future.hh>
-#include "crimson/os/cyan_store.h"
+#include "crimson/os/futurized_store.h"
 #include "crimson/os/cyan_collection.h"
 #endif
 
@@ -1585,7 +1585,7 @@ public:
 
 #ifdef WITH_SEASTAR
   seastar::future<> read_log_and_missing_crimson(
-    ceph::os::CyanStore &store,
+    ceph::os::FuturizedStore &store,
     ceph::os::CollectionRef ch,
     const pg_info_t &info,
     ghobject_t pgmeta_oid
@@ -1597,8 +1597,8 @@ public:
   }
 
   template <typename missing_type>
-  struct CyanStoreLogReader {
-    ceph::os::CyanStore &store;
+  struct FuturizedStoreLogReader {
+    ceph::os::FuturizedStore &store;
     ceph::os::CollectionRef ch;
     const pg_info_t &info;
     IndexedLog &log;
@@ -1667,12 +1667,12 @@ public:
       on_disk_can_rollback_to = info.last_update;
       missing.may_include_deletes = false;
 
-      auto reader = std::unique_ptr<CyanStoreLogReader>(this);
+      auto reader = std::unique_ptr<FuturizedStoreLogReader>(this);
       return seastar::repeat(
        [this]() {
          return store.omap_get_values(ch, pgmeta_oid, next).then(
            [this](
-             bool done, ceph::os::CyanStore::omap_values_t values) {
+             bool done, ceph::os::FuturizedStore::omap_values_t values) {
              for (auto &&p : values) {
                process_entry(p);
              }
@@ -1694,7 +1694,7 @@ public:
 
   template <typename missing_type>
   static seastar::future<> read_log_and_missing_crimson(
-    ceph::os::CyanStore &store,
+    ceph::os::FuturizedStore &store,
     ceph::os::CollectionRef ch,
     const pg_info_t &info,
     IndexedLog &log,
@@ -1705,7 +1705,7 @@ public:
     ldpp_dout(dpp, 20) << "read_log_and_missing coll "
                       << ch->cid
                       << " " << pgmeta_oid << dendl;
-    return (new CyanStoreLogReader<missing_type>{
+    return (new FuturizedStoreLogReader<missing_type>{
       store, ch, info, log, missing, pgmeta_oid, dpp})->start();
   }