YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/tserver/tablet_server_interface.h
Line
Count
Source
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_TSERVER_TABLET_SERVER_INTERFACE_H
15
#define YB_TSERVER_TABLET_SERVER_INTERFACE_H
16
17
#include <future>
18
19
#include "yb/client/client_fwd.h"
20
#include "yb/common/common_types.pb.h"
21
22
#include "yb/rpc/rpc_fwd.h"
23
#include "yb/master/master_heartbeat.fwd.h"
24
#include "yb/server/clock.h"
25
26
#include "yb/tablet/tablet_fwd.h"
27
28
#include "yb/tserver/tserver_util_fwd.h"
29
#include "yb/tserver/local_tablet_server.h"
30
31
namespace yb {
32
33
class MemTracker;
34
35
namespace tserver {
36
37
class TabletServerIf : public LocalTabletServer {
38
 public:
39
256
  virtual ~TabletServerIf() {}
40
41
  virtual TSTabletManager* tablet_manager() = 0;
42
  virtual TabletPeerLookupIf* tablet_peer_lookup() = 0;
43
44
  virtual server::Clock* Clock() = 0;
45
  virtual rpc::Publisher* GetPublisher() = 0;
46
47
  virtual void get_ysql_catalog_version(uint64_t* current_version,
48
                                        uint64_t* last_breaking_version) const = 0;
49
50
  virtual const scoped_refptr<MetricEntity>& MetricEnt() const = 0;
51
52
  virtual client::TransactionPool* TransactionPool() = 0;
53
54
  virtual const std::shared_future<client::YBClient*>& client_future() const = 0;
55
56
  virtual tserver::TServerSharedData& SharedObject() = 0;
57
58
  virtual CHECKED_STATUS GetLiveTServers(
59
      std::vector<master::TSInformationPB> *live_tservers) const = 0;
60
61
  virtual const std::shared_ptr<MemTracker>& mem_tracker() const = 0;
62
63
  virtual void SetPublisher(rpc::Publisher service) = 0;
64
65
73.9k
  client::YBClient* client() const {
66
73.9k
    return client_future().get();
67
73.9k
  }
68
};
69
70
} // namespace tserver
71
} // namespace yb
72
73
#endif // YB_TSERVER_TABLET_SERVER_INTERFACE_H