]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
KeyValueStore: Add collect_metadata support 4759/head
authorHaomai Wang <haomaiwang@gmail.com>
Tue, 26 May 2015 04:40:19 +0000 (12:40 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Tue, 26 May 2015 04:40:19 +0000 (12:40 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/os/KeyValueStore.cc
src/os/KeyValueStore.h
src/test/objectstore/store_test.cc

index 1204a692c7cee549fb7f1191305a0115d5e40626..94092ae8bc22ec390820c2c8a8f7524d71c0b142 100644 (file)
@@ -583,6 +583,11 @@ int KeyValueStore::statfs(struct statfs *buf)
   return 0;
 }
 
+void KeyValueStore::collect_metadata(map<string,string> *pm)
+{
+  (*pm)["keyvaluestore_backend"] = superblock.backend;
+}
+
 int KeyValueStore::mkfs()
 {
   int ret = 0;
index 376a37097ce39d029424edff98e84b669eeb6d1e..0bf69e75a9a14b30bbfa82ef1d1bbb1528ffc213 100644 (file)
@@ -474,7 +474,7 @@ class KeyValueStore : public ObjectStore,
  public:
 
   KeyValueStore(const std::string &base,
-                const char *internal_name = "keyvaluestore-dev",
+                const char *internal_name = "keyvaluestore",
                 bool update_to=false);
   ~KeyValueStore();
 
@@ -524,6 +524,8 @@ class KeyValueStore : public ObjectStore,
    **/
   bool get_allow_sharded_objects() {return false;}
 
+  void collect_metadata(map<string,string> *pm);
+
   int statfs(struct statfs *buf);
 
   int _do_transactions(
index 7f355d5b2f890ad35ccfc99c954a57afcdaf13cf..9e31615f136b41a84a5579173efe76c1fed70a78 100644 (file)
@@ -81,6 +81,8 @@ TEST_P(StoreTest, collect_metadata) {
   if (GetParam() == string("filestore")) {
     ASSERT_NE(pm.count("filestore_backend"), 0u);
     ASSERT_NE(pm.count("filestore_f_type"), 0u);
+  } else if (GetParam() == string("keyvaluestore")) {
+    ASSERT_NE(pm.count("keyvaluestore_backend"), 0u);
   }
 }