Skip to content

Commit 0de0470

Browse files
authored
Merge pull request apache#19 from HappenLee/pipe
[Refactor](pipeline) change OperatorTemplate to OperatorBuilder
2 parents 039878e + 5b7e107 commit 0de0470

25 files changed

Lines changed: 113 additions & 113 deletions

‎be/src/pipeline/exec/aggregation_sink_operator.cpp‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace doris::pipeline {
2323

24-
AggSinkOperator::AggSinkOperator(AggSinkOperatorTemplate* operator_template,
24+
AggSinkOperator::AggSinkOperator(AggSinkOperatorBuilder* operator_template,
2525
vectorized::AggregationNode* agg_node,
2626
std::shared_ptr<AggContext> agg_context)
2727
: Operator(operator_template), _agg_node(agg_node), _agg_context(std::move(agg_context)) {}
@@ -117,23 +117,23 @@ Status AggSinkOperator::close(RuntimeState* state) {
117117

118118
/////////////////////////////// operator template ////////////////////////////////
119119

120-
AggSinkOperatorTemplate::AggSinkOperatorTemplate(int32_t id, const std::string& name,
121-
vectorized::AggregationNode* exec_node,
122-
std::shared_ptr<AggContext> agg_context)
123-
: OperatorTemplate(id, name, exec_node),
120+
AggSinkOperatorBuilder::AggSinkOperatorBuilder(int32_t id, const std::string& name,
121+
vectorized::AggregationNode* exec_node,
122+
std::shared_ptr<AggContext> agg_context)
123+
: OperatorBuilder(id, name, exec_node),
124124
_agg_node(exec_node),
125125
_agg_context(std::move(agg_context)) {}
126126

127-
OperatorPtr AggSinkOperatorTemplate::build_operator() {
127+
OperatorPtr AggSinkOperatorBuilder::build_operator() {
128128
return std::make_shared<AggSinkOperator>(this, _agg_node, _agg_context);
129129
}
130130

131131
// use final aggregation source operator
132-
bool AggSinkOperatorTemplate::is_sink() const {
132+
bool AggSinkOperatorBuilder::is_sink() const {
133133
return true;
134134
}
135135

136-
bool AggSinkOperatorTemplate::is_source() const {
136+
bool AggSinkOperatorBuilder::is_source() const {
137137
return false;
138138
}
139139
} // namespace doris::pipeline

‎be/src/pipeline/exec/aggregation_sink_operator.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class Block;
2828
} // namespace vectorized
2929

3030
namespace pipeline {
31-
class AggSinkOperatorTemplate;
31+
class AggSinkOperatorBuilder;
3232
class AggSinkOperator : public Operator {
3333
public:
34-
AggSinkOperator(AggSinkOperatorTemplate* operator_template, vectorized::AggregationNode*,
34+
AggSinkOperator(AggSinkOperatorBuilder* operator_template, vectorized::AggregationNode*,
3535
std::shared_ptr<AggContext>);
3636

3737
Status init(ExecNode* exec_node, RuntimeState* state = nullptr) override;
@@ -54,10 +54,10 @@ class AggSinkOperator : public Operator {
5454
std::shared_ptr<AggContext> _agg_context;
5555
};
5656

57-
class AggSinkOperatorTemplate : public OperatorTemplate {
57+
class AggSinkOperatorBuilder : public OperatorBuilder {
5858
public:
59-
AggSinkOperatorTemplate(int32_t, const std::string&, vectorized::AggregationNode*,
60-
std::shared_ptr<AggContext>);
59+
AggSinkOperatorBuilder(int32_t, const std::string&, vectorized::AggregationNode*,
60+
std::shared_ptr<AggContext>);
6161

6262
OperatorPtr build_operator() override;
6363

‎be/src/pipeline/exec/aggregation_source_operator.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace doris {
2323
namespace pipeline {
2424

25-
AggregationSourceOperator::AggregationSourceOperator(OperatorTemplate* templ,
25+
AggregationSourceOperator::AggregationSourceOperator(OperatorBuilder* templ,
2626
vectorized::AggregationNode* node)
2727
: Operator(templ), _agg_node(node) {}
2828

@@ -61,11 +61,11 @@ Status AggregationSourceOperator::close(RuntimeState* state) {
6161

6262
/////////////////////////////// operator template ////////////////////////////////
6363

64-
AggregationSourceOperatorTemplate::AggregationSourceOperatorTemplate(
64+
AggregationSourceOperatorBuilder::AggregationSourceOperatorBuilder(
6565
int32_t id, const std::string& name, vectorized::AggregationNode* exec_node)
66-
: OperatorTemplate(id, name, exec_node) {}
66+
: OperatorBuilder(id, name, exec_node) {}
6767

68-
OperatorPtr AggregationSourceOperatorTemplate::build_operator() {
68+
OperatorPtr AggregationSourceOperatorBuilder::build_operator() {
6969
return std::make_shared<AggregationSourceOperator>(
7070
this, assert_cast<vectorized::AggregationNode*>(_related_exec_node));
7171
}

‎be/src/pipeline/exec/aggregation_source_operator.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace pipeline {
2828
// For read none streaming agg sink operator's data
2929
class AggregationSourceOperator : public Operator {
3030
public:
31-
AggregationSourceOperator(OperatorTemplate*, vectorized::AggregationNode*);
31+
AggregationSourceOperator(OperatorBuilder*, vectorized::AggregationNode*);
3232
Status init(ExecNode* exec_node, RuntimeState* state = nullptr) override;
3333
Status prepare(RuntimeState* state) override;
3434
Status open(RuntimeState* state) override;
@@ -40,9 +40,9 @@ class AggregationSourceOperator : public Operator {
4040
vectorized::AggregationNode* _agg_node;
4141
};
4242

43-
class AggregationSourceOperatorTemplate : public OperatorTemplate {
43+
class AggregationSourceOperatorBuilder : public OperatorBuilder {
4444
public:
45-
AggregationSourceOperatorTemplate(int32_t, const std::string&, vectorized::AggregationNode*);
45+
AggregationSourceOperatorBuilder(int32_t, const std::string&, vectorized::AggregationNode*);
4646

4747
bool is_source() const override { return true; }
4848

‎be/src/pipeline/exec/exchange_sink_operator.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace doris::pipeline {
2626

27-
ExchangeSinkOperator::ExchangeSinkOperator(OperatorTemplate* operator_template,
27+
ExchangeSinkOperator::ExchangeSinkOperator(OperatorBuilder* operator_template,
2828
vectorized::VDataStreamSender* sink)
2929
: Operator(operator_template), _sink(sink) {}
3030

‎be/src/pipeline/exec/exchange_sink_operator.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SinkBuffer;
2828
// Now local exchange is not supported since VDataStreamRecvr is considered as a pipeline broker.
2929
class ExchangeSinkOperator : public Operator {
3030
public:
31-
ExchangeSinkOperator(OperatorTemplate* operator_template, vectorized::VDataStreamSender* sink);
31+
ExchangeSinkOperator(OperatorBuilder* operator_template, vectorized::VDataStreamSender* sink);
3232
~ExchangeSinkOperator() override;
3333
Status init(ExecNode* exec_node, RuntimeState* state = nullptr) override;
3434
Status init(const TDataSink& tsink) override;
@@ -50,11 +50,11 @@ class ExchangeSinkOperator : public Operator {
5050
RuntimeState* _state = nullptr;
5151
};
5252

53-
class ExchangeSinkOperatorTemplate : public OperatorTemplate {
53+
class ExchangeSinkOperatorBuilder : public OperatorBuilder {
5454
public:
55-
ExchangeSinkOperatorTemplate(int32_t id, const std::string& name, ExecNode* exec_node,
56-
vectorized::VDataStreamSender* sink)
57-
: OperatorTemplate(id, name, exec_node), _sink(sink) {}
55+
ExchangeSinkOperatorBuilder(int32_t id, const std::string& name, ExecNode* exec_node,
56+
vectorized::VDataStreamSender* sink)
57+
: OperatorBuilder(id, name, exec_node), _sink(sink) {}
5858

5959
bool is_sink() const override { return true; }
6060

‎be/src/pipeline/exec/exchange_source_operator.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace doris::pipeline {
2626

27-
ExchangeSourceOperator::ExchangeSourceOperator(OperatorTemplate* operator_template)
27+
ExchangeSourceOperator::ExchangeSourceOperator(OperatorBuilder* operator_template)
2828
: Operator(operator_template) {}
2929

3030
Status ExchangeSourceOperator::init(ExecNode* exec_node, RuntimeState* state) {

‎be/src/pipeline/exec/exchange_source_operator.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace doris::pipeline {
2727

2828
class ExchangeSourceOperator : public Operator {
2929
public:
30-
explicit ExchangeSourceOperator(OperatorTemplate* operator_template);
30+
explicit ExchangeSourceOperator(OperatorBuilder* operator_template);
3131
Status init(ExecNode* exec_node, RuntimeState* state = nullptr) override;
3232
Status prepare(RuntimeState* state) override;
3333
Status open(RuntimeState* state) override;
@@ -39,10 +39,10 @@ class ExchangeSourceOperator : public Operator {
3939
doris::vectorized::VExchangeNode* _exchange_node;
4040
};
4141

42-
class ExchangeSourceOperatorTemplate : public OperatorTemplate {
42+
class ExchangeSourceOperatorBuilder : public OperatorBuilder {
4343
public:
44-
ExchangeSourceOperatorTemplate(int32_t id, const std::string& name, ExecNode* exec_node)
45-
: OperatorTemplate(id, name, exec_node) {}
44+
ExchangeSourceOperatorBuilder(int32_t id, const std::string& name, ExecNode* exec_node)
45+
: OperatorBuilder(id, name, exec_node) {}
4646

4747
bool is_source() const override { return true; }
4848

‎be/src/pipeline/exec/olap_scan_operator.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace doris::pipeline {
2323

24-
OlapScanOperator::OlapScanOperator(OperatorTemplate* operator_template,
24+
OlapScanOperator::OlapScanOperator(OperatorBuilder* operator_template,
2525
doris::vectorized::NewOlapScanNode* scan_node)
2626
: ScanOperator(operator_template, scan_node) {}
2727

@@ -36,10 +36,10 @@ Status OlapScanOperator::prepare(RuntimeState* state) {
3636
return Status::OK();
3737
}
3838

39-
OlapScanOperatorTemplate::OlapScanOperatorTemplate(uint32_t id, const std::string& name,
40-
// TupleId o_tuple_id, int64_t limit_per_scanner,
41-
vectorized::NewOlapScanNode* new_olap_scan_node)
42-
: ScanOperatorTemplate(id, name, new_olap_scan_node),
39+
OlapScanOperatorBuilder::OlapScanOperatorBuilder(uint32_t id, const std::string& name,
40+
// TupleId o_tuple_id, int64_t limit_per_scanner,
41+
vectorized::NewOlapScanNode* new_olap_scan_node)
42+
: ScanOperatorBuilder(id, name, new_olap_scan_node),
4343
_new_olap_scan_node(new_olap_scan_node) {}
4444

4545
} // namespace doris::pipeline

‎be/src/pipeline/exec/olap_scan_operator.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ class NewOlapScanNode;
2727

2828
namespace doris::pipeline {
2929

30-
class OlapScanOperatorTemplate;
30+
class OlapScanOperatorBuilder;
3131
class OlapScanOperator : public ScanOperator {
3232
public:
33-
OlapScanOperator(OperatorTemplate* operator_template,
33+
OlapScanOperator(OperatorBuilder* operator_template,
3434
doris::vectorized::NewOlapScanNode* scan_node);
3535
Status prepare(RuntimeState* state) override;
3636
Status init(ExecNode* exec_node, RuntimeState* state) override;
3737
// Status open(RuntimeState* state) override; // NewOlapScanNode::_build_key_ranges_and_filters
3838
};
3939

40-
class OlapScanOperatorTemplate : public ScanOperatorTemplate {
40+
class OlapScanOperatorBuilder : public ScanOperatorBuilder {
4141
public:
42-
OlapScanOperatorTemplate(uint32_t id, const std::string& name,
43-
// TupleId o_tuple_id, int64_t limit_per_scanner,
44-
vectorized::NewOlapScanNode* new_olap_scan_node);
45-
// : ScanOperatorTemplate(id, name, dynamic_cast<ExecNode*>(new_olap_scan_node)),
42+
OlapScanOperatorBuilder(uint32_t id, const std::string& name,
43+
// TupleId o_tuple_id, int64_t limit_per_scanner,
44+
vectorized::NewOlapScanNode* new_olap_scan_node);
45+
// : ScanOperatorBuilder(id, name, dynamic_cast<ExecNode*>(new_olap_scan_node)),
4646
// _output_tuple_id(o_tuple_id), _limit_per_scanner(limit_per_scanner),
4747
// _new_olap_scan_node(new_olap_scan_node) {}
4848

0 commit comments

Comments
 (0)