diff options
| author | vvvv <[email protected]> | 2025-10-09 12:25:18 +0300 |
|---|---|---|
| committer | vvvv <[email protected]> | 2025-10-09 12:57:17 +0300 |
| commit | cb77d014972b2cdb27d2e6d979fc3a2772b27ad4 (patch) | |
| tree | 7f3bcd8ce71c6bd0f3ccc11e31b9f665475b819e /yql/essentials/minikql/computation/mkql_computation_pattern_cache.h | |
| parent | d58a8990d353b051c27e1069141117fdfde64358 (diff) | |
YQL-20086 minikql
commit_hash:e96f7390db5fcbe7e9f64f898141a263ad522daa
Diffstat (limited to 'yql/essentials/minikql/computation/mkql_computation_pattern_cache.h')
| -rw-r--r-- | yql/essentials/minikql/computation/mkql_computation_pattern_cache.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h index 433bb842f6e..41cc613e4bc 100644 --- a/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h +++ b/yql/essentials/minikql/computation/mkql_computation_pattern_cache.h @@ -27,7 +27,7 @@ struct TPatternCacheEntry { TStructType* ParamsStruct; IComputationPattern::TPtr Pattern; - size_t SizeForCache = 0; // set only by cache to lock the size, which can slightly vary when pattern is used + size_t SizeForCache = 0; // set only by cache to lock the size, which can slightly vary when pattern is used std::atomic<size_t> AccessTimes = 0; // set only by cache std::atomic<bool> IsInCache = false; // set only by cache @@ -63,29 +63,32 @@ public: Config(size_t maxSizeBytes, size_t maxCompiledSizeBytes) : MaxSizeBytes(maxSizeBytes) , MaxCompiledSizeBytes(maxCompiledSizeBytes) - {} + { + } Config(size_t maxSizeBytes, size_t maxCompiledSizeBytes, size_t patternAccessTimesBeforeTryToCompile) : MaxSizeBytes(maxSizeBytes) , MaxCompiledSizeBytes(maxCompiledSizeBytes) , PatternAccessTimesBeforeTryToCompile(patternAccessTimesBeforeTryToCompile) - {} + { + } const size_t MaxSizeBytes; const size_t MaxCompiledSizeBytes; const std::optional<size_t> PatternAccessTimesBeforeTryToCompile; - bool operator==(const Config & rhs) { + bool operator==(const Config& rhs) { return std::tie(MaxSizeBytes, MaxCompiledSizeBytes, PatternAccessTimesBeforeTryToCompile) == - std::tie(rhs.MaxSizeBytes, rhs.MaxCompiledSizeBytes, rhs.PatternAccessTimesBeforeTryToCompile); + std::tie(rhs.MaxSizeBytes, rhs.MaxCompiledSizeBytes, rhs.PatternAccessTimesBeforeTryToCompile); } - bool operator!=(const Config & rhs) { + bool operator!=(const Config& rhs) { return !(*this == rhs); } }; - TComputationPatternLRUCache(const Config& configuration, NMonitoring::TDynamicCounterPtr counters = MakeIntrusive<NMonitoring::TDynamicCounters>()); + TComputationPatternLRUCache(const Config& configuration, + NMonitoring::TDynamicCounterPtr counters = MakeIntrusive<NMonitoring::TDynamicCounters>()); ~TComputationPatternLRUCache(); static TPatternCacheEntryPtr CreateCacheEntry(bool useAlloc = true) { @@ -127,7 +130,7 @@ public: return PatternsToCompile_.size(); } - void GetPatternsToCompile(THashMap<TString, TPatternCacheEntryPtr> & result) { + void GetPatternsToCompile(THashMap<TString, TPatternCacheEntryPtr>& result) { std::lock_guard lock(Mutex_); result.swap(PatternsToCompile_); } |
