]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PaxosService: use get and put for version_t
authorSamuel Just <sam.just@inktank.com>
Fri, 26 Apr 2013 23:48:21 +0000 (16:48 -0700)
committerSamuel Just <sam.just@inktank.com>
Sat, 27 Apr 2013 00:19:59 +0000 (17:19 -0700)
Otherwise, we just duplicate the logic for generating the version
key names.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/mon/PaxosService.cc

index 9484f367a6f119008c7e57b9766910189fc99d93..d02cb1d7ab56b8c3ab9f06340f645d25e864720e 100644 (file)
@@ -294,19 +294,13 @@ void PaxosService::put_version(MonitorDBStore::Transaction *t,
                               const string& prefix, version_t ver,
                               bufferlist& bl)
 {
-  ostringstream os;
-  os << ver;
-  string key = mon->store->combine_strings(prefix, os.str());
-  t->put(get_service_name(), key, bl);
+  t->put(get_service_name(), ver, bl);
 }
 
 int PaxosService::get_version(const string& prefix, version_t ver,
                              bufferlist& bl)
 {
-  ostringstream os;
-  os << ver;
-  string key = mon->store->combine_strings(prefix, os.str());
-  return mon->store->get(get_service_name(), key, bl);
+  return mon->store->get(get_service_name(), ver, bl);
 }
 
 void PaxosService::trim(MonitorDBStore::Transaction *t,