2018-05-24 02:39:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Processors/IProcessor.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2019-02-07 18:51:53 +00:00
|
|
|
/** Has one input and arbitrary non zero number of outputs.
|
2018-05-24 02:39:22 +00:00
|
|
|
* All of them have the same structure.
|
|
|
|
*
|
|
|
|
* Pulls data input and copies it to every output.
|
|
|
|
* You may have heard about it under the name 'tee'.
|
|
|
|
*
|
|
|
|
* Doesn't do any heavy calculations.
|
|
|
|
* Preserves an order of data.
|
|
|
|
*/
|
|
|
|
class ForkProcessor : public IProcessor
|
|
|
|
{
|
|
|
|
public:
|
2019-02-07 18:51:53 +00:00
|
|
|
ForkProcessor(const Block & header, size_t num_outputs)
|
2018-05-24 02:52:21 +00:00
|
|
|
: IProcessor(InputPorts{header}, OutputPorts(num_outputs, header))
|
2018-05-24 02:39:22 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
String getName() const override { return "Fork"; }
|
|
|
|
|
|
|
|
Status prepare() override;
|
|
|
|
|
2019-02-27 11:24:14 +00:00
|
|
|
InputPort & getInputPort() { return inputs.front(); }
|
2018-05-24 02:39:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|