Coverage Report

Created: 2026-01-10 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/brpc/build/brpc/span.pb.cc
Line
Count
Source
1
// Generated by the protocol buffer compiler.  DO NOT EDIT!
2
// source: brpc/span.proto
3
4
#include "brpc/span.pb.h"
5
6
#include <algorithm>
7
8
#include <google/protobuf/io/coded_stream.h>
9
#include <google/protobuf/extension_set.h>
10
#include <google/protobuf/wire_format_lite.h>
11
#include <google/protobuf/descriptor.h>
12
#include <google/protobuf/generated_message_reflection.h>
13
#include <google/protobuf/reflection_ops.h>
14
#include <google/protobuf/wire_format.h>
15
// @@protoc_insertion_point(includes)
16
#include <google/protobuf/port_def.inc>
17
18
PROTOBUF_PRAGMA_INIT_SEG
19
20
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21
namespace _pbi = _pb::internal;
22
23
namespace brpc {
24
PROTOBUF_CONSTEXPR RpczSpan::RpczSpan(
25
    ::_pbi::ConstantInitialized): _impl_{
26
    /*decltype(_impl_._has_bits_)*/{}
27
  , /*decltype(_impl_._cached_size_)*/{}
28
  , /*decltype(_impl_.client_spans_)*/{}
29
  , /*decltype(_impl_.info_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
30
  , /*decltype(_impl_.full_method_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
31
  , /*decltype(_impl_.trace_id_)*/uint64_t{0u}
32
  , /*decltype(_impl_.span_id_)*/uint64_t{0u}
33
  , /*decltype(_impl_.parent_span_id_)*/uint64_t{0u}
34
  , /*decltype(_impl_.log_id_)*/uint64_t{0u}
35
  , /*decltype(_impl_.base_cid_)*/uint64_t{0u}
36
  , /*decltype(_impl_.ending_cid_)*/uint64_t{0u}
37
  , /*decltype(_impl_.remote_ip_)*/0u
38
  , /*decltype(_impl_.remote_port_)*/0u
39
  , /*decltype(_impl_.type_)*/0
40
  , /*decltype(_impl_.async_)*/false
41
  , /*decltype(_impl_.protocol_)*/0
42
  , /*decltype(_impl_.error_code_)*/0
43
  , /*decltype(_impl_.request_size_)*/0
44
  , /*decltype(_impl_.response_size_)*/0
45
  , /*decltype(_impl_.received_real_us_)*/int64_t{0}
46
  , /*decltype(_impl_.start_parse_real_us_)*/int64_t{0}
47
  , /*decltype(_impl_.start_callback_real_us_)*/int64_t{0}
48
  , /*decltype(_impl_.start_send_real_us_)*/int64_t{0}
49
  , /*decltype(_impl_.sent_real_us_)*/int64_t{0}} {}
50
struct RpczSpanDefaultTypeInternal {
51
  PROTOBUF_CONSTEXPR RpczSpanDefaultTypeInternal()
52
0
      : _instance(::_pbi::ConstantInitialized{}) {}
53
0
  ~RpczSpanDefaultTypeInternal() {}
54
  union {
55
    RpczSpan _instance;
56
  };
57
};
58
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RpczSpanDefaultTypeInternal _RpczSpan_default_instance_;
59
PROTOBUF_CONSTEXPR BriefSpan::BriefSpan(
60
    ::_pbi::ConstantInitialized): _impl_{
61
    /*decltype(_impl_._has_bits_)*/{}
62
  , /*decltype(_impl_._cached_size_)*/{}
63
  , /*decltype(_impl_.full_method_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
64
  , /*decltype(_impl_.trace_id_)*/uint64_t{0u}
65
  , /*decltype(_impl_.span_id_)*/uint64_t{0u}
66
  , /*decltype(_impl_.log_id_)*/uint64_t{0u}
67
  , /*decltype(_impl_.type_)*/0
68
  , /*decltype(_impl_.error_code_)*/0
69
  , /*decltype(_impl_.request_size_)*/0
70
  , /*decltype(_impl_.response_size_)*/0
71
  , /*decltype(_impl_.start_real_us_)*/int64_t{0}
72
  , /*decltype(_impl_.latency_us_)*/int64_t{0}} {}
73
struct BriefSpanDefaultTypeInternal {
74
  PROTOBUF_CONSTEXPR BriefSpanDefaultTypeInternal()
75
0
      : _instance(::_pbi::ConstantInitialized{}) {}
76
0
  ~BriefSpanDefaultTypeInternal() {}
77
  union {
78
    BriefSpan _instance;
79
  };
80
};
81
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BriefSpanDefaultTypeInternal _BriefSpan_default_instance_;
82
PROTOBUF_CONSTEXPR SpanAnnotation::SpanAnnotation(
83
    ::_pbi::ConstantInitialized): _impl_{
84
    /*decltype(_impl_._has_bits_)*/{}
85
  , /*decltype(_impl_._cached_size_)*/{}
86
  , /*decltype(_impl_.content_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
87
  , /*decltype(_impl_.realtime_us_)*/int64_t{0}} {}
88
struct SpanAnnotationDefaultTypeInternal {
89
  PROTOBUF_CONSTEXPR SpanAnnotationDefaultTypeInternal()
90
0
      : _instance(::_pbi::ConstantInitialized{}) {}
91
0
  ~SpanAnnotationDefaultTypeInternal() {}
92
  union {
93
    SpanAnnotation _instance;
94
  };
95
};
96
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SpanAnnotationDefaultTypeInternal _SpanAnnotation_default_instance_;
97
PROTOBUF_CONSTEXPR TracingSpan::TracingSpan(
98
    ::_pbi::ConstantInitialized): _impl_{
99
    /*decltype(_impl_._has_bits_)*/{}
100
  , /*decltype(_impl_._cached_size_)*/{}
101
  , /*decltype(_impl_.annotations_)*/{}
102
  , /*decltype(_impl_.client_spans_)*/{}
103
  , /*decltype(_impl_.span_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
104
  , /*decltype(_impl_.trace_id_)*/uint64_t{0u}
105
  , /*decltype(_impl_.span_id_)*/uint64_t{0u}
106
  , /*decltype(_impl_.parent_span_id_)*/uint64_t{0u}
107
  , /*decltype(_impl_.log_id_)*/uint64_t{0u}
108
  , /*decltype(_impl_.remote_ip_)*/0u
109
  , /*decltype(_impl_.remote_port_)*/0u
110
  , /*decltype(_impl_.type_)*/0
111
  , /*decltype(_impl_.protocol_)*/0
112
  , /*decltype(_impl_.error_code_)*/0
113
  , /*decltype(_impl_.request_size_)*/0
114
  , /*decltype(_impl_.received_real_us_)*/int64_t{0}
115
  , /*decltype(_impl_.start_parse_real_us_)*/int64_t{0}
116
  , /*decltype(_impl_.start_callback_real_us_)*/int64_t{0}
117
  , /*decltype(_impl_.start_send_real_us_)*/int64_t{0}
118
  , /*decltype(_impl_.sent_real_us_)*/int64_t{0}
119
  , /*decltype(_impl_.response_size_)*/0} {}
120
struct TracingSpanDefaultTypeInternal {
121
  PROTOBUF_CONSTEXPR TracingSpanDefaultTypeInternal()
122
0
      : _instance(::_pbi::ConstantInitialized{}) {}
123
0
  ~TracingSpanDefaultTypeInternal() {}
124
  union {
125
    TracingSpan _instance;
126
  };
127
};
128
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TracingSpanDefaultTypeInternal _TracingSpan_default_instance_;
129
}  // namespace brpc
130
static ::_pb::Metadata file_level_metadata_brpc_2fspan_2eproto[4];
131
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_brpc_2fspan_2eproto[1];
132
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_brpc_2fspan_2eproto = nullptr;
133
134
const uint32_t TableStruct_brpc_2fspan_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
135
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_._has_bits_),
136
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _internal_metadata_),
137
  ~0u,  // no _extensions_
138
  ~0u,  // no _oneof_case_
139
  ~0u,  // no _weak_field_map_
140
  ~0u,  // no _inlined_string_donated_
141
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.trace_id_),
142
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.span_id_),
143
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.parent_span_id_),
144
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.log_id_),
145
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.base_cid_),
146
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.ending_cid_),
147
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.remote_ip_),
148
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.remote_port_),
149
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.type_),
150
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.async_),
151
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.protocol_),
152
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.error_code_),
153
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.request_size_),
154
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.response_size_),
155
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.received_real_us_),
156
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.start_parse_real_us_),
157
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.start_callback_real_us_),
158
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.start_send_real_us_),
159
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.sent_real_us_),
160
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.info_),
161
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.client_spans_),
162
  PROTOBUF_FIELD_OFFSET(::brpc::RpczSpan, _impl_.full_method_name_),
163
  2,
164
  3,
165
  4,
166
  5,
167
  6,
168
  7,
169
  8,
170
  9,
171
  10,
172
  11,
173
  12,
174
  13,
175
  14,
176
  15,
177
  16,
178
  17,
179
  18,
180
  19,
181
  20,
182
  0,
183
  ~0u,
184
  1,
185
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_._has_bits_),
186
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _internal_metadata_),
187
  ~0u,  // no _extensions_
188
  ~0u,  // no _oneof_case_
189
  ~0u,  // no _weak_field_map_
190
  ~0u,  // no _inlined_string_donated_
191
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.trace_id_),
192
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.span_id_),
193
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.log_id_),
194
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.type_),
195
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.error_code_),
196
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.request_size_),
197
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.response_size_),
198
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.start_real_us_),
199
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.latency_us_),
200
  PROTOBUF_FIELD_OFFSET(::brpc::BriefSpan, _impl_.full_method_name_),
201
  1,
202
  2,
203
  3,
204
  4,
205
  5,
206
  6,
207
  7,
208
  8,
209
  9,
210
  0,
211
  PROTOBUF_FIELD_OFFSET(::brpc::SpanAnnotation, _impl_._has_bits_),
212
  PROTOBUF_FIELD_OFFSET(::brpc::SpanAnnotation, _internal_metadata_),
213
  ~0u,  // no _extensions_
214
  ~0u,  // no _oneof_case_
215
  ~0u,  // no _weak_field_map_
216
  ~0u,  // no _inlined_string_donated_
217
  PROTOBUF_FIELD_OFFSET(::brpc::SpanAnnotation, _impl_.realtime_us_),
218
  PROTOBUF_FIELD_OFFSET(::brpc::SpanAnnotation, _impl_.content_),
219
  1,
220
  0,
221
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_._has_bits_),
222
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _internal_metadata_),
223
  ~0u,  // no _extensions_
224
  ~0u,  // no _oneof_case_
225
  ~0u,  // no _weak_field_map_
226
  ~0u,  // no _inlined_string_donated_
227
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.trace_id_),
228
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.span_id_),
229
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.parent_span_id_),
230
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.log_id_),
231
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.remote_ip_),
232
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.remote_port_),
233
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.type_),
234
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.protocol_),
235
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.error_code_),
236
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.request_size_),
237
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.response_size_),
238
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.received_real_us_),
239
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.start_parse_real_us_),
240
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.start_callback_real_us_),
241
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.start_send_real_us_),
242
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.sent_real_us_),
243
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.span_name_),
244
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.annotations_),
245
  PROTOBUF_FIELD_OFFSET(::brpc::TracingSpan, _impl_.client_spans_),
246
  1,
247
  2,
248
  3,
249
  4,
250
  5,
251
  6,
252
  7,
253
  8,
254
  9,
255
  10,
256
  16,
257
  11,
258
  12,
259
  13,
260
  14,
261
  15,
262
  0,
263
  ~0u,
264
  ~0u,
265
};
266
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
267
  { 0, 28, -1, sizeof(::brpc::RpczSpan)},
268
  { 50, 66, -1, sizeof(::brpc::BriefSpan)},
269
  { 76, 84, -1, sizeof(::brpc::SpanAnnotation)},
270
  { 86, 111, -1, sizeof(::brpc::TracingSpan)},
271
};
272
273
static const ::_pb::Message* const file_default_instances[] = {
274
  &::brpc::_RpczSpan_default_instance_._instance,
275
  &::brpc::_BriefSpan_default_instance_._instance,
276
  &::brpc::_SpanAnnotation_default_instance_._instance,
277
  &::brpc::_TracingSpan_default_instance_._instance,
278
};
279
280
const char descriptor_table_protodef_brpc_2fspan_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
281
  "\n\017brpc/span.proto\022\004brpc\032\022brpc/options.pr"
282
  "oto\"\216\004\n\010RpczSpan\022\020\n\010trace_id\030\001 \002(\004\022\017\n\007sp"
283
  "an_id\030\002 \002(\004\022\026\n\016parent_span_id\030\003 \002(\004\022\016\n\006l"
284
  "og_id\030\004 \001(\004\022\020\n\010base_cid\030\005 \001(\004\022\022\n\nending_"
285
  "cid\030\006 \001(\004\022\021\n\tremote_ip\030\007 \001(\r\022\023\n\013remote_p"
286
  "ort\030\010 \001(\r\022\034\n\004type\030\t \001(\0162\016.brpc.SpanType\022"
287
  "\r\n\005async\030\n \001(\010\022$\n\010protocol\030\013 \001(\0162\022.brpc."
288
  "ProtocolType\022\022\n\nerror_code\030\014 \001(\005\022\024\n\014requ"
289
  "est_size\030\r \001(\005\022\025\n\rresponse_size\030\016 \001(\005\022\030\n"
290
  "\020received_real_us\030\017 \001(\003\022\033\n\023start_parse_r"
291
  "eal_us\030\020 \001(\003\022\036\n\026start_callback_real_us\030\021"
292
  " \001(\003\022\032\n\022start_send_real_us\030\022 \001(\003\022\024\n\014sent"
293
  "_real_us\030\023 \001(\003\022\014\n\004info\030\024 \001(\014\022$\n\014client_s"
294
  "pans\030\025 \003(\0132\016.brpc.RpczSpan\022\030\n\020full_metho"
295
  "d_name\030\026 \001(\014\"\342\001\n\tBriefSpan\022\020\n\010trace_id\030\001"
296
  " \002(\004\022\017\n\007span_id\030\002 \002(\004\022\016\n\006log_id\030\003 \001(\004\022\034\n"
297
  "\004type\030\004 \001(\0162\016.brpc.SpanType\022\022\n\nerror_cod"
298
  "e\030\005 \001(\005\022\024\n\014request_size\030\006 \001(\005\022\025\n\rrespons"
299
  "e_size\030\007 \001(\005\022\025\n\rstart_real_us\030\010 \001(\003\022\022\n\nl"
300
  "atency_us\030\t \001(\003\022\030\n\020full_method_name\030\n \001("
301
  "\014\"6\n\016SpanAnnotation\022\023\n\013realtime_us\030\001 \002(\003"
302
  "\022\017\n\007content\030\002 \002(\t\"\365\003\n\013TracingSpan\022\020\n\010tra"
303
  "ce_id\030\001 \002(\004\022\017\n\007span_id\030\002 \002(\004\022\026\n\016parent_s"
304
  "pan_id\030\003 \002(\004\022\016\n\006log_id\030\004 \001(\004\022\021\n\tremote_i"
305
  "p\030\005 \001(\r\022\023\n\013remote_port\030\006 \001(\r\022\034\n\004type\030\007 \001"
306
  "(\0162\016.brpc.SpanType\022$\n\010protocol\030\010 \001(\0162\022.b"
307
  "rpc.ProtocolType\022\022\n\nerror_code\030\t \001(\005\022\024\n\014"
308
  "request_size\030\n \001(\005\022\025\n\rresponse_size\030\013 \001("
309
  "\005\022\030\n\020received_real_us\030\014 \001(\003\022\033\n\023start_par"
310
  "se_real_us\030\r \001(\003\022\036\n\026start_callback_real_"
311
  "us\030\016 \001(\003\022\032\n\022start_send_real_us\030\017 \001(\003\022\024\n\014"
312
  "sent_real_us\030\020 \001(\003\022\021\n\tspan_name\030\021 \001(\t\022)\n"
313
  "\013annotations\030\022 \003(\0132\024.brpc.SpanAnnotation"
314
  "\022\'\n\014client_spans\030\023 \003(\0132\021.brpc.TracingSpa"
315
  "n*M\n\010SpanType\022\024\n\020SPAN_TYPE_SERVER\020\000\022\024\n\020S"
316
  "PAN_TYPE_CLIENT\020\001\022\025\n\021SPAN_TYPE_BTHREAD\020\002"
317
  "B\020\n\010com.brpcB\004Span"
318
  ;
319
static const ::_pbi::DescriptorTable* const descriptor_table_brpc_2fspan_2eproto_deps[1] = {
320
  &::descriptor_table_brpc_2foptions_2eproto,
321
};
322
static ::_pbi::once_flag descriptor_table_brpc_2fspan_2eproto_once;
323
const ::_pbi::DescriptorTable descriptor_table_brpc_2fspan_2eproto = {
324
    false, false, 1458, descriptor_table_protodef_brpc_2fspan_2eproto,
325
    "brpc/span.proto",
326
    &descriptor_table_brpc_2fspan_2eproto_once, descriptor_table_brpc_2fspan_2eproto_deps, 1, 4,
327
    schemas, file_default_instances, TableStruct_brpc_2fspan_2eproto::offsets,
328
    file_level_metadata_brpc_2fspan_2eproto, file_level_enum_descriptors_brpc_2fspan_2eproto,
329
    file_level_service_descriptors_brpc_2fspan_2eproto,
330
};
331
0
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_brpc_2fspan_2eproto_getter() {
332
0
  return &descriptor_table_brpc_2fspan_2eproto;
333
0
}
334
335
// Force running AddDescriptors() at dynamic initialization time.
336
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_brpc_2fspan_2eproto(&descriptor_table_brpc_2fspan_2eproto);
337
namespace brpc {
338
0
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SpanType_descriptor() {
339
0
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_brpc_2fspan_2eproto);
340
0
  return file_level_enum_descriptors_brpc_2fspan_2eproto[0];
341
0
}
342
0
bool SpanType_IsValid(int value) {
343
0
  switch (value) {
344
0
    case 0:
345
0
    case 1:
346
0
    case 2:
347
0
      return true;
348
0
    default:
349
0
      return false;
350
0
  }
351
0
}
352
353
354
// ===================================================================
355
356
class RpczSpan::_Internal {
357
 public:
358
  using HasBits = decltype(std::declval<RpczSpan>()._impl_._has_bits_);
359
0
  static void set_has_trace_id(HasBits* has_bits) {
360
0
    (*has_bits)[0] |= 4u;
361
0
  }
362
0
  static void set_has_span_id(HasBits* has_bits) {
363
0
    (*has_bits)[0] |= 8u;
364
0
  }
365
0
  static void set_has_parent_span_id(HasBits* has_bits) {
366
0
    (*has_bits)[0] |= 16u;
367
0
  }
368
0
  static void set_has_log_id(HasBits* has_bits) {
369
0
    (*has_bits)[0] |= 32u;
370
0
  }
371
0
  static void set_has_base_cid(HasBits* has_bits) {
372
0
    (*has_bits)[0] |= 64u;
373
0
  }
374
0
  static void set_has_ending_cid(HasBits* has_bits) {
375
0
    (*has_bits)[0] |= 128u;
376
0
  }
377
0
  static void set_has_remote_ip(HasBits* has_bits) {
378
0
    (*has_bits)[0] |= 256u;
379
0
  }
380
0
  static void set_has_remote_port(HasBits* has_bits) {
381
0
    (*has_bits)[0] |= 512u;
382
0
  }
383
0
  static void set_has_type(HasBits* has_bits) {
384
0
    (*has_bits)[0] |= 1024u;
385
0
  }
386
0
  static void set_has_async(HasBits* has_bits) {
387
0
    (*has_bits)[0] |= 2048u;
388
0
  }
389
0
  static void set_has_protocol(HasBits* has_bits) {
390
0
    (*has_bits)[0] |= 4096u;
391
0
  }
392
0
  static void set_has_error_code(HasBits* has_bits) {
393
0
    (*has_bits)[0] |= 8192u;
394
0
  }
395
0
  static void set_has_request_size(HasBits* has_bits) {
396
0
    (*has_bits)[0] |= 16384u;
397
0
  }
398
0
  static void set_has_response_size(HasBits* has_bits) {
399
0
    (*has_bits)[0] |= 32768u;
400
0
  }
401
0
  static void set_has_received_real_us(HasBits* has_bits) {
402
0
    (*has_bits)[0] |= 65536u;
403
0
  }
404
0
  static void set_has_start_parse_real_us(HasBits* has_bits) {
405
0
    (*has_bits)[0] |= 131072u;
406
0
  }
407
0
  static void set_has_start_callback_real_us(HasBits* has_bits) {
408
0
    (*has_bits)[0] |= 262144u;
409
0
  }
410
0
  static void set_has_start_send_real_us(HasBits* has_bits) {
411
0
    (*has_bits)[0] |= 524288u;
412
0
  }
413
0
  static void set_has_sent_real_us(HasBits* has_bits) {
414
0
    (*has_bits)[0] |= 1048576u;
415
0
  }
416
0
  static void set_has_info(HasBits* has_bits) {
417
0
    (*has_bits)[0] |= 1u;
418
0
  }
419
0
  static void set_has_full_method_name(HasBits* has_bits) {
420
0
    (*has_bits)[0] |= 2u;
421
0
  }
422
0
  static bool MissingRequiredFields(const HasBits& has_bits) {
423
0
    return ((has_bits[0] & 0x0000001c) ^ 0x0000001c) != 0;
424
0
  }
425
};
426
427
RpczSpan::RpczSpan(::PROTOBUF_NAMESPACE_ID::Arena* arena,
428
                         bool is_message_owned)
429
0
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
430
0
  SharedCtor(arena, is_message_owned);
431
  // @@protoc_insertion_point(arena_constructor:brpc.RpczSpan)
432
0
}
433
RpczSpan::RpczSpan(const RpczSpan& from)
434
0
  : ::PROTOBUF_NAMESPACE_ID::Message() {
435
0
  RpczSpan* const _this = this; (void)_this;
436
0
  new (&_impl_) Impl_{
437
0
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
438
0
    , /*decltype(_impl_._cached_size_)*/{}
439
0
    , decltype(_impl_.client_spans_){from._impl_.client_spans_}
440
0
    , decltype(_impl_.info_){}
441
0
    , decltype(_impl_.full_method_name_){}
442
0
    , decltype(_impl_.trace_id_){}
443
0
    , decltype(_impl_.span_id_){}
444
0
    , decltype(_impl_.parent_span_id_){}
445
0
    , decltype(_impl_.log_id_){}
446
0
    , decltype(_impl_.base_cid_){}
447
0
    , decltype(_impl_.ending_cid_){}
448
0
    , decltype(_impl_.remote_ip_){}
449
0
    , decltype(_impl_.remote_port_){}
450
0
    , decltype(_impl_.type_){}
451
0
    , decltype(_impl_.async_){}
452
0
    , decltype(_impl_.protocol_){}
453
0
    , decltype(_impl_.error_code_){}
454
0
    , decltype(_impl_.request_size_){}
455
0
    , decltype(_impl_.response_size_){}
456
0
    , decltype(_impl_.received_real_us_){}
457
0
    , decltype(_impl_.start_parse_real_us_){}
458
0
    , decltype(_impl_.start_callback_real_us_){}
459
0
    , decltype(_impl_.start_send_real_us_){}
460
0
    , decltype(_impl_.sent_real_us_){}};
461
462
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
463
0
  _impl_.info_.InitDefault();
464
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
465
    _impl_.info_.Set("", GetArenaForAllocation());
466
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
467
0
  if (from._internal_has_info()) {
468
0
    _this->_impl_.info_.Set(from._internal_info(), 
469
0
      _this->GetArenaForAllocation());
470
0
  }
471
0
  _impl_.full_method_name_.InitDefault();
472
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
473
    _impl_.full_method_name_.Set("", GetArenaForAllocation());
474
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
475
0
  if (from._internal_has_full_method_name()) {
476
0
    _this->_impl_.full_method_name_.Set(from._internal_full_method_name(), 
477
0
      _this->GetArenaForAllocation());
478
0
  }
479
0
  ::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_,
480
0
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.sent_real_us_) -
481
0
    reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.sent_real_us_));
482
  // @@protoc_insertion_point(copy_constructor:brpc.RpczSpan)
483
0
}
484
485
inline void RpczSpan::SharedCtor(
486
0
    ::_pb::Arena* arena, bool is_message_owned) {
487
0
  (void)arena;
488
0
  (void)is_message_owned;
489
0
  new (&_impl_) Impl_{
490
0
      decltype(_impl_._has_bits_){}
491
0
    , /*decltype(_impl_._cached_size_)*/{}
492
0
    , decltype(_impl_.client_spans_){arena}
493
0
    , decltype(_impl_.info_){}
494
0
    , decltype(_impl_.full_method_name_){}
495
0
    , decltype(_impl_.trace_id_){uint64_t{0u}}
496
0
    , decltype(_impl_.span_id_){uint64_t{0u}}
497
0
    , decltype(_impl_.parent_span_id_){uint64_t{0u}}
498
0
    , decltype(_impl_.log_id_){uint64_t{0u}}
499
0
    , decltype(_impl_.base_cid_){uint64_t{0u}}
500
0
    , decltype(_impl_.ending_cid_){uint64_t{0u}}
501
0
    , decltype(_impl_.remote_ip_){0u}
502
0
    , decltype(_impl_.remote_port_){0u}
503
0
    , decltype(_impl_.type_){0}
504
0
    , decltype(_impl_.async_){false}
505
0
    , decltype(_impl_.protocol_){0}
506
0
    , decltype(_impl_.error_code_){0}
507
0
    , decltype(_impl_.request_size_){0}
508
0
    , decltype(_impl_.response_size_){0}
509
0
    , decltype(_impl_.received_real_us_){int64_t{0}}
510
0
    , decltype(_impl_.start_parse_real_us_){int64_t{0}}
511
0
    , decltype(_impl_.start_callback_real_us_){int64_t{0}}
512
0
    , decltype(_impl_.start_send_real_us_){int64_t{0}}
513
0
    , decltype(_impl_.sent_real_us_){int64_t{0}}
514
0
  };
515
0
  _impl_.info_.InitDefault();
516
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
517
    _impl_.info_.Set("", GetArenaForAllocation());
518
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
519
0
  _impl_.full_method_name_.InitDefault();
520
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
521
    _impl_.full_method_name_.Set("", GetArenaForAllocation());
522
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
523
0
}
524
525
0
RpczSpan::~RpczSpan() {
526
  // @@protoc_insertion_point(destructor:brpc.RpczSpan)
527
0
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
528
0
  (void)arena;
529
0
    return;
530
0
  }
531
0
  SharedDtor();
532
0
}
533
534
0
inline void RpczSpan::SharedDtor() {
535
0
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
536
0
  _impl_.client_spans_.~RepeatedPtrField();
537
0
  _impl_.info_.Destroy();
538
0
  _impl_.full_method_name_.Destroy();
539
0
}
540
541
0
void RpczSpan::SetCachedSize(int size) const {
542
0
  _impl_._cached_size_.Set(size);
543
0
}
544
545
0
void RpczSpan::Clear() {
546
// @@protoc_insertion_point(message_clear_start:brpc.RpczSpan)
547
0
  uint32_t cached_has_bits = 0;
548
  // Prevent compiler warnings about cached_has_bits being unused
549
0
  (void) cached_has_bits;
550
551
0
  _impl_.client_spans_.Clear();
552
0
  cached_has_bits = _impl_._has_bits_[0];
553
0
  if (cached_has_bits & 0x00000003u) {
554
0
    if (cached_has_bits & 0x00000001u) {
555
0
      _impl_.info_.ClearNonDefaultToEmpty();
556
0
    }
557
0
    if (cached_has_bits & 0x00000002u) {
558
0
      _impl_.full_method_name_.ClearNonDefaultToEmpty();
559
0
    }
560
0
  }
561
0
  if (cached_has_bits & 0x000000fcu) {
562
0
    ::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
563
0
        reinterpret_cast<char*>(&_impl_.ending_cid_) -
564
0
        reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.ending_cid_));
565
0
  }
566
0
  if (cached_has_bits & 0x0000ff00u) {
567
0
    ::memset(&_impl_.remote_ip_, 0, static_cast<size_t>(
568
0
        reinterpret_cast<char*>(&_impl_.response_size_) -
569
0
        reinterpret_cast<char*>(&_impl_.remote_ip_)) + sizeof(_impl_.response_size_));
570
0
  }
571
0
  if (cached_has_bits & 0x001f0000u) {
572
0
    ::memset(&_impl_.received_real_us_, 0, static_cast<size_t>(
573
0
        reinterpret_cast<char*>(&_impl_.sent_real_us_) -
574
0
        reinterpret_cast<char*>(&_impl_.received_real_us_)) + sizeof(_impl_.sent_real_us_));
575
0
  }
576
0
  _impl_._has_bits_.Clear();
577
0
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
578
0
}
579
580
0
const char* RpczSpan::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
581
0
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
582
0
  _Internal::HasBits has_bits{};
583
0
  while (!ctx->Done(&ptr)) {
584
0
    uint32_t tag;
585
0
    ptr = ::_pbi::ReadTag(ptr, &tag);
586
0
    switch (tag >> 3) {
587
      // required uint64 trace_id = 1;
588
0
      case 1:
589
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
590
0
          _Internal::set_has_trace_id(&has_bits);
591
0
          _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
592
0
          CHK_(ptr);
593
0
        } else
594
0
          goto handle_unusual;
595
0
        continue;
596
      // required uint64 span_id = 2;
597
0
      case 2:
598
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
599
0
          _Internal::set_has_span_id(&has_bits);
600
0
          _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
601
0
          CHK_(ptr);
602
0
        } else
603
0
          goto handle_unusual;
604
0
        continue;
605
      // required uint64 parent_span_id = 3;
606
0
      case 3:
607
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
608
0
          _Internal::set_has_parent_span_id(&has_bits);
609
0
          _impl_.parent_span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
610
0
          CHK_(ptr);
611
0
        } else
612
0
          goto handle_unusual;
613
0
        continue;
614
      // optional uint64 log_id = 4;
615
0
      case 4:
616
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
617
0
          _Internal::set_has_log_id(&has_bits);
618
0
          _impl_.log_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
619
0
          CHK_(ptr);
620
0
        } else
621
0
          goto handle_unusual;
622
0
        continue;
623
      // optional uint64 base_cid = 5;
624
0
      case 5:
625
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
626
0
          _Internal::set_has_base_cid(&has_bits);
627
0
          _impl_.base_cid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
628
0
          CHK_(ptr);
629
0
        } else
630
0
          goto handle_unusual;
631
0
        continue;
632
      // optional uint64 ending_cid = 6;
633
0
      case 6:
634
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
635
0
          _Internal::set_has_ending_cid(&has_bits);
636
0
          _impl_.ending_cid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
637
0
          CHK_(ptr);
638
0
        } else
639
0
          goto handle_unusual;
640
0
        continue;
641
      // optional uint32 remote_ip = 7;
642
0
      case 7:
643
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
644
0
          _Internal::set_has_remote_ip(&has_bits);
645
0
          _impl_.remote_ip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
646
0
          CHK_(ptr);
647
0
        } else
648
0
          goto handle_unusual;
649
0
        continue;
650
      // optional uint32 remote_port = 8;
651
0
      case 8:
652
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
653
0
          _Internal::set_has_remote_port(&has_bits);
654
0
          _impl_.remote_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
655
0
          CHK_(ptr);
656
0
        } else
657
0
          goto handle_unusual;
658
0
        continue;
659
      // optional .brpc.SpanType type = 9;
660
0
      case 9:
661
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
662
0
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
663
0
          CHK_(ptr);
664
0
          if (PROTOBUF_PREDICT_TRUE(::brpc::SpanType_IsValid(val))) {
665
0
            _internal_set_type(static_cast<::brpc::SpanType>(val));
666
0
          } else {
667
0
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
668
0
          }
669
0
        } else
670
0
          goto handle_unusual;
671
0
        continue;
672
      // optional bool async = 10;
673
0
      case 10:
674
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
675
0
          _Internal::set_has_async(&has_bits);
676
0
          _impl_.async_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
677
0
          CHK_(ptr);
678
0
        } else
679
0
          goto handle_unusual;
680
0
        continue;
681
      // optional .brpc.ProtocolType protocol = 11;
682
0
      case 11:
683
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
684
0
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
685
0
          CHK_(ptr);
686
0
          if (PROTOBUF_PREDICT_TRUE(::brpc::ProtocolType_IsValid(val))) {
687
0
            _internal_set_protocol(static_cast<::brpc::ProtocolType>(val));
688
0
          } else {
689
0
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
690
0
          }
691
0
        } else
692
0
          goto handle_unusual;
693
0
        continue;
694
      // optional int32 error_code = 12;
695
0
      case 12:
696
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
697
0
          _Internal::set_has_error_code(&has_bits);
698
0
          _impl_.error_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
699
0
          CHK_(ptr);
700
0
        } else
701
0
          goto handle_unusual;
702
0
        continue;
703
      // optional int32 request_size = 13;
704
0
      case 13:
705
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
706
0
          _Internal::set_has_request_size(&has_bits);
707
0
          _impl_.request_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
708
0
          CHK_(ptr);
709
0
        } else
710
0
          goto handle_unusual;
711
0
        continue;
712
      // optional int32 response_size = 14;
713
0
      case 14:
714
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
715
0
          _Internal::set_has_response_size(&has_bits);
716
0
          _impl_.response_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
717
0
          CHK_(ptr);
718
0
        } else
719
0
          goto handle_unusual;
720
0
        continue;
721
      // optional int64 received_real_us = 15;
722
0
      case 15:
723
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
724
0
          _Internal::set_has_received_real_us(&has_bits);
725
0
          _impl_.received_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
726
0
          CHK_(ptr);
727
0
        } else
728
0
          goto handle_unusual;
729
0
        continue;
730
      // optional int64 start_parse_real_us = 16;
731
0
      case 16:
732
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
733
0
          _Internal::set_has_start_parse_real_us(&has_bits);
734
0
          _impl_.start_parse_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
735
0
          CHK_(ptr);
736
0
        } else
737
0
          goto handle_unusual;
738
0
        continue;
739
      // optional int64 start_callback_real_us = 17;
740
0
      case 17:
741
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
742
0
          _Internal::set_has_start_callback_real_us(&has_bits);
743
0
          _impl_.start_callback_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
744
0
          CHK_(ptr);
745
0
        } else
746
0
          goto handle_unusual;
747
0
        continue;
748
      // optional int64 start_send_real_us = 18;
749
0
      case 18:
750
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
751
0
          _Internal::set_has_start_send_real_us(&has_bits);
752
0
          _impl_.start_send_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
753
0
          CHK_(ptr);
754
0
        } else
755
0
          goto handle_unusual;
756
0
        continue;
757
      // optional int64 sent_real_us = 19;
758
0
      case 19:
759
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
760
0
          _Internal::set_has_sent_real_us(&has_bits);
761
0
          _impl_.sent_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
762
0
          CHK_(ptr);
763
0
        } else
764
0
          goto handle_unusual;
765
0
        continue;
766
      // optional bytes info = 20;
767
0
      case 20:
768
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
769
0
          auto str = _internal_mutable_info();
770
0
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
771
0
          CHK_(ptr);
772
0
        } else
773
0
          goto handle_unusual;
774
0
        continue;
775
      // repeated .brpc.RpczSpan client_spans = 21;
776
0
      case 21:
777
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
778
0
          ptr -= 2;
779
0
          do {
780
0
            ptr += 2;
781
0
            ptr = ctx->ParseMessage(_internal_add_client_spans(), ptr);
782
0
            CHK_(ptr);
783
0
            if (!ctx->DataAvailable(ptr)) break;
784
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<170>(ptr));
785
0
        } else
786
0
          goto handle_unusual;
787
0
        continue;
788
      // optional bytes full_method_name = 22;
789
0
      case 22:
790
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
791
0
          auto str = _internal_mutable_full_method_name();
792
0
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
793
0
          CHK_(ptr);
794
0
        } else
795
0
          goto handle_unusual;
796
0
        continue;
797
0
      default:
798
0
        goto handle_unusual;
799
0
    }  // switch
800
0
  handle_unusual:
801
0
    if ((tag == 0) || ((tag & 7) == 4)) {
802
0
      CHK_(ptr);
803
0
      ctx->SetLastTag(tag);
804
0
      goto message_done;
805
0
    }
806
0
    ptr = UnknownFieldParse(
807
0
        tag,
808
0
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
809
0
        ptr, ctx);
810
0
    CHK_(ptr != nullptr);
811
0
  }  // while
812
0
message_done:
813
0
  _impl_._has_bits_.Or(has_bits);
814
0
  return ptr;
815
0
failure:
816
0
  ptr = nullptr;
817
0
  goto message_done;
818
0
#undef CHK_
819
0
}
820
821
uint8_t* RpczSpan::_InternalSerialize(
822
0
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
823
  // @@protoc_insertion_point(serialize_to_array_start:brpc.RpczSpan)
824
0
  uint32_t cached_has_bits = 0;
825
0
  (void) cached_has_bits;
826
827
0
  cached_has_bits = _impl_._has_bits_[0];
828
  // required uint64 trace_id = 1;
829
0
  if (cached_has_bits & 0x00000004u) {
830
0
    target = stream->EnsureSpace(target);
831
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_trace_id(), target);
832
0
  }
833
834
  // required uint64 span_id = 2;
835
0
  if (cached_has_bits & 0x00000008u) {
836
0
    target = stream->EnsureSpace(target);
837
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_span_id(), target);
838
0
  }
839
840
  // required uint64 parent_span_id = 3;
841
0
  if (cached_has_bits & 0x00000010u) {
842
0
    target = stream->EnsureSpace(target);
843
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_parent_span_id(), target);
844
0
  }
845
846
  // optional uint64 log_id = 4;
847
0
  if (cached_has_bits & 0x00000020u) {
848
0
    target = stream->EnsureSpace(target);
849
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_log_id(), target);
850
0
  }
851
852
  // optional uint64 base_cid = 5;
853
0
  if (cached_has_bits & 0x00000040u) {
854
0
    target = stream->EnsureSpace(target);
855
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_base_cid(), target);
856
0
  }
857
858
  // optional uint64 ending_cid = 6;
859
0
  if (cached_has_bits & 0x00000080u) {
860
0
    target = stream->EnsureSpace(target);
861
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_ending_cid(), target);
862
0
  }
863
864
  // optional uint32 remote_ip = 7;
865
0
  if (cached_has_bits & 0x00000100u) {
866
0
    target = stream->EnsureSpace(target);
867
0
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_remote_ip(), target);
868
0
  }
869
870
  // optional uint32 remote_port = 8;
871
0
  if (cached_has_bits & 0x00000200u) {
872
0
    target = stream->EnsureSpace(target);
873
0
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_remote_port(), target);
874
0
  }
875
876
  // optional .brpc.SpanType type = 9;
877
0
  if (cached_has_bits & 0x00000400u) {
878
0
    target = stream->EnsureSpace(target);
879
0
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
880
0
      9, this->_internal_type(), target);
881
0
  }
882
883
  // optional bool async = 10;
884
0
  if (cached_has_bits & 0x00000800u) {
885
0
    target = stream->EnsureSpace(target);
886
0
    target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_async(), target);
887
0
  }
888
889
  // optional .brpc.ProtocolType protocol = 11;
890
0
  if (cached_has_bits & 0x00001000u) {
891
0
    target = stream->EnsureSpace(target);
892
0
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
893
0
      11, this->_internal_protocol(), target);
894
0
  }
895
896
  // optional int32 error_code = 12;
897
0
  if (cached_has_bits & 0x00002000u) {
898
0
    target = stream->EnsureSpace(target);
899
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_error_code(), target);
900
0
  }
901
902
  // optional int32 request_size = 13;
903
0
  if (cached_has_bits & 0x00004000u) {
904
0
    target = stream->EnsureSpace(target);
905
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(13, this->_internal_request_size(), target);
906
0
  }
907
908
  // optional int32 response_size = 14;
909
0
  if (cached_has_bits & 0x00008000u) {
910
0
    target = stream->EnsureSpace(target);
911
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(14, this->_internal_response_size(), target);
912
0
  }
913
914
  // optional int64 received_real_us = 15;
915
0
  if (cached_has_bits & 0x00010000u) {
916
0
    target = stream->EnsureSpace(target);
917
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(15, this->_internal_received_real_us(), target);
918
0
  }
919
920
  // optional int64 start_parse_real_us = 16;
921
0
  if (cached_has_bits & 0x00020000u) {
922
0
    target = stream->EnsureSpace(target);
923
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(16, this->_internal_start_parse_real_us(), target);
924
0
  }
925
926
  // optional int64 start_callback_real_us = 17;
927
0
  if (cached_has_bits & 0x00040000u) {
928
0
    target = stream->EnsureSpace(target);
929
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(17, this->_internal_start_callback_real_us(), target);
930
0
  }
931
932
  // optional int64 start_send_real_us = 18;
933
0
  if (cached_has_bits & 0x00080000u) {
934
0
    target = stream->EnsureSpace(target);
935
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(18, this->_internal_start_send_real_us(), target);
936
0
  }
937
938
  // optional int64 sent_real_us = 19;
939
0
  if (cached_has_bits & 0x00100000u) {
940
0
    target = stream->EnsureSpace(target);
941
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(19, this->_internal_sent_real_us(), target);
942
0
  }
943
944
  // optional bytes info = 20;
945
0
  if (cached_has_bits & 0x00000001u) {
946
0
    target = stream->WriteBytesMaybeAliased(
947
0
        20, this->_internal_info(), target);
948
0
  }
949
950
  // repeated .brpc.RpczSpan client_spans = 21;
951
0
  for (unsigned i = 0,
952
0
      n = static_cast<unsigned>(this->_internal_client_spans_size()); i < n; i++) {
953
0
    const auto& repfield = this->_internal_client_spans(i);
954
0
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
955
0
        InternalWriteMessage(21, repfield, repfield.GetCachedSize(), target, stream);
956
0
  }
957
958
  // optional bytes full_method_name = 22;
959
0
  if (cached_has_bits & 0x00000002u) {
960
0
    target = stream->WriteBytesMaybeAliased(
961
0
        22, this->_internal_full_method_name(), target);
962
0
  }
963
964
0
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
965
0
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
966
0
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
967
0
  }
968
  // @@protoc_insertion_point(serialize_to_array_end:brpc.RpczSpan)
969
0
  return target;
970
0
}
971
972
0
size_t RpczSpan::RequiredFieldsByteSizeFallback() const {
973
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.RpczSpan)
974
0
  size_t total_size = 0;
975
976
0
  if (_internal_has_trace_id()) {
977
    // required uint64 trace_id = 1;
978
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
979
0
  }
980
981
0
  if (_internal_has_span_id()) {
982
    // required uint64 span_id = 2;
983
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
984
0
  }
985
986
0
  if (_internal_has_parent_span_id()) {
987
    // required uint64 parent_span_id = 3;
988
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_parent_span_id());
989
0
  }
990
991
0
  return total_size;
992
0
}
993
0
size_t RpczSpan::ByteSizeLong() const {
994
// @@protoc_insertion_point(message_byte_size_start:brpc.RpczSpan)
995
0
  size_t total_size = 0;
996
997
0
  if (((_impl_._has_bits_[0] & 0x0000001c) ^ 0x0000001c) == 0) {  // All required fields are present.
998
    // required uint64 trace_id = 1;
999
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
1000
1001
    // required uint64 span_id = 2;
1002
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
1003
1004
    // required uint64 parent_span_id = 3;
1005
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_parent_span_id());
1006
1007
0
  } else {
1008
0
    total_size += RequiredFieldsByteSizeFallback();
1009
0
  }
1010
0
  uint32_t cached_has_bits = 0;
1011
  // Prevent compiler warnings about cached_has_bits being unused
1012
0
  (void) cached_has_bits;
1013
1014
  // repeated .brpc.RpczSpan client_spans = 21;
1015
0
  total_size += 2UL * this->_internal_client_spans_size();
1016
0
  for (const auto& msg : this->_impl_.client_spans_) {
1017
0
    total_size +=
1018
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1019
0
  }
1020
1021
0
  cached_has_bits = _impl_._has_bits_[0];
1022
0
  if (cached_has_bits & 0x00000003u) {
1023
    // optional bytes info = 20;
1024
0
    if (cached_has_bits & 0x00000001u) {
1025
0
      total_size += 2 +
1026
0
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
1027
0
          this->_internal_info());
1028
0
    }
1029
1030
    // optional bytes full_method_name = 22;
1031
0
    if (cached_has_bits & 0x00000002u) {
1032
0
      total_size += 2 +
1033
0
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
1034
0
          this->_internal_full_method_name());
1035
0
    }
1036
1037
0
  }
1038
0
  if (cached_has_bits & 0x000000e0u) {
1039
    // optional uint64 log_id = 4;
1040
0
    if (cached_has_bits & 0x00000020u) {
1041
0
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_log_id());
1042
0
    }
1043
1044
    // optional uint64 base_cid = 5;
1045
0
    if (cached_has_bits & 0x00000040u) {
1046
0
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_base_cid());
1047
0
    }
1048
1049
    // optional uint64 ending_cid = 6;
1050
0
    if (cached_has_bits & 0x00000080u) {
1051
0
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_ending_cid());
1052
0
    }
1053
1054
0
  }
1055
0
  if (cached_has_bits & 0x0000ff00u) {
1056
    // optional uint32 remote_ip = 7;
1057
0
    if (cached_has_bits & 0x00000100u) {
1058
0
      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_ip());
1059
0
    }
1060
1061
    // optional uint32 remote_port = 8;
1062
0
    if (cached_has_bits & 0x00000200u) {
1063
0
      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_port());
1064
0
    }
1065
1066
    // optional .brpc.SpanType type = 9;
1067
0
    if (cached_has_bits & 0x00000400u) {
1068
0
      total_size += 1 +
1069
0
        ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
1070
0
    }
1071
1072
    // optional bool async = 10;
1073
0
    if (cached_has_bits & 0x00000800u) {
1074
0
      total_size += 1 + 1;
1075
0
    }
1076
1077
    // optional .brpc.ProtocolType protocol = 11;
1078
0
    if (cached_has_bits & 0x00001000u) {
1079
0
      total_size += 1 +
1080
0
        ::_pbi::WireFormatLite::EnumSize(this->_internal_protocol());
1081
0
    }
1082
1083
    // optional int32 error_code = 12;
1084
0
    if (cached_has_bits & 0x00002000u) {
1085
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_error_code());
1086
0
    }
1087
1088
    // optional int32 request_size = 13;
1089
0
    if (cached_has_bits & 0x00004000u) {
1090
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_request_size());
1091
0
    }
1092
1093
    // optional int32 response_size = 14;
1094
0
    if (cached_has_bits & 0x00008000u) {
1095
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_response_size());
1096
0
    }
1097
1098
0
  }
1099
0
  if (cached_has_bits & 0x001f0000u) {
1100
    // optional int64 received_real_us = 15;
1101
0
    if (cached_has_bits & 0x00010000u) {
1102
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_received_real_us());
1103
0
    }
1104
1105
    // optional int64 start_parse_real_us = 16;
1106
0
    if (cached_has_bits & 0x00020000u) {
1107
0
      total_size += 2 +
1108
0
        ::_pbi::WireFormatLite::Int64Size(
1109
0
          this->_internal_start_parse_real_us());
1110
0
    }
1111
1112
    // optional int64 start_callback_real_us = 17;
1113
0
    if (cached_has_bits & 0x00040000u) {
1114
0
      total_size += 2 +
1115
0
        ::_pbi::WireFormatLite::Int64Size(
1116
0
          this->_internal_start_callback_real_us());
1117
0
    }
1118
1119
    // optional int64 start_send_real_us = 18;
1120
0
    if (cached_has_bits & 0x00080000u) {
1121
0
      total_size += 2 +
1122
0
        ::_pbi::WireFormatLite::Int64Size(
1123
0
          this->_internal_start_send_real_us());
1124
0
    }
1125
1126
    // optional int64 sent_real_us = 19;
1127
0
    if (cached_has_bits & 0x00100000u) {
1128
0
      total_size += 2 +
1129
0
        ::_pbi::WireFormatLite::Int64Size(
1130
0
          this->_internal_sent_real_us());
1131
0
    }
1132
1133
0
  }
1134
0
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
1135
0
}
1136
1137
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RpczSpan::_class_data_ = {
1138
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
1139
    RpczSpan::MergeImpl
1140
};
1141
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RpczSpan::GetClassData() const { return &_class_data_; }
1142
1143
1144
0
void RpczSpan::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
1145
0
  auto* const _this = static_cast<RpczSpan*>(&to_msg);
1146
0
  auto& from = static_cast<const RpczSpan&>(from_msg);
1147
  // @@protoc_insertion_point(class_specific_merge_from_start:brpc.RpczSpan)
1148
0
  GOOGLE_DCHECK_NE(&from, _this);
1149
0
  uint32_t cached_has_bits = 0;
1150
0
  (void) cached_has_bits;
1151
1152
0
  _this->_impl_.client_spans_.MergeFrom(from._impl_.client_spans_);
1153
0
  cached_has_bits = from._impl_._has_bits_[0];
1154
0
  if (cached_has_bits & 0x000000ffu) {
1155
0
    if (cached_has_bits & 0x00000001u) {
1156
0
      _this->_internal_set_info(from._internal_info());
1157
0
    }
1158
0
    if (cached_has_bits & 0x00000002u) {
1159
0
      _this->_internal_set_full_method_name(from._internal_full_method_name());
1160
0
    }
1161
0
    if (cached_has_bits & 0x00000004u) {
1162
0
      _this->_impl_.trace_id_ = from._impl_.trace_id_;
1163
0
    }
1164
0
    if (cached_has_bits & 0x00000008u) {
1165
0
      _this->_impl_.span_id_ = from._impl_.span_id_;
1166
0
    }
1167
0
    if (cached_has_bits & 0x00000010u) {
1168
0
      _this->_impl_.parent_span_id_ = from._impl_.parent_span_id_;
1169
0
    }
1170
0
    if (cached_has_bits & 0x00000020u) {
1171
0
      _this->_impl_.log_id_ = from._impl_.log_id_;
1172
0
    }
1173
0
    if (cached_has_bits & 0x00000040u) {
1174
0
      _this->_impl_.base_cid_ = from._impl_.base_cid_;
1175
0
    }
1176
0
    if (cached_has_bits & 0x00000080u) {
1177
0
      _this->_impl_.ending_cid_ = from._impl_.ending_cid_;
1178
0
    }
1179
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
1180
0
  }
1181
0
  if (cached_has_bits & 0x0000ff00u) {
1182
0
    if (cached_has_bits & 0x00000100u) {
1183
0
      _this->_impl_.remote_ip_ = from._impl_.remote_ip_;
1184
0
    }
1185
0
    if (cached_has_bits & 0x00000200u) {
1186
0
      _this->_impl_.remote_port_ = from._impl_.remote_port_;
1187
0
    }
1188
0
    if (cached_has_bits & 0x00000400u) {
1189
0
      _this->_impl_.type_ = from._impl_.type_;
1190
0
    }
1191
0
    if (cached_has_bits & 0x00000800u) {
1192
0
      _this->_impl_.async_ = from._impl_.async_;
1193
0
    }
1194
0
    if (cached_has_bits & 0x00001000u) {
1195
0
      _this->_impl_.protocol_ = from._impl_.protocol_;
1196
0
    }
1197
0
    if (cached_has_bits & 0x00002000u) {
1198
0
      _this->_impl_.error_code_ = from._impl_.error_code_;
1199
0
    }
1200
0
    if (cached_has_bits & 0x00004000u) {
1201
0
      _this->_impl_.request_size_ = from._impl_.request_size_;
1202
0
    }
1203
0
    if (cached_has_bits & 0x00008000u) {
1204
0
      _this->_impl_.response_size_ = from._impl_.response_size_;
1205
0
    }
1206
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
1207
0
  }
1208
0
  if (cached_has_bits & 0x001f0000u) {
1209
0
    if (cached_has_bits & 0x00010000u) {
1210
0
      _this->_impl_.received_real_us_ = from._impl_.received_real_us_;
1211
0
    }
1212
0
    if (cached_has_bits & 0x00020000u) {
1213
0
      _this->_impl_.start_parse_real_us_ = from._impl_.start_parse_real_us_;
1214
0
    }
1215
0
    if (cached_has_bits & 0x00040000u) {
1216
0
      _this->_impl_.start_callback_real_us_ = from._impl_.start_callback_real_us_;
1217
0
    }
1218
0
    if (cached_has_bits & 0x00080000u) {
1219
0
      _this->_impl_.start_send_real_us_ = from._impl_.start_send_real_us_;
1220
0
    }
1221
0
    if (cached_has_bits & 0x00100000u) {
1222
0
      _this->_impl_.sent_real_us_ = from._impl_.sent_real_us_;
1223
0
    }
1224
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
1225
0
  }
1226
0
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
1227
0
}
1228
1229
0
void RpczSpan::CopyFrom(const RpczSpan& from) {
1230
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.RpczSpan)
1231
0
  if (&from == this) return;
1232
0
  Clear();
1233
0
  MergeFrom(from);
1234
0
}
1235
1236
0
bool RpczSpan::IsInitialized() const {
1237
0
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
1238
0
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.client_spans_))
1239
0
    return false;
1240
0
  return true;
1241
0
}
1242
1243
0
void RpczSpan::InternalSwap(RpczSpan* other) {
1244
0
  using std::swap;
1245
0
  auto* lhs_arena = GetArenaForAllocation();
1246
0
  auto* rhs_arena = other->GetArenaForAllocation();
1247
0
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1248
0
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1249
0
  _impl_.client_spans_.InternalSwap(&other->_impl_.client_spans_);
1250
0
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1251
0
      &_impl_.info_, lhs_arena,
1252
0
      &other->_impl_.info_, rhs_arena
1253
0
  );
1254
0
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1255
0
      &_impl_.full_method_name_, lhs_arena,
1256
0
      &other->_impl_.full_method_name_, rhs_arena
1257
0
  );
1258
0
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1259
0
      PROTOBUF_FIELD_OFFSET(RpczSpan, _impl_.sent_real_us_)
1260
0
      + sizeof(RpczSpan::_impl_.sent_real_us_)
1261
0
      - PROTOBUF_FIELD_OFFSET(RpczSpan, _impl_.trace_id_)>(
1262
0
          reinterpret_cast<char*>(&_impl_.trace_id_),
1263
0
          reinterpret_cast<char*>(&other->_impl_.trace_id_));
1264
0
}
1265
1266
0
::PROTOBUF_NAMESPACE_ID::Metadata RpczSpan::GetMetadata() const {
1267
0
  return ::_pbi::AssignDescriptors(
1268
0
      &descriptor_table_brpc_2fspan_2eproto_getter, &descriptor_table_brpc_2fspan_2eproto_once,
1269
0
      file_level_metadata_brpc_2fspan_2eproto[0]);
1270
0
}
1271
1272
// ===================================================================
1273
1274
class BriefSpan::_Internal {
1275
 public:
1276
  using HasBits = decltype(std::declval<BriefSpan>()._impl_._has_bits_);
1277
0
  static void set_has_trace_id(HasBits* has_bits) {
1278
0
    (*has_bits)[0] |= 2u;
1279
0
  }
1280
0
  static void set_has_span_id(HasBits* has_bits) {
1281
0
    (*has_bits)[0] |= 4u;
1282
0
  }
1283
0
  static void set_has_log_id(HasBits* has_bits) {
1284
0
    (*has_bits)[0] |= 8u;
1285
0
  }
1286
0
  static void set_has_type(HasBits* has_bits) {
1287
0
    (*has_bits)[0] |= 16u;
1288
0
  }
1289
0
  static void set_has_error_code(HasBits* has_bits) {
1290
0
    (*has_bits)[0] |= 32u;
1291
0
  }
1292
0
  static void set_has_request_size(HasBits* has_bits) {
1293
0
    (*has_bits)[0] |= 64u;
1294
0
  }
1295
0
  static void set_has_response_size(HasBits* has_bits) {
1296
0
    (*has_bits)[0] |= 128u;
1297
0
  }
1298
0
  static void set_has_start_real_us(HasBits* has_bits) {
1299
0
    (*has_bits)[0] |= 256u;
1300
0
  }
1301
0
  static void set_has_latency_us(HasBits* has_bits) {
1302
0
    (*has_bits)[0] |= 512u;
1303
0
  }
1304
0
  static void set_has_full_method_name(HasBits* has_bits) {
1305
0
    (*has_bits)[0] |= 1u;
1306
0
  }
1307
0
  static bool MissingRequiredFields(const HasBits& has_bits) {
1308
0
    return ((has_bits[0] & 0x00000006) ^ 0x00000006) != 0;
1309
0
  }
1310
};
1311
1312
BriefSpan::BriefSpan(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1313
                         bool is_message_owned)
1314
0
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
1315
0
  SharedCtor(arena, is_message_owned);
1316
  // @@protoc_insertion_point(arena_constructor:brpc.BriefSpan)
1317
0
}
1318
BriefSpan::BriefSpan(const BriefSpan& from)
1319
0
  : ::PROTOBUF_NAMESPACE_ID::Message() {
1320
0
  BriefSpan* const _this = this; (void)_this;
1321
0
  new (&_impl_) Impl_{
1322
0
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
1323
0
    , /*decltype(_impl_._cached_size_)*/{}
1324
0
    , decltype(_impl_.full_method_name_){}
1325
0
    , decltype(_impl_.trace_id_){}
1326
0
    , decltype(_impl_.span_id_){}
1327
0
    , decltype(_impl_.log_id_){}
1328
0
    , decltype(_impl_.type_){}
1329
0
    , decltype(_impl_.error_code_){}
1330
0
    , decltype(_impl_.request_size_){}
1331
0
    , decltype(_impl_.response_size_){}
1332
0
    , decltype(_impl_.start_real_us_){}
1333
0
    , decltype(_impl_.latency_us_){}};
1334
1335
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
1336
0
  _impl_.full_method_name_.InitDefault();
1337
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1338
    _impl_.full_method_name_.Set("", GetArenaForAllocation());
1339
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1340
0
  if (from._internal_has_full_method_name()) {
1341
0
    _this->_impl_.full_method_name_.Set(from._internal_full_method_name(), 
1342
0
      _this->GetArenaForAllocation());
1343
0
  }
1344
0
  ::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_,
1345
0
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.latency_us_) -
1346
0
    reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.latency_us_));
1347
  // @@protoc_insertion_point(copy_constructor:brpc.BriefSpan)
1348
0
}
1349
1350
inline void BriefSpan::SharedCtor(
1351
0
    ::_pb::Arena* arena, bool is_message_owned) {
1352
0
  (void)arena;
1353
0
  (void)is_message_owned;
1354
0
  new (&_impl_) Impl_{
1355
0
      decltype(_impl_._has_bits_){}
1356
0
    , /*decltype(_impl_._cached_size_)*/{}
1357
0
    , decltype(_impl_.full_method_name_){}
1358
0
    , decltype(_impl_.trace_id_){uint64_t{0u}}
1359
0
    , decltype(_impl_.span_id_){uint64_t{0u}}
1360
0
    , decltype(_impl_.log_id_){uint64_t{0u}}
1361
0
    , decltype(_impl_.type_){0}
1362
0
    , decltype(_impl_.error_code_){0}
1363
0
    , decltype(_impl_.request_size_){0}
1364
0
    , decltype(_impl_.response_size_){0}
1365
0
    , decltype(_impl_.start_real_us_){int64_t{0}}
1366
0
    , decltype(_impl_.latency_us_){int64_t{0}}
1367
0
  };
1368
0
  _impl_.full_method_name_.InitDefault();
1369
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1370
    _impl_.full_method_name_.Set("", GetArenaForAllocation());
1371
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1372
0
}
1373
1374
0
BriefSpan::~BriefSpan() {
1375
  // @@protoc_insertion_point(destructor:brpc.BriefSpan)
1376
0
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
1377
0
  (void)arena;
1378
0
    return;
1379
0
  }
1380
0
  SharedDtor();
1381
0
}
1382
1383
0
inline void BriefSpan::SharedDtor() {
1384
0
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1385
0
  _impl_.full_method_name_.Destroy();
1386
0
}
1387
1388
0
void BriefSpan::SetCachedSize(int size) const {
1389
0
  _impl_._cached_size_.Set(size);
1390
0
}
1391
1392
0
void BriefSpan::Clear() {
1393
// @@protoc_insertion_point(message_clear_start:brpc.BriefSpan)
1394
0
  uint32_t cached_has_bits = 0;
1395
  // Prevent compiler warnings about cached_has_bits being unused
1396
0
  (void) cached_has_bits;
1397
1398
0
  cached_has_bits = _impl_._has_bits_[0];
1399
0
  if (cached_has_bits & 0x00000001u) {
1400
0
    _impl_.full_method_name_.ClearNonDefaultToEmpty();
1401
0
  }
1402
0
  if (cached_has_bits & 0x000000feu) {
1403
0
    ::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
1404
0
        reinterpret_cast<char*>(&_impl_.response_size_) -
1405
0
        reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.response_size_));
1406
0
  }
1407
0
  if (cached_has_bits & 0x00000300u) {
1408
0
    ::memset(&_impl_.start_real_us_, 0, static_cast<size_t>(
1409
0
        reinterpret_cast<char*>(&_impl_.latency_us_) -
1410
0
        reinterpret_cast<char*>(&_impl_.start_real_us_)) + sizeof(_impl_.latency_us_));
1411
0
  }
1412
0
  _impl_._has_bits_.Clear();
1413
0
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
1414
0
}
1415
1416
0
const char* BriefSpan::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1417
0
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1418
0
  _Internal::HasBits has_bits{};
1419
0
  while (!ctx->Done(&ptr)) {
1420
0
    uint32_t tag;
1421
0
    ptr = ::_pbi::ReadTag(ptr, &tag);
1422
0
    switch (tag >> 3) {
1423
      // required uint64 trace_id = 1;
1424
0
      case 1:
1425
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
1426
0
          _Internal::set_has_trace_id(&has_bits);
1427
0
          _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1428
0
          CHK_(ptr);
1429
0
        } else
1430
0
          goto handle_unusual;
1431
0
        continue;
1432
      // required uint64 span_id = 2;
1433
0
      case 2:
1434
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
1435
0
          _Internal::set_has_span_id(&has_bits);
1436
0
          _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1437
0
          CHK_(ptr);
1438
0
        } else
1439
0
          goto handle_unusual;
1440
0
        continue;
1441
      // optional uint64 log_id = 3;
1442
0
      case 3:
1443
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
1444
0
          _Internal::set_has_log_id(&has_bits);
1445
0
          _impl_.log_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1446
0
          CHK_(ptr);
1447
0
        } else
1448
0
          goto handle_unusual;
1449
0
        continue;
1450
      // optional .brpc.SpanType type = 4;
1451
0
      case 4:
1452
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
1453
0
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1454
0
          CHK_(ptr);
1455
0
          if (PROTOBUF_PREDICT_TRUE(::brpc::SpanType_IsValid(val))) {
1456
0
            _internal_set_type(static_cast<::brpc::SpanType>(val));
1457
0
          } else {
1458
0
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
1459
0
          }
1460
0
        } else
1461
0
          goto handle_unusual;
1462
0
        continue;
1463
      // optional int32 error_code = 5;
1464
0
      case 5:
1465
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
1466
0
          _Internal::set_has_error_code(&has_bits);
1467
0
          _impl_.error_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1468
0
          CHK_(ptr);
1469
0
        } else
1470
0
          goto handle_unusual;
1471
0
        continue;
1472
      // optional int32 request_size = 6;
1473
0
      case 6:
1474
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
1475
0
          _Internal::set_has_request_size(&has_bits);
1476
0
          _impl_.request_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1477
0
          CHK_(ptr);
1478
0
        } else
1479
0
          goto handle_unusual;
1480
0
        continue;
1481
      // optional int32 response_size = 7;
1482
0
      case 7:
1483
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
1484
0
          _Internal::set_has_response_size(&has_bits);
1485
0
          _impl_.response_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1486
0
          CHK_(ptr);
1487
0
        } else
1488
0
          goto handle_unusual;
1489
0
        continue;
1490
      // optional int64 start_real_us = 8;
1491
0
      case 8:
1492
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
1493
0
          _Internal::set_has_start_real_us(&has_bits);
1494
0
          _impl_.start_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1495
0
          CHK_(ptr);
1496
0
        } else
1497
0
          goto handle_unusual;
1498
0
        continue;
1499
      // optional int64 latency_us = 9;
1500
0
      case 9:
1501
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
1502
0
          _Internal::set_has_latency_us(&has_bits);
1503
0
          _impl_.latency_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1504
0
          CHK_(ptr);
1505
0
        } else
1506
0
          goto handle_unusual;
1507
0
        continue;
1508
      // optional bytes full_method_name = 10;
1509
0
      case 10:
1510
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
1511
0
          auto str = _internal_mutable_full_method_name();
1512
0
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1513
0
          CHK_(ptr);
1514
0
        } else
1515
0
          goto handle_unusual;
1516
0
        continue;
1517
0
      default:
1518
0
        goto handle_unusual;
1519
0
    }  // switch
1520
0
  handle_unusual:
1521
0
    if ((tag == 0) || ((tag & 7) == 4)) {
1522
0
      CHK_(ptr);
1523
0
      ctx->SetLastTag(tag);
1524
0
      goto message_done;
1525
0
    }
1526
0
    ptr = UnknownFieldParse(
1527
0
        tag,
1528
0
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
1529
0
        ptr, ctx);
1530
0
    CHK_(ptr != nullptr);
1531
0
  }  // while
1532
0
message_done:
1533
0
  _impl_._has_bits_.Or(has_bits);
1534
0
  return ptr;
1535
0
failure:
1536
0
  ptr = nullptr;
1537
0
  goto message_done;
1538
0
#undef CHK_
1539
0
}
1540
1541
uint8_t* BriefSpan::_InternalSerialize(
1542
0
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1543
  // @@protoc_insertion_point(serialize_to_array_start:brpc.BriefSpan)
1544
0
  uint32_t cached_has_bits = 0;
1545
0
  (void) cached_has_bits;
1546
1547
0
  cached_has_bits = _impl_._has_bits_[0];
1548
  // required uint64 trace_id = 1;
1549
0
  if (cached_has_bits & 0x00000002u) {
1550
0
    target = stream->EnsureSpace(target);
1551
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_trace_id(), target);
1552
0
  }
1553
1554
  // required uint64 span_id = 2;
1555
0
  if (cached_has_bits & 0x00000004u) {
1556
0
    target = stream->EnsureSpace(target);
1557
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_span_id(), target);
1558
0
  }
1559
1560
  // optional uint64 log_id = 3;
1561
0
  if (cached_has_bits & 0x00000008u) {
1562
0
    target = stream->EnsureSpace(target);
1563
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_log_id(), target);
1564
0
  }
1565
1566
  // optional .brpc.SpanType type = 4;
1567
0
  if (cached_has_bits & 0x00000010u) {
1568
0
    target = stream->EnsureSpace(target);
1569
0
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
1570
0
      4, this->_internal_type(), target);
1571
0
  }
1572
1573
  // optional int32 error_code = 5;
1574
0
  if (cached_has_bits & 0x00000020u) {
1575
0
    target = stream->EnsureSpace(target);
1576
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_error_code(), target);
1577
0
  }
1578
1579
  // optional int32 request_size = 6;
1580
0
  if (cached_has_bits & 0x00000040u) {
1581
0
    target = stream->EnsureSpace(target);
1582
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_request_size(), target);
1583
0
  }
1584
1585
  // optional int32 response_size = 7;
1586
0
  if (cached_has_bits & 0x00000080u) {
1587
0
    target = stream->EnsureSpace(target);
1588
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_response_size(), target);
1589
0
  }
1590
1591
  // optional int64 start_real_us = 8;
1592
0
  if (cached_has_bits & 0x00000100u) {
1593
0
    target = stream->EnsureSpace(target);
1594
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_start_real_us(), target);
1595
0
  }
1596
1597
  // optional int64 latency_us = 9;
1598
0
  if (cached_has_bits & 0x00000200u) {
1599
0
    target = stream->EnsureSpace(target);
1600
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(9, this->_internal_latency_us(), target);
1601
0
  }
1602
1603
  // optional bytes full_method_name = 10;
1604
0
  if (cached_has_bits & 0x00000001u) {
1605
0
    target = stream->WriteBytesMaybeAliased(
1606
0
        10, this->_internal_full_method_name(), target);
1607
0
  }
1608
1609
0
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1610
0
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
1611
0
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
1612
0
  }
1613
  // @@protoc_insertion_point(serialize_to_array_end:brpc.BriefSpan)
1614
0
  return target;
1615
0
}
1616
1617
0
size_t BriefSpan::RequiredFieldsByteSizeFallback() const {
1618
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.BriefSpan)
1619
0
  size_t total_size = 0;
1620
1621
0
  if (_internal_has_trace_id()) {
1622
    // required uint64 trace_id = 1;
1623
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
1624
0
  }
1625
1626
0
  if (_internal_has_span_id()) {
1627
    // required uint64 span_id = 2;
1628
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
1629
0
  }
1630
1631
0
  return total_size;
1632
0
}
1633
0
size_t BriefSpan::ByteSizeLong() const {
1634
// @@protoc_insertion_point(message_byte_size_start:brpc.BriefSpan)
1635
0
  size_t total_size = 0;
1636
1637
0
  if (((_impl_._has_bits_[0] & 0x00000006) ^ 0x00000006) == 0) {  // All required fields are present.
1638
    // required uint64 trace_id = 1;
1639
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
1640
1641
    // required uint64 span_id = 2;
1642
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
1643
1644
0
  } else {
1645
0
    total_size += RequiredFieldsByteSizeFallback();
1646
0
  }
1647
0
  uint32_t cached_has_bits = 0;
1648
  // Prevent compiler warnings about cached_has_bits being unused
1649
0
  (void) cached_has_bits;
1650
1651
  // optional bytes full_method_name = 10;
1652
0
  cached_has_bits = _impl_._has_bits_[0];
1653
0
  if (cached_has_bits & 0x00000001u) {
1654
0
    total_size += 1 +
1655
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
1656
0
        this->_internal_full_method_name());
1657
0
  }
1658
1659
0
  if (cached_has_bits & 0x000000f8u) {
1660
    // optional uint64 log_id = 3;
1661
0
    if (cached_has_bits & 0x00000008u) {
1662
0
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_log_id());
1663
0
    }
1664
1665
    // optional .brpc.SpanType type = 4;
1666
0
    if (cached_has_bits & 0x00000010u) {
1667
0
      total_size += 1 +
1668
0
        ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
1669
0
    }
1670
1671
    // optional int32 error_code = 5;
1672
0
    if (cached_has_bits & 0x00000020u) {
1673
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_error_code());
1674
0
    }
1675
1676
    // optional int32 request_size = 6;
1677
0
    if (cached_has_bits & 0x00000040u) {
1678
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_request_size());
1679
0
    }
1680
1681
    // optional int32 response_size = 7;
1682
0
    if (cached_has_bits & 0x00000080u) {
1683
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_response_size());
1684
0
    }
1685
1686
0
  }
1687
0
  if (cached_has_bits & 0x00000300u) {
1688
    // optional int64 start_real_us = 8;
1689
0
    if (cached_has_bits & 0x00000100u) {
1690
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start_real_us());
1691
0
    }
1692
1693
    // optional int64 latency_us = 9;
1694
0
    if (cached_has_bits & 0x00000200u) {
1695
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_latency_us());
1696
0
    }
1697
1698
0
  }
1699
0
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
1700
0
}
1701
1702
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BriefSpan::_class_data_ = {
1703
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
1704
    BriefSpan::MergeImpl
1705
};
1706
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BriefSpan::GetClassData() const { return &_class_data_; }
1707
1708
1709
0
void BriefSpan::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
1710
0
  auto* const _this = static_cast<BriefSpan*>(&to_msg);
1711
0
  auto& from = static_cast<const BriefSpan&>(from_msg);
1712
  // @@protoc_insertion_point(class_specific_merge_from_start:brpc.BriefSpan)
1713
0
  GOOGLE_DCHECK_NE(&from, _this);
1714
0
  uint32_t cached_has_bits = 0;
1715
0
  (void) cached_has_bits;
1716
1717
0
  cached_has_bits = from._impl_._has_bits_[0];
1718
0
  if (cached_has_bits & 0x000000ffu) {
1719
0
    if (cached_has_bits & 0x00000001u) {
1720
0
      _this->_internal_set_full_method_name(from._internal_full_method_name());
1721
0
    }
1722
0
    if (cached_has_bits & 0x00000002u) {
1723
0
      _this->_impl_.trace_id_ = from._impl_.trace_id_;
1724
0
    }
1725
0
    if (cached_has_bits & 0x00000004u) {
1726
0
      _this->_impl_.span_id_ = from._impl_.span_id_;
1727
0
    }
1728
0
    if (cached_has_bits & 0x00000008u) {
1729
0
      _this->_impl_.log_id_ = from._impl_.log_id_;
1730
0
    }
1731
0
    if (cached_has_bits & 0x00000010u) {
1732
0
      _this->_impl_.type_ = from._impl_.type_;
1733
0
    }
1734
0
    if (cached_has_bits & 0x00000020u) {
1735
0
      _this->_impl_.error_code_ = from._impl_.error_code_;
1736
0
    }
1737
0
    if (cached_has_bits & 0x00000040u) {
1738
0
      _this->_impl_.request_size_ = from._impl_.request_size_;
1739
0
    }
1740
0
    if (cached_has_bits & 0x00000080u) {
1741
0
      _this->_impl_.response_size_ = from._impl_.response_size_;
1742
0
    }
1743
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
1744
0
  }
1745
0
  if (cached_has_bits & 0x00000300u) {
1746
0
    if (cached_has_bits & 0x00000100u) {
1747
0
      _this->_impl_.start_real_us_ = from._impl_.start_real_us_;
1748
0
    }
1749
0
    if (cached_has_bits & 0x00000200u) {
1750
0
      _this->_impl_.latency_us_ = from._impl_.latency_us_;
1751
0
    }
1752
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
1753
0
  }
1754
0
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
1755
0
}
1756
1757
0
void BriefSpan::CopyFrom(const BriefSpan& from) {
1758
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.BriefSpan)
1759
0
  if (&from == this) return;
1760
0
  Clear();
1761
0
  MergeFrom(from);
1762
0
}
1763
1764
0
bool BriefSpan::IsInitialized() const {
1765
0
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
1766
0
  return true;
1767
0
}
1768
1769
0
void BriefSpan::InternalSwap(BriefSpan* other) {
1770
0
  using std::swap;
1771
0
  auto* lhs_arena = GetArenaForAllocation();
1772
0
  auto* rhs_arena = other->GetArenaForAllocation();
1773
0
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1774
0
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1775
0
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1776
0
      &_impl_.full_method_name_, lhs_arena,
1777
0
      &other->_impl_.full_method_name_, rhs_arena
1778
0
  );
1779
0
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1780
0
      PROTOBUF_FIELD_OFFSET(BriefSpan, _impl_.latency_us_)
1781
0
      + sizeof(BriefSpan::_impl_.latency_us_)
1782
0
      - PROTOBUF_FIELD_OFFSET(BriefSpan, _impl_.trace_id_)>(
1783
0
          reinterpret_cast<char*>(&_impl_.trace_id_),
1784
0
          reinterpret_cast<char*>(&other->_impl_.trace_id_));
1785
0
}
1786
1787
0
::PROTOBUF_NAMESPACE_ID::Metadata BriefSpan::GetMetadata() const {
1788
0
  return ::_pbi::AssignDescriptors(
1789
0
      &descriptor_table_brpc_2fspan_2eproto_getter, &descriptor_table_brpc_2fspan_2eproto_once,
1790
0
      file_level_metadata_brpc_2fspan_2eproto[1]);
1791
0
}
1792
1793
// ===================================================================
1794
1795
class SpanAnnotation::_Internal {
1796
 public:
1797
  using HasBits = decltype(std::declval<SpanAnnotation>()._impl_._has_bits_);
1798
0
  static void set_has_realtime_us(HasBits* has_bits) {
1799
0
    (*has_bits)[0] |= 2u;
1800
0
  }
1801
0
  static void set_has_content(HasBits* has_bits) {
1802
0
    (*has_bits)[0] |= 1u;
1803
0
  }
1804
0
  static bool MissingRequiredFields(const HasBits& has_bits) {
1805
0
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
1806
0
  }
1807
};
1808
1809
SpanAnnotation::SpanAnnotation(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1810
                         bool is_message_owned)
1811
0
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
1812
0
  SharedCtor(arena, is_message_owned);
1813
  // @@protoc_insertion_point(arena_constructor:brpc.SpanAnnotation)
1814
0
}
1815
SpanAnnotation::SpanAnnotation(const SpanAnnotation& from)
1816
0
  : ::PROTOBUF_NAMESPACE_ID::Message() {
1817
0
  SpanAnnotation* const _this = this; (void)_this;
1818
0
  new (&_impl_) Impl_{
1819
0
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
1820
0
    , /*decltype(_impl_._cached_size_)*/{}
1821
0
    , decltype(_impl_.content_){}
1822
0
    , decltype(_impl_.realtime_us_){}};
1823
1824
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
1825
0
  _impl_.content_.InitDefault();
1826
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1827
    _impl_.content_.Set("", GetArenaForAllocation());
1828
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1829
0
  if (from._internal_has_content()) {
1830
0
    _this->_impl_.content_.Set(from._internal_content(), 
1831
0
      _this->GetArenaForAllocation());
1832
0
  }
1833
0
  _this->_impl_.realtime_us_ = from._impl_.realtime_us_;
1834
  // @@protoc_insertion_point(copy_constructor:brpc.SpanAnnotation)
1835
0
}
1836
1837
inline void SpanAnnotation::SharedCtor(
1838
0
    ::_pb::Arena* arena, bool is_message_owned) {
1839
0
  (void)arena;
1840
0
  (void)is_message_owned;
1841
0
  new (&_impl_) Impl_{
1842
0
      decltype(_impl_._has_bits_){}
1843
0
    , /*decltype(_impl_._cached_size_)*/{}
1844
0
    , decltype(_impl_.content_){}
1845
0
    , decltype(_impl_.realtime_us_){int64_t{0}}
1846
0
  };
1847
0
  _impl_.content_.InitDefault();
1848
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1849
    _impl_.content_.Set("", GetArenaForAllocation());
1850
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1851
0
}
1852
1853
0
SpanAnnotation::~SpanAnnotation() {
1854
  // @@protoc_insertion_point(destructor:brpc.SpanAnnotation)
1855
0
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
1856
0
  (void)arena;
1857
0
    return;
1858
0
  }
1859
0
  SharedDtor();
1860
0
}
1861
1862
0
inline void SpanAnnotation::SharedDtor() {
1863
0
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1864
0
  _impl_.content_.Destroy();
1865
0
}
1866
1867
0
void SpanAnnotation::SetCachedSize(int size) const {
1868
0
  _impl_._cached_size_.Set(size);
1869
0
}
1870
1871
0
void SpanAnnotation::Clear() {
1872
// @@protoc_insertion_point(message_clear_start:brpc.SpanAnnotation)
1873
0
  uint32_t cached_has_bits = 0;
1874
  // Prevent compiler warnings about cached_has_bits being unused
1875
0
  (void) cached_has_bits;
1876
1877
0
  cached_has_bits = _impl_._has_bits_[0];
1878
0
  if (cached_has_bits & 0x00000001u) {
1879
0
    _impl_.content_.ClearNonDefaultToEmpty();
1880
0
  }
1881
0
  _impl_.realtime_us_ = int64_t{0};
1882
0
  _impl_._has_bits_.Clear();
1883
0
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
1884
0
}
1885
1886
0
const char* SpanAnnotation::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1887
0
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1888
0
  _Internal::HasBits has_bits{};
1889
0
  while (!ctx->Done(&ptr)) {
1890
0
    uint32_t tag;
1891
0
    ptr = ::_pbi::ReadTag(ptr, &tag);
1892
0
    switch (tag >> 3) {
1893
      // required int64 realtime_us = 1;
1894
0
      case 1:
1895
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
1896
0
          _Internal::set_has_realtime_us(&has_bits);
1897
0
          _impl_.realtime_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1898
0
          CHK_(ptr);
1899
0
        } else
1900
0
          goto handle_unusual;
1901
0
        continue;
1902
      // required string content = 2;
1903
0
      case 2:
1904
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
1905
0
          auto str = _internal_mutable_content();
1906
0
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1907
0
          CHK_(ptr);
1908
0
          #ifndef NDEBUG
1909
0
          ::_pbi::VerifyUTF8(str, "brpc.SpanAnnotation.content");
1910
0
          #endif  // !NDEBUG
1911
0
        } else
1912
0
          goto handle_unusual;
1913
0
        continue;
1914
0
      default:
1915
0
        goto handle_unusual;
1916
0
    }  // switch
1917
0
  handle_unusual:
1918
0
    if ((tag == 0) || ((tag & 7) == 4)) {
1919
0
      CHK_(ptr);
1920
0
      ctx->SetLastTag(tag);
1921
0
      goto message_done;
1922
0
    }
1923
0
    ptr = UnknownFieldParse(
1924
0
        tag,
1925
0
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
1926
0
        ptr, ctx);
1927
0
    CHK_(ptr != nullptr);
1928
0
  }  // while
1929
0
message_done:
1930
0
  _impl_._has_bits_.Or(has_bits);
1931
0
  return ptr;
1932
0
failure:
1933
0
  ptr = nullptr;
1934
0
  goto message_done;
1935
0
#undef CHK_
1936
0
}
1937
1938
uint8_t* SpanAnnotation::_InternalSerialize(
1939
0
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1940
  // @@protoc_insertion_point(serialize_to_array_start:brpc.SpanAnnotation)
1941
0
  uint32_t cached_has_bits = 0;
1942
0
  (void) cached_has_bits;
1943
1944
0
  cached_has_bits = _impl_._has_bits_[0];
1945
  // required int64 realtime_us = 1;
1946
0
  if (cached_has_bits & 0x00000002u) {
1947
0
    target = stream->EnsureSpace(target);
1948
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_realtime_us(), target);
1949
0
  }
1950
1951
  // required string content = 2;
1952
0
  if (cached_has_bits & 0x00000001u) {
1953
0
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
1954
0
      this->_internal_content().data(), static_cast<int>(this->_internal_content().length()),
1955
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
1956
0
      "brpc.SpanAnnotation.content");
1957
0
    target = stream->WriteStringMaybeAliased(
1958
0
        2, this->_internal_content(), target);
1959
0
  }
1960
1961
0
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1962
0
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
1963
0
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
1964
0
  }
1965
  // @@protoc_insertion_point(serialize_to_array_end:brpc.SpanAnnotation)
1966
0
  return target;
1967
0
}
1968
1969
0
size_t SpanAnnotation::RequiredFieldsByteSizeFallback() const {
1970
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.SpanAnnotation)
1971
0
  size_t total_size = 0;
1972
1973
0
  if (_internal_has_content()) {
1974
    // required string content = 2;
1975
0
    total_size += 1 +
1976
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1977
0
        this->_internal_content());
1978
0
  }
1979
1980
0
  if (_internal_has_realtime_us()) {
1981
    // required int64 realtime_us = 1;
1982
0
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_realtime_us());
1983
0
  }
1984
1985
0
  return total_size;
1986
0
}
1987
0
size_t SpanAnnotation::ByteSizeLong() const {
1988
// @@protoc_insertion_point(message_byte_size_start:brpc.SpanAnnotation)
1989
0
  size_t total_size = 0;
1990
1991
0
  if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
1992
    // required string content = 2;
1993
0
    total_size += 1 +
1994
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1995
0
        this->_internal_content());
1996
1997
    // required int64 realtime_us = 1;
1998
0
    total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_realtime_us());
1999
2000
0
  } else {
2001
0
    total_size += RequiredFieldsByteSizeFallback();
2002
0
  }
2003
0
  uint32_t cached_has_bits = 0;
2004
  // Prevent compiler warnings about cached_has_bits being unused
2005
0
  (void) cached_has_bits;
2006
2007
0
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
2008
0
}
2009
2010
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SpanAnnotation::_class_data_ = {
2011
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
2012
    SpanAnnotation::MergeImpl
2013
};
2014
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SpanAnnotation::GetClassData() const { return &_class_data_; }
2015
2016
2017
0
void SpanAnnotation::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
2018
0
  auto* const _this = static_cast<SpanAnnotation*>(&to_msg);
2019
0
  auto& from = static_cast<const SpanAnnotation&>(from_msg);
2020
  // @@protoc_insertion_point(class_specific_merge_from_start:brpc.SpanAnnotation)
2021
0
  GOOGLE_DCHECK_NE(&from, _this);
2022
0
  uint32_t cached_has_bits = 0;
2023
0
  (void) cached_has_bits;
2024
2025
0
  cached_has_bits = from._impl_._has_bits_[0];
2026
0
  if (cached_has_bits & 0x00000003u) {
2027
0
    if (cached_has_bits & 0x00000001u) {
2028
0
      _this->_internal_set_content(from._internal_content());
2029
0
    }
2030
0
    if (cached_has_bits & 0x00000002u) {
2031
0
      _this->_impl_.realtime_us_ = from._impl_.realtime_us_;
2032
0
    }
2033
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
2034
0
  }
2035
0
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
2036
0
}
2037
2038
0
void SpanAnnotation::CopyFrom(const SpanAnnotation& from) {
2039
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.SpanAnnotation)
2040
0
  if (&from == this) return;
2041
0
  Clear();
2042
0
  MergeFrom(from);
2043
0
}
2044
2045
0
bool SpanAnnotation::IsInitialized() const {
2046
0
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
2047
0
  return true;
2048
0
}
2049
2050
0
void SpanAnnotation::InternalSwap(SpanAnnotation* other) {
2051
0
  using std::swap;
2052
0
  auto* lhs_arena = GetArenaForAllocation();
2053
0
  auto* rhs_arena = other->GetArenaForAllocation();
2054
0
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
2055
0
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
2056
0
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
2057
0
      &_impl_.content_, lhs_arena,
2058
0
      &other->_impl_.content_, rhs_arena
2059
0
  );
2060
0
  swap(_impl_.realtime_us_, other->_impl_.realtime_us_);
2061
0
}
2062
2063
0
::PROTOBUF_NAMESPACE_ID::Metadata SpanAnnotation::GetMetadata() const {
2064
0
  return ::_pbi::AssignDescriptors(
2065
0
      &descriptor_table_brpc_2fspan_2eproto_getter, &descriptor_table_brpc_2fspan_2eproto_once,
2066
0
      file_level_metadata_brpc_2fspan_2eproto[2]);
2067
0
}
2068
2069
// ===================================================================
2070
2071
class TracingSpan::_Internal {
2072
 public:
2073
  using HasBits = decltype(std::declval<TracingSpan>()._impl_._has_bits_);
2074
0
  static void set_has_trace_id(HasBits* has_bits) {
2075
0
    (*has_bits)[0] |= 2u;
2076
0
  }
2077
0
  static void set_has_span_id(HasBits* has_bits) {
2078
0
    (*has_bits)[0] |= 4u;
2079
0
  }
2080
0
  static void set_has_parent_span_id(HasBits* has_bits) {
2081
0
    (*has_bits)[0] |= 8u;
2082
0
  }
2083
0
  static void set_has_log_id(HasBits* has_bits) {
2084
0
    (*has_bits)[0] |= 16u;
2085
0
  }
2086
0
  static void set_has_remote_ip(HasBits* has_bits) {
2087
0
    (*has_bits)[0] |= 32u;
2088
0
  }
2089
0
  static void set_has_remote_port(HasBits* has_bits) {
2090
0
    (*has_bits)[0] |= 64u;
2091
0
  }
2092
0
  static void set_has_type(HasBits* has_bits) {
2093
0
    (*has_bits)[0] |= 128u;
2094
0
  }
2095
0
  static void set_has_protocol(HasBits* has_bits) {
2096
0
    (*has_bits)[0] |= 256u;
2097
0
  }
2098
0
  static void set_has_error_code(HasBits* has_bits) {
2099
0
    (*has_bits)[0] |= 512u;
2100
0
  }
2101
0
  static void set_has_request_size(HasBits* has_bits) {
2102
0
    (*has_bits)[0] |= 1024u;
2103
0
  }
2104
0
  static void set_has_response_size(HasBits* has_bits) {
2105
0
    (*has_bits)[0] |= 65536u;
2106
0
  }
2107
0
  static void set_has_received_real_us(HasBits* has_bits) {
2108
0
    (*has_bits)[0] |= 2048u;
2109
0
  }
2110
0
  static void set_has_start_parse_real_us(HasBits* has_bits) {
2111
0
    (*has_bits)[0] |= 4096u;
2112
0
  }
2113
0
  static void set_has_start_callback_real_us(HasBits* has_bits) {
2114
0
    (*has_bits)[0] |= 8192u;
2115
0
  }
2116
0
  static void set_has_start_send_real_us(HasBits* has_bits) {
2117
0
    (*has_bits)[0] |= 16384u;
2118
0
  }
2119
0
  static void set_has_sent_real_us(HasBits* has_bits) {
2120
0
    (*has_bits)[0] |= 32768u;
2121
0
  }
2122
0
  static void set_has_span_name(HasBits* has_bits) {
2123
0
    (*has_bits)[0] |= 1u;
2124
0
  }
2125
0
  static bool MissingRequiredFields(const HasBits& has_bits) {
2126
0
    return ((has_bits[0] & 0x0000000e) ^ 0x0000000e) != 0;
2127
0
  }
2128
};
2129
2130
TracingSpan::TracingSpan(::PROTOBUF_NAMESPACE_ID::Arena* arena,
2131
                         bool is_message_owned)
2132
0
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
2133
0
  SharedCtor(arena, is_message_owned);
2134
  // @@protoc_insertion_point(arena_constructor:brpc.TracingSpan)
2135
0
}
2136
TracingSpan::TracingSpan(const TracingSpan& from)
2137
0
  : ::PROTOBUF_NAMESPACE_ID::Message() {
2138
0
  TracingSpan* const _this = this; (void)_this;
2139
0
  new (&_impl_) Impl_{
2140
0
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
2141
0
    , /*decltype(_impl_._cached_size_)*/{}
2142
0
    , decltype(_impl_.annotations_){from._impl_.annotations_}
2143
0
    , decltype(_impl_.client_spans_){from._impl_.client_spans_}
2144
0
    , decltype(_impl_.span_name_){}
2145
0
    , decltype(_impl_.trace_id_){}
2146
0
    , decltype(_impl_.span_id_){}
2147
0
    , decltype(_impl_.parent_span_id_){}
2148
0
    , decltype(_impl_.log_id_){}
2149
0
    , decltype(_impl_.remote_ip_){}
2150
0
    , decltype(_impl_.remote_port_){}
2151
0
    , decltype(_impl_.type_){}
2152
0
    , decltype(_impl_.protocol_){}
2153
0
    , decltype(_impl_.error_code_){}
2154
0
    , decltype(_impl_.request_size_){}
2155
0
    , decltype(_impl_.received_real_us_){}
2156
0
    , decltype(_impl_.start_parse_real_us_){}
2157
0
    , decltype(_impl_.start_callback_real_us_){}
2158
0
    , decltype(_impl_.start_send_real_us_){}
2159
0
    , decltype(_impl_.sent_real_us_){}
2160
0
    , decltype(_impl_.response_size_){}};
2161
2162
0
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
2163
0
  _impl_.span_name_.InitDefault();
2164
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
2165
    _impl_.span_name_.Set("", GetArenaForAllocation());
2166
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
2167
0
  if (from._internal_has_span_name()) {
2168
0
    _this->_impl_.span_name_.Set(from._internal_span_name(), 
2169
0
      _this->GetArenaForAllocation());
2170
0
  }
2171
0
  ::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_,
2172
0
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.response_size_) -
2173
0
    reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.response_size_));
2174
  // @@protoc_insertion_point(copy_constructor:brpc.TracingSpan)
2175
0
}
2176
2177
inline void TracingSpan::SharedCtor(
2178
0
    ::_pb::Arena* arena, bool is_message_owned) {
2179
0
  (void)arena;
2180
0
  (void)is_message_owned;
2181
0
  new (&_impl_) Impl_{
2182
0
      decltype(_impl_._has_bits_){}
2183
0
    , /*decltype(_impl_._cached_size_)*/{}
2184
0
    , decltype(_impl_.annotations_){arena}
2185
0
    , decltype(_impl_.client_spans_){arena}
2186
0
    , decltype(_impl_.span_name_){}
2187
0
    , decltype(_impl_.trace_id_){uint64_t{0u}}
2188
0
    , decltype(_impl_.span_id_){uint64_t{0u}}
2189
0
    , decltype(_impl_.parent_span_id_){uint64_t{0u}}
2190
0
    , decltype(_impl_.log_id_){uint64_t{0u}}
2191
0
    , decltype(_impl_.remote_ip_){0u}
2192
0
    , decltype(_impl_.remote_port_){0u}
2193
0
    , decltype(_impl_.type_){0}
2194
0
    , decltype(_impl_.protocol_){0}
2195
0
    , decltype(_impl_.error_code_){0}
2196
0
    , decltype(_impl_.request_size_){0}
2197
0
    , decltype(_impl_.received_real_us_){int64_t{0}}
2198
0
    , decltype(_impl_.start_parse_real_us_){int64_t{0}}
2199
0
    , decltype(_impl_.start_callback_real_us_){int64_t{0}}
2200
0
    , decltype(_impl_.start_send_real_us_){int64_t{0}}
2201
0
    , decltype(_impl_.sent_real_us_){int64_t{0}}
2202
0
    , decltype(_impl_.response_size_){0}
2203
0
  };
2204
0
  _impl_.span_name_.InitDefault();
2205
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
2206
    _impl_.span_name_.Set("", GetArenaForAllocation());
2207
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
2208
0
}
2209
2210
0
TracingSpan::~TracingSpan() {
2211
  // @@protoc_insertion_point(destructor:brpc.TracingSpan)
2212
0
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
2213
0
  (void)arena;
2214
0
    return;
2215
0
  }
2216
0
  SharedDtor();
2217
0
}
2218
2219
0
inline void TracingSpan::SharedDtor() {
2220
0
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
2221
0
  _impl_.annotations_.~RepeatedPtrField();
2222
0
  _impl_.client_spans_.~RepeatedPtrField();
2223
0
  _impl_.span_name_.Destroy();
2224
0
}
2225
2226
0
void TracingSpan::SetCachedSize(int size) const {
2227
0
  _impl_._cached_size_.Set(size);
2228
0
}
2229
2230
0
void TracingSpan::Clear() {
2231
// @@protoc_insertion_point(message_clear_start:brpc.TracingSpan)
2232
0
  uint32_t cached_has_bits = 0;
2233
  // Prevent compiler warnings about cached_has_bits being unused
2234
0
  (void) cached_has_bits;
2235
2236
0
  _impl_.annotations_.Clear();
2237
0
  _impl_.client_spans_.Clear();
2238
0
  cached_has_bits = _impl_._has_bits_[0];
2239
0
  if (cached_has_bits & 0x00000001u) {
2240
0
    _impl_.span_name_.ClearNonDefaultToEmpty();
2241
0
  }
2242
0
  if (cached_has_bits & 0x000000feu) {
2243
0
    ::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
2244
0
        reinterpret_cast<char*>(&_impl_.type_) -
2245
0
        reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.type_));
2246
0
  }
2247
0
  if (cached_has_bits & 0x0000ff00u) {
2248
0
    ::memset(&_impl_.protocol_, 0, static_cast<size_t>(
2249
0
        reinterpret_cast<char*>(&_impl_.sent_real_us_) -
2250
0
        reinterpret_cast<char*>(&_impl_.protocol_)) + sizeof(_impl_.sent_real_us_));
2251
0
  }
2252
0
  _impl_.response_size_ = 0;
2253
0
  _impl_._has_bits_.Clear();
2254
0
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
2255
0
}
2256
2257
0
const char* TracingSpan::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
2258
0
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
2259
0
  _Internal::HasBits has_bits{};
2260
0
  while (!ctx->Done(&ptr)) {
2261
0
    uint32_t tag;
2262
0
    ptr = ::_pbi::ReadTag(ptr, &tag);
2263
0
    switch (tag >> 3) {
2264
      // required uint64 trace_id = 1;
2265
0
      case 1:
2266
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
2267
0
          _Internal::set_has_trace_id(&has_bits);
2268
0
          _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2269
0
          CHK_(ptr);
2270
0
        } else
2271
0
          goto handle_unusual;
2272
0
        continue;
2273
      // required uint64 span_id = 2;
2274
0
      case 2:
2275
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
2276
0
          _Internal::set_has_span_id(&has_bits);
2277
0
          _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2278
0
          CHK_(ptr);
2279
0
        } else
2280
0
          goto handle_unusual;
2281
0
        continue;
2282
      // required uint64 parent_span_id = 3;
2283
0
      case 3:
2284
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
2285
0
          _Internal::set_has_parent_span_id(&has_bits);
2286
0
          _impl_.parent_span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2287
0
          CHK_(ptr);
2288
0
        } else
2289
0
          goto handle_unusual;
2290
0
        continue;
2291
      // optional uint64 log_id = 4;
2292
0
      case 4:
2293
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
2294
0
          _Internal::set_has_log_id(&has_bits);
2295
0
          _impl_.log_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2296
0
          CHK_(ptr);
2297
0
        } else
2298
0
          goto handle_unusual;
2299
0
        continue;
2300
      // optional uint32 remote_ip = 5;
2301
0
      case 5:
2302
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
2303
0
          _Internal::set_has_remote_ip(&has_bits);
2304
0
          _impl_.remote_ip_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
2305
0
          CHK_(ptr);
2306
0
        } else
2307
0
          goto handle_unusual;
2308
0
        continue;
2309
      // optional uint32 remote_port = 6;
2310
0
      case 6:
2311
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
2312
0
          _Internal::set_has_remote_port(&has_bits);
2313
0
          _impl_.remote_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
2314
0
          CHK_(ptr);
2315
0
        } else
2316
0
          goto handle_unusual;
2317
0
        continue;
2318
      // optional .brpc.SpanType type = 7;
2319
0
      case 7:
2320
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
2321
0
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2322
0
          CHK_(ptr);
2323
0
          if (PROTOBUF_PREDICT_TRUE(::brpc::SpanType_IsValid(val))) {
2324
0
            _internal_set_type(static_cast<::brpc::SpanType>(val));
2325
0
          } else {
2326
0
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
2327
0
          }
2328
0
        } else
2329
0
          goto handle_unusual;
2330
0
        continue;
2331
      // optional .brpc.ProtocolType protocol = 8;
2332
0
      case 8:
2333
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
2334
0
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2335
0
          CHK_(ptr);
2336
0
          if (PROTOBUF_PREDICT_TRUE(::brpc::ProtocolType_IsValid(val))) {
2337
0
            _internal_set_protocol(static_cast<::brpc::ProtocolType>(val));
2338
0
          } else {
2339
0
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
2340
0
          }
2341
0
        } else
2342
0
          goto handle_unusual;
2343
0
        continue;
2344
      // optional int32 error_code = 9;
2345
0
      case 9:
2346
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
2347
0
          _Internal::set_has_error_code(&has_bits);
2348
0
          _impl_.error_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
2349
0
          CHK_(ptr);
2350
0
        } else
2351
0
          goto handle_unusual;
2352
0
        continue;
2353
      // optional int32 request_size = 10;
2354
0
      case 10:
2355
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
2356
0
          _Internal::set_has_request_size(&has_bits);
2357
0
          _impl_.request_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
2358
0
          CHK_(ptr);
2359
0
        } else
2360
0
          goto handle_unusual;
2361
0
        continue;
2362
      // optional int32 response_size = 11;
2363
0
      case 11:
2364
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
2365
0
          _Internal::set_has_response_size(&has_bits);
2366
0
          _impl_.response_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
2367
0
          CHK_(ptr);
2368
0
        } else
2369
0
          goto handle_unusual;
2370
0
        continue;
2371
      // optional int64 received_real_us = 12;
2372
0
      case 12:
2373
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
2374
0
          _Internal::set_has_received_real_us(&has_bits);
2375
0
          _impl_.received_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2376
0
          CHK_(ptr);
2377
0
        } else
2378
0
          goto handle_unusual;
2379
0
        continue;
2380
      // optional int64 start_parse_real_us = 13;
2381
0
      case 13:
2382
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
2383
0
          _Internal::set_has_start_parse_real_us(&has_bits);
2384
0
          _impl_.start_parse_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2385
0
          CHK_(ptr);
2386
0
        } else
2387
0
          goto handle_unusual;
2388
0
        continue;
2389
      // optional int64 start_callback_real_us = 14;
2390
0
      case 14:
2391
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
2392
0
          _Internal::set_has_start_callback_real_us(&has_bits);
2393
0
          _impl_.start_callback_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2394
0
          CHK_(ptr);
2395
0
        } else
2396
0
          goto handle_unusual;
2397
0
        continue;
2398
      // optional int64 start_send_real_us = 15;
2399
0
      case 15:
2400
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
2401
0
          _Internal::set_has_start_send_real_us(&has_bits);
2402
0
          _impl_.start_send_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2403
0
          CHK_(ptr);
2404
0
        } else
2405
0
          goto handle_unusual;
2406
0
        continue;
2407
      // optional int64 sent_real_us = 16;
2408
0
      case 16:
2409
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
2410
0
          _Internal::set_has_sent_real_us(&has_bits);
2411
0
          _impl_.sent_real_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2412
0
          CHK_(ptr);
2413
0
        } else
2414
0
          goto handle_unusual;
2415
0
        continue;
2416
      // optional string span_name = 17;
2417
0
      case 17:
2418
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 138)) {
2419
0
          auto str = _internal_mutable_span_name();
2420
0
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
2421
0
          CHK_(ptr);
2422
0
          #ifndef NDEBUG
2423
0
          ::_pbi::VerifyUTF8(str, "brpc.TracingSpan.span_name");
2424
0
          #endif  // !NDEBUG
2425
0
        } else
2426
0
          goto handle_unusual;
2427
0
        continue;
2428
      // repeated .brpc.SpanAnnotation annotations = 18;
2429
0
      case 18:
2430
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
2431
0
          ptr -= 2;
2432
0
          do {
2433
0
            ptr += 2;
2434
0
            ptr = ctx->ParseMessage(_internal_add_annotations(), ptr);
2435
0
            CHK_(ptr);
2436
0
            if (!ctx->DataAvailable(ptr)) break;
2437
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<146>(ptr));
2438
0
        } else
2439
0
          goto handle_unusual;
2440
0
        continue;
2441
      // repeated .brpc.TracingSpan client_spans = 19;
2442
0
      case 19:
2443
0
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 154)) {
2444
0
          ptr -= 2;
2445
0
          do {
2446
0
            ptr += 2;
2447
0
            ptr = ctx->ParseMessage(_internal_add_client_spans(), ptr);
2448
0
            CHK_(ptr);
2449
0
            if (!ctx->DataAvailable(ptr)) break;
2450
0
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<154>(ptr));
2451
0
        } else
2452
0
          goto handle_unusual;
2453
0
        continue;
2454
0
      default:
2455
0
        goto handle_unusual;
2456
0
    }  // switch
2457
0
  handle_unusual:
2458
0
    if ((tag == 0) || ((tag & 7) == 4)) {
2459
0
      CHK_(ptr);
2460
0
      ctx->SetLastTag(tag);
2461
0
      goto message_done;
2462
0
    }
2463
0
    ptr = UnknownFieldParse(
2464
0
        tag,
2465
0
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
2466
0
        ptr, ctx);
2467
0
    CHK_(ptr != nullptr);
2468
0
  }  // while
2469
0
message_done:
2470
0
  _impl_._has_bits_.Or(has_bits);
2471
0
  return ptr;
2472
0
failure:
2473
0
  ptr = nullptr;
2474
0
  goto message_done;
2475
0
#undef CHK_
2476
0
}
2477
2478
uint8_t* TracingSpan::_InternalSerialize(
2479
0
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
2480
  // @@protoc_insertion_point(serialize_to_array_start:brpc.TracingSpan)
2481
0
  uint32_t cached_has_bits = 0;
2482
0
  (void) cached_has_bits;
2483
2484
0
  cached_has_bits = _impl_._has_bits_[0];
2485
  // required uint64 trace_id = 1;
2486
0
  if (cached_has_bits & 0x00000002u) {
2487
0
    target = stream->EnsureSpace(target);
2488
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_trace_id(), target);
2489
0
  }
2490
2491
  // required uint64 span_id = 2;
2492
0
  if (cached_has_bits & 0x00000004u) {
2493
0
    target = stream->EnsureSpace(target);
2494
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_span_id(), target);
2495
0
  }
2496
2497
  // required uint64 parent_span_id = 3;
2498
0
  if (cached_has_bits & 0x00000008u) {
2499
0
    target = stream->EnsureSpace(target);
2500
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_parent_span_id(), target);
2501
0
  }
2502
2503
  // optional uint64 log_id = 4;
2504
0
  if (cached_has_bits & 0x00000010u) {
2505
0
    target = stream->EnsureSpace(target);
2506
0
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_log_id(), target);
2507
0
  }
2508
2509
  // optional uint32 remote_ip = 5;
2510
0
  if (cached_has_bits & 0x00000020u) {
2511
0
    target = stream->EnsureSpace(target);
2512
0
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_remote_ip(), target);
2513
0
  }
2514
2515
  // optional uint32 remote_port = 6;
2516
0
  if (cached_has_bits & 0x00000040u) {
2517
0
    target = stream->EnsureSpace(target);
2518
0
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_remote_port(), target);
2519
0
  }
2520
2521
  // optional .brpc.SpanType type = 7;
2522
0
  if (cached_has_bits & 0x00000080u) {
2523
0
    target = stream->EnsureSpace(target);
2524
0
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
2525
0
      7, this->_internal_type(), target);
2526
0
  }
2527
2528
  // optional .brpc.ProtocolType protocol = 8;
2529
0
  if (cached_has_bits & 0x00000100u) {
2530
0
    target = stream->EnsureSpace(target);
2531
0
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
2532
0
      8, this->_internal_protocol(), target);
2533
0
  }
2534
2535
  // optional int32 error_code = 9;
2536
0
  if (cached_has_bits & 0x00000200u) {
2537
0
    target = stream->EnsureSpace(target);
2538
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(9, this->_internal_error_code(), target);
2539
0
  }
2540
2541
  // optional int32 request_size = 10;
2542
0
  if (cached_has_bits & 0x00000400u) {
2543
0
    target = stream->EnsureSpace(target);
2544
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(10, this->_internal_request_size(), target);
2545
0
  }
2546
2547
  // optional int32 response_size = 11;
2548
0
  if (cached_has_bits & 0x00010000u) {
2549
0
    target = stream->EnsureSpace(target);
2550
0
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(11, this->_internal_response_size(), target);
2551
0
  }
2552
2553
  // optional int64 received_real_us = 12;
2554
0
  if (cached_has_bits & 0x00000800u) {
2555
0
    target = stream->EnsureSpace(target);
2556
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(12, this->_internal_received_real_us(), target);
2557
0
  }
2558
2559
  // optional int64 start_parse_real_us = 13;
2560
0
  if (cached_has_bits & 0x00001000u) {
2561
0
    target = stream->EnsureSpace(target);
2562
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(13, this->_internal_start_parse_real_us(), target);
2563
0
  }
2564
2565
  // optional int64 start_callback_real_us = 14;
2566
0
  if (cached_has_bits & 0x00002000u) {
2567
0
    target = stream->EnsureSpace(target);
2568
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(14, this->_internal_start_callback_real_us(), target);
2569
0
  }
2570
2571
  // optional int64 start_send_real_us = 15;
2572
0
  if (cached_has_bits & 0x00004000u) {
2573
0
    target = stream->EnsureSpace(target);
2574
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(15, this->_internal_start_send_real_us(), target);
2575
0
  }
2576
2577
  // optional int64 sent_real_us = 16;
2578
0
  if (cached_has_bits & 0x00008000u) {
2579
0
    target = stream->EnsureSpace(target);
2580
0
    target = ::_pbi::WireFormatLite::WriteInt64ToArray(16, this->_internal_sent_real_us(), target);
2581
0
  }
2582
2583
  // optional string span_name = 17;
2584
0
  if (cached_has_bits & 0x00000001u) {
2585
0
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
2586
0
      this->_internal_span_name().data(), static_cast<int>(this->_internal_span_name().length()),
2587
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
2588
0
      "brpc.TracingSpan.span_name");
2589
0
    target = stream->WriteStringMaybeAliased(
2590
0
        17, this->_internal_span_name(), target);
2591
0
  }
2592
2593
  // repeated .brpc.SpanAnnotation annotations = 18;
2594
0
  for (unsigned i = 0,
2595
0
      n = static_cast<unsigned>(this->_internal_annotations_size()); i < n; i++) {
2596
0
    const auto& repfield = this->_internal_annotations(i);
2597
0
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2598
0
        InternalWriteMessage(18, repfield, repfield.GetCachedSize(), target, stream);
2599
0
  }
2600
2601
  // repeated .brpc.TracingSpan client_spans = 19;
2602
0
  for (unsigned i = 0,
2603
0
      n = static_cast<unsigned>(this->_internal_client_spans_size()); i < n; i++) {
2604
0
    const auto& repfield = this->_internal_client_spans(i);
2605
0
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2606
0
        InternalWriteMessage(19, repfield, repfield.GetCachedSize(), target, stream);
2607
0
  }
2608
2609
0
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2610
0
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
2611
0
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
2612
0
  }
2613
  // @@protoc_insertion_point(serialize_to_array_end:brpc.TracingSpan)
2614
0
  return target;
2615
0
}
2616
2617
0
size_t TracingSpan::RequiredFieldsByteSizeFallback() const {
2618
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:brpc.TracingSpan)
2619
0
  size_t total_size = 0;
2620
2621
0
  if (_internal_has_trace_id()) {
2622
    // required uint64 trace_id = 1;
2623
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
2624
0
  }
2625
2626
0
  if (_internal_has_span_id()) {
2627
    // required uint64 span_id = 2;
2628
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
2629
0
  }
2630
2631
0
  if (_internal_has_parent_span_id()) {
2632
    // required uint64 parent_span_id = 3;
2633
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_parent_span_id());
2634
0
  }
2635
2636
0
  return total_size;
2637
0
}
2638
0
size_t TracingSpan::ByteSizeLong() const {
2639
// @@protoc_insertion_point(message_byte_size_start:brpc.TracingSpan)
2640
0
  size_t total_size = 0;
2641
2642
0
  if (((_impl_._has_bits_[0] & 0x0000000e) ^ 0x0000000e) == 0) {  // All required fields are present.
2643
    // required uint64 trace_id = 1;
2644
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
2645
2646
    // required uint64 span_id = 2;
2647
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
2648
2649
    // required uint64 parent_span_id = 3;
2650
0
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_parent_span_id());
2651
2652
0
  } else {
2653
0
    total_size += RequiredFieldsByteSizeFallback();
2654
0
  }
2655
0
  uint32_t cached_has_bits = 0;
2656
  // Prevent compiler warnings about cached_has_bits being unused
2657
0
  (void) cached_has_bits;
2658
2659
  // repeated .brpc.SpanAnnotation annotations = 18;
2660
0
  total_size += 2UL * this->_internal_annotations_size();
2661
0
  for (const auto& msg : this->_impl_.annotations_) {
2662
0
    total_size +=
2663
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
2664
0
  }
2665
2666
  // repeated .brpc.TracingSpan client_spans = 19;
2667
0
  total_size += 2UL * this->_internal_client_spans_size();
2668
0
  for (const auto& msg : this->_impl_.client_spans_) {
2669
0
    total_size +=
2670
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
2671
0
  }
2672
2673
  // optional string span_name = 17;
2674
0
  cached_has_bits = _impl_._has_bits_[0];
2675
0
  if (cached_has_bits & 0x00000001u) {
2676
0
    total_size += 2 +
2677
0
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2678
0
        this->_internal_span_name());
2679
0
  }
2680
2681
0
  if (cached_has_bits & 0x000000f0u) {
2682
    // optional uint64 log_id = 4;
2683
0
    if (cached_has_bits & 0x00000010u) {
2684
0
      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_log_id());
2685
0
    }
2686
2687
    // optional uint32 remote_ip = 5;
2688
0
    if (cached_has_bits & 0x00000020u) {
2689
0
      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_ip());
2690
0
    }
2691
2692
    // optional uint32 remote_port = 6;
2693
0
    if (cached_has_bits & 0x00000040u) {
2694
0
      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_port());
2695
0
    }
2696
2697
    // optional .brpc.SpanType type = 7;
2698
0
    if (cached_has_bits & 0x00000080u) {
2699
0
      total_size += 1 +
2700
0
        ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
2701
0
    }
2702
2703
0
  }
2704
0
  if (cached_has_bits & 0x0000ff00u) {
2705
    // optional .brpc.ProtocolType protocol = 8;
2706
0
    if (cached_has_bits & 0x00000100u) {
2707
0
      total_size += 1 +
2708
0
        ::_pbi::WireFormatLite::EnumSize(this->_internal_protocol());
2709
0
    }
2710
2711
    // optional int32 error_code = 9;
2712
0
    if (cached_has_bits & 0x00000200u) {
2713
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_error_code());
2714
0
    }
2715
2716
    // optional int32 request_size = 10;
2717
0
    if (cached_has_bits & 0x00000400u) {
2718
0
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_request_size());
2719
0
    }
2720
2721
    // optional int64 received_real_us = 12;
2722
0
    if (cached_has_bits & 0x00000800u) {
2723
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_received_real_us());
2724
0
    }
2725
2726
    // optional int64 start_parse_real_us = 13;
2727
0
    if (cached_has_bits & 0x00001000u) {
2728
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start_parse_real_us());
2729
0
    }
2730
2731
    // optional int64 start_callback_real_us = 14;
2732
0
    if (cached_has_bits & 0x00002000u) {
2733
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start_callback_real_us());
2734
0
    }
2735
2736
    // optional int64 start_send_real_us = 15;
2737
0
    if (cached_has_bits & 0x00004000u) {
2738
0
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start_send_real_us());
2739
0
    }
2740
2741
    // optional int64 sent_real_us = 16;
2742
0
    if (cached_has_bits & 0x00008000u) {
2743
0
      total_size += 2 +
2744
0
        ::_pbi::WireFormatLite::Int64Size(
2745
0
          this->_internal_sent_real_us());
2746
0
    }
2747
2748
0
  }
2749
  // optional int32 response_size = 11;
2750
0
  if (cached_has_bits & 0x00010000u) {
2751
0
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_response_size());
2752
0
  }
2753
2754
0
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
2755
0
}
2756
2757
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TracingSpan::_class_data_ = {
2758
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
2759
    TracingSpan::MergeImpl
2760
};
2761
0
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TracingSpan::GetClassData() const { return &_class_data_; }
2762
2763
2764
0
void TracingSpan::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
2765
0
  auto* const _this = static_cast<TracingSpan*>(&to_msg);
2766
0
  auto& from = static_cast<const TracingSpan&>(from_msg);
2767
  // @@protoc_insertion_point(class_specific_merge_from_start:brpc.TracingSpan)
2768
0
  GOOGLE_DCHECK_NE(&from, _this);
2769
0
  uint32_t cached_has_bits = 0;
2770
0
  (void) cached_has_bits;
2771
2772
0
  _this->_impl_.annotations_.MergeFrom(from._impl_.annotations_);
2773
0
  _this->_impl_.client_spans_.MergeFrom(from._impl_.client_spans_);
2774
0
  cached_has_bits = from._impl_._has_bits_[0];
2775
0
  if (cached_has_bits & 0x000000ffu) {
2776
0
    if (cached_has_bits & 0x00000001u) {
2777
0
      _this->_internal_set_span_name(from._internal_span_name());
2778
0
    }
2779
0
    if (cached_has_bits & 0x00000002u) {
2780
0
      _this->_impl_.trace_id_ = from._impl_.trace_id_;
2781
0
    }
2782
0
    if (cached_has_bits & 0x00000004u) {
2783
0
      _this->_impl_.span_id_ = from._impl_.span_id_;
2784
0
    }
2785
0
    if (cached_has_bits & 0x00000008u) {
2786
0
      _this->_impl_.parent_span_id_ = from._impl_.parent_span_id_;
2787
0
    }
2788
0
    if (cached_has_bits & 0x00000010u) {
2789
0
      _this->_impl_.log_id_ = from._impl_.log_id_;
2790
0
    }
2791
0
    if (cached_has_bits & 0x00000020u) {
2792
0
      _this->_impl_.remote_ip_ = from._impl_.remote_ip_;
2793
0
    }
2794
0
    if (cached_has_bits & 0x00000040u) {
2795
0
      _this->_impl_.remote_port_ = from._impl_.remote_port_;
2796
0
    }
2797
0
    if (cached_has_bits & 0x00000080u) {
2798
0
      _this->_impl_.type_ = from._impl_.type_;
2799
0
    }
2800
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
2801
0
  }
2802
0
  if (cached_has_bits & 0x0000ff00u) {
2803
0
    if (cached_has_bits & 0x00000100u) {
2804
0
      _this->_impl_.protocol_ = from._impl_.protocol_;
2805
0
    }
2806
0
    if (cached_has_bits & 0x00000200u) {
2807
0
      _this->_impl_.error_code_ = from._impl_.error_code_;
2808
0
    }
2809
0
    if (cached_has_bits & 0x00000400u) {
2810
0
      _this->_impl_.request_size_ = from._impl_.request_size_;
2811
0
    }
2812
0
    if (cached_has_bits & 0x00000800u) {
2813
0
      _this->_impl_.received_real_us_ = from._impl_.received_real_us_;
2814
0
    }
2815
0
    if (cached_has_bits & 0x00001000u) {
2816
0
      _this->_impl_.start_parse_real_us_ = from._impl_.start_parse_real_us_;
2817
0
    }
2818
0
    if (cached_has_bits & 0x00002000u) {
2819
0
      _this->_impl_.start_callback_real_us_ = from._impl_.start_callback_real_us_;
2820
0
    }
2821
0
    if (cached_has_bits & 0x00004000u) {
2822
0
      _this->_impl_.start_send_real_us_ = from._impl_.start_send_real_us_;
2823
0
    }
2824
0
    if (cached_has_bits & 0x00008000u) {
2825
0
      _this->_impl_.sent_real_us_ = from._impl_.sent_real_us_;
2826
0
    }
2827
0
    _this->_impl_._has_bits_[0] |= cached_has_bits;
2828
0
  }
2829
0
  if (cached_has_bits & 0x00010000u) {
2830
0
    _this->_internal_set_response_size(from._internal_response_size());
2831
0
  }
2832
0
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
2833
0
}
2834
2835
0
void TracingSpan::CopyFrom(const TracingSpan& from) {
2836
// @@protoc_insertion_point(class_specific_copy_from_start:brpc.TracingSpan)
2837
0
  if (&from == this) return;
2838
0
  Clear();
2839
0
  MergeFrom(from);
2840
0
}
2841
2842
0
bool TracingSpan::IsInitialized() const {
2843
0
  if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
2844
0
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.annotations_))
2845
0
    return false;
2846
0
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.client_spans_))
2847
0
    return false;
2848
0
  return true;
2849
0
}
2850
2851
0
void TracingSpan::InternalSwap(TracingSpan* other) {
2852
0
  using std::swap;
2853
0
  auto* lhs_arena = GetArenaForAllocation();
2854
0
  auto* rhs_arena = other->GetArenaForAllocation();
2855
0
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
2856
0
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
2857
0
  _impl_.annotations_.InternalSwap(&other->_impl_.annotations_);
2858
0
  _impl_.client_spans_.InternalSwap(&other->_impl_.client_spans_);
2859
0
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
2860
0
      &_impl_.span_name_, lhs_arena,
2861
0
      &other->_impl_.span_name_, rhs_arena
2862
0
  );
2863
0
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
2864
0
      PROTOBUF_FIELD_OFFSET(TracingSpan, _impl_.response_size_)
2865
0
      + sizeof(TracingSpan::_impl_.response_size_)
2866
0
      - PROTOBUF_FIELD_OFFSET(TracingSpan, _impl_.trace_id_)>(
2867
0
          reinterpret_cast<char*>(&_impl_.trace_id_),
2868
0
          reinterpret_cast<char*>(&other->_impl_.trace_id_));
2869
0
}
2870
2871
0
::PROTOBUF_NAMESPACE_ID::Metadata TracingSpan::GetMetadata() const {
2872
0
  return ::_pbi::AssignDescriptors(
2873
0
      &descriptor_table_brpc_2fspan_2eproto_getter, &descriptor_table_brpc_2fspan_2eproto_once,
2874
0
      file_level_metadata_brpc_2fspan_2eproto[3]);
2875
0
}
2876
2877
// @@protoc_insertion_point(namespace_scope)
2878
}  // namespace brpc
2879
PROTOBUF_NAMESPACE_OPEN
2880
template<> PROTOBUF_NOINLINE ::brpc::RpczSpan*
2881
0
Arena::CreateMaybeMessage< ::brpc::RpczSpan >(Arena* arena) {
2882
0
  return Arena::CreateMessageInternal< ::brpc::RpczSpan >(arena);
2883
0
}
2884
template<> PROTOBUF_NOINLINE ::brpc::BriefSpan*
2885
0
Arena::CreateMaybeMessage< ::brpc::BriefSpan >(Arena* arena) {
2886
0
  return Arena::CreateMessageInternal< ::brpc::BriefSpan >(arena);
2887
0
}
2888
template<> PROTOBUF_NOINLINE ::brpc::SpanAnnotation*
2889
0
Arena::CreateMaybeMessage< ::brpc::SpanAnnotation >(Arena* arena) {
2890
0
  return Arena::CreateMessageInternal< ::brpc::SpanAnnotation >(arena);
2891
0
}
2892
template<> PROTOBUF_NOINLINE ::brpc::TracingSpan*
2893
0
Arena::CreateMaybeMessage< ::brpc::TracingSpan >(Arena* arena) {
2894
0
  return Arena::CreateMessageInternal< ::brpc::TracingSpan >(arena);
2895
0
}
2896
PROTOBUF_NAMESPACE_CLOSE
2897
2898
// @@protoc_insertion_point(global_scope)
2899
#include <google/protobuf/port_undef.inc>