MCPcopy Create free account
hub / github.com/ByConity/ByConity / initialize

Method initialize

src/QueryPlan/PlanCache.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13void PlanCacheManager::initialize(ContextMutablePtr context)
14{
15 if (!context->getPlanCacheManager())
16 {
17 auto manager_instance = std::make_unique<PlanCacheManager>();
18 context->setPlanCacheManager(std::move(manager_instance));
19 }
20
21 auto * manager_instance = context->getPlanCacheManager();
22 if (manager_instance->cache)
23 {
24 LOG_WARNING(&Poco::Logger::get("PlanCacheManager"), "PlanCacheManager already initialized");
25 return;
26 }
27
28 auto max_size = context->getConfigRef().getUInt64("optimizer.plancache.max_cache_size", PlanCacheConfig::max_cache_size);
29 auto expire_time = std::chrono::seconds(
30 context->getConfigRef().getUInt64("optimizer.plancache.cache_expire_time", PlanCacheConfig::cache_expire_time));
31 manager_instance->initialize(max_size, expire_time);
32}
33
34void PlanCacheManager::initialize(UInt64 max_size, std::chrono::seconds expire_time)
35{

Callers

nothing calls this directly

Calls 5

getPlanCacheManagerMethod · 0.80
setPlanCacheManagerMethod · 0.80
getFunction · 0.50
getUInt64Method · 0.45
countMethod · 0.45

Tested by

no test coverage detected