mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-01 06:00:49 +00:00
b4384ce2a9
A bad dictionary cannot block all the loading anymore. Implemented really lazy loading of external dictionaries. Provided more detailed information about the loading of each dictionary to make diagnostics easier.
31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
#include <Interpreters/ExternalDictionaries.h>
|
|
#include <Interpreters/Context.h>
|
|
#include <Dictionaries/DictionaryFactory.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Must not acquire Context lock in constructor to avoid possibility of deadlocks.
|
|
ExternalDictionaries::ExternalDictionaries(
|
|
std::unique_ptr<IExternalLoaderConfigRepository> config_repository,
|
|
const Poco::Util::AbstractConfiguration & config,
|
|
Context & context)
|
|
: ExternalLoader(config,
|
|
"external dictionary",
|
|
&Logger::get("ExternalDictionaries")),
|
|
context(context)
|
|
{
|
|
addConfigRepository(std::move(config_repository), {"dictionary", "name", "dictionaries_config"});
|
|
enableAsyncLoading(true);
|
|
enablePeriodicUpdates(true);
|
|
}
|
|
|
|
|
|
ExternalLoader::LoadablePtr ExternalDictionaries::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);
|
|
}
|
|
|
|
}
|