]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/KeyValueDB: add sipler get() variant
authorSage Weil <sage@redhat.com>
Tue, 17 Feb 2015 19:29:35 +0000 (11:29 -0800)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:52 +0000 (17:03 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/KeyValueDB.h

index a49c49bc9684ab33eaeb545a83ea65cbf56ee54e..80fdceca81658f541b301c2792dbdcfa49289bfa 100644 (file)
@@ -86,6 +86,16 @@ public:
     const std::set<string> &key,      ///< [in] Key to retrieve
     std::map<string, bufferlist> *out ///< [out] Key value retrieved
     ) = 0;
+  virtual int get(const string &prefix, ///< [in] prefix
+                 const string &key,    ///< [in] key
+                 bufferlist *value) {  ///< [out] value
+    set<string> ks;
+    ks.insert(key);
+    map<string,bufferlist> om;
+    int r = get(prefix, ks, &om);
+    *value = om[key];
+    return r;
+  }
 
   class WholeSpaceIteratorImpl {
   public: