#pragma once #include #include #include #include namespace DB { class Context; /// Manages user-defined dictionaries. class ExternalDictionariesLoader : public ExternalLoader { public: using DictPtr = std::shared_ptr; /// Dictionaries will be loaded immediately and then will be updated in separate thread, each 'reload_period' seconds. ExternalDictionariesLoader( std::unique_ptr config_repository, const Poco::Util::AbstractConfiguration & config, Context & context_); DictPtr getDictionary(const std::string & name) const { return std::static_pointer_cast(getLoadable(name)); } DictPtr tryGetDictionary(const std::string & name) const { return std::static_pointer_cast(tryGetLoadable(name)); } protected: LoadablePtr create(const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & key_in_config) const override; friend class StorageSystemDictionaries; friend class DatabaseDictionary; private: Context & context; }; }