aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp
blob: 10fc61a2ed0b727a0313eace91f759a01bdbd427 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <Interpreters/ExternalLoaderTempConfigRepository.h>
#include <Common/Exception.h>


namespace DB
{
namespace ErrorCodes
{
    extern const int BAD_ARGUMENTS;
}


ExternalLoaderTempConfigRepository::ExternalLoaderTempConfigRepository(const String & repository_name_, const String & path_, const LoadablesConfigurationPtr & config_)
    : name(repository_name_), path(path_), config(config_) {}


std::set<String> ExternalLoaderTempConfigRepository::getAllLoadablesDefinitionNames()
{
    std::set<String> paths;
    paths.insert(path);
    return paths;
}


bool ExternalLoaderTempConfigRepository::exists(const String & path_)
{
    return path == path_;
}


Poco::Timestamp ExternalLoaderTempConfigRepository::getUpdateTime(const String & path_)
{
    if (!exists(path_))
        throw Exception(ErrorCodes::BAD_ARGUMENTS, "Loadable {} not found", path_);
    return creation_time;
}


LoadablesConfigurationPtr ExternalLoaderTempConfigRepository::load(const String & path_)
{
    if (!exists(path_))
        throw Exception(ErrorCodes::BAD_ARGUMENTS, "Loadable {} not found", path_);
    return config;
}

}