/root/doris/be/src/exec/scan_node.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | // This file is copied from |
18 | | // https://github.com/apache/impala/blob/branch-2.9.0/be/src/exec/scan-node.cpp |
19 | | // and modified by Doris |
20 | | |
21 | | #include "exec/scan_node.h" |
22 | | |
23 | | #include <gen_cpp/Metrics_types.h> |
24 | | |
25 | | #include <memory> |
26 | | |
27 | | #include "vec/exprs/vexpr_context.h" |
28 | | #include "vec/utils/util.hpp" |
29 | | |
30 | | namespace doris { |
31 | | class RuntimeState; |
32 | | namespace vectorized { |
33 | | class VExpr; |
34 | | } // namespace vectorized |
35 | | |
36 | | const std::string ScanNode::_s_bytes_read_counter = "BytesRead"; |
37 | | const std::string ScanNode::_s_rows_read_counter = "RowsRead"; |
38 | | const std::string ScanNode::_s_total_throughput_counter = "TotalReadThroughput"; |
39 | | const std::string ScanNode::_s_num_disks_accessed_counter = "NumDiskAccess"; |
40 | | |
41 | 0 | Status ScanNode::prepare(RuntimeState* state) { |
42 | 0 | RETURN_IF_ERROR(ExecNode::prepare(state)); |
43 | | |
44 | 0 | _bytes_read_counter = ADD_COUNTER(runtime_profile(), _s_bytes_read_counter, TUnit::BYTES); |
45 | | //TODO: The _rows_read_counter == RowsReturned counter in exec node, there is no need to keep both of them |
46 | 0 | _rows_read_counter = ADD_COUNTER(runtime_profile(), _s_rows_read_counter, TUnit::UNIT); |
47 | | #ifndef BE_TEST |
48 | | _total_throughput_counter = |
49 | | runtime_profile()->add_rate_counter(_s_total_throughput_counter, _bytes_read_counter); |
50 | | #endif |
51 | 0 | _num_disks_accessed_counter = |
52 | 0 | ADD_COUNTER(runtime_profile(), _s_num_disks_accessed_counter, TUnit::UNIT); |
53 | |
|
54 | 0 | return Status::OK(); |
55 | 0 | } |
56 | | |
57 | | } // namespace doris |