diff options
author | hor911 <hor911@ydb.tech> | 2022-08-16 16:39:47 +0300 |
---|---|---|
committer | hor911 <hor911@ydb.tech> | 2022-08-16 16:39:47 +0300 |
commit | 6eacb40870aeea9a0668645fd6b141e978e4618f (patch) | |
tree | 4e1d46d95dc877c55e436ce9c8752bdd908880ae | |
parent | c862041927ca1463f35dd57725cf1d756689de44 (diff) | |
download | ydb-6eacb40870aeea9a0668645fd6b141e978e4618f.tar.gz |
Insert into S3 fix and tests
-rw-r--r-- | ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp | 17 |
1 files changed, 10 insertions, 7 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 af2092a9aba..ca635fb7a0a 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 @@ -310,7 +310,12 @@ public: , MemoryLimit(memoryLimit) , MaxFileSize(maxFileSize) , Compression(compression) - {} + { + if (!RandomProvider) { + DefaultRandomProvider = CreateDefaultRandomProvider(); + RandomProvider = DefaultRandomProvider.Get(); + } + } void Bootstrap() { Become(&TS3WriteActor::StateFunc); @@ -343,11 +348,8 @@ private: } TString MakeSuffix() const { - if (RandomProvider) { - const auto rand = std::make_tuple(RandomProvider->GenUuid4(), RandomProvider->GenRand()); - return Base64EncodeUrl(TStringBuf(reinterpret_cast<const char*>(&rand), sizeof(rand))); - } - return ""; + const auto rand = std::make_tuple(RandomProvider->GenUuid4(), RandomProvider->GenRand()); + return Base64EncodeUrl(TStringBuf(reinterpret_cast<const char*>(&rand), sizeof(rand))); } STRICT_STFUNC(StateFunc, @@ -397,7 +399,8 @@ private: const IHTTPGateway::TPtr Gateway; const NYdb::TCredentialsProviderPtr CredProvider; - IRandomProvider *const RandomProvider; + IRandomProvider * RandomProvider; + TIntrusivePtr<IRandomProvider> DefaultRandomProvider; const ui64 OutputIndex; IDqComputeActorAsyncOutput::ICallbacks *const Callbacks; |