#pragma once #include #include #include #include namespace DB { class KeeperDispatcher; class TinyContext: public std::enable_shared_from_this { public: std::shared_ptr getKeeperDispatcher() const; void initializeKeeperDispatcher(bool start_async) const; void shutdownKeeperDispatcher() const; void updateKeeperConfiguration(const Poco::Util::AbstractConfiguration & config); using ConfigurationPtr = Poco::AutoPtr; void setConfig(const ConfigurationPtr & config); const Poco::Util::AbstractConfiguration & getConfigRef() const; private: mutable std::mutex keeper_dispatcher_mutex; mutable std::shared_ptr keeper_dispatcher TSA_GUARDED_BY(keeper_dispatcher_mutex); ConfigurationPtr config TSA_GUARDED_BY(keeper_dispatcher_mutex); }; }