mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <DB/Interpreters/InterserverIOHandler.h>
|
|
#include <DB/IO/WriteBuffer.h>
|
|
#include <common/logger_useful.h>
|
|
|
|
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;
|
|
Logger * log;
|
|
};
|
|
|
|
/** Клиент для отправления кусков из партиции таблицы *MergeTree.
|
|
*/
|
|
class Client final
|
|
{
|
|
public:
|
|
Client();
|
|
Client(const Client &) = delete;
|
|
Client & operator=(const Client &) = delete;
|
|
bool send(const InterserverIOEndpointLocation & to_location, const InterserverIOEndpointLocation & from_location,
|
|
const std::string & part, size_t shard_no);
|
|
void cancel() { is_cancelled = true; }
|
|
|
|
private:
|
|
std::atomic<bool> is_cancelled{false};
|
|
Logger * log;
|
|
};
|
|
|
|
}
|
|
|
|
}
|