ClickHouse/dbms/src/DataStreams/BlockExtraInfoInputStream.h

45 lines
966 B
C++
Raw Normal View History

2015-10-12 14:53:16 +00:00
#pragma once
#include <DataStreams/IProfilingBlockInputStream.h>
2015-10-12 14:53:16 +00:00
namespace DB
{
2017-05-13 22:19:04 +00:00
/** Adds to one thread additional block information that is specified
* as the constructor parameter.
2015-10-12 14:53:16 +00:00
*/
class BlockExtraInfoInputStream : public IProfilingBlockInputStream
{
public:
BlockExtraInfoInputStream(const 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();
}
2015-10-12 14:53:16 +00:00
protected:
Block readImpl() override
{
return children.back()->read();
}
2015-10-12 14:53:16 +00:00
private:
BlockExtraInfo block_extra_info;
2015-10-12 14:53:16 +00:00
};
}