8#include <unordered_map>
10#include <userver/components/component_fwd.hpp>
11#include <userver/components/loggable_component_base.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
33class SubscribeClientImpl;
115 Redis(
const ComponentConfig& config,
116 const ComponentContext& component_context);
125 const std::string& name,
127 [[
deprecated(
"use GetClient()")]] std::shared_ptr<redis::Sentinel> Client(
128 const std::string& name)
const;
130 const std::string& name,
133 static yaml_config::Schema GetStaticConfigSchema();
136 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
138 void Connect(
const ComponentConfig& config,
139 const ComponentContext& component_context,
142 void WriteStatistics(utils::statistics::Writer& writer);
143 void WriteStatisticsPubsub(utils::statistics::Writer& writer);
146 std::unordered_map<std::string, std::shared_ptr<redis::Sentinel>> sentinels_;
147 std::unordered_map<std::string, std::shared_ptr<storages::redis::Client>>
149 std::unordered_map<std::string,
150 std::shared_ptr<storages::redis::SubscribeClientImpl>>
153 dynamic_config::Source config_;
154 concurrent::AsyncEventSubscriberScope config_subscription_;
156 utils::statistics::Entry statistics_holder_;
157 utils::statistics::Entry subscribe_statistics_holder_;
160 rcu::Variable<redis::MetricsSettings> metrics_settings_;
161 rcu::Variable<redis::PubsubMetricsSettings> pubsub_metrics_settings_;
165inline constexpr bool kHasValidate<Redis> =
true;