@@ -139,7 +139,7 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
139
139
const TString& token)
140
140
: TxId(txId)
141
141
, Gateway(std::move(gateway))
142
- , Credentials(std::move( crdentials))
142
+ , AuthInfo( crdentials.GetAuthInfo( ))
143
143
, RetryPolicy(retryPolicy)
144
144
, ActorSystem(TActivationContext::ActorSystem())
145
145
, Key(key)
@@ -155,22 +155,21 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
155
155
void Bootstrap (const TActorId& parentId) {
156
156
ParentId = parentId;
157
157
LOG_D (" TS3FileWriteActor" , " Bootstrap by " << ParentId << " for Key: [" << Key << " ], Url: [" << Url << " ], request id: [" << RequestId << " ]" );
158
- auto authInfo = Credentials.GetAuthInfo ();
159
158
if (DirtyWrite && Parts->IsSealed () && Parts->Size () <= 1 ) {
160
159
Become (&TS3FileWriteActor::SinglepartWorkingStateFunc);
161
160
const size_t size = Max<size_t >(Parts->Volume (), 1 );
162
161
InFlight += size;
163
162
SentSize += size;
164
163
Gateway->Upload (Url,
165
- IHTTPGateway::MakeYcHeaders (RequestId, authInfo .GetToken (), {}, authInfo .GetAwsUserPwd (), authInfo .GetAwsSigV4 ()),
164
+ IHTTPGateway::MakeYcHeaders (RequestId, AuthInfo .GetToken (), {}, AuthInfo .GetAwsUserPwd (), AuthInfo .GetAwsSigV4 ()),
166
165
Parts->Pop (),
167
166
std::bind (&TS3FileWriteActor::OnUploadFinish, ActorSystem, SelfId (), ParentId, Key, Url, RequestId, size, std::placeholders::_1),
168
167
true ,
169
168
RetryPolicy);
170
169
} else {
171
170
Become (&TS3FileWriteActor::MultipartInitialStateFunc);
172
171
Gateway->Upload (Url + " ?uploads" ,
173
- IHTTPGateway::MakeYcHeaders (RequestId, authInfo .GetToken (), {}, authInfo .GetAwsUserPwd (), authInfo .GetAwsSigV4 ()),
172
+ IHTTPGateway::MakeYcHeaders (RequestId, AuthInfo .GetToken (), {}, AuthInfo .GetAwsUserPwd (), AuthInfo .GetAwsSigV4 ()),
174
173
0 ,
175
174
std::bind (&TS3FileWriteActor::OnUploadsCreated, ActorSystem, SelfId (), ParentId, RequestId, std::placeholders::_1),
176
175
false ,
@@ -367,9 +366,8 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
367
366
Tags.emplace_back ();
368
367
InFlight += size;
369
368
SentSize += size;
370
- auto authInfo = Credentials.GetAuthInfo ();
371
369
Gateway->Upload (Url + " ?partNumber=" + std::to_string (index + 1 ) + " &uploadId=" + UploadId,
372
- IHTTPGateway::MakeYcHeaders (RequestId, authInfo .GetToken (), {}, authInfo .GetAwsUserPwd (), authInfo .GetAwsSigV4 ()),
370
+ IHTTPGateway::MakeYcHeaders (RequestId, AuthInfo .GetToken (), {}, AuthInfo .GetAwsUserPwd (), AuthInfo .GetAwsSigV4 ()),
373
371
std::move (part),
374
372
std::bind (&TS3FileWriteActor::OnPartUploadFinish, ActorSystem, SelfId (), ParentId, size, index , RequestId, std::placeholders::_1),
375
373
true ,
@@ -395,9 +393,8 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
395
393
for (const auto & tag : Tags)
396
394
xml << " <Part><PartNumber>" << ++i << " </PartNumber><ETag>" << tag << " </ETag></Part>" << Endl;
397
395
xml << " </CompleteMultipartUpload>" << Endl;
398
- auto authInfo = Credentials.GetAuthInfo ();
399
396
Gateway->Upload (Url + " ?uploadId=" + UploadId,
400
- IHTTPGateway::MakeYcHeaders (RequestId, authInfo .GetToken (), " application/xml" , authInfo .GetAwsUserPwd (), authInfo .GetAwsSigV4 ()),
397
+ IHTTPGateway::MakeYcHeaders (RequestId, AuthInfo .GetToken (), " application/xml" , AuthInfo .GetAwsUserPwd (), AuthInfo .GetAwsSigV4 ()),
401
398
xml,
402
399
std::bind (&TS3FileWriteActor::OnMultipartUploadFinish, ActorSystem, SelfId (), ParentId, Key, Url, RequestId, SentSize, std::placeholders::_1),
403
400
false ,
@@ -412,9 +409,8 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
412
409
return ;
413
410
}
414
411
415
- auto authInfo = Credentials.GetAuthInfo ();
416
412
Gateway->Delete (Url + " ?uploadId=" + UploadId,
417
- IHTTPGateway::MakeYcHeaders (RequestId, authInfo .GetToken (), " application/xml" , authInfo .GetAwsUserPwd (), authInfo .GetAwsSigV4 ()),
413
+ IHTTPGateway::MakeYcHeaders (RequestId, AuthInfo .GetToken (), " application/xml" , AuthInfo .GetAwsUserPwd (), AuthInfo .GetAwsSigV4 ()),
418
414
std::bind (&TS3FileWriteActor::OnMultipartUploadAbort, ActorSystem, SelfId (), TxId, RequestId, std::placeholders::_1),
419
415
RetryPolicy);
420
416
UploadId.clear ();
@@ -425,7 +421,7 @@ class TS3FileWriteActor : public TActorBootstrapped<TS3FileWriteActor> {
425
421
426
422
const TTxId TxId;
427
423
const IHTTPGateway::TPtr Gateway;
428
- const TS3Credentials Credentials ;
424
+ const TS3Credentials::TAuthInfo AuthInfo ;
429
425
const IHTTPGateway::TRetryPolicy::TPtr RetryPolicy;
430
426
431
427
TActorSystem* const ActorSystem;
0 commit comments