be/src/information_schema/schema_extensions_scanner.h
Line | Count | Source |
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 | | |
18 | | #pragma once |
19 | | |
20 | | #include <vector> |
21 | | |
22 | | #include "common/status.h" |
23 | | #include "information_schema/schema_scanner.h" |
24 | | |
25 | | namespace doris { |
26 | | class RuntimeState; |
27 | | class Block; |
28 | | |
29 | | // information_schema.extensions: kernel extension inventory of the currently |
30 | | // connected FE (extensions are per-FE local state, so the RPC targets the |
31 | | // connected FE instead of the master). |
32 | | class SchemaExtensionsScanner : public SchemaScanner { |
33 | | ENABLE_FACTORY_CREATOR(SchemaExtensionsScanner); |
34 | | |
35 | | public: |
36 | | SchemaExtensionsScanner(); |
37 | 6 | ~SchemaExtensionsScanner() override = default; |
38 | | |
39 | | Status start(RuntimeState* state) override; |
40 | | Status get_next_block_internal(Block* block, bool* eos) override; |
41 | | |
42 | | static std::vector<SchemaScanner::ColumnDesc> _s_tbls_columns; |
43 | | |
44 | | private: |
45 | | Status _get_extensions_block_from_fe(); |
46 | | |
47 | | TNetworkAddress _fe_addr; |
48 | | |
49 | | int _block_rows_limit = 4096; |
50 | | int _row_idx = 0; |
51 | | int _total_rows = 0; |
52 | | int _rpc_timeout_ms = 3000; |
53 | | std::unique_ptr<Block> _extensions_block = nullptr; |
54 | | }; |
55 | | |
56 | | } // namespace doris |