diff options
author | va-kuznecov <va-kuznecov@ydb.tech> | 2023-02-20 18:39:51 +0300 |
---|---|---|
committer | va-kuznecov <va-kuznecov@ydb.tech> | 2023-02-20 18:39:51 +0300 |
commit | a181588e011454f9b95afde48fd5a71f7513461b (patch) | |
tree | 3bf9103d56f1e1a6863cf574bc910a31e83d8d04 | |
parent | 142f2cd89af424e0f06f02439c13caeac9b3e24b (diff) | |
download | ydb-a181588e011454f9b95afde48fd5a71f7513461b.tar.gz |
Remove CreateLongTimer from CompileService in KQP
-rw-r--r-- | ydb/core/kqp/compile_service/kqp_compile_service.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ydb/core/kqp/compile_service/kqp_compile_service.cpp b/ydb/core/kqp/compile_service/kqp_compile_service.cpp index 08ce7821692..1ebbade8db6 100644 --- a/ydb/core/kqp/compile_service/kqp_compile_service.cpp +++ b/ydb/core/kqp/compile_service/kqp_compile_service.cpp @@ -325,7 +325,7 @@ public: Become(&TKqpCompileService::MainState); if (Config.GetCompileQueryCacheTTLSec()) { - StartCheckQueriesTtlTimer(ctx); + StartCheckQueriesTtlTimer(); } } @@ -341,7 +341,7 @@ private: hFunc(NConsole::TEvConsole::TEvConfigNotificationRequest, HandleConfig); hFunc(TEvents::TEvUndelivered, HandleUndelivery); - CFunc(TEvents::TSystem::Wakeup, HandleTimeout); + CFunc(TEvents::TSystem::Wakeup, HandleTtlTimer); cFunc(TEvents::TEvPoison::EventType, PassAway); default: Y_FAIL("TKqpCompileService: unexpected event 0x%08" PRIx32, ev->GetTypeRewrite()); @@ -661,7 +661,7 @@ private: QueryCache.EraseByUid(request.Uid); } - void HandleTimeout(const TActorContext& ctx) { + void HandleTtlTimer(const TActorContext& ctx) { LOG_DEBUG_S(ctx, NKikimrServices::KQP_COMPILE_SERVICE, "Received check queries TTL timeout"); auto evicted = QueryCache.EraseExpiredQueries(); @@ -669,7 +669,7 @@ private: Counters->CompileQueryCacheEvicted->Add(evicted); } - StartCheckQueriesTtlTimer(ctx); + StartCheckQueriesTtlTimer(); } private: @@ -713,9 +713,8 @@ private: RequestsQueue.AddActiveRequest(std::move(request)); } - void StartCheckQueriesTtlTimer(const TActorContext& ctx) { - CheckQueriesTtlTimer = CreateLongTimer(ctx, TDuration::Seconds(Config.GetCompileQueryCacheTTLSec()), - new IEventHandle(ctx.SelfID, ctx.SelfID, new TEvents::TEvWakeup())); + void StartCheckQueriesTtlTimer() { + Schedule(TDuration::Seconds(Config.GetCompileQueryCacheTTLSec()), new TEvents::TEvWakeup()); } void Reply(const TActorId& sender, const TKqpCompileResult::TConstPtr& compileResult, @@ -787,7 +786,6 @@ private: TKqpQueryCache QueryCache; TKqpRequestsQueue RequestsQueue; - TActorId CheckQueriesTtlTimer; std::shared_ptr<IQueryReplayBackendFactory> QueryReplayFactory; }; |