]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonitorDBStore: use single-key LevelDB::get() method
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Fri, 23 Oct 2015 13:46:20 +0000 (15:46 +0200)
committerSage Weil <sage@redhat.com>
Mon, 9 Nov 2015 14:03:22 +0000 (09:03 -0500)
Make MonitorDBStore use single-key ::get() method for some performance
increase in heavy K/V workloads.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/mon/MonitorDBStore.h

index 15558e3da986c0268cbe2c16bb15b79e5b48cb41..b9b0ee54c938b26425be9c64cd4a913a9e895615 100644 (file)
@@ -507,14 +507,12 @@ class MonitorDBStore
   }
 
   int get(const string& prefix, const string& key, bufferlist& bl) {
-    set<string> k;
-    k.insert(key);
-    map<string,bufferlist> out;
-
-    db->get(prefix, k, &out);
-    if (out.empty())
+    
+    bufferlist outbl;
+    db->get(prefix, key, &outbl);
+    if (outbl.length() == 0) 
       return -ENOENT;
-    bl.append(out[key]);
+    bl.append(outbl);
 
     return 0;
   }