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
30namespace storages::
redis {
33class SubscribeClientImpl;
91 Redis(
const ComponentConfig& config,
92 const ComponentContext& component_context);
100 std::shared_ptr<storages::
redis::
Client> GetClient(
101 const std::string& name,
103 [[
deprecated(
"use GetClient()")]] std::shared_ptr<redis::Sentinel> Client(
104 const std::string& name)
const;
106 const std::string& name,
109 static yaml_config::Schema GetStaticConfigSchema();
112 void OnConfigUpdate(
const dynamic_config::Snapshot& cfg);
114 void Connect(
const ComponentConfig& config,
115 const ComponentContext& component_context,
118 void WriteStatistics(
utils::statistics::Writer& writer);
119 void WriteStatisticsPubsub(
utils::statistics::Writer& writer);
122 std::unordered_map<std::string, std::shared_ptr<redis::Sentinel>> sentinels_;
123 std::unordered_map<std::string, std::shared_ptr<storages::redis::Client>>
125 std::unordered_map<std::string,
126 std::shared_ptr<storages::redis::SubscribeClientImpl>>
129 dynamic_config::Source config_;
130 concurrent::AsyncEventSubscriberScope config_subscription_;
132 utils::statistics::Entry statistics_holder_;
133 utils::statistics::Entry subscribe_statistics_holder_;
135 rcu::Variable<redis::MetricsSettings> metrics_settings_;
136 rcu::Variable<redis::PubsubMetricsSettings> pubsub_metrics_settings_;
140inline constexpr bool kHasValidate<Redis> =
true;