ClickHouse/dbms/include/DB/Storages/MergeTree/ShardedPartitionSender.h

51 lines
1.2 KiB
C
Raw Normal View History

2016-01-28 01:00:27 +00:00
#pragma once
#include <DB/Interpreters/InterserverIOHandler.h>
#include <DB/IO/WriteBuffer.h>
2016-01-28 01:00:42 +00:00
#include <common/logger_useful.h>
2016-01-28 01:00:27 +00:00
namespace DB
{
class StorageReplicatedMergeTree;
namespace ShardedPartitionSender
{
/** Сервис для получения кусков из партиции таблицы *MergeTree.
*/
class Service final : public InterserverIOEndpoint
{
public:
Service(StorageReplicatedMergeTree & storage_);
Service(const Service &) = delete;
Service & operator=(const Service &) = delete;
std::string getId(const std::string & node_id) const override;
void processQuery(const Poco::Net::HTMLForm & params, WriteBuffer & out) override;
private:
StorageReplicatedMergeTree & storage;
2016-01-28 01:00:42 +00:00
Logger * log;
2016-01-28 01:00:27 +00:00
};
/** Клиент для отправления кусков из партиции таблицы *MergeTree.
*/
class Client final
{
public:
2016-01-28 01:00:42 +00:00
Client();
2016-01-28 01:00:27 +00:00
Client(const Client &) = delete;
Client & operator=(const Client &) = delete;
bool send(const InterserverIOEndpointLocation & to_location, const InterserverIOEndpointLocation & from_location,
2016-01-28 16:06:57 +00:00
const std::string & part, size_t shard_no);
2016-01-28 01:00:27 +00:00
void cancel() { is_cancelled = true; }
private:
std::atomic<bool> is_cancelled{false};
2016-01-28 01:00:42 +00:00
Logger * log;
2016-01-28 01:00:27 +00:00
};
}
}