ClickHouse/dbms/include/DB/Interpreters/ClusterProxy/IQueryConstructor.h

42 lines
1.1 KiB
C
Raw Normal View History

2016-01-28 01:00:27 +00:00
#pragma once
#include <DB/Interpreters/Cluster.h>
2016-03-01 17:47:53 +00:00
#include <DB/Interpreters/ClusterProxy/PreSendHook.h>
2016-01-28 01:00:27 +00:00
#include <DB/Parsers/IAST.h>
#include <DB/Storages/IStorage.h>
#include <DB/Client/ConnectionPool.h>
namespace DB
{
2016-03-07 04:35:06 +00:00
struct Settings;
2016-01-28 01:00:27 +00:00
class Context;
class Cluster;
class Throttler;
namespace ClusterProxy
{
class IQueryConstructor
{
public:
virtual ~IQueryConstructor() {}
2016-03-01 17:47:53 +00:00
void setPreSendHook(PreSendHook & pre_send_hook_) { pre_send_hook = pre_send_hook_; }
void setupBarrier(size_t count) { if (pre_send_hook) { pre_send_hook.setupBarrier(count); } }
2016-01-28 01:00:27 +00:00
virtual BlockInputStreamPtr createLocal(ASTPtr query_ast, const Context & context, const Cluster::Address & address) = 0;
virtual BlockInputStreamPtr createRemote(IConnectionPool * pool, const std::string & query,
const Settings & settings, ThrottlerPtr throttler, const Context & context) = 0;
virtual BlockInputStreamPtr createRemote(ConnectionPoolsPtr & pools, const std::string & query,
const Settings & new_settings, ThrottlerPtr throttler, const Context & context) = 0;
virtual bool isInclusive() const = 0;
2016-03-01 17:47:53 +00:00
protected:
PreSendHook pre_send_hook;
2016-01-28 01:00:27 +00:00
};
}
}