diff options
| author | annashest18 <[email protected]> | 2023-10-22 13:19:53 +0300 |
|---|---|---|
| committer | annashest18 <[email protected]> | 2023-10-22 13:40:13 +0300 |
| commit | 24a44df2ab01109cefd64d4bfad05c66e7ebd2af (patch) | |
| tree | 1ec1ca95a2a8aceaa383fde2e19e61db9ab4fe02 /yt/cpp/mapreduce/http/host_manager.cpp | |
| parent | a991b019f74cbfe6efb40c3b68b46a1ac2a9bd09 (diff) | |
add using http-proxy for reading table from YT
add using http-proxy for reading table from YT
Нам нужна возможность ходить в YT через HTTP proxy для чтения таблиц, используя С++ клиент не из контура Яндекса, к сожалению, сейчас такой возможности нет. В этом ПР черновик изменения, которого нам достаточно
https://a.yandex-team.ru/review/4676436/details - тут это же изменение в YT + коммит с тем, как мы планируем использовать
Diffstat (limited to 'yt/cpp/mapreduce/http/host_manager.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/http/host_manager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yt/cpp/mapreduce/http/host_manager.cpp b/yt/cpp/mapreduce/http/host_manager.cpp index a239dde769a..e9716ec7a6e 100644 --- a/yt/cpp/mapreduce/http/host_manager.cpp +++ b/yt/cpp/mapreduce/http/host_manager.cpp @@ -94,7 +94,7 @@ void THostManager::Reset() TString THostManager::GetProxyForHeavyRequest(const TClientContext& context) { - auto cluster = context.ServerName; + auto cluster = context.ProxyAddress ? *context.ProxyAddress : context.ServerName; { auto guard = Guard(Lock_); auto it = ClusterHosts_.find(cluster); @@ -121,10 +121,10 @@ THostManager::TClusterHostList THostManager::GetHosts(const TClientContext& cont THttpHeader header("GET", hostsEndpoint, false); try { - auto hostName = context.ServerName; auto requestId = CreateGuidAsString(); // TODO: we need to set socket timeout here - auto response = context.HttpClient->Request(GetFullUrl(hostName, context, header), requestId, header); + UpdateHeaderForProxyIfNeed(context.ServerName, context, header); + auto response = context.HttpClient->Request(GetFullUrlForProxy(context.ServerName, context, header), requestId, header); auto hosts = ParseJsonStringArray(response->GetResponse()); for (auto& host : hosts) { host = CreateHostNameWithPort(host, context); |
