From: Joao Eduardo Luis Date: Thu, 4 Apr 2013 17:17:21 +0000 (+0100) Subject: mon: PaxosService: add helper function to check if a given version exists X-Git-Tag: v0.61~182^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=12600417772f21ddf83e573a5cf9fab201a98215;p=ceph.git mon: PaxosService: add helper function to check if a given version exists Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index cc403574df86..f16bc77cdeb1 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -17,6 +17,7 @@ #include "messages/PaxosServiceMessage.h" #include "include/Context.h" +#include "include/stringify.h" #include #include "Paxos.h" #include "Monitor.h" @@ -918,6 +919,17 @@ public: string key = mon->store->combine_strings(prefix, name); return mon->store->exists(get_service_name(), key); } + + /** + * Checks if a given version @v exists + * + * @param prefix key's prefix + * @param v key's suffix + * @returns true if key exists; false otherwise. + */ + bool exists_version(const string& prefix, const version_t v) { + return exists_key(prefix, stringify(v)); + } /** * @} */