diff options
author | ignat <ignat@yandex-team.com> | 2023-08-06 19:14:36 +0300 |
---|---|---|
committer | ignat <ignat@yandex-team.com> | 2023-08-06 20:00:26 +0300 |
commit | e4a2c0af7f6a54090f882b9e7417e26081a489c9 (patch) | |
tree | ba18c7817f5a92ac79908e43eb882ec415e123f9 | |
parent | ff8e3f0a46bb9fcefd488d3c0df14cd5db6ed210 (diff) | |
download | ydb-e4a2c0af7f6a54090f882b9e7417e26081a489c9.tar.gz |
OAuth authenticator: cosmetics
-rw-r--r-- | yt/yt/core/http/CMakeLists.darwin-x86_64.txt | 2 | ||||
-rw-r--r-- | yt/yt/core/http/CMakeLists.linux-aarch64.txt | 2 | ||||
-rw-r--r-- | yt/yt/core/http/CMakeLists.linux-x86_64.txt | 2 | ||||
-rw-r--r-- | yt/yt/core/http/CMakeLists.windows-x86_64.txt | 2 | ||||
-rw-r--r-- | yt/yt/core/http/config.cpp | 2 | ||||
-rw-r--r-- | yt/yt/core/http/config.h | 6 | ||||
-rw-r--r-- | yt/yt/core/http/public.h | 4 | ||||
-rw-r--r-- | yt/yt/core/http/retrying_client.cpp (renamed from yt/yt/core/http/retriable_client.cpp) | 30 | ||||
-rw-r--r-- | yt/yt/core/http/retrying_client.h (renamed from yt/yt/core/http/retriable_client.h) | 8 | ||||
-rw-r--r-- | yt/yt/core/http/ya.make | 2 |
10 files changed, 29 insertions, 31 deletions
diff --git a/yt/yt/core/http/CMakeLists.darwin-x86_64.txt b/yt/yt/core/http/CMakeLists.darwin-x86_64.txt index c7a5c2a2b2..92bee16f81 100644 --- a/yt/yt/core/http/CMakeLists.darwin-x86_64.txt +++ b/yt/yt/core/http/CMakeLists.darwin-x86_64.txt @@ -23,7 +23,7 @@ target_sources(yt-core-http PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_pool.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_reuse_helpers.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/http.cpp - ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retriable_client.cpp + ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retrying_client.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/server.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/stream.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/helpers.cpp diff --git a/yt/yt/core/http/CMakeLists.linux-aarch64.txt b/yt/yt/core/http/CMakeLists.linux-aarch64.txt index 61bc495008..26808f5720 100644 --- a/yt/yt/core/http/CMakeLists.linux-aarch64.txt +++ b/yt/yt/core/http/CMakeLists.linux-aarch64.txt @@ -24,7 +24,7 @@ target_sources(yt-core-http PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_pool.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_reuse_helpers.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/http.cpp - ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retriable_client.cpp + ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retrying_client.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/server.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/stream.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/helpers.cpp diff --git a/yt/yt/core/http/CMakeLists.linux-x86_64.txt b/yt/yt/core/http/CMakeLists.linux-x86_64.txt index 61bc495008..26808f5720 100644 --- a/yt/yt/core/http/CMakeLists.linux-x86_64.txt +++ b/yt/yt/core/http/CMakeLists.linux-x86_64.txt @@ -24,7 +24,7 @@ target_sources(yt-core-http PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_pool.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_reuse_helpers.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/http.cpp - ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retriable_client.cpp + ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retrying_client.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/server.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/stream.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/helpers.cpp diff --git a/yt/yt/core/http/CMakeLists.windows-x86_64.txt b/yt/yt/core/http/CMakeLists.windows-x86_64.txt index 79a0874891..3a283cbd21 100644 --- a/yt/yt/core/http/CMakeLists.windows-x86_64.txt +++ b/yt/yt/core/http/CMakeLists.windows-x86_64.txt @@ -20,7 +20,7 @@ target_sources(yt-core-http PRIVATE ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_pool.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/connection_reuse_helpers.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/http.cpp - ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retriable_client.cpp + ${CMAKE_SOURCE_DIR}/yt/yt/core/http/retrying_client.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/server.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/stream.cpp ${CMAKE_SOURCE_DIR}/yt/yt/core/http/helpers.cpp diff --git a/yt/yt/core/http/config.cpp b/yt/yt/core/http/config.cpp index c9423a37bc..92584561c8 100644 --- a/yt/yt/core/http/config.cpp +++ b/yt/yt/core/http/config.cpp @@ -66,7 +66,7 @@ void TClientConfig::Register(TRegistrar registrar) //////////////////////////////////////////////////////////////////////////////// -void TRetrialbeClientConfig::Register(TRegistrar registrar) +void TRetryingClientConfig::Register(TRegistrar registrar) { registrar.Parameter("request_timeout", &TThis::RequestTimeout) .Default(TDuration::Seconds(15)); diff --git a/yt/yt/core/http/config.h b/yt/yt/core/http/config.h index 7468a03462..ee6e5511e9 100644 --- a/yt/yt/core/http/config.h +++ b/yt/yt/core/http/config.h @@ -86,7 +86,7 @@ DEFINE_REFCOUNTED_TYPE(TClientConfig) //////////////////////////////////////////////////////////////////////////////// -class TRetrialbeClientConfig +class TRetryingClientConfig : public NYTree::TYsonStruct { public: @@ -95,12 +95,12 @@ public: TDuration BackoffTimeout; int MaxAttemptCount; - REGISTER_YSON_STRUCT(TRetrialbeClientConfig); + REGISTER_YSON_STRUCT(TRetryingClientConfig); static void Register(TRegistrar registrar); }; -DEFINE_REFCOUNTED_TYPE(TRetrialbeClientConfig); +DEFINE_REFCOUNTED_TYPE(TRetryingClientConfig); //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/http/public.h b/yt/yt/core/http/public.h index 694da6f5f3..95208767f5 100644 --- a/yt/yt/core/http/public.h +++ b/yt/yt/core/http/public.h @@ -15,7 +15,7 @@ DECLARE_REFCOUNTED_CLASS(IActiveRequest) DECLARE_REFCOUNTED_STRUCT(IServer) DECLARE_REFCOUNTED_STRUCT(IClient) -DECLARE_REFCOUNTED_STRUCT(IRetriableClient) +DECLARE_REFCOUNTED_STRUCT(IRetryingClient) DECLARE_REFCOUNTED_STRUCT(IResponseChecker) DECLARE_REFCOUNTED_STRUCT(IHttpHandler) @@ -23,7 +23,7 @@ DECLARE_REFCOUNTED_STRUCT(IHttpHandler) DECLARE_REFCOUNTED_CLASS(THttpIOConfig) DECLARE_REFCOUNTED_CLASS(TServerConfig) DECLARE_REFCOUNTED_CLASS(TClientConfig) -DECLARE_REFCOUNTED_CLASS(TRetrialbeClientConfig) +DECLARE_REFCOUNTED_CLASS(TRetryingClientConfig) DECLARE_REFCOUNTED_CLASS(TCorsConfig) DECLARE_REFCOUNTED_CLASS(TConnectionPool) DECLARE_REFCOUNTED_CLASS(IRequestPathMatcher) diff --git a/yt/yt/core/http/retriable_client.cpp b/yt/yt/core/http/retrying_client.cpp index 400af9931b..40315fa3af 100644 --- a/yt/yt/core/http/retriable_client.cpp +++ b/yt/yt/core/http/retrying_client.cpp @@ -1,6 +1,6 @@ #include "config.h" -#include "retriable_client.h" +#include "retrying_client.h" #include "private.h" #include <yt/yt/core/http/client.h> @@ -48,10 +48,9 @@ public: } try { - auto result = ErrorChecker_(response, Json_); - return result; - } catch (const std::exception& err) { - return err; + return ErrorChecker_(response, Json_); + } catch (const std::exception& ex) { + return ex; } } @@ -60,11 +59,11 @@ public: return Json_; } - private: const NJson::TJsonFormatConfigPtr JsonFormatConfig_; + const TJsonErrorChecker ErrorChecker_; + INodePtr Json_; - TJsonErrorChecker ErrorChecker_; TError Error_; }; @@ -79,12 +78,12 @@ IResponseCheckerPtr CreateJsonResponseChecker( //////////////////////////////////////////////////////////////////////////////// -class TRetrialbeClient - : public IRetriableClient +class TRetryingClient + : public IRetryingClient { public: - TRetrialbeClient( - TRetrialbeClientConfigPtr config, + TRetryingClient( + TRetryingClientConfigPtr config, IClientPtr client, IInvokerPtr invoker) : Config_(std::move(config)) @@ -136,7 +135,7 @@ public: } private: - const TRetrialbeClientConfigPtr Config_; + const TRetryingClientConfigPtr Config_; const IInvokerPtr Invoker_; const IClientPtr UnderlyingClient_; @@ -217,17 +216,16 @@ private: << TErrorAttribute("attempt_count", attempt) << TErrorAttribute("max_attempt_count", Config_->MaxAttemptCount); } - }; //////////////////////////////////////////////////////////////////////////////// -IRetriableClientPtr CreateRetriableClient( - TRetrialbeClientConfigPtr config, +IRetryingClientPtr CreateRetryingClient( + TRetryingClientConfigPtr config, IClientPtr client, IInvokerPtr invoker) { - return New<TRetrialbeClient>(std::move(config), std::move(client), std::move(invoker)); + return New<TRetryingClient>(std::move(config), std::move(client), std::move(invoker)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/http/retriable_client.h b/yt/yt/core/http/retrying_client.h index 9103389cd6..8bdbe7d39a 100644 --- a/yt/yt/core/http/retriable_client.h +++ b/yt/yt/core/http/retrying_client.h @@ -29,7 +29,7 @@ IResponseCheckerPtr CreateJsonResponseChecker( //////////////////////////////////////////////////////////////////////////////// -struct IRetriableClient +struct IRetryingClient : public virtual TRefCounted { virtual TFuture<IResponsePtr> Get( @@ -61,12 +61,12 @@ struct IRetriableClient const THeadersPtr& headers = nullptr) = 0; }; -DEFINE_REFCOUNTED_TYPE(IRetriableClient) +DEFINE_REFCOUNTED_TYPE(IRetryingClient) //////////////////////////////////////////////////////////////////////////////// -IRetriableClientPtr CreateRetriableClient( - TRetrialbeClientConfigPtr config, +IRetryingClientPtr CreateRetryingClient( + TRetryingClientConfigPtr config, IClientPtr client, IInvokerPtr invoker); diff --git a/yt/yt/core/http/ya.make b/yt/yt/core/http/ya.make index fe346db002..a0f877f209 100644 --- a/yt/yt/core/http/ya.make +++ b/yt/yt/core/http/ya.make @@ -8,7 +8,7 @@ SRCS( connection_pool.cpp connection_reuse_helpers.cpp http.cpp - retriable_client.cpp + retrying_client.cpp server.cpp stream.cpp helpers.cpp |