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

41 lines
1.2 KiB
C++
Raw Normal View History

2016-01-28 01:00:27 +00:00
#pragma once
#include <DB/Interpreters/Cluster.h>
#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
{
/// Base class for the implementation of the details of distributed query
/// execution that are specific to the query type.
2016-01-28 01:00:27 +00:00
class IQueryConstructor
{
public:
virtual ~IQueryConstructor() {}
2016-03-01 17:47:53 +00:00
/// Create an input stream for local query execution.
2016-01-28 01:00:27 +00:00
virtual BlockInputStreamPtr createLocal(ASTPtr query_ast, const Context & context, const Cluster::Address & address) = 0;
/// Create an input stream for remote query execution on one shard.
virtual BlockInputStreamPtr createRemote(ConnectionPoolPtr & pool, const std::string & query,
2016-01-28 01:00:27 +00:00
const Settings & settings, ThrottlerPtr throttler, const Context & context) = 0;
/// Create an input stream for remote query execution on one or more shards.
2016-01-28 01:00:27 +00:00
virtual BlockInputStreamPtr createRemote(ConnectionPoolsPtr & pools, const std::string & query,
const Settings & new_settings, ThrottlerPtr throttler, const Context & context) = 0;
/// Specify how we allocate connections on a shard.
virtual PoolMode getPoolMode() const = 0;
2016-01-28 01:00:27 +00:00
};
}
}