mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
31 lines
612 B
C++
31 lines
612 B
C++
|
#pragma once
|
||
|
|
||
|
#include <DataStreams/IBlockOutputStream.h>
|
||
|
#include <Interpreters/Context.h>
|
||
|
#include <Storages/Kafka/StorageKafka.h>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
class KafkaBlockOutputStream : public IBlockOutputStream
|
||
|
{
|
||
|
public:
|
||
|
explicit KafkaBlockOutputStream(StorageKafka & storage_, const Context & context_);
|
||
|
|
||
|
Block getHeader() const override;
|
||
|
|
||
|
void writePrefix() override;
|
||
|
void write(const Block & block) override;
|
||
|
void writeSuffix() override;
|
||
|
|
||
|
void flush() override;
|
||
|
|
||
|
private:
|
||
|
StorageKafka & storage;
|
||
|
Context context;
|
||
|
ProducerBufferPtr buffer;
|
||
|
BlockOutputStreamPtr child;
|
||
|
};
|
||
|
|
||
|
}
|