#pragma once #include #include #include namespace Poco { class Logger; } namespace DB { class FileLogBlockInputStream : public IBlockInputStream { public: FileLogBlockInputStream( StorageFileLog & storage_, const StorageMetadataPtr & metadata_snapshot_, const std::shared_ptr & context_, const Names & columns, size_t max_block_size_); ~FileLogBlockInputStream() override = default; String getName() const override { return storage.getName(); } Block getHeader() const override; void readPrefixImpl() override; Block readImpl() override; void readSuffixImpl() override; bool isStalled() { return !buffer || buffer->isStalled(); } private: StorageFileLog & storage; StorageMetadataPtr metadata_snapshot; ContextPtr context; Names column_names; UInt64 max_block_size; ReadBufferFromFileLogPtr buffer; const Block non_virtual_header; const Block virtual_header; }; }