aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhor911 <hor911@ydb.tech>2022-08-16 16:39:47 +0300
committerhor911 <hor911@ydb.tech>2022-08-16 16:39:47 +0300
commit6eacb40870aeea9a0668645fd6b141e978e4618f (patch)
tree4e1d46d95dc877c55e436ce9c8752bdd908880ae
parentc862041927ca1463f35dd57725cf1d756689de44 (diff)
downloadydb-6eacb40870aeea9a0668645fd6b141e978e4618f.tar.gz
Insert into S3 fix and tests
-rw-r--r--ydb/library/yql/providers/s3/actors/yql_s3_write_actor.cpp17
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;