From 89dc74e9c9b07c1dbbbcaa4f4270d2b9b9173da7 Mon Sep 17 00:00:00 2001 From: antoshkka Date: Fri, 10 Jan 2025 15:01:01 +0300 Subject: [PATCH] feat redis: remove legacy namespace and macro for its usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests: протестировано CI commit_hash:cfdd87dd3793bc6dc1c1c9fe86413a72754d2e8d --- .mapping.json | 1 - .../storages/redis/command_control.hpp | 17 ------------ .../userver/storages/redis/exception.hpp | 12 --------- .../userver/storages/redis/expire_reply.hpp | 6 ----- .../userver/storages/redis/hedged_request.hpp | 10 ------- .../userver/storages/redis/impl/base.hpp | 26 ------------------- .../userver/storages/redis/reply_fwd.hpp | 8 ------ .../userver/storages/redis/reply_status.hpp | 6 ----- .../userver/storages/redis/ttl_reply.hpp | 7 ----- .../storages/redis/wait_connected_mode.hpp | 8 ------ 10 files changed, 101 deletions(-) delete mode 100644 redis/include/userver/storages/redis/impl/base.hpp diff --git a/.mapping.json b/.mapping.json index 85d7fe5c64cb..83f79fd0ea4a 100644 --- a/.mapping.json +++ b/.mapping.json @@ -2930,7 +2930,6 @@ "redis/include/userver/storages/redis/expire_reply.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/expire_reply.hpp", "redis/include/userver/storages/redis/fwd.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/fwd.hpp", "redis/include/userver/storages/redis/hedged_request.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/hedged_request.hpp", - "redis/include/userver/storages/redis/impl/base.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/impl/base.hpp", "redis/include/userver/storages/redis/impl/keyshard.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/impl/keyshard.hpp", "redis/include/userver/storages/redis/impl/secdist_redis.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/impl/secdist_redis.hpp", "redis/include/userver/storages/redis/impl/transaction_subrequest_data.hpp":"taxi/uservices/userver/redis/include/userver/storages/redis/impl/transaction_subrequest_data.hpp", diff --git a/redis/include/userver/storages/redis/command_control.hpp b/redis/include/userver/storages/redis/command_control.hpp index 4f29ab08b808..24a468e2a6f0 100644 --- a/redis/include/userver/storages/redis/command_control.hpp +++ b/redis/include/userver/storages/redis/command_control.hpp @@ -154,21 +154,4 @@ std::string_view StrategyToString(CommandControl::Strategy s); } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::kDefaultMaxRetries; -using storages::redis::kDefaultTimeoutAll; -using storages::redis::kDefaultTimeoutSingle; - -using storages::redis::kRetryNilFromMaster; -using storages::redis::RetryNilFromMaster; -using storages::redis::ServerIdHasher; - -using storages::redis::CommandControl; -using storages::redis::ServerId; -using storages::redis::StrategyFromString; -using storages::redis::StrategyToString; -} // namespace redis -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/exception.hpp b/redis/include/userver/storages/redis/exception.hpp index 95b79301327f..083eeb9af379 100644 --- a/redis/include/userver/storages/redis/exception.hpp +++ b/redis/include/userver/storages/redis/exception.hpp @@ -64,16 +64,4 @@ class ClientNotConnectedException : public Exception { } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::ClientNotConnectedException; -using storages::redis::Exception; -using storages::redis::InvalidArgumentException; -using storages::redis::ParseConfigException; -using storages::redis::ParseReplyException; -using storages::redis::RequestCancelledException; -using storages::redis::RequestFailedException; -} // namespace redis -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/expire_reply.hpp b/redis/include/userver/storages/redis/expire_reply.hpp index e0f5cfc4300a..c35c83d9c4ea 100644 --- a/redis/include/userver/storages/redis/expire_reply.hpp +++ b/redis/include/userver/storages/redis/expire_reply.hpp @@ -29,10 +29,4 @@ class ExpireReply final { } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::ExpireReply; -} -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/hedged_request.hpp b/redis/include/userver/storages/redis/hedged_request.hpp index 26a00816915d..2214a5af3f93 100644 --- a/redis/include/userver/storages/redis/hedged_request.hpp +++ b/redis/include/userver/storages/redis/hedged_request.hpp @@ -189,14 +189,4 @@ MakeBulkHedgedRedisRequestAsync( } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using USERVER_NAMESPACE::storages::redis::HedgedRedisRequest; -using USERVER_NAMESPACE::storages::redis::MakeBulkHedgedRedisRequest; -using USERVER_NAMESPACE::storages::redis::MakeBulkHedgedRedisRequestAsync; -using USERVER_NAMESPACE::storages::redis::MakeHedgedRedisRequest; -using USERVER_NAMESPACE::storages::redis::MakeHedgedRedisRequestAsync; -} // namespace redis -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/impl/base.hpp b/redis/include/userver/storages/redis/impl/base.hpp deleted file mode 100644 index b910ac7eebbe..000000000000 --- a/redis/include/userver/storages/redis/impl/base.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE - -#include - -USERVER_NAMESPACE_BEGIN -namespace redis { -using storages::redis::CommandsBufferingSettings; -using storages::redis::ConnectionInfo; -using storages::redis::ConnectionSecurity; -using storages::redis::Password; -using storages::redis::PublishSettings; -using storages::redis::PubsubMetricsSettings; -using storages::redis::ReplicationMonitoringSettings; -using storages::redis::ScanCursor; -using storages::redis::Stat; -} // namespace redis - -USERVER_NAMESPACE_END - -#else - -#error This header is deprecated, use instead - -#endif diff --git a/redis/include/userver/storages/redis/reply_fwd.hpp b/redis/include/userver/storages/redis/reply_fwd.hpp index 86501e87b9e4..d341de29717b 100644 --- a/redis/include/userver/storages/redis/reply_fwd.hpp +++ b/redis/include/userver/storages/redis/reply_fwd.hpp @@ -13,12 +13,4 @@ using ReplyPtr = std::shared_ptr; } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::Reply; -using storages::redis::ReplyData; -using storages::redis::ReplyPtr; -} // namespace redis -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/reply_status.hpp b/redis/include/userver/storages/redis/reply_status.hpp index a8215e45d0e9..c49538a0aaaa 100644 --- a/redis/include/userver/storages/redis/reply_status.hpp +++ b/redis/include/userver/storages/redis/reply_status.hpp @@ -17,10 +17,4 @@ enum class ReplyStatus { } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::ReplyStatus; -} -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/ttl_reply.hpp b/redis/include/userver/storages/redis/ttl_reply.hpp index d830b95897c3..a6e12dc5b2d2 100644 --- a/redis/include/userver/storages/redis/ttl_reply.hpp +++ b/redis/include/userver/storages/redis/ttl_reply.hpp @@ -38,11 +38,4 @@ class KeyHasNoExpirationException : public Exception { } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::KeyHasNoExpirationException; -using storages::redis::TtlReply; -} // namespace redis -#endif - USERVER_NAMESPACE_END diff --git a/redis/include/userver/storages/redis/wait_connected_mode.hpp b/redis/include/userver/storages/redis/wait_connected_mode.hpp index 0b25996a2fa2..1c99a3afc3a3 100644 --- a/redis/include/userver/storages/redis/wait_connected_mode.hpp +++ b/redis/include/userver/storages/redis/wait_connected_mode.hpp @@ -34,12 +34,4 @@ struct RedisWaitConnected { } // namespace storages::redis -#ifdef USERVER_FEATURE_LEGACY_REDIS_NAMESPACE -namespace redis { -using storages::redis::kRedisWaitConnectedDefaultTimeout; -using storages::redis::RedisWaitConnected; -using storages::redis::WaitConnectedMode; -} // namespace redis -#endif - USERVER_NAMESPACE_END