aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.h
blob: 92816dcb7f2f798c00217213cba9b1ed3b70cdc2 (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
#pragma once

#include <base/types.h>
#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_);

    String getName() const override { return name; }
    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;
};

}