8#include <unordered_map>
10#include <userver/components/component_base.hpp>
11#include <userver/components/component_fwd.hpp>
12#include <userver/dynamic_config/source.hpp>
13#include <userver/rcu/rcu.hpp>
14#include <userver/storages/redis/impl/base.hpp>
15#include <userver/storages/redis/impl/wait_connected_mode.hpp>
16#include <userver/testsuite/redis_control.hpp>
17#include <userver/utils/statistics/entry.hpp>
19USERVER_NAMESPACE_BEGIN
30namespace storages::
redis {
33class SubscribeClientImpl;
129 Redis(
const ComponentConfig& config,
const ComponentContext& component_context);
138 GetClient(
const std::string& name, USERVER_NAMESPACE::redis::RedisWaitConnected wait_connected = {})
const;
139 [[
deprecated(
"use GetClient()")]] std::shared_ptr<redis::Sentinel> Client(
const std::string& name)
const;
141 GetSubscribeClient(
const std::string& name, USERVER_NAMESPACE::redis::RedisWaitConnected wait_connected = {})
const;
143 static yaml_config::Schema GetStaticConfigSchema();
146 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
149 const ComponentConfig& config,
150 const ComponentContext& component_context,
154 void WriteStatistics(
utils::statistics::Writer& writer);
155 void WriteStatisticsPubsub(
utils::statistics::Writer& writer);
157 std::shared_ptr<redis::ThreadPools> thread_pools_;
158 std::unordered_map<std::string, std::shared_ptr<redis::Sentinel>> sentinels_;
159 std::unordered_map<std::string, std::shared_ptr<storages::redis::Client>> clients_;
160 std::unordered_map<std::string, std::shared_ptr<storages::redis::SubscribeClientImpl>> subscribe_clients_;
162 dynamic_config::Source config_;
163 concurrent::AsyncEventSubscriberScope config_subscription_;
165 utils::statistics::Entry statistics_holder_;
166 utils::statistics::Entry subscribe_statistics_holder_;
168 redis::MetricsSettings::StaticSettings static_metrics_settings_;
169 rcu::Variable<redis::MetricsSettings> metrics_settings_;
170 rcu::Variable<redis::PubsubMetricsSettings> pubsub_metrics_settings_;
174inline constexpr bool kHasValidate<Redis> =
true;