ClickHouse/dbms/src/Interpreters/InterpreterSystemQuery.h

39 lines
868 B
C++
Raw Normal View History

#pragma once
2019-03-11 14:01:45 +00:00
#include <Interpreters/IInterpreter.h>
2019-03-11 14:01:45 +00:00
#include <Parsers/IAST_fwd.h>
#include <Storages/IStorage_fwd.h>
namespace Poco { class Logger; }
namespace DB
{
class Context;
class ASTSystemQuery;
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);
2018-08-27 18:05:28 +00:00
void restartReplicas(Context & system_context);
void syncReplica(ASTSystemQuery & query);
void flushDistributed(ASTSystemQuery & query);
};
}