ClickHouse/dbms/Processors/Sources/SinkToOutputStream.h
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

29 lines
576 B
C++

#pragma once
#include <Processors/ISink.h>
namespace DB
{
class IBlockOutputStream;
using BlockOutputStreamPtr = std::shared_ptr<IBlockOutputStream>;
/// Sink which writes data to IBlockOutputStream.
/// It's a temporary wrapper.
class SinkToOutputStream : public ISink
{
public:
explicit SinkToOutputStream(BlockOutputStreamPtr stream);
String getName() const override { return "SinkToOutputStream"; }
protected:
void consume(Chunk chunk) override;
void onFinish() override;
private:
BlockOutputStreamPtr stream;
bool initialized = false;
};
}