diff options
author | hor911 <hor911@ydb.tech> | 2022-08-23 19:10:46 +0300 |
---|---|---|
committer | hor911 <hor911@ydb.tech> | 2022-08-23 19:10:46 +0300 |
commit | 05b694dd4ef965ddcb61b55ea4e3d6d84ab873da (patch) | |
tree | 2ac950673998932fec4549b7002ccc17f55e33a9 | |
parent | 6f53b0cf4c2e1f7ada88e3481a872b9a9c63aebc (diff) | |
download | ydb-05b694dd4ef965ddcb61b55ea4e3d6d84ab873da.tar.gz |
Cleanup TS3FileWriteActor-s
-rw-r--r-- | ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp b/ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp index 1064b4112dc..4c1800ab917 100644 --- a/ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp +++ b/ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp @@ -70,6 +70,10 @@ struct TEvPrivate { using namespace NKikimr::NMiniKQL; class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> { + + friend class TS3WriteActor; + using TActorBootstrapped<TS3FileWriteActor>::PassAway; + public: TS3FileWriteActor( IHTTPGateway::TPtr gateway, @@ -239,11 +243,6 @@ private: CommitUploadedParts(); } - // IActor & IDqComputeActorAsyncOutput - void PassAway() override { // Is called from Compute Actor - TActorBootstrapped<TS3FileWriteActor>::PassAway(); - } - void StartUploadParts() { while (auto part = Parts->Pop()) { const auto size = part.size(); @@ -389,6 +388,7 @@ private: void Handle(TEvPrivate::TEvUploadFinished::TPtr& result) { if (const auto it = FileWriteActors.find(result->Get()->Key); FileWriteActors.cend() != it) { if (const auto ft = std::find_if(it->second.cbegin(), it->second.cend(), [&](TS3FileWriteActor* actor){ return result->Get()->Url == actor->GetUrl(); }); it->second.cend() != ft) { + (*ft)->PassAway(); it->second.erase(ft); if (it->second.empty()) FileWriteActors.erase(it); @@ -401,6 +401,14 @@ private: // IActor & IDqComputeActorAsyncOutput void PassAway() override { // Is called from Compute Actor + + for (const auto& p : FileWriteActors) { + for (const auto& fileWriter : p.second) { + fileWriter->PassAway(); + } + } + FileWriteActors.clear(); + TActorBootstrapped<TS3WriteActor>::PassAway(); } |