summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/raw_client
diff options
context:
space:
mode:
authorhiddenpath <[email protected]>2025-01-16 00:49:07 +0300
committerhiddenpath <[email protected]>2025-01-16 01:07:01 +0300
commit8dff5c10763551a5b2e82294518d7d95d68bec23 (patch)
tree2cebe415c5a7b7c04b979964c48ec4d36c613d01 /yt/cpp/mapreduce/raw_client
parent0395c5087038d4d95d8f64c67e458add6ac040fd (diff)
YT-23616: Make implementation of CanonizeYPath method being common
commit_hash:7f3ecc44b4299acc4fc7b0f463eceac61d0b0156
Diffstat (limited to 'yt/cpp/mapreduce/raw_client')
-rw-r--r--yt/cpp/mapreduce/raw_client/raw_requests.cpp19
-rw-r--r--yt/cpp/mapreduce/raw_client/raw_requests.h6
2 files changed, 12 insertions, 13 deletions
diff --git a/yt/cpp/mapreduce/raw_client/raw_requests.cpp b/yt/cpp/mapreduce/raw_client/raw_requests.cpp
index 6ba8a3f0843..30b1619b710 100644
--- a/yt/cpp/mapreduce/raw_client/raw_requests.cpp
+++ b/yt/cpp/mapreduce/raw_client/raw_requests.cpp
@@ -253,25 +253,26 @@ TCheckPermissionResponse ParseCheckPermissionResponse(const TNode& node)
}
TRichYPath CanonizeYPath(
- const IRequestRetryPolicyPtr& retryPolicy,
- const TClientContext& context,
+ const IRawClientPtr& rawClient,
const TRichYPath& path)
{
- return CanonizeYPaths(retryPolicy, context, {path}).front();
+ return CanonizeYPaths(rawClient, {path}).front();
}
TVector<TRichYPath> CanonizeYPaths(
- const IRequestRetryPolicyPtr& retryPolicy,
- const TClientContext& context,
+ const IRawClientPtr& rawClient,
const TVector<TRichYPath>& paths)
{
- THttpRawBatchRequest batch(context, retryPolicy);
+ auto batch = rawClient->CreateRawBatchRequest();
+
TVector<NThreading::TFuture<TRichYPath>> futures;
futures.reserve(paths.size());
- for (int i = 0; i < static_cast<int>(paths.size()); ++i) {
- futures.push_back(batch.CanonizeYPath(paths[i]));
+ for (const auto& path : paths) {
+ futures.push_back(batch->CanonizeYPath(path));
}
- batch.ExecuteBatch();
+
+ batch->ExecuteBatch();
+
TVector<TRichYPath> result;
result.reserve(futures.size());
for (auto& future : futures) {
diff --git a/yt/cpp/mapreduce/raw_client/raw_requests.h b/yt/cpp/mapreduce/raw_client/raw_requests.h
index 101985735c0..14876241714 100644
--- a/yt/cpp/mapreduce/raw_client/raw_requests.h
+++ b/yt/cpp/mapreduce/raw_client/raw_requests.h
@@ -34,13 +34,11 @@ TCheckPermissionResponse ParseCheckPermissionResponse(const TNode& node);
////////////////////////////////////////////////////////////////////////////////
TRichYPath CanonizeYPath(
- const IRequestRetryPolicyPtr& retryPolicy,
- const TClientContext& context,
+ const IRawClientPtr& rawClient,
const TRichYPath& path);
TVector<TRichYPath> CanonizeYPaths(
- const IRequestRetryPolicyPtr& retryPolicy,
- const TClientContext& context,
+ const IRawClientPtr& rawClient,
const TVector<TRichYPath>& paths);
NHttpClient::IHttpResponsePtr SkyShareTable(