os/DBObjectMap: use single-key LevelDB::get method

Make FileStore use single-key ::get() method for some performance
increase in k/v-heavy workloads.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
This commit is contained in:
Piotr Dałek 2015-10-23 15:44:47 +02:00 committed by Sage Weil
parent 76eb04aeef
commit a3f88918c9

View File

@ -1089,17 +1089,16 @@ DBObjectMap::Header DBObjectMap::_lookup_map_header(
}
}
map<string, bufferlist> out;
set<string> to_get;
to_get.insert(map_header_key(oid));
int r = db->get(HOBJECT_TO_SEQ, to_get, &out);
if (r < 0 || out.empty()) {
bufferlist out;
int r = db->get(HOBJECT_TO_SEQ, map_header_key(oid), &out);
if (r < 0 || out.length()==0) {
delete header;
return Header();
}
Header ret(header, RemoveOnDelete(this));
bufferlist::iterator iter = out.begin()->second.begin();
bufferlist::iterator iter = out.begin();
ret->decode(iter);
{
Mutex::Locker l(cache_lock);