mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <Interpreters/Context_fwd.h>
|
|
#include <Interpreters/ExternalLoader.h>
|
|
#include <Interpreters/UserDefinedExecutableFunction.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class IExternalLoaderConfigRepository;
|
|
|
|
/// Manages external user-defined functions.
|
|
class ExternalUserDefinedExecutableFunctionsLoader : public ExternalLoader, WithContext
|
|
{
|
|
public:
|
|
|
|
using UserDefinedExecutableFunctionPtr = std::shared_ptr<const UserDefinedExecutableFunction>;
|
|
|
|
/// External user-defined functions will be loaded immediately and then will be updated in separate thread, each 'reload_period' seconds.
|
|
explicit ExternalUserDefinedExecutableFunctionsLoader(ContextPtr global_context_);
|
|
|
|
UserDefinedExecutableFunctionPtr getUserDefinedFunction(const std::string & user_defined_function_name) const;
|
|
|
|
UserDefinedExecutableFunctionPtr tryGetUserDefinedFunction(const std::string & user_defined_function_name) const;
|
|
|
|
void reloadFunction(const std::string & user_defined_function_name) const;
|
|
|
|
protected:
|
|
LoadablePtr create(const std::string & name,
|
|
const Poco::Util::AbstractConfiguration & config,
|
|
const std::string & key_in_config,
|
|
const std::string & repository_name) const override;
|
|
|
|
};
|
|
|
|
}
|