ClickHouse/dbms/Interpreters/InterpreterSystemQuery.h

49 lines
1.3 KiB
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>
2020-03-13 10:30:55 +00:00
#include <Interpreters/StorageID.h>
2020-03-04 20:29:52 +00:00
#include <Common/ActionLock.h>
namespace Poco { class Logger; }
namespace DB
{
class Context;
2020-01-24 16:20:36 +00:00
class AccessRightsElements;
class ASTSystemQuery;
class InterpreterSystemQuery : public IInterpreter
{
public:
InterpreterSystemQuery(const ASTPtr & query_ptr_, Context & context_);
BlockIO execute() override;
bool ignoreQuota() const override { return true; }
bool ignoreLimits() const override { return true; }
private:
ASTPtr query_ptr;
Context & context;
Poco::Logger * log = nullptr;
2020-03-04 20:29:52 +00:00
StorageID table_id = StorageID::createEmpty(); /// Will be set up if query contains table name
/// Tries to get a replicated table and restart it
/// Returns pointer to a newly created table if the restart was successful
StoragePtr tryRestartReplica(const StorageID & replica, Context & context, bool need_ddl_guard = true);
2018-08-27 18:05:28 +00:00
void restartReplicas(Context & system_context);
void syncReplica(ASTSystemQuery & query);
void flushDistributed(ASTSystemQuery & query);
2020-01-24 16:20:36 +00:00
AccessRightsElements getRequiredAccessForDDLOnCluster() const;
2020-03-04 20:29:52 +00:00
void startStopAction(StorageActionBlockType action_type, bool start);
};
}