mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 21:12:28 +00:00
3f57fc085b
Also remove it from some visitors.
52 lines
1.8 KiB
C++
52 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <Dictionaries/IDictionary.h>
|
|
#include <Interpreters/Context_fwd.h>
|
|
#include <Interpreters/ExternalLoader.h>
|
|
#include <Common/quoteString.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class IExternalLoaderConfigRepository;
|
|
|
|
/// Manages user-defined dictionaries.
|
|
class ExternalDictionariesLoader : public ExternalLoader, WithConstContext
|
|
{
|
|
public:
|
|
using DictPtr = std::shared_ptr<const IDictionary>;
|
|
|
|
/// Dictionaries will be loaded immediately and then will be updated in separate thread, each 'reload_period' seconds.
|
|
explicit ExternalDictionariesLoader(ContextConstPtr global_context_);
|
|
|
|
DictPtr getDictionary(const std::string & dictionary_name, ContextConstPtr context) const;
|
|
|
|
DictPtr tryGetDictionary(const std::string & dictionary_name, ContextConstPtr context) const;
|
|
|
|
void reloadDictionary(const std::string & dictionary_name, ContextConstPtr context) const;
|
|
|
|
DictionaryStructure getDictionaryStructure(const std::string & dictionary_name, ContextConstPtr context) const;
|
|
|
|
static DictionaryStructure getDictionaryStructure(const Poco::Util::AbstractConfiguration & config, const std::string & key_in_config = "dictionary");
|
|
|
|
static DictionaryStructure getDictionaryStructure(const ObjectConfig & config);
|
|
|
|
static void resetAll();
|
|
|
|
protected:
|
|
LoadablePtr create(const std::string & name, const Poco::Util::AbstractConfiguration & config,
|
|
const std::string & key_in_config, const std::string & repository_name) const override;
|
|
|
|
std::string resolveDictionaryName(const std::string & dictionary_name, const std::string & current_database_name) const;
|
|
|
|
/// Try convert qualified dictionary name to persistent UUID
|
|
std::string resolveDictionaryNameFromDatabaseCatalog(const std::string & name) const;
|
|
|
|
friend class StorageSystemDictionaries;
|
|
friend class DatabaseDictionary;
|
|
};
|
|
|
|
}
|