MCPcopy Create free account
hub / github.com/apache/impala / Lookup

Method Lookup

be/src/kudu/util/cache.cc:393–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391
392template<Cache::EvictionPolicy policy>
393Cache::Handle* CacheShard<policy>::Lookup(const Slice& key,
394 uint32_t hash,
395 bool caching) {
396 RLHandle* e;
397 {
398 std::lock_guard<decltype(mutex_)> l(mutex_);
399 e = table_.Lookup(key, hash);
400 if (e != nullptr) {
401 e->refs.fetch_add(1, std::memory_order_relaxed);
402 RL_UpdateAfterLookup(e);
403 }
404 }
405
406 // Do the metrics outside of the lock.
407 UpdateMetricsLookup(e != nullptr, caching);
408
409 return reinterpret_cast<Cache::Handle*>(e);
410}
411
412template<Cache::EvictionPolicy policy>
413void CacheShard<policy>::Release(Cache::Handle* handle) {

Callers 7

LookupFromCacheMethod · 0.45
DoQueriesMethod · 0.45
TYPED_TESTFunction · 0.45
LookupMethod · 0.45
TEST_FFunction · 0.45
GetMethod · 0.45
OpenMethod · 0.45

Calls

no outgoing calls

Tested by 2

TYPED_TESTFunction · 0.36
TEST_FFunction · 0.36