mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
30 lines
637 B
C++
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;
|
|
};
|
|
}
|