1#include <Interpreters/ExternalLoaderTempConfigRepository.h>
2#include <Common/Exception.h>
3
4
5namespace DB
6{
7namespace ErrorCodes
8{
9 extern const int BAD_ARGUMENTS;
10}
11
12
13ExternalLoaderTempConfigRepository::ExternalLoaderTempConfigRepository(const String & repository_name_, const String & path_, const LoadablesConfigurationPtr & config_)
14 : name(repository_name_), path(path_), config(config_) {}
15
16
17std::set<String> ExternalLoaderTempConfigRepository::getAllLoadablesDefinitionNames()
18{
19 std::set<String> paths;
20 paths.insert(path);
21 return paths;
22}
23
24
25bool ExternalLoaderTempConfigRepository::exists(const String & path_)
26{
27 return path == path_;
28}
29
30
31Poco::Timestamp ExternalLoaderTempConfigRepository::getUpdateTime(const String & path_)
32{
33 if (!exists(path_))
34 throw Exception("Loadable " + path_ + " not found", ErrorCodes::BAD_ARGUMENTS);
35 return creation_time;
36}
37
38
39LoadablesConfigurationPtr ExternalLoaderTempConfigRepository::load(const String & path_)
40{
41 if (!exists(path_))
42 throw Exception("Loadable " + path_ + " not found", ErrorCodes::BAD_ARGUMENTS);
43 return config;
44}
45
46}
47