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

Function NewCacheShard

be/src/util/cache/cache.cc:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84CacheShard* NewCacheShard(Cache::EvictionPolicy policy, kudu::MemTracker* mem_tracker,
85 size_t capacity) {
86 switch (policy) {
87 case Cache::EvictionPolicy::FIFO:
88 return NewCacheShardInt<Cache::EvictionPolicy::FIFO>(mem_tracker, capacity);
89 case Cache::EvictionPolicy::LRU:
90 return NewCacheShardInt<Cache::EvictionPolicy::LRU>(mem_tracker, capacity);
91 case Cache::EvictionPolicy::LIRS:
92 return NewCacheShardInt<Cache::EvictionPolicy::LIRS>(mem_tracker, capacity);
93 default:
94 LOG(FATAL) << "unexpected cache eviction policy: " << static_cast<int>(policy);
95 }
96}
97
98Cache* NewCache(Cache::EvictionPolicy policy, size_t capacity, const std::string& id) {
99 return new ShardedCache(policy, capacity, id);

Callers 1

ShardedCacheMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected