ClickHouse/src/Storages/RabbitMQ/RabbitMQSink.h
2021-07-26 19:48:25 +03:00

30 lines
637 B
C++

#pragma once
#include <Processors/Sinks/SinkToStorage.h>
#include <Storages/RabbitMQ/StorageRabbitMQ.h>
namespace DB
{
class RabbitMQSink : public SinkToStorage
{
public:
explicit RabbitMQSink(StorageRabbitMQ & storage_, const StorageMetadataPtr & metadata_snapshot_, ContextPtr context_);
void onStart() override;
void consume(Chunk chunk) override;
void onFinish() override;
String getName() const override { return "RabbitMQSink"; }
private:
StorageRabbitMQ & storage;
StorageMetadataPtr metadata_snapshot;
ContextPtr context;
ProducerBufferPtr buffer;
BlockOutputStreamPtr child;
};
}