YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/rpc/lightweight_message.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_RPC_LIGHTWEIGHT_MESSAGE_H
15
#define YB_RPC_LIGHTWEIGHT_MESSAGE_H
16
17
#include <google/protobuf/io/coded_stream.h>
18
#include <google/protobuf/wire_format_lite.h>
19
20
#include "yb/gutil/casts.h"
21
22
#include "yb/rpc/serialization.h"
23
24
#include "yb/util/memory/arena.h"
25
#include "yb/util/status.h"
26
27
namespace yb {
28
namespace rpc {
29
30
class LightweightMessage {
31
 public:
32
5
  virtual ~LightweightMessage() = default;
33
34
  virtual CHECKED_STATUS ParseFromCodedStream(google::protobuf::io::CodedInputStream* cis) = 0;
35
  virtual size_t SerializedSize() const = 0;
36
  virtual uint8_t* SerializeToArray(uint8_t* out) const = 0;
37
  virtual void AppendToDebugString(std::string* out) const = 0;
38
  virtual void Clear() = 0;
39
40
  CHECKED_STATUS ParseFromSlice(const Slice& slice);
41
42
0
  size_t SpaceUsedLong() const {
43
0
    return SerializedSize(); // TODO(LW)
44
0
  }
45
46
  std::string ShortDebugString() const;
47
  std::string SerializeAsString() const;
48
};
49
50
template <class MsgPtr, class LWMsgPtr>
51
class AnyMessagePtrBase {
52
 public:
53
10.8M
  AnyMessagePtrBase() : message_(0) {}
54
243M
  explicit AnyMessagePtrBase(MsgPtr message) : message_(reinterpret_cast<size_t>(message)) {}
yb::rpc::AnyMessagePtrBase<google::protobuf::Message const*, yb::rpc::LightweightMessage const*>::AnyMessagePtrBase(google::protobuf::Message const*)
Line
Count
Source
54
157M
  explicit AnyMessagePtrBase(MsgPtr message) : message_(reinterpret_cast<size_t>(message)) {}
yb::rpc::AnyMessagePtrBase<google::protobuf::Message*, yb::rpc::LightweightMessage*>::AnyMessagePtrBase(google::protobuf::Message*)
Line
Count
Source
54
86.3M
  explicit AnyMessagePtrBase(MsgPtr message) : message_(reinterpret_cast<size_t>(message)) {}
55
  explicit AnyMessagePtrBase(LWMsgPtr message)
56
1
      : message_(message ? reinterpret_cast<size_t>(message) | 1 : 0) {
57
1
  }
yb::rpc::AnyMessagePtrBase<google::protobuf::Message const*, yb::rpc::LightweightMessage const*>::AnyMessagePtrBase(yb::rpc::LightweightMessage const*)
Line
Count
Source
56
1
      : message_(message ? reinterpret_cast<size_t>(message) | 1 : 0) {
57
1
  }
Unexecuted instantiation: yb::rpc::AnyMessagePtrBase<google::protobuf::Message*, yb::rpc::LightweightMessage*>::AnyMessagePtrBase(yb::rpc::LightweightMessage*)
58
59
1.06G
  bool is_lightweight() const {
60
1.06G
    return message_ & 1;
61
1.06G
  }
yb::rpc::AnyMessagePtrBase<google::protobuf::Message*, yb::rpc::LightweightMessage*>::is_lightweight() const
Line
Count
Source
59
176M
  bool is_lightweight() const {
60
176M
    return message_ & 1;
61
176M
  }
yb::rpc::AnyMessagePtrBase<google::protobuf::Message const*, yb::rpc::LightweightMessage const*>::is_lightweight() const
Line
Count
Source
59
889M
  bool is_lightweight() const {
60
889M
    return message_ & 1;
61
889M
  }
62
63
3
  LWMsgPtr lightweight() const {
64
3
    DCHECK(is_lightweight());
65
3
    return reinterpret_cast<LWMsgPtr>(message_ ^ 1);
66
3
  }
Unexecuted instantiation: yb::rpc::AnyMessagePtrBase<google::protobuf::Message*, yb::rpc::LightweightMessage*>::lightweight() const
yb::rpc::AnyMessagePtrBase<google::protobuf::Message const*, yb::rpc::LightweightMessage const*>::lightweight() const
Line
Count
Source
63
3
  LWMsgPtr lightweight() const {
64
3
    DCHECK(is_lightweight());
65
3
    return reinterpret_cast<LWMsgPtr>(message_ ^ 1);
66
3
  }
67
68
543M
  MsgPtr protobuf() const {
69
543M
    DCHECK(!is_lightweight());
70
543M
    return reinterpret_cast<MsgPtr>(message_);
71
543M
  }
yb::rpc::AnyMessagePtrBase<google::protobuf::Message*, yb::rpc::LightweightMessage*>::protobuf() const
Line
Count
Source
68
93.5M
  MsgPtr protobuf() const {
69
93.5M
    DCHECK(!is_lightweight());
70
93.5M
    return reinterpret_cast<MsgPtr>(message_);
71
93.5M
  }
yb::rpc::AnyMessagePtrBase<google::protobuf::Message const*, yb::rpc::LightweightMessage const*>::protobuf() const
Line
Count
Source
68
450M
  MsgPtr protobuf() const {
69
450M
    DCHECK(!is_lightweight());
70
450M
    return reinterpret_cast<MsgPtr>(message_);
71
450M
  }
72
73
10.8M
  size_t impl() const {
74
10.8M
    return message_;
75
10.8M
  }
76
77
 protected:
78
93.0M
  friend bool operator==(AnyMessagePtrBase lhs, std::nullptr_t) {
79
93.0M
    return lhs.message_ == 0;
80
93.0M
  }
81
82
10.8M
  explicit AnyMessagePtrBase(size_t message) : message_(message) {}
83
84
  size_t message_;
85
};
86
87
class AnyMessagePtr : public AnyMessagePtrBase<google::protobuf::Message*, LightweightMessage*> {
88
 public:
89
  template <class... Args>
90
172M
  explicit AnyMessagePtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessagePtr::AnyMessagePtr<yb::rpc::AnyMessagePtr&>(yb::rpc::AnyMessagePtr&)
Line
Count
Source
90
86.4M
  explicit AnyMessagePtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessagePtr::AnyMessagePtr<google::protobuf::Message*&>(google::protobuf::Message*&)
Line
Count
Source
90
86.3M
  explicit AnyMessagePtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
Unexecuted instantiation: yb::rpc::AnyMessagePtr::AnyMessagePtr<yb::rpc::LightweightMessage*&>(yb::rpc::LightweightMessage*&)
91
92
86.4M
  void operator=(std::nullptr_t) {
93
86.4M
    message_ = 0;
94
86.4M
  }
95
96
  CHECKED_STATUS ParseFromSlice(const Slice& slice);
97
};
98
99
class AnyMessageConstPtr : public AnyMessagePtrBase<
100
    const google::protobuf::Message*, const LightweightMessage*> {
101
 public:
102
  template <class... Args>
103
168M
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<>()
Line
Count
Source
103
10.8M
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<google::protobuf::Message const*>(google::protobuf::Message const*&&)
Line
Count
Source
103
86.4M
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
Unexecuted instantiation: yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc::LightweightMessage const*>(yb::rpc::LightweightMessage const*&&)
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<google::protobuf::Message*>(google::protobuf::Message*&&)
Line
Count
Source
103
70.3M
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc::LightweightMessage*>(yb::rpc::LightweightMessage*&&)
Line
Count
Source
103
1
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc::ErrorStatusPB*>(yb::rpc::ErrorStatusPB*&&)
Line
Count
Source
103
272k
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc_test::AddResponsePB*>(yb::rpc_test::AddResponsePB*&&)
Line
Count
Source
103
818
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc_test::SendStringsResponsePB*>(yb::rpc_test::SendStringsResponsePB*&&)
Line
Count
Source
103
3
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc_test::SleepResponsePB*>(yb::rpc_test::SleepResponsePB*&&)
Line
Count
Source
103
4
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
yb::rpc::AnyMessageConstPtr::AnyMessageConstPtr<yb::rpc_test::EchoResponsePB*>(yb::rpc_test::EchoResponsePB*&&)
Line
Count
Source
103
261k
  explicit AnyMessageConstPtr(Args&&... args) : AnyMessagePtrBase(std::forward<Args>(args)...) {}
104
105
  AnyMessageConstPtr(const AnyMessagePtr& rhs) // NOLINT
106
10.8M
      : AnyMessagePtrBase(rhs.impl()) {
107
10.8M
  }
108
109
  size_t SerializedSize() const;
110
111
  Result<uint8_t*> SerializeToArray(uint8_t* out) const;
112
};
113
114
template <google::protobuf::internal::WireFormatLite::FieldType type, class T>
115
class LightweightSerialization {
116
 public:
117
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t);
118
  static uint8_t* Write(T value, uint8_t* out);
119
  static size_t Size(T value);
120
};
121
122
template <class T>
123
class LightweightSerialization<google::protobuf::internal::WireFormatLite::TYPE_ENUM, T> {
124
 public:
125
  using Impl = LightweightSerialization<
126
      google::protobuf::internal::WireFormatLite::TYPE_UINT32, uint32_t>;
127
128
1
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
129
1
    uint32_t temp;
130
1
    if (!Impl::Read(input, &temp)) {
131
0
      return false;
132
0
    }
133
1
    *t = static_cast<T>(temp);
134
1
    return true;
135
1
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc::ErrorStatusPB_RpcErrorCodePB>::Read(google::protobuf::io::CodedInputStream*, yb::rpc::ErrorStatusPB_RpcErrorCodePB*)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc_test::LightweightEnum>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LightweightEnum*)
Line
Count
Source
128
1
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
129
1
    uint32_t temp;
130
1
    if (!Impl::Read(input, &temp)) {
131
0
      return false;
132
0
    }
133
1
    *t = static_cast<T>(temp);
134
1
    return true;
135
1
  }
136
137
1
  static uint8_t* Write(T value, uint8_t* out) {
138
1
    return Impl::Write(value, out);
139
1
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc::ErrorStatusPB_RpcErrorCodePB>::Write(yb::rpc::ErrorStatusPB_RpcErrorCodePB, unsigned char*)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc_test::LightweightEnum>::Write(yb::rpc_test::LightweightEnum, unsigned char*)
Line
Count
Source
137
1
  static uint8_t* Write(T value, uint8_t* out) {
138
1
    return Impl::Write(value, out);
139
1
  }
140
141
2
  static size_t Size(T value) {
142
2
    return Impl::Size(value);
143
2
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc::ErrorStatusPB_RpcErrorCodePB>::Size(yb::rpc::ErrorStatusPB_RpcErrorCodePB)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc_test::LightweightEnum>::Size(yb::rpc_test::LightweightEnum)
Line
Count
Source
141
2
  static size_t Size(T value) {
142
2
    return Impl::Size(value);
143
2
  }
144
};
145
146
template <class T>
147
class LightweightSerialization<google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, T> {
148
 public:
149
  using Impl = LightweightSerialization<
150
      google::protobuf::internal::WireFormatLite::TYPE_UINT32, uint32_t>;
151
152
35
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
153
35
    int length;
154
35
    if (!input->ReadVarintSizeAsInt(&length)) {
155
0
      return false;
156
0
    }
157
35
    auto p = input->IncrementRecursionDepthAndPushLimit(length);
158
35
    if (p.second < 0 || !t->ParseFromCodedStream(input).ok()) {
159
0
      return false;
160
0
    }
161
35
    return input->DecrementRecursionDepthAndPopLimit(p.first);
162
35
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWRemoteMethodPB>::Read(google::protobuf::io::CodedInputStream*, yb::rpc::LWRemoteMethodPB*)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LWLightweightSubMessagePB*)
Line
Count
Source
152
11
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
153
11
    int length;
154
11
    if (!input->ReadVarintSizeAsInt(&length)) {
155
0
      return false;
156
0
    }
157
11
    auto p = input->IncrementRecursionDepthAndPushLimit(length);
158
11
    if (p.second < 0 || !t->ParseFromCodedStream(input).ok()) {
159
0
      return false;
160
0
    }
161
11
    return input->DecrementRecursionDepthAndPopLimit(p.first);
162
11
  }
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LWLightweightPairPB*)
Line
Count
Source
152
13
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
153
13
    int length;
154
13
    if (!input->ReadVarintSizeAsInt(&length)) {
155
0
      return false;
156
0
    }
157
13
    auto p = input->IncrementRecursionDepthAndPushLimit(length);
158
13
    if (p.second < 0 || !t->ParseFromCodedStream(input).ok()) {
159
0
      return false;
160
0
    }
161
13
    return input->DecrementRecursionDepthAndPopLimit(p.first);
162
13
  }
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse*)
Line
Count
Source
152
11
  static bool Read(google::protobuf::io::CodedInputStream* input, T* t) {
153
11
    int length;
154
11
    if (!input->ReadVarintSizeAsInt(&length)) {
155
0
      return false;
156
0
    }
157
11
    auto p = input->IncrementRecursionDepthAndPushLimit(length);
158
11
    if (p.second < 0 || !t->ParseFromCodedStream(input).ok()) {
159
0
      return false;
160
0
    }
161
11
    return input->DecrementRecursionDepthAndPopLimit(p.first);
162
11
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWAny>::Read(google::protobuf::io::CodedInputStream*, yb::rpc::LWAny*)
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse*)
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWTrivialErrorPB>::Read(google::protobuf::io::CodedInputStream*, yb::rpc_test::LWTrivialErrorPB*)
163
164
41
  static uint8_t* Write(const T& value, uint8_t* out) {
165
41
    out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
166
41
        narrow_cast<uint32_t>(value.cached_size()), out);
167
41
    return value.SerializeToArray(out);
168
41
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWRemoteMethodPB>::Write(yb::rpc::LWRemoteMethodPB const&, unsigned char*)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>::Write(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
164
17
  static uint8_t* Write(const T& value, uint8_t* out) {
165
17
    out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
166
17
        narrow_cast<uint32_t>(value.cached_size()), out);
167
17
    return value.SerializeToArray(out);
168
17
  }
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>::Write(yb::rpc_test::LWLightweightPairPB const&, unsigned char*)
Line
Count
Source
164
13
  static uint8_t* Write(const T& value, uint8_t* out) {
165
13
    out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
166
13
        narrow_cast<uint32_t>(value.cached_size()), out);
167
13
    return value.SerializeToArray(out);
168
13
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::Write(yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&, unsigned char*)
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWAny>::Write(yb::rpc::LWAny const&, unsigned char*)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::Write(yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&, unsigned char*)
Line
Count
Source
164
11
  static uint8_t* Write(const T& value, uint8_t* out) {
165
11
    out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
166
11
        narrow_cast<uint32_t>(value.cached_size()), out);
167
11
    return value.SerializeToArray(out);
168
11
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWTrivialErrorPB>::Write(yb::rpc_test::LWTrivialErrorPB const&, unsigned char*)
169
170
82
  static size_t Size(const T& value) {
171
82
    size_t size = value.SerializedSize();
172
82
    return google::protobuf::io::CodedOutputStream::VarintSize32(narrow_cast<uint32_t>(size))
173
82
           + size;
174
82
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWRemoteMethodPB>::Size(yb::rpc::LWRemoteMethodPB const&)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>::Size(yb::rpc_test::LWLightweightSubMessagePB const&)
Line
Count
Source
170
34
  static size_t Size(const T& value) {
171
34
    size_t size = value.SerializedSize();
172
34
    return google::protobuf::io::CodedOutputStream::VarintSize32(narrow_cast<uint32_t>(size))
173
34
           + size;
174
34
  }
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>::Size(yb::rpc_test::LWLightweightPairPB const&)
Line
Count
Source
170
26
  static size_t Size(const T& value) {
171
26
    size_t size = value.SerializedSize();
172
26
    return google::protobuf::io::CodedOutputStream::VarintSize32(narrow_cast<uint32_t>(size))
173
26
           + size;
174
26
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>::Size(yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&)
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWAny>::Size(yb::rpc::LWAny const&)
yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>::Size(yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&)
Line
Count
Source
170
22
  static size_t Size(const T& value) {
171
22
    size_t size = value.SerializedSize();
172
22
    return google::protobuf::io::CodedOutputStream::VarintSize32(narrow_cast<uint32_t>(size))
173
22
           + size;
174
22
  }
Unexecuted instantiation: yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWTrivialErrorPB>::Size(yb::rpc_test::LWTrivialErrorPB const&)
175
};
176
177
CHECKED_STATUS ParseFailed(const char* field_name);
178
179
template <class Serialization, size_t TagSize, class Value>
180
80
inline size_t RepeatedSize(const Value& value) {
181
80
  size_t result = TagSize * value.size();
182
938
  for (const auto& entry : value) {
183
938
    result += Serialization::Size(entry);
184
938
  }
185
80
  return result;
186
80
}
Unexecuted instantiation: unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 1ul, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&)
Unexecuted instantiation: unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 1ul, std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > const&)
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)17, int>, 1ul, std::__1::vector<int, yb::internal::ArenaAllocatorBase<int, yb::internal::ArenaTraits> > >(std::__1::vector<int, yb::internal::ArenaAllocatorBase<int, yb::internal::ArenaTraits> > const&)
Line
Count
Source
180
34
inline size_t RepeatedSize(const Value& value) {
181
34
  size_t result = TagSize * value.size();
182
442
  for (const auto& entry : value) {
183
442
    result += Serialization::Size(entry);
184
442
  }
185
34
  return result;
186
34
}
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 1ul, std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > >(std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > const&)
Line
Count
Source
180
34
inline size_t RepeatedSize(const Value& value) {
181
34
  size_t result = TagSize * value.size();
182
374
  for (const auto& entry : value) {
183
374
    result += Serialization::Size(entry);
184
374
  }
185
34
  return result;
186
34
}
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 2ul, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&)
Line
Count
Source
180
2
inline size_t RepeatedSize(const Value& value) {
181
2
  size_t result = TagSize * value.size();
182
40
  for (const auto& entry : value) {
183
40
    result += Serialization::Size(entry);
184
40
  }
185
2
  return result;
186
2
}
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 2ul, std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > >(std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > const&)
Line
Count
Source
180
2
inline size_t RepeatedSize(const Value& value) {
181
2
  size_t result = TagSize * value.size();
182
14
  for (const auto& entry : value) {
183
14
    result += Serialization::Size(entry);
184
14
  }
185
2
  return result;
186
2
}
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 2ul, yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> >(yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> const&)
Line
Count
Source
180
4
inline size_t RepeatedSize(const Value& value) {
181
4
  size_t result = TagSize * value.size();
182
20
  for (const auto& entry : value) {
183
20
    result += Serialization::Size(entry);
184
20
  }
185
4
  return result;
186
4
}
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>, 2ul, yb::ArenaList<yb::rpc_test::LWLightweightPairPB> >(yb::ArenaList<yb::rpc_test::LWLightweightPairPB> const&)
Line
Count
Source
180
2
inline size_t RepeatedSize(const Value& value) {
181
2
  size_t result = TagSize * value.size();
182
26
  for (const auto& entry : value) {
183
26
    result += Serialization::Size(entry);
184
26
  }
185
2
  return result;
186
2
}
Unexecuted instantiation: unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>, 2ul, yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> >(yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> const&)
unsigned long yb::rpc::RepeatedSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>, 2ul, yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> >(yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> const&)
Line
Count
Source
180
2
inline size_t RepeatedSize(const Value& value) {
181
2
  size_t result = TagSize * value.size();
182
22
  for (const auto& entry : value) {
183
22
    result += Serialization::Size(entry);
184
22
  }
185
2
  return result;
186
2
}
187
188
template <class Serialization, size_t TagSize, class Value>
189
164
inline size_t SingleSize(const Value& value) {
190
164
  return TagSize + Serialization::Size(value);
191
164
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 1ul, yb::Slice>(yb::Slice const&)
Line
Count
Source
189
110
inline size_t SingleSize(const Value& value) {
190
110
  return TagSize + Serialization::Size(value);
191
110
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 1ul, yb::Slice>(yb::Slice const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)5, int>, 1ul, int>(int const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
Unexecuted instantiation: unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWRemoteMethodPB>, 1ul, yb::rpc::LWRemoteMethodPB>(yb::rpc::LWRemoteMethodPB const&)
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 1ul, unsigned int>(unsigned int const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
Unexecuted instantiation: unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc::ErrorStatusPB_RpcErrorCodePB>, 1ul, yb::rpc::ErrorStatusPB_RpcErrorCodePB>(yb::rpc::ErrorStatusPB_RpcErrorCodePB const&)
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 1ul, unsigned long long>(unsigned long long const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 1ul, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&)
Line
Count
Source
189
10
inline size_t SingleSize(const Value& value) {
190
10
  return TagSize + Serialization::Size(value);
191
10
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)3, long long>, 1ul, long long>(long long const&)
Line
Count
Source
189
24
inline size_t SingleSize(const Value& value) {
190
24
  return TagSize + Serialization::Size(value);
191
24
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc_test::LightweightEnum>, 1ul, yb::rpc_test::LightweightEnum>(yb::rpc_test::LightweightEnum const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)17, int>, 1ul, int>(int const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)18, long long>, 1ul, long long>(long long const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 2ul, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&)
Line
Count
Source
189
4
inline size_t SingleSize(const Value& value) {
190
4
  return TagSize + Serialization::Size(value);
191
4
}
Unexecuted instantiation: unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWAny>, 2ul, yb::rpc::LWAny>(yb::rpc::LWAny const&)
unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 2ul, yb::Slice>(yb::Slice const&)
Line
Count
Source
189
2
inline size_t SingleSize(const Value& value) {
190
2
  return TagSize + Serialization::Size(value);
191
2
}
Unexecuted instantiation: unsigned long yb::rpc::SingleSize<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWTrivialErrorPB>, 1ul, yb::rpc_test::LWTrivialErrorPB>(yb::rpc_test::LWTrivialErrorPB const&)
192
193
template <class Serialization, uint32_t Tag, class Value>
194
584
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
584
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
584
  return Serialization::Write(value, out);
197
584
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 10u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
24
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
24
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
24
  return Serialization::Write(value, out);
197
24
}
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 18u, yb::Slice>(yb::Slice const&, unsigned char*)
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 18u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
13
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
13
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
13
  return Serialization::Write(value, out);
197
13
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)5, int>, 8u, int>(int const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWRemoteMethodPB>, 18u, yb::rpc::LWRemoteMethodPB>(yb::rpc::LWRemoteMethodPB const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 24u, unsigned int>(unsigned int const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)8, bool>, 16u, bool>(bool const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc::ErrorStatusPB_RpcErrorCodePB>, 16u, yb::rpc::ErrorStatusPB_RpcErrorCodePB>(yb::rpc::ErrorStatusPB_RpcErrorCodePB const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 8u, unsigned int>(unsigned int const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 16u, unsigned int>(unsigned int const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)8, bool>, 24u, bool>(bool const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)8, bool>, 32u, bool>(bool const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 16u, unsigned long long>(unsigned long long const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 8u, unsigned long long>(unsigned long long const&, unsigned char*)
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)15, int>, 13u, int>(int const&, unsigned char*)
Line
Count
Source
194
17
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
17
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
17
  return Serialization::Write(value, out);
197
17
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)17, int>, 16u, int>(int const&, unsigned char*)
Line
Count
Source
194
221
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
221
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
221
  return Serialization::Write(value, out);
197
221
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 26u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
17
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
17
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
17
  return Serialization::Write(value, out);
197
17
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 34u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
187
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
187
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
187
  return Serialization::Write(value, out);
197
187
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 42u, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
194
5
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
5
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
5
  return Serialization::Write(value, out);
197
5
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)3, long long>, 16u, long long>(long long const&, unsigned char*)
Line
Count
Source
194
12
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
12
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
12
  return Serialization::Write(value, out);
197
12
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)7, unsigned int>, 29u, unsigned int>(unsigned int const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)6, unsigned long long>, 33u, unsigned long long>(unsigned long long const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 40u, unsigned int>(unsigned int const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 48u, unsigned long long>(unsigned long long const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)2, float>, 61u, float>(float const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)1, double>, 65u, double>(double const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 74u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 82u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)14, yb::rpc_test::LightweightEnum>, 88u, yb::rpc_test::LightweightEnum>(yb::rpc_test::LightweightEnum const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)15, int>, 101u, int>(int const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)16, long long>, 105u, long long>(long long const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)17, int>, 112u, int>(int const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)18, long long>, 120u, long long>(long long const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 128u, unsigned int>(unsigned int const&, unsigned char*)
Line
Count
Source
194
20
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
20
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
20
  return Serialization::Write(value, out);
197
20
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)7, unsigned int>, 141u, unsigned int>(unsigned int const&, unsigned char*)
Line
Count
Source
194
10
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
10
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
10
  return Serialization::Write(value, out);
197
10
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 146u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
7
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
7
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
7
  return Serialization::Write(value, out);
197
7
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 154u, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 162u, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
194
5
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
5
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
5
  return Serialization::Write(value, out);
197
5
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>, 186u, yb::rpc_test::LWLightweightPairPB>(yb::rpc_test::LWLightweightPairPB const&, unsigned char*)
Line
Count
Source
194
13
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
13
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
13
  return Serialization::Write(value, out);
197
13
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 194u, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>, 202u, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>(yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc::LWAny>, 210u, yb::rpc::LWAny>(yb::rpc::LWAny const&, unsigned char*)
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 962u, yb::rpc_test::LWLightweightSubMessagePB>(yb::rpc_test::LWLightweightSubMessagePB const&, unsigned char*)
Line
Count
Source
194
5
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
5
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
5
  return Serialization::Write(value, out);
197
5
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>, 202u, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>(yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse const&, unsigned char*)
Line
Count
Source
194
11
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
11
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
11
  return Serialization::Write(value, out);
197
11
}
unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 802u, yb::Slice>(yb::Slice const&, unsigned char*)
Line
Count
Source
194
1
inline uint8_t* SingleWrite(const Value& value, uint8_t* out) {
195
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
196
1
  return Serialization::Write(value, out);
197
1
}
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWTrivialErrorPB>, 10u, yb::rpc_test::LWTrivialErrorPB>(yb::rpc_test::LWTrivialErrorPB const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)5, int>, 16u, int>(int const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::SingleWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)3, long long>, 8u, long long>(long long const&, unsigned char*)
198
199
template <class Serialization, uint32_t Tag, class Value>
200
41
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
479
  for (const auto& entry : value) {
202
479
    out = SingleWrite<Serialization, Tag>(entry, out);
203
479
  }
204
41
  return out;
205
41
}
Unexecuted instantiation: unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 24u, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 16u, std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > const&, unsigned char*)
Unexecuted instantiation: unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 8u, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&, unsigned char*)
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)17, int>, 16u, std::__1::vector<int, yb::internal::ArenaAllocatorBase<int, yb::internal::ArenaTraits> > >(std::__1::vector<int, yb::internal::ArenaAllocatorBase<int, yb::internal::ArenaTraits> > const&, unsigned char*)
Line
Count
Source
200
17
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
221
  for (const auto& entry : value) {
202
221
    out = SingleWrite<Serialization, Tag>(entry, out);
203
221
  }
204
17
  return out;
205
17
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)12, yb::Slice>, 34u, std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > >(std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > const&, unsigned char*)
Line
Count
Source
200
17
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
187
  for (const auto& entry : value) {
202
187
    out = SingleWrite<Serialization, Tag>(entry, out);
203
187
  }
204
17
  return out;
205
17
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)13, unsigned int>, 128u, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
20
  for (const auto& entry : value) {
202
20
    out = SingleWrite<Serialization, Tag>(entry, out);
203
20
  }
204
1
  return out;
205
1
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)7, unsigned int>, 141u, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
10
  for (const auto& entry : value) {
202
10
    out = SingleWrite<Serialization, Tag>(entry, out);
203
10
  }
204
1
  return out;
205
1
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)9, yb::Slice>, 146u, std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > >(std::__1::vector<yb::Slice, yb::internal::ArenaAllocatorBase<yb::Slice, yb::internal::ArenaTraits> > const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
7
  for (const auto& entry : value) {
202
7
    out = SingleWrite<Serialization, Tag>(entry, out);
203
7
  }
204
1
  return out;
205
1
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 162u, yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> >(yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
5
  for (const auto& entry : value) {
202
5
    out = SingleWrite<Serialization, Tag>(entry, out);
203
5
  }
204
1
  return out;
205
1
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightPairPB>, 186u, yb::ArenaList<yb::rpc_test::LWLightweightPairPB> >(yb::ArenaList<yb::rpc_test::LWLightweightPairPB> const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
13
  for (const auto& entry : value) {
202
13
    out = SingleWrite<Serialization, Tag>(entry, out);
203
13
  }
204
1
  return out;
205
1
}
Unexecuted instantiation: unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse>, 202u, yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> >(yb::ArenaList<yb::rpc_test::LWLightweightRequestPB_LWMapEntry_DoNotUse> const&, unsigned char*)
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightSubMessagePB>, 962u, yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> >(yb::ArenaList<yb::rpc_test::LWLightweightSubMessagePB> const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
5
  for (const auto& entry : value) {
202
5
    out = SingleWrite<Serialization, Tag>(entry, out);
203
5
  }
204
1
  return out;
205
1
}
unsigned char* yb::rpc::RepeatedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)11, yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse>, 202u, yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> >(yb::ArenaList<yb::rpc_test::LWLightweightResponsePB_LWMapEntry_DoNotUse> const&, unsigned char*)
Line
Count
Source
200
1
inline uint8_t* RepeatedWrite(const Value& value, uint8_t* out) {
201
11
  for (const auto& entry : value) {
202
11
    out = SingleWrite<Serialization, Tag>(entry, out);
203
11
  }
204
1
  return out;
205
1
}
206
207
template <class Serialization, size_t TagSize, class Value>
208
2
inline size_t PackedSize(const Value& value, size_t* out_body_size) {
209
2
  size_t body_size = 0;
210
254
  for (const auto& entry : value) {
211
254
    body_size += Serialization::Size(entry);
212
254
  }
213
2
  *out_body_size = body_size;
214
2
  return TagSize
215
2
         + google::protobuf::io::CodedOutputStream::VarintSize32(narrow_cast<uint32_t>(body_size))
216
2
         + body_size;
217
2
}
218
219
template <class Serialization, uint32_t Tag, class Value>
220
2
inline uint8_t* PackedWrite(const Value& value, size_t body_size, uint8_t* out) {
221
2
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
222
2
  out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
223
2
      narrow_cast<uint32_t>(body_size), out);
224
164
  for (const auto& entry : value) {
225
164
    out = Serialization::Write(entry, out);
226
164
  }
227
2
  return out;
228
2
}
unsigned char* yb::rpc::PackedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)4, unsigned long long>, 170u, std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned long long, yb::internal::ArenaAllocatorBase<unsigned long long, yb::internal::ArenaTraits> > const&, unsigned long, unsigned char*)
Line
Count
Source
220
1
inline uint8_t* PackedWrite(const Value& value, size_t body_size, uint8_t* out) {
221
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
222
1
  out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
223
1
      narrow_cast<uint32_t>(body_size), out);
224
127
  for (const auto& entry : value) {
225
127
    out = Serialization::Write(entry, out);
226
127
  }
227
1
  return out;
228
1
}
unsigned char* yb::rpc::PackedWrite<yb::rpc::LightweightSerialization<(google::protobuf::internal::WireFormatLite::FieldType)7, unsigned int>, 178u, std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > >(std::__1::vector<unsigned int, yb::internal::ArenaAllocatorBase<unsigned int, yb::internal::ArenaTraits> > const&, unsigned long, unsigned char*)
Line
Count
Source
220
1
inline uint8_t* PackedWrite(const Value& value, size_t body_size, uint8_t* out) {
221
1
  out = google::protobuf::io::CodedOutputStream::WriteTagToArray(Tag, out);
222
1
  out = google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
223
1
      narrow_cast<uint32_t>(body_size), out);
224
37
  for (const auto& entry : value) {
225
37
    out = Serialization::Write(entry, out);
226
37
  }
227
1
  return out;
228
1
}
229
230
template <class T>
231
0
const T& empty_message() {
232
0
  static T result(nullptr);
233
0
  return result;
234
0
}
235
236
template <class T>
237
std::shared_ptr<T> MakeSharedMessage() {
238
  auto arena = std::make_shared<Arena>();
239
  auto t = arena->NewObject<T>(arena.get());
240
  return std::shared_ptr<T>(std::move(arena), t);
241
}
242
243
template <class T, class PB>
244
5
std::shared_ptr<T> CopySharedMessage(const PB& rhs) {
245
5
  auto arena = std::make_shared<Arena>();
246
5
  auto t = arena->NewObject<T>(arena.get(), rhs);
247
5
  return std::shared_ptr<T>(std::move(arena), t);
248
5
}
249
250
template <class T>
251
class AsSharedMessageHelper {
252
 public:
253
  explicit AsSharedMessageHelper(const T& t) : t_(t) {}
254
255
  template <class U>
256
  operator std::shared_ptr<U>() const {
257
    return CopySharedMessage<U>(t_);
258
  }
259
260
 private:
261
  const T& t_;
262
};
263
264
template <class T>
265
auto AsSharedMessage(const T& t) {
266
  return AsSharedMessageHelper<T>(t);
267
}
268
269
template <class T, class S>
270
std::shared_ptr<T> SharedField(std::shared_ptr<S> ptr, T* field) {
271
  return std::shared_ptr<T>(std::move(ptr), field);
272
}
273
274
void AppendFieldTitle(const char* name, const char* suffix, bool* first, std::string* out);
275
276
void SetupLimit(google::protobuf::io::CodedInputStream* in);
277
278
} // namespace rpc
279
} // namespace yb
280
281
#endif // YB_RPC_LIGHTWEIGHT_MESSAGE_H