mirror of
https://github.com/ceph/ceph
synced 2024-12-18 09:25:49 +00:00
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:
parent
76eb04aeef
commit
a3f88918c9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user