From: Haomai Wang Date: Tue, 26 May 2015 04:40:19 +0000 (+0800) Subject: KeyValueStore: Add collect_metadata support X-Git-Tag: v9.0.2~109^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4759%2Fhead;p=ceph.git KeyValueStore: Add collect_metadata support Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 1204a692c7ce..94092ae8bc22 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -583,6 +583,11 @@ int KeyValueStore::statfs(struct statfs *buf) return 0; } +void KeyValueStore::collect_metadata(map *pm) +{ + (*pm)["keyvaluestore_backend"] = superblock.backend; +} + int KeyValueStore::mkfs() { int ret = 0; diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index 376a37097ce3..0bf69e75a9a1 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -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 *pm); + int statfs(struct statfs *buf); int _do_transactions( diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 7f355d5b2f89..9e31615f136b 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -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); } }