diff options
author | mrlolthe1st <mrlolthe1st@yandex-team.com> | 2023-01-20 10:44:08 +0300 |
---|---|---|
committer | mrlolthe1st <mrlolthe1st@yandex-team.com> | 2023-01-20 10:44:08 +0300 |
commit | 54c3e562802c97aa57576292298f18260078161a (patch) | |
tree | 2c9bd0f5aa8f8760b01d3c59f8932ffa509a5775 | |
parent | fe46dc24992f93cb132f72b88f00305bb76308ec (diff) | |
download | ydb-54c3e562802c97aa57576292298f18260078161a.tar.gz |
Add Offset to IHTTPGateway::Download
Add offset
6 files changed, 9 insertions, 2 deletions
diff --git a/ydb/core/yq/libs/test_connection/test_object_storage.cpp b/ydb/core/yq/libs/test_connection/test_object_storage.cpp index fca95c2fdf7..68b96fee122 100644 --- a/ydb/core/yq/libs/test_connection/test_object_storage.cpp +++ b/ydb/core/yq/libs/test_connection/test_object_storage.cpp @@ -183,6 +183,7 @@ private: url, headers, 0U, + 0U, std::bind(&DiscoveryCallback, std::placeholders::_1, SelfId(), requestId, TActivationContext::ActorSystem()), /*data=*/"", retryPolicy diff --git a/ydb/library/yql/providers/common/http_gateway/mock/yql_http_mock_gateway.cpp b/ydb/library/yql/providers/common/http_gateway/mock/yql_http_mock_gateway.cpp index 6e545bb3622..3b5acce0ab0 100644 --- a/ydb/library/yql/providers/common/http_gateway/mock/yql_http_mock_gateway.cpp +++ b/ydb/library/yql/providers/common/http_gateway/mock/yql_http_mock_gateway.cpp @@ -48,6 +48,7 @@ public: void Download( TString url, THeaders headers, + std::size_t offset, std::size_t sizeLimit, TOnResult callback, TString data, @@ -55,6 +56,7 @@ public: { Y_UNUSED(sizeLimit); + Y_UNUSED(offset); Y_UNUSED(retryPolicy); auto key = TKeyType(url, headers, data); diff --git a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp index 53a48398759..6054404ea45 100644 --- a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp +++ b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp @@ -731,6 +731,7 @@ private: void Download( TString url, THeaders headers, + size_t offset, size_t sizeLimit, TOnResult callback, TString data, @@ -748,7 +749,7 @@ private: if (easy->AddCallback(callback)) return; - auto easy = TEasyCurlBuffer::Make(InFlight, DownloadedBytes, UploadedBytes, std::move(url), TEasyCurl::EMethod::GET, std::move(data), std::move(headers), 0U, sizeLimit, std::move(callback), retryPolicy ? retryPolicy->CreateRetryState() : nullptr, InitConfig); + auto easy = TEasyCurlBuffer::Make(InFlight, DownloadedBytes, UploadedBytes, std::move(url), TEasyCurl::EMethod::GET, std::move(data), std::move(headers), offset, sizeLimit, std::move(callback), retryPolicy ? retryPolicy->CreateRetryState() : nullptr, InitConfig); entry = easy; Await.emplace(std::move(easy)); Wakeup(sizeLimit); diff --git a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.h b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.h index d9aec8fa32d..db58a4bae16 100644 --- a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.h +++ b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.h @@ -76,6 +76,7 @@ public: virtual void Download( TString url, THeaders headers, + std::size_t offset, std::size_t sizeLimit, TOnResult callback, TString data = {}, diff --git a/ydb/library/yql/providers/s3/actors/yql_s3_read_actor.cpp b/ydb/library/yql/providers/s3/actors/yql_s3_read_actor.cpp index a7ea4000b9b..ffabe50549e 100644 --- a/ydb/library/yql/providers/s3/actors/yql_s3_read_actor.cpp +++ b/ydb/library/yql/providers/s3/actors/yql_s3_read_actor.cpp @@ -308,7 +308,7 @@ public: auto id = index + StartPathIndex; const TString requestId = CreateGuidAsString(); LOG_D("TS3ReadActor", "Download: " << url << ", ID: " << id << ", request id: [" << requestId << "]"); - Gateway->Download(url, MakeHeaders(Token, requestId), std::min(std::get<size_t>(path), SizeLimit), + Gateway->Download(url, MakeHeaders(Token, requestId), 0U, std::min(std::get<size_t>(path), SizeLimit), std::bind(&TS3ReadActor::OnDownloadFinished, ActorSystem, SelfId(), requestId, std::placeholders::_1, id), {}, RetryPolicy); } diff --git a/ydb/library/yql/providers/s3/provider/yql_s3_list.cpp b/ydb/library/yql/providers/s3/provider/yql_s3_list.cpp index d15b91b6f63..4fc30924b1a 100644 --- a/ydb/library/yql/providers/s3/provider/yql_s3_list.cpp +++ b/ydb/library/yql/providers/s3/provider/yql_s3_list.cpp @@ -150,6 +150,7 @@ private: url, std::move(headers), 0U, + 0U, std::bind(&OnDiscovery, IHTTPGateway::TWeakPtr(gateway), std::placeholders::_1, @@ -246,6 +247,7 @@ private: url, std::move(headers), 0U, + 0U, std::bind(&OnDiscovery, IHTTPGateway::TWeakPtr(Gateway), std::placeholders::_1, |