]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PaxosService: add 'exists_key/version' helper functions
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 22 Apr 2013 15:13:33 +0000 (16:13 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 22 Apr 2013 16:08:06 +0000 (17:08 +0100)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/mon/PaxosService.h

index f16bc77cdeb1b28d14a16e8279ad6931adb9a6e9..268253599bf1a85515154b71953821e531265498 100644 (file)
@@ -908,6 +908,15 @@ public:
   int get_mkfs(bufferlist& bl) {
     return mon->store->get(mkfs_name, get_service_name(), bl);
   }
+
+  bool exists_key(const string &key) {
+    return mon->store->exists(get_service_name(), key);
+  }
+
+  bool exists_version(const version_t v) {
+    return exists_key(stringify(v));
+  }
+
   /**
    * Checks if a given key composed by @p prefix and @p name exists.
    *
@@ -917,7 +926,7 @@ public:
    */
   bool exists_key(const string& prefix, const string& name) {
     string key = mon->store->combine_strings(prefix, name);
-    return mon->store->exists(get_service_name(), key);
+    return exists_key(key);
   }
 
   /**