/Users/deen/code/yugabyte-db/src/yb/master/master_tserver.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_MASTER_MASTER_TSERVER_H |
15 | | #define YB_MASTER_MASTER_TSERVER_H |
16 | | |
17 | | #include <future> |
18 | | |
19 | | #include "yb/tserver/tablet_peer_lookup.h" |
20 | | #include "yb/tserver/tablet_server_interface.h" |
21 | | |
22 | | namespace yb { |
23 | | namespace master { |
24 | | |
25 | | class Master; |
26 | | |
27 | | // Master's version of a TabletServer which is required to support virtual tables in the Master. |
28 | | // This isn't really an actual server and is just a nice way of overriding the default tablet |
29 | | // server interface to support virtual tables. |
30 | | class MasterTabletServer : public tserver::TabletServerIf, |
31 | | public tserver::TabletPeerLookupIf { |
32 | | public: |
33 | | MasterTabletServer(Master* master, scoped_refptr<MetricEntity> metric_entity); |
34 | | tserver::TSTabletManager* tablet_manager() override; |
35 | | tserver::TabletPeerLookupIf* tablet_peer_lookup() override; |
36 | | |
37 | | server::Clock* Clock() override; |
38 | | const scoped_refptr<MetricEntity>& MetricEnt() const override; |
39 | 0 | rpc::Publisher* GetPublisher() override { return nullptr; } |
40 | | |
41 | | CHECKED_STATUS GetTabletPeer(const std::string& tablet_id, |
42 | | std::shared_ptr<tablet::TabletPeer>* tablet_peer) const override; |
43 | | |
44 | | CHECKED_STATUS GetTabletStatus(const tserver::GetTabletStatusRequestPB* req, |
45 | | tserver::GetTabletStatusResponsePB* resp) const override; |
46 | | |
47 | | bool LeaderAndReady(const TabletId& tablet_id, bool allow_stale = false) const override; |
48 | | |
49 | | const NodeInstancePB& NodeInstance() const override; |
50 | | |
51 | | CHECKED_STATUS GetRegistration(ServerRegistrationPB* reg) const override; |
52 | | |
53 | | CHECKED_STATUS StartRemoteBootstrap(const consensus::StartRemoteBootstrapRequestPB& req) override; |
54 | | |
55 | | void get_ysql_catalog_version(uint64_t* current_version, |
56 | | uint64_t* last_breaking_version) const override; |
57 | | |
58 | 0 | client::TransactionPool* TransactionPool() override { |
59 | 0 | return nullptr; |
60 | 0 | } |
61 | | |
62 | | tserver::TServerSharedData& SharedObject() override; |
63 | | |
64 | | const std::shared_future<client::YBClient*>& client_future() const override; |
65 | | |
66 | | CHECKED_STATUS GetLiveTServers( |
67 | | std::vector<master::TSInformationPB> *live_tservers) const override; |
68 | | |
69 | | const std::shared_ptr<MemTracker>& mem_tracker() const override; |
70 | | |
71 | | void SetPublisher(rpc::Publisher service) override; |
72 | | |
73 | | private: |
74 | | Master* master_ = nullptr; |
75 | | scoped_refptr<MetricEntity> metric_entity_; |
76 | | }; |
77 | | |
78 | | } // namespace master |
79 | | } // namespace yb |
80 | | #endif // YB_MASTER_MASTER_TSERVER_H |