YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/build/debugcov-clang-dynamic-arm64-ninja/src/yb/master/master_backup.service.h
Line
Count
Source (jump to first uncovered line)
1
// THIS FILE IS AUTOGENERATED FROM yb/master/master_backup.proto
2
3
#ifndef YB_MASTER_MASTER_BACKUP_SERVICE_IF_DOT_H
4
#define YB_MASTER_MASTER_BACKUP_SERVICE_IF_DOT_H
5
6
#include "yb/master/master_backup.pb.h"
7
8
#include <string>
9
10
#include "yb/rpc/rpc_fwd.h"
11
#include "yb/rpc/rpc_header.pb.h"
12
#include "yb/rpc/service_if.h"
13
14
#include "yb/util/monotime.h"
15
16
namespace yb {
17
class MetricEntity;
18
} // namespace yb
19
20
namespace yb {
21
namespace master {
22
23
enum class MasterBackupRpcMethodIndexes {
24
  kCreateSnapshot,
25
  kListSnapshots,
26
  kListSnapshotRestorations,
27
  kRestoreSnapshot,
28
  kDeleteSnapshot,
29
  kImportSnapshotMeta,
30
  kCreateSnapshotSchedule,
31
  kListSnapshotSchedules,
32
  kDeleteSnapshotSchedule,
33
}; // enum
34
35
class MasterBackupIf : public ::yb::rpc::ServiceIf {
36
 public:
37
  explicit MasterBackupIf(const scoped_refptr<MetricEntity>& entity);
38
  virtual ~MasterBackupIf();
39
  void Handle(::yb::rpc::InboundCallPtr call) override;
40
  void FillEndpoints(const ::yb::rpc::RpcServicePtr& service, ::yb::rpc::RpcEndpointMap* map) override;
41
  std::string service_name() const override;
42
  static std::string static_service_name();
43
44
  virtual void CreateSnapshot(
45
      const ::yb::master::CreateSnapshotRequestPB* req,
46
      ::yb::master::CreateSnapshotResponsePB* resp,
47
      ::yb::rpc::RpcContext context) = 0;
48
  virtual void ListSnapshots(
49
      const ::yb::master::ListSnapshotsRequestPB* req,
50
      ::yb::master::ListSnapshotsResponsePB* resp,
51
      ::yb::rpc::RpcContext context) = 0;
52
  virtual void ListSnapshotRestorations(
53
      const ::yb::master::ListSnapshotRestorationsRequestPB* req,
54
      ::yb::master::ListSnapshotRestorationsResponsePB* resp,
55
      ::yb::rpc::RpcContext context) = 0;
56
  virtual void RestoreSnapshot(
57
      const ::yb::master::RestoreSnapshotRequestPB* req,
58
      ::yb::master::RestoreSnapshotResponsePB* resp,
59
      ::yb::rpc::RpcContext context) = 0;
60
  virtual void DeleteSnapshot(
61
      const ::yb::master::DeleteSnapshotRequestPB* req,
62
      ::yb::master::DeleteSnapshotResponsePB* resp,
63
      ::yb::rpc::RpcContext context) = 0;
64
  virtual void ImportSnapshotMeta(
65
      const ::yb::master::ImportSnapshotMetaRequestPB* req,
66
      ::yb::master::ImportSnapshotMetaResponsePB* resp,
67
      ::yb::rpc::RpcContext context) = 0;
68
  virtual void CreateSnapshotSchedule(
69
      const ::yb::master::CreateSnapshotScheduleRequestPB* req,
70
      ::yb::master::CreateSnapshotScheduleResponsePB* resp,
71
      ::yb::rpc::RpcContext context) = 0;
72
  virtual void ListSnapshotSchedules(
73
      const ::yb::master::ListSnapshotSchedulesRequestPB* req,
74
      ::yb::master::ListSnapshotSchedulesResponsePB* resp,
75
      ::yb::rpc::RpcContext context) = 0;
76
  virtual void DeleteSnapshotSchedule(
77
      const ::yb::master::DeleteSnapshotScheduleRequestPB* req,
78
      ::yb::master::DeleteSnapshotScheduleResponsePB* resp,
79
      ::yb::rpc::RpcContext context) = 0;
80
  
81
0
  ::yb::rpc::RpcMethodMetrics GetMetric(MasterBackupRpcMethodIndexes index) {
82
0
    return methods_[static_cast<size_t>(index)].metrics;
83
0
  }
84
85
 private:
86
  static const int kMethodCount = 9;
87
88
  // Pre-initialize metrics because calling METRIC_foo.Instantiate() is expensive.
89
  void InitMethods(const scoped_refptr<MetricEntity>& ent);
90
91
  ::yb::rpc::RpcMethodDesc methods_[kMethodCount];
92
};
93
94
} // namespace master
95
} // namespace yb
96
97
#endif