ClickHouse/dbms/include/DB/DataStreams/BlockExtraInfoInputStream.h
2016-06-07 11:23:15 +03:00

45 lines
993 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <DB/DataStreams/IProfilingBlockInputStream.h>
namespace DB
{
/** Прибавляет к одному потоку дополнительную информацию о блоках, которая задана
* в качестве параметра конструктора.
*/
class BlockExtraInfoInputStream : public IProfilingBlockInputStream
{
public:
BlockExtraInfoInputStream(BlockInputStreamPtr input_, const BlockExtraInfo & block_extra_info_)
: block_extra_info(block_extra_info_)
{
children.push_back(input_);
}
BlockExtraInfo getBlockExtraInfo() const override
{
return block_extra_info;
}
String getName() const override { return "BlockExtraInfoInput"; }
String getID() const override
{
std::stringstream res;
res << "BlockExtraInfoInput(" << children.back()->getID() << ")";
return res.str();
}
protected:
Block readImpl() override
{
return children.back()->read();
}
private:
BlockExtraInfo block_extra_info;
};
}