YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/ent/src/yb/master/cdc_rpc_tasks.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 ENT_SRC_YB_MASTER_CDC_RPC_TASKS_H
15
#define ENT_SRC_YB_MASTER_CDC_RPC_TASKS_H
16
17
#include <stdlib.h>
18
19
#include <google/protobuf/repeated_field.h>
20
21
#include "yb/common/entity_ids.h"
22
23
#include "yb/util/status_fwd.h"
24
#include "yb/util/net/net_util.h"
25
26
namespace yb {
27
namespace client {
28
29
class YBClient;
30
class YBTableName;
31
32
} // namespace client
33
34
namespace rpc {
35
36
class Messenger;
37
class SecureContext;
38
39
} // namespace rpc
40
41
namespace master {
42
43
class TableIdentifierPB;
44
class TabletLocationsPB;
45
46
class CDCRpcTasks {
47
 public:
48
  static Result<std::shared_ptr<CDCRpcTasks>> CreateWithMasterAddrs(
49
      const std::string& producer_id, const std::string& master_addrs);
50
51
  ~CDCRpcTasks();
52
53
  Result<google::protobuf::RepeatedPtrField<TabletLocationsPB>> GetTableLocations(
54
      const std::string& table_id);
55
  // Returns a list of (table id, table name).
56
  Result<std::vector<std::pair<TableId, client::YBTableName>>> ListTables();
57
0
  client::YBClient* client() const {
58
0
    return yb_client_.get();
59
0
  }
60
  Result<client::YBClient*> UpdateMasters(const std::string& master_addrs);
61
62
 private:
63
  std::unique_ptr<rpc::SecureContext> secure_context_;
64
  std::unique_ptr<rpc::Messenger> messenger_;
65
  std::unique_ptr<client::YBClient> yb_client_;
66
};
67
68
} // namespace master
69
} // namespace yb
70
71
72
#endif // ENT_SRC_YB_MASTER_CDC_RPC_TASKS_H