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
|
|
|
|
{
|
|
|
|
|
2016-03-28 13:00:00 +00:00
|
|
|
/// 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
|
|
|
|
2016-03-28 13:00:00 +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;
|
2016-03-28 13:00:00 +00:00
|
|
|
/// Create an input stream for remote query execution on one shard.
|
2016-10-04 14:42:41 +00:00
|
|
|
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;
|
2016-03-28 13:00:00 +00:00
|
|
|
/// 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;
|
2016-03-28 13:00:00 +00:00
|
|
|
/// Specify how we allocate connections on a shard.
|
|
|
|
virtual PoolMode getPoolMode() const = 0;
|
2016-01-28 01:00:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|