ClickHouse/src/Storages/MergeTree/MergeTreeBlockOutputStream.h

37 lines
851 B
C++
Raw Normal View History

2014-03-13 12:48:07 +00:00
#pragma once
#include <DataStreams/IBlockOutputStream.h>
#include <Storages/StorageInMemoryMetadata.h>
2014-03-13 12:48:07 +00:00
2014-03-13 12:48:07 +00:00
namespace DB
{
class Block;
class StorageMergeTree;
2014-03-13 12:48:07 +00:00
class MergeTreeBlockOutputStream : public IBlockOutputStream
{
public:
MergeTreeBlockOutputStream(StorageMergeTree & storage_, const StorageMetadataPtr metadata_snapshot_, size_t max_parts_per_block_, bool optimize_on_insert_)
: storage(storage_)
, metadata_snapshot(metadata_snapshot_)
, max_parts_per_block(max_parts_per_block_)
, optimize_on_insert(optimize_on_insert_)
2020-06-26 11:30:23 +00:00
{
}
2014-03-13 12:48:07 +00:00
Block getHeader() const override;
void write(const Block & block) override;
void writePrefix() override;
2014-03-13 12:48:07 +00:00
private:
StorageMergeTree & storage;
StorageMetadataPtr metadata_snapshot;
size_t max_parts_per_block;
bool optimize_on_insert;
2014-03-13 12:48:07 +00:00
};
}