mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 19:32:07 +00:00
b742908731
Merge remote-tracking branch 'upstream/master' into system-log-prepare-table-on-each-flush #2131 deleted excessive logging Revert "#2131 deleted excessive logging" This reverts commitd78a46d958
. Revert "SystemLog: execute prepareTable() on each flush" This reverts commit7f60bb0a9b
. SystemLog: execute prepareTable() on each flush
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <Dictionaries/IDictionary.h>
|
|
#include <Interpreters/ExternalLoader.h>
|
|
#include <common/logger_useful.h>
|
|
#include <memory>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Context;
|
|
|
|
/// Manages user-defined dictionaries.
|
|
class ExternalDictionaries : public ExternalLoader
|
|
{
|
|
public:
|
|
using DictPtr = std::shared_ptr<IDictionaryBase>;
|
|
|
|
/// Dictionaries will be loaded immediately and then will be updated in separate thread, each 'reload_period' seconds.
|
|
ExternalDictionaries(
|
|
std::unique_ptr<IExternalLoaderConfigRepository> config_repository,
|
|
Context & context,
|
|
bool throw_on_error);
|
|
|
|
/// Forcibly reloads specified dictionary.
|
|
void reloadDictionary(const std::string & name) { reload(name); }
|
|
|
|
DictPtr getDictionary(const std::string & name) const
|
|
{
|
|
return std::static_pointer_cast<IDictionaryBase>(getLoadable(name));
|
|
}
|
|
|
|
DictPtr tryGetDictionary(const std::string & name) const
|
|
{
|
|
return std::static_pointer_cast<IDictionaryBase>(tryGetLoadable(name));
|
|
}
|
|
|
|
protected:
|
|
|
|
std::unique_ptr<IExternalLoadable> create(const std::string & name, const Configuration & config,
|
|
const std::string & config_prefix) override;
|
|
|
|
using ExternalLoader::getObjectsMap;
|
|
|
|
friend class StorageSystemDictionaries;
|
|
friend class DatabaseDictionary;
|
|
|
|
private:
|
|
|
|
Context & context;
|
|
};
|
|
|
|
}
|