diff options
author | grigoriypisar <grigoriypisar@yandex-team.com> | 2024-12-17 00:12:19 +0300 |
---|---|---|
committer | grigoriypisar <grigoriypisar@yandex-team.com> | 2024-12-17 00:35:46 +0300 |
commit | 37b9c88deefbfee76b8f4a1fcd917b028fea3c30 (patch) | |
tree | e20796127dc23ff4e7c4f439263974ea54d59917 /yql/essentials/public/purecalc | |
parent | a0ed0141c57419c25ed8b04129d18443261a8ad0 (diff) | |
download | ydb-37b9c88deefbfee76b8f4a1fcd917b028fea3c30.tar.gz |
added cache invalidation for computation graph
Fixed purecalc cache invalidation
commit_hash:088ac16b3481db39893f4fab0cf80c3809a5dcdd
Diffstat (limited to 'yql/essentials/public/purecalc')
4 files changed, 18 insertions, 1 deletions
diff --git a/yql/essentials/public/purecalc/common/interface.h b/yql/essentials/public/purecalc/common/interface.h index 6e56c9aa3f..4096195bd3 100644 --- a/yql/essentials/public/purecalc/common/interface.h +++ b/yql/essentials/public/purecalc/common/interface.h @@ -684,6 +684,11 @@ namespace NYql { * Get time provider */ virtual ITimeProvider* GetTimeProvider() const = 0; + + /** + * Release all input data from worker state + */ + virtual void Invalidate() = 0; }; /** diff --git a/yql/essentials/public/purecalc/common/worker.cpp b/yql/essentials/public/purecalc/common/worker.cpp index 58cbf23c92..285b638025 100644 --- a/yql/essentials/public/purecalc/common/worker.cpp +++ b/yql/essentials/public/purecalc/common/worker.cpp @@ -340,6 +340,17 @@ void TWorker<TBase>::Release() { } } +template <typename TBase> +void TWorker<TBase>::Invalidate() { + auto& ctx = Graph_.ComputationGraph_->GetContext(); + for (const auto* selfNode : Graph_.SelfNodes_) { + if (selfNode) { + selfNode->InvalidateValue(ctx); + } + } + Graph_.ComputationGraph_->InvalidateCaches(); +} + TPullStreamWorker::~TPullStreamWorker() { auto guard = Guard(GetScopedAlloc()); Output_.Clear(); diff --git a/yql/essentials/public/purecalc/common/worker.h b/yql/essentials/public/purecalc/common/worker.h index 07b8dfa2e7..39f381c9ea 100644 --- a/yql/essentials/public/purecalc/common/worker.h +++ b/yql/essentials/public/purecalc/common/worker.h @@ -104,6 +104,7 @@ namespace NYql { const TString& GetLLVMSettings() const override; ui64 GetNativeYtTypeFlags() const override; ITimeProvider* GetTimeProvider() const override; + void Invalidate() override; protected: void Release() override; }; diff --git a/yql/essentials/public/purecalc/ut/test_mixed_allocators.cpp b/yql/essentials/public/purecalc/ut/test_mixed_allocators.cpp index 797f3c5b51..2932538f78 100644 --- a/yql/essentials/public/purecalc/ut/test_mixed_allocators.cpp +++ b/yql/essentials/public/purecalc/ut/test_mixed_allocators.cpp @@ -51,7 +51,7 @@ namespace { // Clear graph after each object because // values allocated on another allocator and should be released - Worker_->GetGraph().Invalidate(); + Worker_->Invalidate(); } } |