summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-04-22 16:13:33 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-04-22 17:08:06 +0100
commit41b874cb707976091472f93bac0c33323b880573 (patch)
tree2fb85cc9773a9d06685291c8000fcbf840b82b9c
parentcd2cabecf17041d3365b85dfc1f5542b2dff5819 (diff)
downloadceph-41b874cb707976091472f93bac0c33323b880573.tar.gz
mon: PaxosService: add 'exists_key/version' helper functions
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/PaxosService.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h
index f16bc77cdeb..268253599bf 100644
--- a/src/mon/PaxosService.h
+++ b/src/mon/PaxosService.h
@@ -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);
}
/**