2019-12-30 23:30:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-09-15 09:55:57 +00:00
|
|
|
#include <common/types.h>
|
2019-12-30 23:30:06 +00:00
|
|
|
#include <Interpreters/IExternalLoaderConfigRepository.h>
|
|
|
|
#include <Poco/Timestamp.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/// A config repository filled with preset loadables used by ExternalLoader.
|
|
|
|
class ExternalLoaderTempConfigRepository : public IExternalLoaderConfigRepository
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ExternalLoaderTempConfigRepository(const String & repository_name_, const String & path_, const LoadablesConfigurationPtr & config_);
|
|
|
|
|
2021-04-22 07:53:44 +00:00
|
|
|
String getName() const override { return name; }
|
2019-12-30 23:30:06 +00:00
|
|
|
bool isTemporary() const override { return true; }
|
|
|
|
|
|
|
|
std::set<String> getAllLoadablesDefinitionNames() override;
|
|
|
|
bool exists(const String & path) override;
|
|
|
|
Poco::Timestamp getUpdateTime(const String & path) override;
|
|
|
|
LoadablesConfigurationPtr load(const String & path) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
String name;
|
|
|
|
String path;
|
|
|
|
LoadablesConfigurationPtr config;
|
|
|
|
Poco::Timestamp creation_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|