mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
38 lines
830 B
C++
38 lines
830 B
C++
#pragma once
|
|
#include <Interpreters/IInterpreter.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Context;
|
|
class IAST;
|
|
class ASTSystemQuery;
|
|
class IStorage;
|
|
using ASTPtr = std::shared_ptr<IAST>;
|
|
using StoragePtr = std::shared_ptr<IStorage>;
|
|
|
|
|
|
class InterpreterSystemQuery : public IInterpreter
|
|
{
|
|
public:
|
|
InterpreterSystemQuery(const ASTPtr & query_ptr_, Context & context_);
|
|
|
|
BlockIO execute() override;
|
|
|
|
private:
|
|
ASTPtr query_ptr;
|
|
Context & context;
|
|
Poco::Logger * log = nullptr;
|
|
|
|
/// Tries to get a replicated table and restart it
|
|
/// Returns pointer to a newly created table if the restart was successful
|
|
StoragePtr tryRestartReplica(const String & database_name, const String & table_name, Context & context);
|
|
|
|
void restartReplicas(Context & system_context);
|
|
void syncReplica(ASTSystemQuery & query);
|
|
};
|
|
|
|
|
|
}
|