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

Function createCachedStatsProxy

src/Statistics/CachedStatsProxy.cpp:213–240  ·  view source on GitHub ↗

dispatcher

Source from the content-addressed store, hash-verified

211
212// dispatcher
213CachedStatsProxyPtr createCachedStatsProxy(const CatalogAdaptorPtr & catalog, StatisticsCachePolicy policy)
214{
215 // when enable_memory_catalog is true, we won't use cache
216 if (catalog->getSettingsRef().enable_memory_catalog)
217 {
218 if (policy != StatisticsCachePolicy::Default)
219 throw Exception("memory catalog don't support cache policy", ErrorCodes::BAD_ARGUMENTS);
220
221 return std::make_unique<CachedStatsProxyDirectImpl>(catalog);
222 }
223
224 if (policy == StatisticsCachePolicy::Default)
225 {
226 return std::make_unique<CachedStatsProxyImpl<false>>(catalog);
227 }
228 else if (policy == StatisticsCachePolicy::Catalog)
229 {
230 return std::make_unique<CachedStatsProxyDirectImpl>(catalog);
231 }
232 else if (policy == StatisticsCachePolicy::Cache)
233 {
234 return std::make_unique<CachedStatsProxyImpl<true>>(catalog);
235 }
236 else
237 {
238 throw Exception("Unknown statistics cache policy", ErrorCodes::LOGICAL_ERROR);
239 }
240}
241
242
243} // namespace DB

Callers 6

writeToCatalogMethod · 0.85
readFromCatalogImplMethod · 0.85
dropStatsTableFunction · 0.85
dropStatsColumnsFunction · 0.85
getTableStatisticsFunction · 0.85
executeMethod · 0.85

Calls 1

ExceptionClass · 0.50

Tested by

no test coverage detected