2015-10-12 14:53:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#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:
|
2017-04-01 07:20:54 +00:00
|
|
|
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();
|
|
|
|
}
|
2015-10-12 14:53:16 +00:00
|
|
|
|
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
Block readImpl() override
|
|
|
|
{
|
|
|
|
return children.back()->read();
|
|
|
|
}
|
2015-10-12 14:53:16 +00:00
|
|
|
|
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
BlockExtraInfo block_extra_info;
|
2015-10-12 14:53:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|