ClickHouse/dbms/src/Interpreters/ExternalDictionariesLoader.cpp

27 lines
908 B
C++
Raw Normal View History

2019-09-26 11:19:10 +00:00
#include <Interpreters/ExternalDictionariesLoader.h>
#include <Interpreters/Context.h>
#include <Dictionaries/DictionaryFactory.h>
namespace DB
{
/// Must not acquire Context lock in constructor to avoid possibility of deadlocks.
ExternalDictionariesLoader::ExternalDictionariesLoader(
ExternalLoaderConfigRepositoryPtr config_repository, Context & context_)
: ExternalLoader("external dictionary", &Logger::get("ExternalDictionariesLoader"))
, context(context_)
2019-09-26 11:19:10 +00:00
{
addConfigRepository(std::move(config_repository), {"dictionary", "name"});
2019-09-26 11:19:10 +00:00
enableAsyncLoading(true);
enablePeriodicUpdates(true);
}
ExternalLoader::LoadablePtr ExternalDictionariesLoader::create(
const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & key_in_config) const
{
return DictionaryFactory::instance().create(name, config, key_in_config, context);
}
}