YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/rpc/proxy_context.h
Line
Count
Source
1
//
2
// Copyright (c) YugaByte, Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
// in compliance with the License.  You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software distributed under the License
10
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
// or implied.  See the License for the specific language governing permissions and limitations
12
// under the License.
13
//
14
//
15
16
#ifndef YB_RPC_PROXY_CONTEXT_H
17
#define YB_RPC_PROXY_CONTEXT_H
18
19
#include "yb/rpc/rpc_fwd.h"
20
21
#include "yb/util/metrics_fwd.h"
22
#include "yb/util/net/net_fwd.h"
23
24
namespace yb {
25
26
class MemTracker;
27
28
namespace rpc {
29
30
class ProxyContext {
31
 public:
32
  virtual scoped_refptr<MetricEntity> metric_entity() const = 0;
33
34
  // Queue a call for transmission. This will pick the appropriate reactor, and enqueue a task on
35
  // that reactor to assign and send the call.
36
  virtual void QueueOutboundCall(OutboundCallPtr call) = 0;
37
38
  virtual void Handle(InboundCallPtr call, Queue queue) = 0;
39
40
  virtual const Protocol* DefaultProtocol() = 0;
41
42
  virtual ThreadPool& CallbackThreadPool(ServicePriority priority = ServicePriority::kNormal) = 0;
43
44
  virtual IoService& io_service() = 0;
45
46
  virtual DnsResolver& resolver() = 0;
47
48
  virtual const std::shared_ptr<RpcMetrics>& rpc_metrics() = 0;
49
50
  virtual const std::shared_ptr<MemTracker>& parent_mem_tracker() = 0;
51
52
  // Number of connections to create per destination address.
53
  virtual int num_connections_to_server() const = 0;
54
55
8.69k
  virtual ~ProxyContext() {}
56
};
57
58
} // namespace rpc
59
} // namespace yb
60
61
#endif // YB_RPC_PROXY_CONTEXT_H