From 91a8ffd57d8783a3d940c9506254fa7e2012e1ec Mon Sep 17 00:00:00 2001 From: hiddenpath Date: Fri, 13 Dec 2024 20:18:29 +0300 Subject: yt/cpp/mapreduce: move Create to THttpRawClient commit_hash:9ca8428c322034064576bb56f74e704425ce7de9 --- yt/cpp/mapreduce/client/client.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'yt/cpp/mapreduce/client/client.cpp') diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp index 24aed7fb77f..45a5bf1d47e 100644 --- a/yt/cpp/mapreduce/client/client.cpp +++ b/yt/cpp/mapreduce/client/client.cpp @@ -112,7 +112,11 @@ TNodeId TClientBase::Create( ENodeType type, const TCreateOptions& options) { - return NRawClient::Create(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, path, type, options); + return RequestWithRetry( + ClientRetryPolicy_->CreatePolicyForGenericRequest(), + [this, &path, &type, &options] (TMutationId& mutationId) { + return RawClient_->Create(mutationId, TransactionId_, path, type, options); + }); } void TClientBase::Remove( @@ -337,8 +341,11 @@ IFileWriterPtr TClientBase::CreateFileWriter( return RawClient_->Exists(mutationId, TransactionId_, realPath.Path_); }); if (!exists) { - NRawClient::Create(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, realPath.Path_, NT_FILE, - TCreateOptions().IgnoreExisting(true)); + RequestWithRetry( + ClientRetryPolicy_->CreatePolicyForGenericRequest(), + [this, &realPath] (TMutationId& mutationId) { + RawClient_->Create(mutationId, TransactionId_, realPath.Path_, NT_FILE, TCreateOptions().IgnoreExisting(true)); + }); } return new TFileWriter(realPath, RawClient_, ClientRetryPolicy_, GetTransactionPinger(), Context_, TransactionId_, options); @@ -737,8 +744,11 @@ THolder TClientBase::CreateClientWriter( return RawClient_->Exists(mutationId, TransactionId_, realPath.Path_); }); if (!exists) { - NRawClient::Create(ClientRetryPolicy_->CreatePolicyForGenericRequest(), Context_, TransactionId_, realPath.Path_, NT_TABLE, - TCreateOptions().IgnoreExisting(true)); + RequestWithRetry( + ClientRetryPolicy_->CreatePolicyForGenericRequest(), + [this, &realPath] (TMutationId& mutataionId) { + RawClient_->Create(mutataionId, TransactionId_, realPath.Path_, NT_TABLE, TCreateOptions().IgnoreExisting(true)); + }); } return MakeHolder( -- cgit v1.3