1 | #pragma once |
---|---|
2 | |
3 | #include <ext/shared_ptr_helper.h> |
4 | #include <Storages/IStorage.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | |
10 | class Context; |
11 | |
12 | |
13 | /** Implements `replicas` system table, which provides information about the status of the replicated tables. |
14 | */ |
15 | class StorageSystemReplicas : public ext::shared_ptr_helper<StorageSystemReplicas>, public IStorage |
16 | { |
17 | friend struct ext::shared_ptr_helper<StorageSystemReplicas>; |
18 | public: |
19 | std::string getName() const override { return "SystemReplicas"; } |
20 | std::string getTableName() const override { return name; } |
21 | std::string getDatabaseName() const override { return "system"; } |
22 | |
23 | BlockInputStreams read( |
24 | const Names & column_names, |
25 | const SelectQueryInfo & query_info, |
26 | const Context & context, |
27 | QueryProcessingStage::Enum processed_stage, |
28 | size_t max_block_size, |
29 | unsigned num_streams) override; |
30 | |
31 | private: |
32 | const std::string name; |
33 | |
34 | protected: |
35 | StorageSystemReplicas(const std::string & name_); |
36 | }; |
37 | |
38 | } |
39 |