MCPcopy Create free account
hub / github.com/apple/foundationdb / getIfExists

Method getIfExists

fdbserver/VersionedBTree.actor.cpp:1997–2004  ·  view source on GitHub ↗

Get the object for i if it exists, else return nullptr. If the object exists, its eviction order will NOT change as this is not a cache hit.

Source from the content-addressed store, hash-verified

1995 // Get the object for i if it exists, else return nullptr.
1996 // If the object exists, its eviction order will NOT change as this is not a cache hit.
1997 ObjectType* getIfExists(const IndexType& index) {
1998 auto i = cache.find(index);
1999 if (i != cache.end()) {
2000 ++i->second.hits;
2001 return &i->second.item;
2002 }
2003 return nullptr;
2004 }
2005
2006 // If index is in cache and not on the prioritized eviction order list, move it there.
2007 void prioritizeEviction(const IndexType& index) {

Callers 3

readPageFunction · 0.80
readMultiPageFunction · 0.80
readExtentFunction · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected