YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/build/debugcov-clang-dynamic-arm64-ninja/src/yb/consensus/metadata.pb.cc
Line
Count
Source (jump to first uncovered line)
1
// Generated by the protocol buffer compiler.  DO NOT EDIT!
2
// source: yb/consensus/metadata.proto
3
4
#include "yb/consensus/metadata.pb.h"
5
6
#include <algorithm>
7
8
#include <google/protobuf/stubs/common.h>
9
#include <google/protobuf/stubs/port.h>
10
#include <google/protobuf/stubs/once.h>
11
#include <google/protobuf/io/coded_stream.h>
12
#include <google/protobuf/wire_format_lite_inl.h>
13
#include <google/protobuf/descriptor.h>
14
#include <google/protobuf/generated_message_reflection.h>
15
#include <google/protobuf/reflection_ops.h>
16
#include <google/protobuf/wire_format.h>
17
// This is a temporary google only hack
18
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
19
#include "third_party/protobuf/version.h"
20
#endif
21
#include "yb/util/protobuf-annotations.h"
22
// @@protoc_insertion_point(includes)
23
namespace yb {
24
namespace consensus {
25
class RaftPeerPBDefaultTypeInternal {
26
 public:
27
  ::google::protobuf::internal::ExplicitlyConstructed<RaftPeerPB>
28
      _instance;
29
} _RaftPeerPB_default_instance_;
30
class RaftConfigPBDefaultTypeInternal {
31
 public:
32
  ::google::protobuf::internal::ExplicitlyConstructed<RaftConfigPB>
33
      _instance;
34
} _RaftConfigPB_default_instance_;
35
class ConsensusStatePBDefaultTypeInternal {
36
 public:
37
  ::google::protobuf::internal::ExplicitlyConstructed<ConsensusStatePB>
38
      _instance;
39
} _ConsensusStatePB_default_instance_;
40
class ConsensusMetadataPBDefaultTypeInternal {
41
 public:
42
  ::google::protobuf::internal::ExplicitlyConstructed<ConsensusMetadataPB>
43
      _instance;
44
} _ConsensusMetadataPB_default_instance_;
45
}  // namespace consensus
46
}  // namespace yb
47
namespace protobuf_yb_2fconsensus_2fmetadata_2eproto {
48
28.1k
void InitDefaultsRaftPeerPBImpl() {
49
28.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
50
51
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
52
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
53
#else
54
28.1k
  ::google::protobuf::internal::InitProtobufDefaults();
55
28.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
56
28.1k
  protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::InitDefaultsHostPortPB();
57
28.1k
  protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::InitDefaultsCloudInfoPB();
58
28.1k
  {
59
28.1k
    void* ptr = &::yb::consensus::_RaftPeerPB_default_instance_;
60
28.1k
    new (ptr) ::yb::consensus::RaftPeerPB();
61
28.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
62
28.1k
  }
63
28.1k
  ::yb::consensus::RaftPeerPB::InitAsDefaultInstance();
64
28.1k
}
65
66
366M
void InitDefaultsRaftPeerPB() {
67
366M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
68
366M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsRaftPeerPBImpl);
69
366M
}
70
71
28.1k
void InitDefaultsRaftConfigPBImpl() {
72
28.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
73
74
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
75
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
76
#else
77
28.1k
  ::google::protobuf::internal::InitProtobufDefaults();
78
28.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
79
28.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftPeerPB();
80
28.1k
  {
81
28.1k
    void* ptr = &::yb::consensus::_RaftConfigPB_default_instance_;
82
28.1k
    new (ptr) ::yb::consensus::RaftConfigPB();
83
28.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
84
28.1k
  }
85
28.1k
  ::yb::consensus::RaftConfigPB::InitAsDefaultInstance();
86
28.1k
}
87
88
49.6M
void InitDefaultsRaftConfigPB() {
89
49.6M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
90
49.6M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsRaftConfigPBImpl);
91
49.6M
}
92
93
28.1k
void InitDefaultsConsensusStatePBImpl() {
94
28.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
95
96
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
97
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
98
#else
99
28.1k
  ::google::protobuf::internal::InitProtobufDefaults();
100
28.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
101
28.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
102
28.1k
  {
103
28.1k
    void* ptr = &::yb::consensus::_ConsensusStatePB_default_instance_;
104
28.1k
    new (ptr) ::yb::consensus::ConsensusStatePB();
105
28.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
106
28.1k
  }
107
28.1k
  ::yb::consensus::ConsensusStatePB::InitAsDefaultInstance();
108
28.1k
}
109
110
54.5M
void InitDefaultsConsensusStatePB() {
111
54.5M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
112
54.5M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConsensusStatePBImpl);
113
54.5M
}
114
115
28.1k
void InitDefaultsConsensusMetadataPBImpl() {
116
28.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
117
118
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
119
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
120
#else
121
28.1k
  ::google::protobuf::internal::InitProtobufDefaults();
122
28.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
123
28.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
124
28.1k
  {
125
28.1k
    void* ptr = &::yb::consensus::_ConsensusMetadataPB_default_instance_;
126
28.1k
    new (ptr) ::yb::consensus::ConsensusMetadataPB();
127
28.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
128
28.1k
  }
129
28.1k
  ::yb::consensus::ConsensusMetadataPB::InitAsDefaultInstance();
130
28.1k
}
131
132
479k
void InitDefaultsConsensusMetadataPB() {
133
479k
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
134
479k
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConsensusMetadataPBImpl);
135
479k
}
136
137
::google::protobuf::Metadata file_level_metadata[4];
138
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
139
140
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
141
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, _has_bits_),
142
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, _internal_metadata_),
143
  ~0u,  // no _extensions_
144
  ~0u,  // no _oneof_case_
145
  ~0u,  // no _weak_field_map_
146
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, permanent_uuid_),
147
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, member_type_),
148
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, last_known_private_addr_),
149
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, last_known_broadcast_addr_),
150
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftPeerPB, cloud_info_),
151
  0,
152
  2,
153
  ~0u,
154
  ~0u,
155
  1,
156
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftConfigPB, _has_bits_),
157
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftConfigPB, _internal_metadata_),
158
  ~0u,  // no _extensions_
159
  ~0u,  // no _oneof_case_
160
  ~0u,  // no _weak_field_map_
161
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftConfigPB, opid_index_),
162
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftConfigPB, unsafe_config_change_),
163
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::RaftConfigPB, peers_),
164
  0,
165
  1,
166
  ~0u,
167
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusStatePB, _has_bits_),
168
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusStatePB, _internal_metadata_),
169
  ~0u,  // no _extensions_
170
  ~0u,  // no _oneof_case_
171
  ~0u,  // no _weak_field_map_
172
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusStatePB, current_term_),
173
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusStatePB, leader_uuid_),
174
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusStatePB, config_),
175
  2,
176
  0,
177
  1,
178
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, _has_bits_),
179
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, _internal_metadata_),
180
  ~0u,  // no _extensions_
181
  ~0u,  // no _oneof_case_
182
  ~0u,  // no _weak_field_map_
183
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, committed_config_),
184
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, current_term_),
185
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, voted_for_),
186
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::yb::consensus::ConsensusMetadataPB, split_parent_tablet_id_),
187
  2,
188
  3,
189
  0,
190
  1,
191
};
192
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
193
  { 0, 10, sizeof(::yb::consensus::RaftPeerPB)},
194
  { 15, 23, sizeof(::yb::consensus::RaftConfigPB)},
195
  { 26, 34, sizeof(::yb::consensus::ConsensusStatePB)},
196
  { 37, 46, sizeof(::yb::consensus::ConsensusMetadataPB)},
197
};
198
199
static ::google::protobuf::Message const * const file_default_instances[] = {
200
  reinterpret_cast<const ::google::protobuf::Message*>(&::yb::consensus::_RaftPeerPB_default_instance_),
201
  reinterpret_cast<const ::google::protobuf::Message*>(&::yb::consensus::_RaftConfigPB_default_instance_),
202
  reinterpret_cast<const ::google::protobuf::Message*>(&::yb::consensus::_ConsensusStatePB_default_instance_),
203
  reinterpret_cast<const ::google::protobuf::Message*>(&::yb::consensus::_ConsensusMetadataPB_default_instance_),
204
};
205
206
14.3k
void protobuf_AssignDescriptors() {
207
14.3k
  AddDescriptors();
208
14.3k
  ::google::protobuf::MessageFactory* factory = NULL;
209
14.3k
  AssignDescriptors(
210
14.3k
      "yb/consensus/metadata.proto", schemas, file_default_instances, TableStruct::offsets, factory,
211
14.3k
      file_level_metadata, file_level_enum_descriptors, NULL);
212
14.3k
}
213
214
406M
void protobuf_AssignDescriptorsOnce() {
215
406M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
216
406M
  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
217
406M
}
218
219
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
220
0
void protobuf_RegisterTypes(const ::std::string&) {
221
0
  protobuf_AssignDescriptorsOnce();
222
0
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
223
0
}
224
225
28.1k
void AddDescriptorsImpl() {
226
28.1k
  InitDefaults();
227
28.1k
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
228
28.1k
      "\n\033yb/consensus/metadata.proto\022\014yb.consen"
229
28.1k
      "sus\032\032yb/common/common_net.proto\"\340\001\n\nRaft"
230
28.1k
      "PeerPB\022\026\n\016permanent_uuid\030\001 \001(\014\0221\n\013member"
231
28.1k
      "_type\030\002 \001(\0162\034.yb.consensus.PeerMemberTyp"
232
28.1k
      "e\022/\n\027last_known_private_addr\030\003 \003(\0132\016.yb."
233
28.1k
      "HostPortPB\0221\n\031last_known_broadcast_addr\030"
234
28.1k
      "\004 \003(\0132\016.yb.HostPortPB\022#\n\ncloud_info\030\005 \001("
235
28.1k
      "\0132\017.yb.CloudInfoPB\"p\n\014RaftConfigPB\022\022\n\nop"
236
28.1k
      "id_index\030\001 \001(\003\022#\n\024unsafe_config_change\030\004"
237
28.1k
      " \001(\010:\005false\022\'\n\005peers\030\002 \003(\0132\030.yb.consensu"
238
28.1k
      "s.RaftPeerPB\"i\n\020ConsensusStatePB\022\024\n\014curr"
239
28.1k
      "ent_term\030\001 \002(\003\022\023\n\013leader_uuid\030\002 \001(\t\022*\n\006c"
240
28.1k
      "onfig\030\003 \002(\0132\032.yb.consensus.RaftConfigPB\""
241
28.1k
      "\224\001\n\023ConsensusMetadataPB\0224\n\020committed_con"
242
28.1k
      "fig\030\001 \002(\0132\032.yb.consensus.RaftConfigPB\022\024\n"
243
28.1k
      "\014current_term\030\002 \002(\003\022\021\n\tvoted_for\030\003 \001(\t\022\036"
244
28.1k
      "\n\026split_parent_tablet_id\030\004 \001(\014*d\n\016PeerMe"
245
28.1k
      "mberType\022\030\n\023UNKNOWN_MEMBER_TYPE\020\347\007\022\r\n\tPR"
246
28.1k
      "E_VOTER\020\000\022\t\n\005VOTER\020\001\022\020\n\014PRE_OBSERVER\020\002\022\014"
247
28.1k
      "\n\010OBSERVER\020\003*q\n\023ConsensusConfigType\022\035\n\030C"
248
28.1k
      "ONSENSUS_CONFIG_UNKNOWN\020\347\007\022\036\n\032CONSENSUS_"
249
28.1k
      "CONFIG_COMMITTED\020\001\022\033\n\027CONSENSUS_CONFIG_A"
250
28.1k
      "CTIVE\020\002B\022\n\020org.yb.consensus"
251
28.1k
  };
252
28.1k
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
253
28.1k
      descriptor, 907);
254
28.1k
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
255
28.1k
    "yb/consensus/metadata.proto", &protobuf_RegisterTypes);
256
28.1k
  ::protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::AddDescriptors();
257
28.1k
}
258
259
230k
void AddDescriptors() {
260
230k
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
261
230k
  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
262
230k
}
263
// Force AddDescriptors() to be called at dynamic initialization time.
264
struct StaticDescriptorInitializer {
265
28.1k
  StaticDescriptorInitializer() {
266
28.1k
    AddDescriptors();
267
28.1k
  }
268
} static_descriptor_initializer;
269
}  // namespace protobuf_yb_2fconsensus_2fmetadata_2eproto
270
namespace yb {
271
namespace consensus {
272
643k
const ::google::protobuf::EnumDescriptor* PeerMemberType_descriptor() {
273
643k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
274
643k
  return protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_enum_descriptors[0];
275
643k
}
276
9.33M
bool PeerMemberType_IsValid(int value) {
277
9.33M
  switch (value) {
278
89.5k
    case 0:
279
9.17M
    case 1:
280
9.18M
    case 2:
281
9.34M
    case 3:
282
9.34M
    case 999:
283
9.34M
      return true;
284
0
    default:
285
0
      return false;
286
9.33M
  }
287
9.33M
}
288
289
0
const ::google::protobuf::EnumDescriptor* ConsensusConfigType_descriptor() {
290
0
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
291
0
  return protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_enum_descriptors[1];
292
0
}
293
11.1k
bool ConsensusConfigType_IsValid(int value) {
294
11.1k
  switch (value) {
295
2.77k
    case 1:
296
11.1k
    case 2:
297
11.1k
    case 999:
298
11.1k
      return true;
299
0
    default:
300
0
      return false;
301
11.1k
  }
302
11.1k
}
303
304
305
// ===================================================================
306
307
28.1k
void RaftPeerPB::InitAsDefaultInstance() {
308
28.1k
  ::yb::consensus::_RaftPeerPB_default_instance_._instance.get_mutable()->cloud_info_ = const_cast< ::yb::CloudInfoPB*>(
309
28.1k
      ::yb::CloudInfoPB::internal_default_instance());
310
28.1k
}
311
0
void RaftPeerPB::clear_last_known_private_addr() {
312
0
  last_known_private_addr_.Clear();
313
0
}
314
0
void RaftPeerPB::clear_last_known_broadcast_addr() {
315
0
  last_known_broadcast_addr_.Clear();
316
0
}
317
0
void RaftPeerPB::clear_cloud_info() {
318
0
  if (cloud_info_ != NULL) cloud_info_->Clear();
319
0
  clear_has_cloud_info();
320
0
}
321
#if !defined(_MSC_VER) || _MSC_VER >= 1900
322
const int RaftPeerPB::kPermanentUuidFieldNumber;
323
const int RaftPeerPB::kMemberTypeFieldNumber;
324
const int RaftPeerPB::kLastKnownPrivateAddrFieldNumber;
325
const int RaftPeerPB::kLastKnownBroadcastAddrFieldNumber;
326
const int RaftPeerPB::kCloudInfoFieldNumber;
327
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
328
329
RaftPeerPB::RaftPeerPB()
330
366M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
331
366M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
332
366M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftPeerPB();
333
366M
  }
334
366M
  SharedCtor();
335
  // @@protoc_insertion_point(constructor:yb.consensus.RaftPeerPB)
336
366M
}
337
RaftPeerPB::RaftPeerPB(const RaftPeerPB& from)
338
  : ::google::protobuf::Message(),
339
      _internal_metadata_(NULL),
340
      _has_bits_(from._has_bits_),
341
      _cached_size_(0),
342
      last_known_private_addr_(from.last_known_private_addr_),
343
872k
      last_known_broadcast_addr_(from.last_known_broadcast_addr_) {
344
872k
  _internal_metadata_.MergeFrom(from._internal_metadata_);
345
872k
  permanent_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
346
872k
  if (from.has_permanent_uuid()) {
347
872k
    permanent_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.permanent_uuid_);
348
872k
  }
349
872k
  if (from.has_cloud_info()) {
350
869k
    cloud_info_ = new ::yb::CloudInfoPB(*from.cloud_info_);
351
869k
  } else {
352
2.79k
    cloud_info_ = NULL;
353
2.79k
  }
354
872k
  member_type_ = from.member_type_;
355
  // @@protoc_insertion_point(copy_constructor:yb.consensus.RaftPeerPB)
356
872k
}
357
358
366M
void RaftPeerPB::SharedCtor() {
359
366M
  _cached_size_ = 0;
360
366M
  permanent_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
361
366M
  cloud_info_ = NULL;
362
366M
  member_type_ = 999;
363
366M
}
364
365
366M
RaftPeerPB::~RaftPeerPB() {
366
  // @@protoc_insertion_point(destructor:yb.consensus.RaftPeerPB)
367
366M
  SharedDtor();
368
366M
}
369
370
366M
void RaftPeerPB::SharedDtor() {
371
366M
  permanent_uuid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
372
366M
  if (this != internal_default_instance()) 
delete cloud_info_366M
;
373
366M
}
374
375
0
void RaftPeerPB::SetCachedSize(int size) const {
376
0
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
377
0
  _cached_size_ = size;
378
0
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
379
0
}
380
0
const ::google::protobuf::Descriptor* RaftPeerPB::descriptor() {
381
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
382
0
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
383
0
}
384
385
0
const RaftPeerPB& RaftPeerPB::default_instance() {
386
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftPeerPB();
387
0
  return *internal_default_instance();
388
0
}
389
390
0
RaftPeerPB* RaftPeerPB::New(::google::protobuf::Arena* arena) const {
391
0
  RaftPeerPB* n = new RaftPeerPB;
392
0
  if (arena != NULL) {
393
0
    arena->Own(n);
394
0
  }
395
0
  return n;
396
0
}
397
398
35.2M
void RaftPeerPB::Clear() {
399
// @@protoc_insertion_point(message_clear_start:yb.consensus.RaftPeerPB)
400
35.2M
  ::google::protobuf::uint32 cached_has_bits = 0;
401
  // Prevent compiler warnings about cached_has_bits being unused
402
35.2M
  (void) cached_has_bits;
403
404
35.2M
  last_known_private_addr_.Clear();
405
35.2M
  last_known_broadcast_addr_.Clear();
406
35.2M
  cached_has_bits = _has_bits_[0];
407
35.2M
  if (cached_has_bits & 7u) {
408
355k
    if (cached_has_bits & 0x00000001u) {
409
355k
      GOOGLE_DCHECK(!permanent_uuid_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
410
355k
      (*permanent_uuid_.UnsafeRawStringPointer())->clear();
411
355k
    }
412
355k
    if (cached_has_bits & 0x00000002u) {
413
352k
      GOOGLE_DCHECK(cloud_info_ != NULL);
414
352k
      cloud_info_->Clear();
415
352k
    }
416
355k
    member_type_ = 999;
417
355k
  }
418
35.2M
  _has_bits_.Clear();
419
35.2M
  _internal_metadata_.Clear();
420
35.2M
}
421
422
bool RaftPeerPB::MergePartialFromCodedStream(
423
2.95M
    ::google::protobuf::io::CodedInputStream* input) {
424
11.8M
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) 
goto failure0
425
2.95M
  ::google::protobuf::uint32 tag;
426
  // @@protoc_insertion_point(parse_start:yb.consensus.RaftPeerPB)
427
14.7M
  for (;;) {
428
14.7M
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
429
14.7M
    tag = p.first;
430
14.7M
    if (!p.second) 
goto handle_unusual2.96M
;
431
11.7M
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
432
      // optional bytes permanent_uuid = 1;
433
2.95M
      case 1: {
434
2.95M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
435
2.95M
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
436
2.95M
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
437
2.95M
                input, this->mutable_permanent_uuid()));
438
18.4E
        } else {
439
18.4E
          goto handle_unusual;
440
18.4E
        }
441
2.95M
        break;
442
2.95M
      }
443
444
      // optional .yb.consensus.PeerMemberType member_type = 2;
445
2.95M
      case 2: {
446
2.95M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
447
2.95M
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
448
2.95M
          int value;
449
2.95M
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
450
2.95M
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
451
2.95M
                 input, &value)));
452
2.95M
          if (::yb::consensus::PeerMemberType_IsValid(value)) {
453
2.95M
            set_member_type(static_cast< ::yb::consensus::PeerMemberType >(value));
454
2.95M
          } else {
455
901
            mutable_unknown_fields()->AddVarint(
456
901
                2, static_cast< ::google::protobuf::uint64>(value));
457
901
          }
458
18.4E
        } else {
459
18.4E
          goto handle_unusual;
460
18.4E
        }
461
2.95M
        break;
462
2.95M
      }
463
464
      // repeated .yb.HostPortPB last_known_private_addr = 3;
465
2.95M
      case 3: {
466
2.95M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
467
2.95M
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
468
2.95M
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_last_known_private_addr()));
469
18.4E
        } else {
470
18.4E
          goto handle_unusual;
471
18.4E
        }
472
2.95M
        break;
473
2.95M
      }
474
475
      // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
476
2.95M
      case 4: {
477
2.07k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
478
2.07k
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
479
2.07k
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_last_known_broadcast_addr()));
480
2.07k
        } else {
481
0
          goto handle_unusual;
482
0
        }
483
2.07k
        break;
484
2.07k
      }
485
486
      // optional .yb.CloudInfoPB cloud_info = 5;
487
2.95M
      case 5: {
488
2.95M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
489
2.95M
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
490
2.95M
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
491
2.95M
               input, mutable_cloud_info()));
492
18.4E
        } else {
493
18.4E
          goto handle_unusual;
494
18.4E
        }
495
2.95M
        break;
496
2.95M
      }
497
498
2.95M
      default: {
499
2.96M
      handle_unusual:
500
2.96M
        if (
tag == 02.96M
) {
501
2.96M
          goto success;
502
2.96M
        }
503
18.4E
        DO_(::google::protobuf::internal::WireFormat::SkipField(
504
18.4E
              input, tag, _internal_metadata_.mutable_unknown_fields()));
505
18.4E
        break;
506
18.4E
      }
507
11.7M
    }
508
11.7M
  }
509
2.96M
success:
510
  // @@protoc_insertion_point(parse_success:yb.consensus.RaftPeerPB)
511
2.96M
  return true;
512
0
failure:
513
  // @@protoc_insertion_point(parse_failure:yb.consensus.RaftPeerPB)
514
0
  return false;
515
2.95M
#undef DO_
516
2.95M
}
517
518
void RaftPeerPB::SerializeWithCachedSizes(
519
0
    ::google::protobuf::io::CodedOutputStream* output) const {
520
  // @@protoc_insertion_point(serialize_start:yb.consensus.RaftPeerPB)
521
0
  ::google::protobuf::uint32 cached_has_bits = 0;
522
0
  (void) cached_has_bits;
523
524
0
  cached_has_bits = _has_bits_[0];
525
  // optional bytes permanent_uuid = 1;
526
0
  if (cached_has_bits & 0x00000001u) {
527
0
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
528
0
      1, this->permanent_uuid(), output);
529
0
  }
530
531
  // optional .yb.consensus.PeerMemberType member_type = 2;
532
0
  if (cached_has_bits & 0x00000004u) {
533
0
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
534
0
      2, this->member_type(), output);
535
0
  }
536
537
  // repeated .yb.HostPortPB last_known_private_addr = 3;
538
0
  for (unsigned int i = 0,
539
0
      n = static_cast<unsigned int>(this->last_known_private_addr_size()); i < n; i++) {
540
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
541
0
      3, this->last_known_private_addr(static_cast<int>(i)), output);
542
0
  }
543
544
  // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
545
0
  for (unsigned int i = 0,
546
0
      n = static_cast<unsigned int>(this->last_known_broadcast_addr_size()); i < n; i++) {
547
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
548
0
      4, this->last_known_broadcast_addr(static_cast<int>(i)), output);
549
0
  }
550
551
  // optional .yb.CloudInfoPB cloud_info = 5;
552
0
  if (cached_has_bits & 0x00000002u) {
553
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
554
0
      5, *this->cloud_info_, output);
555
0
  }
556
557
0
  if (_internal_metadata_.have_unknown_fields()) {
558
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
559
0
        _internal_metadata_.unknown_fields(), output);
560
0
  }
561
  // @@protoc_insertion_point(serialize_end:yb.consensus.RaftPeerPB)
562
0
}
563
564
::google::protobuf::uint8* RaftPeerPB::InternalSerializeWithCachedSizesToArray(
565
4.28M
    bool deterministic, ::google::protobuf::uint8* target) const {
566
4.28M
  (void)deterministic; // Unused
567
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.RaftPeerPB)
568
4.28M
  ::google::protobuf::uint32 cached_has_bits = 0;
569
4.28M
  (void) cached_has_bits;
570
571
4.28M
  cached_has_bits = _has_bits_[0];
572
  // optional bytes permanent_uuid = 1;
573
4.29M
  if (
cached_has_bits & 0x00000001u4.28M
) {
574
4.29M
    target =
575
4.29M
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
576
4.29M
        1, this->permanent_uuid(), target);
577
4.29M
  }
578
579
  // optional .yb.consensus.PeerMemberType member_type = 2;
580
4.28M
  if (cached_has_bits & 0x00000004u) {
581
4.28M
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
582
4.28M
      2, this->member_type(), target);
583
4.28M
  }
584
585
  // repeated .yb.HostPortPB last_known_private_addr = 3;
586
4.28M
  for (unsigned int i = 0,
587
8.57M
      n = static_cast<unsigned int>(this->last_known_private_addr_size()); i < n; 
i++4.28M
) {
588
4.28M
    target = ::google::protobuf::internal::WireFormatLite::
589
4.28M
      InternalWriteMessageToArray(
590
4.28M
        3, this->last_known_private_addr(static_cast<int>(i)), deterministic, target);
591
4.28M
  }
592
593
  // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
594
4.28M
  for (unsigned int i = 0,
595
4.28M
      n = static_cast<unsigned int>(this->last_known_broadcast_addr_size()); i < n; 
i++2.47k
) {
596
2.47k
    target = ::google::protobuf::internal::WireFormatLite::
597
2.47k
      InternalWriteMessageToArray(
598
2.47k
        4, this->last_known_broadcast_addr(static_cast<int>(i)), deterministic, target);
599
2.47k
  }
600
601
  // optional .yb.CloudInfoPB cloud_info = 5;
602
4.28M
  if (cached_has_bits & 0x00000002u) {
603
4.27M
    target = ::google::protobuf::internal::WireFormatLite::
604
4.27M
      InternalWriteMessageToArray(
605
4.27M
        5, *this->cloud_info_, deterministic, target);
606
4.27M
  }
607
608
4.28M
  if (_internal_metadata_.have_unknown_fields()) {
609
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
610
0
        _internal_metadata_.unknown_fields(), target);
611
0
  }
612
  // @@protoc_insertion_point(serialize_to_array_end:yb.consensus.RaftPeerPB)
613
4.28M
  return target;
614
4.28M
}
615
616
6.50M
size_t RaftPeerPB::ByteSizeLong() const {
617
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.RaftPeerPB)
618
6.50M
  size_t total_size = 0;
619
620
6.50M
  if (_internal_metadata_.have_unknown_fields()) {
621
0
    total_size +=
622
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
623
0
        _internal_metadata_.unknown_fields());
624
0
  }
625
  // repeated .yb.HostPortPB last_known_private_addr = 3;
626
6.50M
  {
627
6.50M
    unsigned int count = static_cast<unsigned int>(this->last_known_private_addr_size());
628
6.50M
    total_size += 1UL * count;
629
12.9M
    for (unsigned int i = 0; i < count; 
i++6.48M
) {
630
6.48M
      total_size +=
631
6.48M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
632
6.48M
          this->last_known_private_addr(static_cast<int>(i)));
633
6.48M
    }
634
6.50M
  }
635
636
  // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
637
6.50M
  {
638
6.50M
    unsigned int count = static_cast<unsigned int>(this->last_known_broadcast_addr_size());
639
6.50M
    total_size += 1UL * count;
640
6.50M
    for (unsigned int i = 0; i < count; 
i++2.93k
) {
641
2.93k
      total_size +=
642
2.93k
        ::google::protobuf::internal::WireFormatLite::MessageSize(
643
2.93k
          this->last_known_broadcast_addr(static_cast<int>(i)));
644
2.93k
    }
645
6.50M
  }
646
647
6.50M
  if (_has_bits_[0 / 32] & 7u) {
648
    // optional bytes permanent_uuid = 1;
649
6.49M
    if (has_permanent_uuid()) {
650
6.48M
      total_size += 1 +
651
6.48M
        ::google::protobuf::internal::WireFormatLite::BytesSize(
652
6.48M
          this->permanent_uuid());
653
6.48M
    }
654
655
    // optional .yb.CloudInfoPB cloud_info = 5;
656
6.49M
    if (has_cloud_info()) {
657
6.46M
      total_size += 1 +
658
6.46M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
659
6.46M
          *this->cloud_info_);
660
6.46M
    }
661
662
    // optional .yb.consensus.PeerMemberType member_type = 2;
663
6.49M
    if (has_member_type()) {
664
6.49M
      total_size += 1 +
665
6.49M
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->member_type());
666
6.49M
    }
667
668
6.49M
  }
669
6.50M
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
670
6.50M
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
671
6.50M
  _cached_size_ = cached_size;
672
6.50M
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
673
6.50M
  return total_size;
674
6.50M
}
675
676
0
void RaftPeerPB::MergeFrom(const ::google::protobuf::Message& from) {
677
// @@protoc_insertion_point(generalized_merge_from_start:yb.consensus.RaftPeerPB)
678
0
  GOOGLE_DCHECK_NE(&from, this);
679
0
  const RaftPeerPB* source =
680
0
      ::google::protobuf::internal::DynamicCastToGenerated<const RaftPeerPB>(
681
0
          &from);
682
0
  if (source == NULL) {
683
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:yb.consensus.RaftPeerPB)
684
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
685
0
  } else {
686
  // @@protoc_insertion_point(generalized_merge_from_cast_success:yb.consensus.RaftPeerPB)
687
0
    MergeFrom(*source);
688
0
  }
689
0
}
690
691
360M
void RaftPeerPB::MergeFrom(const RaftPeerPB& from) {
692
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.RaftPeerPB)
693
360M
  GOOGLE_DCHECK_NE(&from, this);
694
360M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
695
360M
  ::google::protobuf::uint32 cached_has_bits = 0;
696
360M
  (void) cached_has_bits;
697
698
360M
  last_known_private_addr_.MergeFrom(from.last_known_private_addr_);
699
360M
  last_known_broadcast_addr_.MergeFrom(from.last_known_broadcast_addr_);
700
360M
  cached_has_bits = from._has_bits_[0];
701
360M
  if (cached_has_bits & 7u) {
702
360M
    if (
cached_has_bits & 0x00000001u360M
) {
703
360M
      set_has_permanent_uuid();
704
360M
      permanent_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.permanent_uuid_);
705
360M
    }
706
360M
    if (cached_has_bits & 0x00000002u) {
707
360M
      mutable_cloud_info()->::yb::CloudInfoPB::MergeFrom(from.cloud_info());
708
360M
    }
709
360M
    if (
cached_has_bits & 0x00000004u360M
) {
710
360M
      member_type_ = from.member_type_;
711
360M
    }
712
360M
    _has_bits_[0] |= cached_has_bits;
713
360M
  }
714
360M
}
715
716
0
void RaftPeerPB::CopyFrom(const ::google::protobuf::Message& from) {
717
// @@protoc_insertion_point(generalized_copy_from_start:yb.consensus.RaftPeerPB)
718
0
  if (&from == this) return;
719
0
  Clear();
720
0
  MergeFrom(from);
721
0
}
722
723
34.8M
void RaftPeerPB::CopyFrom(const RaftPeerPB& from) {
724
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.RaftPeerPB)
725
34.8M
  if (&from == this) 
return0
;
726
34.8M
  Clear();
727
34.8M
  MergeFrom(from);
728
34.8M
}
729
730
7.67M
bool RaftPeerPB::IsInitialized() const {
731
7.67M
  if (!::google::protobuf::internal::AllAreInitialized(this->last_known_private_addr())) 
return false0
;
732
7.67M
  if (!::google::protobuf::internal::AllAreInitialized(this->last_known_broadcast_addr())) 
return false0
;
733
7.67M
  return true;
734
7.67M
}
735
736
20.8k
void RaftPeerPB::Swap(RaftPeerPB* other) {
737
20.8k
  if (other == this) 
return0
;
738
20.8k
  InternalSwap(other);
739
20.8k
}
740
40.0k
void RaftPeerPB::InternalSwap(RaftPeerPB* other) {
741
40.0k
  using std::swap;
742
40.0k
  last_known_private_addr_.InternalSwap(&other->last_known_private_addr_);
743
40.0k
  last_known_broadcast_addr_.InternalSwap(&other->last_known_broadcast_addr_);
744
40.0k
  permanent_uuid_.Swap(&other->permanent_uuid_);
745
40.0k
  swap(cloud_info_, other->cloud_info_);
746
40.0k
  swap(member_type_, other->member_type_);
747
40.0k
  swap(_has_bits_[0], other->_has_bits_[0]);
748
40.0k
  _internal_metadata_.Swap(&other->_internal_metadata_);
749
40.0k
  swap(_cached_size_, other->_cached_size_);
750
40.0k
}
751
752
253M
::google::protobuf::Metadata RaftPeerPB::GetMetadata() const {
753
253M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
754
253M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
755
253M
}
756
757
758
// ===================================================================
759
760
28.1k
void RaftConfigPB::InitAsDefaultInstance() {
761
28.1k
}
762
#if !defined(_MSC_VER) || _MSC_VER >= 1900
763
const int RaftConfigPB::kOpidIndexFieldNumber;
764
const int RaftConfigPB::kUnsafeConfigChangeFieldNumber;
765
const int RaftConfigPB::kPeersFieldNumber;
766
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
767
768
RaftConfigPB::RaftConfigPB()
769
49.5M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
770
49.5M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
771
49.4M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
772
49.4M
  }
773
49.5M
  SharedCtor();
774
  // @@protoc_insertion_point(constructor:yb.consensus.RaftConfigPB)
775
49.5M
}
776
RaftConfigPB::RaftConfigPB(const RaftConfigPB& from)
777
  : ::google::protobuf::Message(),
778
      _internal_metadata_(NULL),
779
      _has_bits_(from._has_bits_),
780
      _cached_size_(0),
781
79.3M
      peers_(from.peers_) {
782
79.3M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
783
79.3M
  ::memcpy(&opid_index_, &from.opid_index_,
784
79.3M
    static_cast<size_t>(reinterpret_cast<char*>(&unsafe_config_change_) -
785
79.3M
    reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
786
  // @@protoc_insertion_point(copy_constructor:yb.consensus.RaftConfigPB)
787
79.3M
}
788
789
49.5M
void RaftConfigPB::SharedCtor() {
790
49.5M
  _cached_size_ = 0;
791
49.5M
  ::memset(&opid_index_, 0, static_cast<size_t>(
792
49.5M
      reinterpret_cast<char*>(&unsafe_config_change_) -
793
49.5M
      reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
794
49.5M
}
795
796
128M
RaftConfigPB::~RaftConfigPB() {
797
  // @@protoc_insertion_point(destructor:yb.consensus.RaftConfigPB)
798
128M
  SharedDtor();
799
128M
}
800
801
128M
void RaftConfigPB::SharedDtor() {
802
128M
}
803
804
0
void RaftConfigPB::SetCachedSize(int size) const {
805
0
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
806
0
  _cached_size_ = size;
807
0
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
808
0
}
809
0
const ::google::protobuf::Descriptor* RaftConfigPB::descriptor() {
810
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
811
0
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
812
0
}
813
814
0
const RaftConfigPB& RaftConfigPB::default_instance() {
815
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
816
0
  return *internal_default_instance();
817
0
}
818
819
0
RaftConfigPB* RaftConfigPB::New(::google::protobuf::Arena* arena) const {
820
0
  RaftConfigPB* n = new RaftConfigPB;
821
0
  if (arena != NULL) {
822
0
    arena->Own(n);
823
0
  }
824
0
  return n;
825
0
}
826
827
48.1M
void RaftConfigPB::Clear() {
828
// @@protoc_insertion_point(message_clear_start:yb.consensus.RaftConfigPB)
829
48.1M
  ::google::protobuf::uint32 cached_has_bits = 0;
830
  // Prevent compiler warnings about cached_has_bits being unused
831
48.1M
  (void) cached_has_bits;
832
833
48.1M
  peers_.Clear();
834
48.1M
  cached_has_bits = _has_bits_[0];
835
48.1M
  if (cached_has_bits & 3u) {
836
84.9k
    ::memset(&opid_index_, 0, static_cast<size_t>(
837
84.9k
        reinterpret_cast<char*>(&unsafe_config_change_) -
838
84.9k
        reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
839
84.9k
  }
840
48.1M
  _has_bits_.Clear();
841
48.1M
  _internal_metadata_.Clear();
842
48.1M
}
843
844
bool RaftConfigPB::MergePartialFromCodedStream(
845
958k
    ::google::protobuf::io::CodedInputStream* input) {
846
3.88M
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) 
goto failure0
847
958k
  ::google::protobuf::uint32 tag;
848
  // @@protoc_insertion_point(parse_start:yb.consensus.RaftConfigPB)
849
4.84M
  for (;;) {
850
4.84M
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
851
4.84M
    tag = p.first;
852
4.84M
    if (!p.second) 
goto handle_unusual959k
;
853
3.88M
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
854
      // optional int64 opid_index = 1;
855
929k
      case 1: {
856
929k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
857
929k
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
858
929k
          set_has_opid_index();
859
929k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
860
929k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
861
929k
                 input, &opid_index_)));
862
18.4E
        } else {
863
18.4E
          goto handle_unusual;
864
18.4E
        }
865
929k
        break;
866
929k
      }
867
868
      // repeated .yb.consensus.RaftPeerPB peers = 2;
869
2.95M
      case 2: {
870
2.95M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
871
2.95M
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
872
2.95M
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_peers()));
873
18.4E
        } else {
874
18.4E
          goto handle_unusual;
875
18.4E
        }
876
2.95M
        break;
877
2.95M
      }
878
879
      // optional bool unsafe_config_change = 4 [default = false];
880
2.95M
      case 4: {
881
374
        if (static_cast< ::google::protobuf::uint8>(tag) ==
882
374
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
883
374
          set_has_unsafe_config_change();
884
374
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
885
374
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
886
374
                 input, &unsafe_config_change_)));
887
374
        } else {
888
0
          goto handle_unusual;
889
0
        }
890
374
        break;
891
374
      }
892
893
374
      default: {
894
959k
      handle_unusual:
895
959k
        if (
tag == 0959k
) {
896
959k
          goto success;
897
959k
        }
898
18.4E
        DO_(::google::protobuf::internal::WireFormat::SkipField(
899
18.4E
              input, tag, _internal_metadata_.mutable_unknown_fields()));
900
18.4E
        break;
901
18.4E
      }
902
3.88M
    }
903
3.88M
  }
904
959k
success:
905
  // @@protoc_insertion_point(parse_success:yb.consensus.RaftConfigPB)
906
959k
  return true;
907
0
failure:
908
  // @@protoc_insertion_point(parse_failure:yb.consensus.RaftConfigPB)
909
0
  return false;
910
958k
#undef DO_
911
958k
}
912
913
void RaftConfigPB::SerializeWithCachedSizes(
914
0
    ::google::protobuf::io::CodedOutputStream* output) const {
915
  // @@protoc_insertion_point(serialize_start:yb.consensus.RaftConfigPB)
916
0
  ::google::protobuf::uint32 cached_has_bits = 0;
917
0
  (void) cached_has_bits;
918
919
0
  cached_has_bits = _has_bits_[0];
920
  // optional int64 opid_index = 1;
921
0
  if (cached_has_bits & 0x00000001u) {
922
0
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->opid_index(), output);
923
0
  }
924
925
  // repeated .yb.consensus.RaftPeerPB peers = 2;
926
0
  for (unsigned int i = 0,
927
0
      n = static_cast<unsigned int>(this->peers_size()); i < n; i++) {
928
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
929
0
      2, this->peers(static_cast<int>(i)), output);
930
0
  }
931
932
  // optional bool unsafe_config_change = 4 [default = false];
933
0
  if (cached_has_bits & 0x00000002u) {
934
0
    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->unsafe_config_change(), output);
935
0
  }
936
937
0
  if (_internal_metadata_.have_unknown_fields()) {
938
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
939
0
        _internal_metadata_.unknown_fields(), output);
940
0
  }
941
  // @@protoc_insertion_point(serialize_end:yb.consensus.RaftConfigPB)
942
0
}
943
944
::google::protobuf::uint8* RaftConfigPB::InternalSerializeWithCachedSizesToArray(
945
1.37M
    bool deterministic, ::google::protobuf::uint8* target) const {
946
1.37M
  (void)deterministic; // Unused
947
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.RaftConfigPB)
948
1.37M
  ::google::protobuf::uint32 cached_has_bits = 0;
949
1.37M
  (void) cached_has_bits;
950
951
1.37M
  cached_has_bits = _has_bits_[0];
952
  // optional int64 opid_index = 1;
953
1.37M
  if (cached_has_bits & 0x00000001u) {
954
1.30M
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->opid_index(), target);
955
1.30M
  }
956
957
  // repeated .yb.consensus.RaftPeerPB peers = 2;
958
1.37M
  for (unsigned int i = 0,
959
5.66M
      n = static_cast<unsigned int>(this->peers_size()); i < n; 
i++4.28M
) {
960
4.28M
    target = ::google::protobuf::internal::WireFormatLite::
961
4.28M
      InternalWriteMessageToArray(
962
4.28M
        2, this->peers(static_cast<int>(i)), deterministic, target);
963
4.28M
  }
964
965
  // optional bool unsafe_config_change = 4 [default = false];
966
1.37M
  if (cached_has_bits & 0x00000002u) {
967
438
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->unsafe_config_change(), target);
968
438
  }
969
970
1.37M
  if (_internal_metadata_.have_unknown_fields()) {
971
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
972
0
        _internal_metadata_.unknown_fields(), target);
973
0
  }
974
  // @@protoc_insertion_point(serialize_to_array_end:yb.consensus.RaftConfigPB)
975
1.37M
  return target;
976
1.37M
}
977
978
2.06M
size_t RaftConfigPB::ByteSizeLong() const {
979
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.RaftConfigPB)
980
2.06M
  size_t total_size = 0;
981
982
2.06M
  if (_internal_metadata_.have_unknown_fields()) {
983
0
    total_size +=
984
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
985
0
        _internal_metadata_.unknown_fields());
986
0
  }
987
  // repeated .yb.consensus.RaftPeerPB peers = 2;
988
2.06M
  {
989
2.06M
    unsigned int count = static_cast<unsigned int>(this->peers_size());
990
2.06M
    total_size += 1UL * count;
991
8.55M
    for (unsigned int i = 0; i < count; 
i++6.48M
) {
992
6.48M
      total_size +=
993
6.48M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
994
6.48M
          this->peers(static_cast<int>(i)));
995
6.48M
    }
996
2.06M
  }
997
998
2.06M
  if (_has_bits_[0 / 32] & 3u) {
999
    // optional int64 opid_index = 1;
1000
1.94M
    if (has_opid_index()) {
1001
1.94M
      total_size += 1 +
1002
1.94M
        ::google::protobuf::internal::WireFormatLite::Int64Size(
1003
1.94M
          this->opid_index());
1004
1.94M
    }
1005
1006
    // optional bool unsafe_config_change = 4 [default = false];
1007
1.94M
    if (has_unsafe_config_change()) {
1008
819
      total_size += 1 + 1;
1009
819
    }
1010
1011
1.94M
  }
1012
2.06M
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1013
2.06M
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1014
2.06M
  _cached_size_ = cached_size;
1015
2.06M
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1016
2.06M
  return total_size;
1017
2.06M
}
1018
1019
0
void RaftConfigPB::MergeFrom(const ::google::protobuf::Message& from) {
1020
// @@protoc_insertion_point(generalized_merge_from_start:yb.consensus.RaftConfigPB)
1021
0
  GOOGLE_DCHECK_NE(&from, this);
1022
0
  const RaftConfigPB* source =
1023
0
      ::google::protobuf::internal::DynamicCastToGenerated<const RaftConfigPB>(
1024
0
          &from);
1025
0
  if (source == NULL) {
1026
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:yb.consensus.RaftConfigPB)
1027
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1028
0
  } else {
1029
  // @@protoc_insertion_point(generalized_merge_from_cast_success:yb.consensus.RaftConfigPB)
1030
0
    MergeFrom(*source);
1031
0
  }
1032
0
}
1033
1034
48.1M
void RaftConfigPB::MergeFrom(const RaftConfigPB& from) {
1035
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.RaftConfigPB)
1036
48.1M
  GOOGLE_DCHECK_NE(&from, this);
1037
48.1M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1038
48.1M
  ::google::protobuf::uint32 cached_has_bits = 0;
1039
48.1M
  (void) cached_has_bits;
1040
1041
48.1M
  peers_.MergeFrom(from.peers_);
1042
48.1M
  cached_has_bits = from._has_bits_[0];
1043
48.1M
  if (cached_has_bits & 3u) {
1044
48.0M
    if (cached_has_bits & 0x00000001u) {
1045
48.0M
      opid_index_ = from.opid_index_;
1046
48.0M
    }
1047
48.0M
    if (cached_has_bits & 0x00000002u) {
1048
684
      unsafe_config_change_ = from.unsafe_config_change_;
1049
684
    }
1050
48.0M
    _has_bits_[0] |= cached_has_bits;
1051
48.0M
  }
1052
48.1M
}
1053
1054
0
void RaftConfigPB::CopyFrom(const ::google::protobuf::Message& from) {
1055
// @@protoc_insertion_point(generalized_copy_from_start:yb.consensus.RaftConfigPB)
1056
0
  if (&from == this) return;
1057
0
  Clear();
1058
0
  MergeFrom(from);
1059
0
}
1060
1061
48.0M
void RaftConfigPB::CopyFrom(const RaftConfigPB& from) {
1062
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.RaftConfigPB)
1063
48.0M
  if (&from == this) 
return0
;
1064
48.0M
  Clear();
1065
48.0M
  MergeFrom(from);
1066
48.0M
}
1067
1068
2.44M
bool RaftConfigPB::IsInitialized() const {
1069
2.44M
  if (!::google::protobuf::internal::AllAreInitialized(this->peers())) 
return false0
;
1070
2.44M
  return true;
1071
2.44M
}
1072
1073
0
void RaftConfigPB::Swap(RaftConfigPB* other) {
1074
0
  if (other == this) return;
1075
0
  InternalSwap(other);
1076
0
}
1077
77.7M
void RaftConfigPB::InternalSwap(RaftConfigPB* other) {
1078
77.7M
  using std::swap;
1079
77.7M
  peers_.InternalSwap(&other->peers_);
1080
77.7M
  swap(opid_index_, other->opid_index_);
1081
77.7M
  swap(unsafe_config_change_, other->unsafe_config_change_);
1082
77.7M
  swap(_has_bits_[0], other->_has_bits_[0]);
1083
77.7M
  _internal_metadata_.Swap(&other->_internal_metadata_);
1084
77.7M
  swap(_cached_size_, other->_cached_size_);
1085
77.7M
}
1086
1087
83.8M
::google::protobuf::Metadata RaftConfigPB::GetMetadata() const {
1088
83.8M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1089
83.8M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1090
83.8M
}
1091
1092
1093
// ===================================================================
1094
1095
28.1k
void ConsensusStatePB::InitAsDefaultInstance() {
1096
28.1k
  ::yb::consensus::_ConsensusStatePB_default_instance_._instance.get_mutable()->config_ = const_cast< ::yb::consensus::RaftConfigPB*>(
1097
28.1k
      ::yb::consensus::RaftConfigPB::internal_default_instance());
1098
28.1k
}
1099
#if !defined(_MSC_VER) || _MSC_VER >= 1900
1100
const int ConsensusStatePB::kCurrentTermFieldNumber;
1101
const int ConsensusStatePB::kLeaderUuidFieldNumber;
1102
const int ConsensusStatePB::kConfigFieldNumber;
1103
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
1104
1105
ConsensusStatePB::ConsensusStatePB()
1106
54.4M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
1107
54.4M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
1108
54.4M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusStatePB();
1109
54.4M
  }
1110
54.4M
  SharedCtor();
1111
  // @@protoc_insertion_point(constructor:yb.consensus.ConsensusStatePB)
1112
54.4M
}
1113
ConsensusStatePB::ConsensusStatePB(const ConsensusStatePB& from)
1114
  : ::google::protobuf::Message(),
1115
      _internal_metadata_(NULL),
1116
      _has_bits_(from._has_bits_),
1117
1.03M
      _cached_size_(0) {
1118
1.03M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1119
1.03M
  leader_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1120
1.03M
  if (from.has_leader_uuid()) {
1121
619k
    leader_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leader_uuid_);
1122
619k
  }
1123
1.03M
  if (from.has_config()) {
1124
1.03M
    config_ = new ::yb::consensus::RaftConfigPB(*from.config_);
1125
1.03M
  } else {
1126
62
    config_ = NULL;
1127
62
  }
1128
1.03M
  current_term_ = from.current_term_;
1129
  // @@protoc_insertion_point(copy_constructor:yb.consensus.ConsensusStatePB)
1130
1.03M
}
1131
1132
54.4M
void ConsensusStatePB::SharedCtor() {
1133
54.4M
  _cached_size_ = 0;
1134
54.4M
  leader_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1135
54.4M
  ::memset(&config_, 0, static_cast<size_t>(
1136
54.4M
      reinterpret_cast<char*>(&current_term_) -
1137
54.4M
      reinterpret_cast<char*>(&config_)) + sizeof(current_term_));
1138
54.4M
}
1139
1140
55.3M
ConsensusStatePB::~ConsensusStatePB() {
1141
  // @@protoc_insertion_point(destructor:yb.consensus.ConsensusStatePB)
1142
55.3M
  SharedDtor();
1143
55.3M
}
1144
1145
55.3M
void ConsensusStatePB::SharedDtor() {
1146
55.3M
  leader_uuid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1147
55.3M
  if (this != internal_default_instance()) 
delete config_55.3M
;
1148
55.3M
}
1149
1150
0
void ConsensusStatePB::SetCachedSize(int size) const {
1151
0
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1152
0
  _cached_size_ = size;
1153
0
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1154
0
}
1155
0
const ::google::protobuf::Descriptor* ConsensusStatePB::descriptor() {
1156
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1157
0
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
1158
0
}
1159
1160
0
const ConsensusStatePB& ConsensusStatePB::default_instance() {
1161
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusStatePB();
1162
0
  return *internal_default_instance();
1163
0
}
1164
1165
0
ConsensusStatePB* ConsensusStatePB::New(::google::protobuf::Arena* arena) const {
1166
0
  ConsensusStatePB* n = new ConsensusStatePB;
1167
0
  if (arena != NULL) {
1168
0
    arena->Own(n);
1169
0
  }
1170
0
  return n;
1171
0
}
1172
1173
70.5k
void ConsensusStatePB::Clear() {
1174
// @@protoc_insertion_point(message_clear_start:yb.consensus.ConsensusStatePB)
1175
70.5k
  ::google::protobuf::uint32 cached_has_bits = 0;
1176
  // Prevent compiler warnings about cached_has_bits being unused
1177
70.5k
  (void) cached_has_bits;
1178
1179
70.5k
  cached_has_bits = _has_bits_[0];
1180
70.5k
  if (cached_has_bits & 3u) {
1181
65.1k
    if (cached_has_bits & 0x00000001u) {
1182
17.2k
      GOOGLE_DCHECK(!leader_uuid_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
1183
17.2k
      (*leader_uuid_.UnsafeRawStringPointer())->clear();
1184
17.2k
    }
1185
65.1k
    if (
cached_has_bits & 0x00000002u65.1k
) {
1186
65.1k
      GOOGLE_DCHECK(config_ != NULL);
1187
65.1k
      config_->Clear();
1188
65.1k
    }
1189
65.1k
  }
1190
70.5k
  current_term_ = GOOGLE_LONGLONG(0);
1191
70.5k
  _has_bits_.Clear();
1192
70.5k
  _internal_metadata_.Clear();
1193
70.5k
}
1194
1195
bool ConsensusStatePB::MergePartialFromCodedStream(
1196
461k
    ::google::protobuf::io::CodedInputStream* input) {
1197
1.20M
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) 
goto failure0
1198
461k
  ::google::protobuf::uint32 tag;
1199
  // @@protoc_insertion_point(parse_start:yb.consensus.ConsensusStatePB)
1200
1.66M
  for (;;) {
1201
1.66M
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1202
1.66M
    tag = p.first;
1203
1.66M
    if (!p.second) 
goto handle_unusual461k
;
1204
1.20M
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1205
      // required int64 current_term = 1;
1206
460k
      case 1: {
1207
460k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1208
460k
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
1209
460k
          set_has_current_term();
1210
460k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1211
460k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1212
460k
                 input, &current_term_)));
1213
18.4E
        } else {
1214
18.4E
          goto handle_unusual;
1215
18.4E
        }
1216
460k
        break;
1217
460k
      }
1218
1219
      // optional string leader_uuid = 2;
1220
460k
      case 2: {
1221
285k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1222
285k
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
1223
285k
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1224
285k
                input, this->mutable_leader_uuid()));
1225
285k
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1226
285k
            this->leader_uuid().data(), static_cast<int>(this->leader_uuid().length()),
1227
285k
            ::google::protobuf::internal::WireFormat::PARSE,
1228
285k
            "yb.consensus.ConsensusStatePB.leader_uuid");
1229
18.4E
        } else {
1230
18.4E
          goto handle_unusual;
1231
18.4E
        }
1232
285k
        break;
1233
285k
      }
1234
1235
      // required .yb.consensus.RaftConfigPB config = 3;
1236
460k
      case 3: {
1237
460k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1238
460k
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
1239
460k
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
1240
460k
               input, mutable_config()));
1241
18.4E
        } else {
1242
18.4E
          goto handle_unusual;
1243
18.4E
        }
1244
460k
        break;
1245
460k
      }
1246
1247
460k
      default: {
1248
461k
      handle_unusual:
1249
461k
        if (
tag == 0461k
) {
1250
461k
          goto success;
1251
461k
        }
1252
18.4E
        DO_(::google::protobuf::internal::WireFormat::SkipField(
1253
18.4E
              input, tag, _internal_metadata_.mutable_unknown_fields()));
1254
18.4E
        break;
1255
18.4E
      }
1256
1.20M
    }
1257
1.20M
  }
1258
461k
success:
1259
  // @@protoc_insertion_point(parse_success:yb.consensus.ConsensusStatePB)
1260
461k
  return true;
1261
0
failure:
1262
  // @@protoc_insertion_point(parse_failure:yb.consensus.ConsensusStatePB)
1263
0
  return false;
1264
461k
#undef DO_
1265
461k
}
1266
1267
void ConsensusStatePB::SerializeWithCachedSizes(
1268
0
    ::google::protobuf::io::CodedOutputStream* output) const {
1269
  // @@protoc_insertion_point(serialize_start:yb.consensus.ConsensusStatePB)
1270
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1271
0
  (void) cached_has_bits;
1272
1273
0
  cached_has_bits = _has_bits_[0];
1274
  // required int64 current_term = 1;
1275
0
  if (cached_has_bits & 0x00000004u) {
1276
0
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->current_term(), output);
1277
0
  }
1278
1279
  // optional string leader_uuid = 2;
1280
0
  if (cached_has_bits & 0x00000001u) {
1281
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1282
0
      this->leader_uuid().data(), static_cast<int>(this->leader_uuid().length()),
1283
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1284
0
      "yb.consensus.ConsensusStatePB.leader_uuid");
1285
0
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1286
0
      2, this->leader_uuid(), output);
1287
0
  }
1288
1289
  // required .yb.consensus.RaftConfigPB config = 3;
1290
0
  if (cached_has_bits & 0x00000002u) {
1291
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1292
0
      3, *this->config_, output);
1293
0
  }
1294
1295
0
  if (_internal_metadata_.have_unknown_fields()) {
1296
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1297
0
        _internal_metadata_.unknown_fields(), output);
1298
0
  }
1299
  // @@protoc_insertion_point(serialize_end:yb.consensus.ConsensusStatePB)
1300
0
}
1301
1302
::google::protobuf::uint8* ConsensusStatePB::InternalSerializeWithCachedSizesToArray(
1303
607k
    bool deterministic, ::google::protobuf::uint8* target) const {
1304
607k
  (void)deterministic; // Unused
1305
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.ConsensusStatePB)
1306
607k
  ::google::protobuf::uint32 cached_has_bits = 0;
1307
607k
  (void) cached_has_bits;
1308
1309
607k
  cached_has_bits = _has_bits_[0];
1310
  // required int64 current_term = 1;
1311
607k
  if (cached_has_bits & 0x00000004u) {
1312
607k
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->current_term(), target);
1313
607k
  }
1314
1315
  // optional string leader_uuid = 2;
1316
607k
  if (cached_has_bits & 0x00000001u) {
1317
383k
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1318
383k
      this->leader_uuid().data(), static_cast<int>(this->leader_uuid().length()),
1319
383k
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1320
383k
      "yb.consensus.ConsensusStatePB.leader_uuid");
1321
383k
    target =
1322
383k
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1323
383k
        2, this->leader_uuid(), target);
1324
383k
  }
1325
1326
  // required .yb.consensus.RaftConfigPB config = 3;
1327
607k
  if (cached_has_bits & 0x00000002u) {
1328
607k
    target = ::google::protobuf::internal::WireFormatLite::
1329
607k
      InternalWriteMessageToArray(
1330
607k
        3, *this->config_, deterministic, target);
1331
607k
  }
1332
1333
607k
  if (_internal_metadata_.have_unknown_fields()) {
1334
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1335
0
        _internal_metadata_.unknown_fields(), target);
1336
0
  }
1337
  // @@protoc_insertion_point(serialize_to_array_end:yb.consensus.ConsensusStatePB)
1338
607k
  return target;
1339
607k
}
1340
1341
0
size_t ConsensusStatePB::RequiredFieldsByteSizeFallback() const {
1342
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:yb.consensus.ConsensusStatePB)
1343
0
  size_t total_size = 0;
1344
1345
0
  if (has_config()) {
1346
    // required .yb.consensus.RaftConfigPB config = 3;
1347
0
    total_size += 1 +
1348
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1349
0
        *this->config_);
1350
0
  }
1351
1352
0
  if (has_current_term()) {
1353
    // required int64 current_term = 1;
1354
0
    total_size += 1 +
1355
0
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1356
0
        this->current_term());
1357
0
  }
1358
1359
0
  return total_size;
1360
0
}
1361
1.06M
size_t ConsensusStatePB::ByteSizeLong() const {
1362
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.ConsensusStatePB)
1363
1.06M
  size_t total_size = 0;
1364
1365
1.06M
  if (_internal_metadata_.have_unknown_fields()) {
1366
0
    total_size +=
1367
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1368
0
        _internal_metadata_.unknown_fields());
1369
0
  }
1370
1.06M
  if (((_has_bits_[0] & 0x00000006) ^ 0x00000006) == 0) {  // All required fields are present.
1371
    // required .yb.consensus.RaftConfigPB config = 3;
1372
1.06M
    total_size += 1 +
1373
1.06M
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1374
1.06M
        *this->config_);
1375
1376
    // required int64 current_term = 1;
1377
1.06M
    total_size += 1 +
1378
1.06M
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1379
1.06M
        this->current_term());
1380
1381
1.06M
  } else {
1382
58
    total_size += RequiredFieldsByteSizeFallback();
1383
58
  }
1384
  // optional string leader_uuid = 2;
1385
1.06M
  if (has_leader_uuid()) {
1386
669k
    total_size += 1 +
1387
669k
      ::google::protobuf::internal::WireFormatLite::StringSize(
1388
669k
        this->leader_uuid());
1389
669k
  }
1390
1391
1.06M
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1392
1.06M
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1393
1.06M
  _cached_size_ = cached_size;
1394
1.06M
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1395
1.06M
  return total_size;
1396
1.06M
}
1397
1398
0
void ConsensusStatePB::MergeFrom(const ::google::protobuf::Message& from) {
1399
// @@protoc_insertion_point(generalized_merge_from_start:yb.consensus.ConsensusStatePB)
1400
0
  GOOGLE_DCHECK_NE(&from, this);
1401
0
  const ConsensusStatePB* source =
1402
0
      ::google::protobuf::internal::DynamicCastToGenerated<const ConsensusStatePB>(
1403
0
          &from);
1404
0
  if (source == NULL) {
1405
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:yb.consensus.ConsensusStatePB)
1406
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1407
0
  } else {
1408
  // @@protoc_insertion_point(generalized_merge_from_cast_success:yb.consensus.ConsensusStatePB)
1409
0
    MergeFrom(*source);
1410
0
  }
1411
0
}
1412
1413
71.4k
void ConsensusStatePB::MergeFrom(const ConsensusStatePB& from) {
1414
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.ConsensusStatePB)
1415
71.4k
  GOOGLE_DCHECK_NE(&from, this);
1416
71.4k
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1417
71.4k
  ::google::protobuf::uint32 cached_has_bits = 0;
1418
71.4k
  (void) cached_has_bits;
1419
1420
71.4k
  cached_has_bits = from._has_bits_[0];
1421
71.4k
  if (cached_has_bits & 7u) {
1422
71.4k
    if (cached_has_bits & 0x00000001u) {
1423
71.4k
      set_has_leader_uuid();
1424
71.4k
      leader_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leader_uuid_);
1425
71.4k
    }
1426
71.4k
    if (cached_has_bits & 0x00000002u) {
1427
71.4k
      mutable_config()->::yb::consensus::RaftConfigPB::MergeFrom(from.config());
1428
71.4k
    }
1429
71.4k
    if (
cached_has_bits & 0x00000004u71.4k
) {
1430
71.4k
      current_term_ = from.current_term_;
1431
71.4k
    }
1432
71.4k
    _has_bits_[0] |= cached_has_bits;
1433
71.4k
  }
1434
71.4k
}
1435
1436
0
void ConsensusStatePB::CopyFrom(const ::google::protobuf::Message& from) {
1437
// @@protoc_insertion_point(generalized_copy_from_start:yb.consensus.ConsensusStatePB)
1438
0
  if (&from == this) return;
1439
0
  Clear();
1440
0
  MergeFrom(from);
1441
0
}
1442
1443
70.5k
void ConsensusStatePB::CopyFrom(const ConsensusStatePB& from) {
1444
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.ConsensusStatePB)
1445
70.5k
  if (&from == this) 
return0
;
1446
70.5k
  Clear();
1447
70.5k
  MergeFrom(from);
1448
70.5k
}
1449
1450
1.35M
bool ConsensusStatePB::IsInitialized() const {
1451
1.35M
  if ((_has_bits_[0] & 0x00000006) != 0x00000006) 
return false289k
;
1452
1.06M
  if (has_config()) {
1453
1.06M
    if (!this->config_->IsInitialized()) 
return false0
;
1454
1.06M
  }
1455
1.06M
  return true;
1456
1.06M
}
1457
1458
0
void ConsensusStatePB::Swap(ConsensusStatePB* other) {
1459
0
  if (other == this) return;
1460
0
  InternalSwap(other);
1461
0
}
1462
5.87M
void ConsensusStatePB::InternalSwap(ConsensusStatePB* other) {
1463
5.87M
  using std::swap;
1464
5.87M
  leader_uuid_.Swap(&other->leader_uuid_);
1465
5.87M
  swap(config_, other->config_);
1466
5.87M
  swap(current_term_, other->current_term_);
1467
5.87M
  swap(_has_bits_[0], other->_has_bits_[0]);
1468
5.87M
  _internal_metadata_.Swap(&other->_internal_metadata_);
1469
5.87M
  swap(_cached_size_, other->_cached_size_);
1470
5.87M
}
1471
1472
67.7M
::google::protobuf::Metadata ConsensusStatePB::GetMetadata() const {
1473
67.7M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1474
67.7M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1475
67.7M
}
1476
1477
1478
// ===================================================================
1479
1480
28.1k
void ConsensusMetadataPB::InitAsDefaultInstance() {
1481
28.1k
  ::yb::consensus::_ConsensusMetadataPB_default_instance_._instance.get_mutable()->committed_config_ = const_cast< ::yb::consensus::RaftConfigPB*>(
1482
28.1k
      ::yb::consensus::RaftConfigPB::internal_default_instance());
1483
28.1k
}
1484
#if !defined(_MSC_VER) || _MSC_VER >= 1900
1485
const int ConsensusMetadataPB::kCommittedConfigFieldNumber;
1486
const int ConsensusMetadataPB::kCurrentTermFieldNumber;
1487
const int ConsensusMetadataPB::kVotedForFieldNumber;
1488
const int ConsensusMetadataPB::kSplitParentTabletIdFieldNumber;
1489
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
1490
1491
ConsensusMetadataPB::ConsensusMetadataPB()
1492
479k
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
1493
479k
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
1494
451k
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusMetadataPB();
1495
451k
  }
1496
479k
  SharedCtor();
1497
  // @@protoc_insertion_point(constructor:yb.consensus.ConsensusMetadataPB)
1498
479k
}
1499
ConsensusMetadataPB::ConsensusMetadataPB(const ConsensusMetadataPB& from)
1500
  : ::google::protobuf::Message(),
1501
      _internal_metadata_(NULL),
1502
      _has_bits_(from._has_bits_),
1503
0
      _cached_size_(0) {
1504
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1505
0
  voted_for_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1506
0
  if (from.has_voted_for()) {
1507
0
    voted_for_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.voted_for_);
1508
0
  }
1509
0
  split_parent_tablet_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1510
0
  if (from.has_split_parent_tablet_id()) {
1511
0
    split_parent_tablet_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.split_parent_tablet_id_);
1512
0
  }
1513
0
  if (from.has_committed_config()) {
1514
0
    committed_config_ = new ::yb::consensus::RaftConfigPB(*from.committed_config_);
1515
0
  } else {
1516
0
    committed_config_ = NULL;
1517
0
  }
1518
0
  current_term_ = from.current_term_;
1519
  // @@protoc_insertion_point(copy_constructor:yb.consensus.ConsensusMetadataPB)
1520
0
}
1521
1522
479k
void ConsensusMetadataPB::SharedCtor() {
1523
479k
  _cached_size_ = 0;
1524
479k
  voted_for_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1525
479k
  split_parent_tablet_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1526
479k
  ::memset(&committed_config_, 0, static_cast<size_t>(
1527
479k
      reinterpret_cast<char*>(&current_term_) -
1528
479k
      reinterpret_cast<char*>(&committed_config_)) + sizeof(current_term_));
1529
479k
}
1530
1531
376k
ConsensusMetadataPB::~ConsensusMetadataPB() {
1532
  // @@protoc_insertion_point(destructor:yb.consensus.ConsensusMetadataPB)
1533
376k
  SharedDtor();
1534
376k
}
1535
1536
376k
void ConsensusMetadataPB::SharedDtor() {
1537
376k
  voted_for_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1538
376k
  split_parent_tablet_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1539
376k
  if (this != internal_default_instance()) 
delete committed_config_376k
;
1540
376k
}
1541
1542
0
void ConsensusMetadataPB::SetCachedSize(int size) const {
1543
0
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1544
0
  _cached_size_ = size;
1545
0
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1546
0
}
1547
0
const ::google::protobuf::Descriptor* ConsensusMetadataPB::descriptor() {
1548
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1549
0
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
1550
0
}
1551
1552
0
const ConsensusMetadataPB& ConsensusMetadataPB::default_instance() {
1553
0
  ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusMetadataPB();
1554
0
  return *internal_default_instance();
1555
0
}
1556
1557
0
ConsensusMetadataPB* ConsensusMetadataPB::New(::google::protobuf::Arena* arena) const {
1558
0
  ConsensusMetadataPB* n = new ConsensusMetadataPB;
1559
0
  if (arena != NULL) {
1560
0
    arena->Own(n);
1561
0
  }
1562
0
  return n;
1563
0
}
1564
1565
301k
void ConsensusMetadataPB::Clear() {
1566
// @@protoc_insertion_point(message_clear_start:yb.consensus.ConsensusMetadataPB)
1567
301k
  ::google::protobuf::uint32 cached_has_bits = 0;
1568
  // Prevent compiler warnings about cached_has_bits being unused
1569
301k
  (void) cached_has_bits;
1570
1571
301k
  cached_has_bits = _has_bits_[0];
1572
301k
  if (cached_has_bits & 7u) {
1573
0
    if (cached_has_bits & 0x00000001u) {
1574
0
      GOOGLE_DCHECK(!voted_for_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
1575
0
      (*voted_for_.UnsafeRawStringPointer())->clear();
1576
0
    }
1577
0
    if (cached_has_bits & 0x00000002u) {
1578
0
      GOOGLE_DCHECK(!split_parent_tablet_id_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
1579
0
      (*split_parent_tablet_id_.UnsafeRawStringPointer())->clear();
1580
0
    }
1581
0
    if (cached_has_bits & 0x00000004u) {
1582
0
      GOOGLE_DCHECK(committed_config_ != NULL);
1583
0
      committed_config_->Clear();
1584
0
    }
1585
0
  }
1586
301k
  current_term_ = GOOGLE_LONGLONG(0);
1587
301k
  _has_bits_.Clear();
1588
301k
  _internal_metadata_.Clear();
1589
301k
}
1590
1591
bool ConsensusMetadataPB::MergePartialFromCodedStream(
1592
300k
    ::google::protobuf::io::CodedInputStream* input) {
1593
603k
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) 
goto failure0
1594
300k
  ::google::protobuf::uint32 tag;
1595
  // @@protoc_insertion_point(parse_start:yb.consensus.ConsensusMetadataPB)
1596
904k
  for (;;) {
1597
904k
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1598
904k
    tag = p.first;
1599
904k
    if (!p.second) 
goto handle_unusual301k
;
1600
602k
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1601
      // required .yb.consensus.RaftConfigPB committed_config = 1;
1602
300k
      case 1: {
1603
300k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1604
300k
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
1605
300k
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
1606
300k
               input, mutable_committed_config()));
1607
18.4E
        } else {
1608
18.4E
          goto handle_unusual;
1609
18.4E
        }
1610
300k
        break;
1611
300k
      }
1612
1613
      // required int64 current_term = 2;
1614
301k
      case 2: {
1615
301k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1616
301k
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
1617
301k
          set_has_current_term();
1618
301k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1619
301k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1620
301k
                 input, &current_term_)));
1621
18.4E
        } else {
1622
18.4E
          goto handle_unusual;
1623
18.4E
        }
1624
301k
        break;
1625
301k
      }
1626
1627
      // optional string voted_for = 3;
1628
301k
      case 3: {
1629
1.09k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1630
1.09k
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
1631
1.09k
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1632
1.09k
                input, this->mutable_voted_for()));
1633
1.09k
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1634
1.09k
            this->voted_for().data(), static_cast<int>(this->voted_for().length()),
1635
1.09k
            ::google::protobuf::internal::WireFormat::PARSE,
1636
1.09k
            "yb.consensus.ConsensusMetadataPB.voted_for");
1637
18.4E
        } else {
1638
18.4E
          goto handle_unusual;
1639
18.4E
        }
1640
1.09k
        break;
1641
1.09k
      }
1642
1643
      // optional bytes split_parent_tablet_id = 4;
1644
1.09k
      case 4: {
1645
305
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1646
305
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
1647
303
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1648
303
                input, this->mutable_split_parent_tablet_id()));
1649
303
        } else {
1650
2
          goto handle_unusual;
1651
2
        }
1652
303
        break;
1653
305
      }
1654
1655
303
      default: {
1656
301k
      handle_unusual:
1657
301k
        if (
tag == 0301k
) {
1658
301k
          goto success;
1659
301k
        }
1660
18.4E
        DO_(::google::protobuf::internal::WireFormat::SkipField(
1661
18.4E
              input, tag, _internal_metadata_.mutable_unknown_fields()));
1662
18.4E
        break;
1663
18.4E
      }
1664
602k
    }
1665
602k
  }
1666
301k
success:
1667
  // @@protoc_insertion_point(parse_success:yb.consensus.ConsensusMetadataPB)
1668
301k
  return true;
1669
0
failure:
1670
  // @@protoc_insertion_point(parse_failure:yb.consensus.ConsensusMetadataPB)
1671
0
  return false;
1672
300k
#undef DO_
1673
300k
}
1674
1675
void ConsensusMetadataPB::SerializeWithCachedSizes(
1676
0
    ::google::protobuf::io::CodedOutputStream* output) const {
1677
  // @@protoc_insertion_point(serialize_start:yb.consensus.ConsensusMetadataPB)
1678
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1679
0
  (void) cached_has_bits;
1680
1681
0
  cached_has_bits = _has_bits_[0];
1682
  // required .yb.consensus.RaftConfigPB committed_config = 1;
1683
0
  if (cached_has_bits & 0x00000004u) {
1684
0
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1685
0
      1, *this->committed_config_, output);
1686
0
  }
1687
1688
  // required int64 current_term = 2;
1689
0
  if (cached_has_bits & 0x00000008u) {
1690
0
    ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->current_term(), output);
1691
0
  }
1692
1693
  // optional string voted_for = 3;
1694
0
  if (cached_has_bits & 0x00000001u) {
1695
0
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1696
0
      this->voted_for().data(), static_cast<int>(this->voted_for().length()),
1697
0
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1698
0
      "yb.consensus.ConsensusMetadataPB.voted_for");
1699
0
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1700
0
      3, this->voted_for(), output);
1701
0
  }
1702
1703
  // optional bytes split_parent_tablet_id = 4;
1704
0
  if (cached_has_bits & 0x00000002u) {
1705
0
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
1706
0
      4, this->split_parent_tablet_id(), output);
1707
0
  }
1708
1709
0
  if (_internal_metadata_.have_unknown_fields()) {
1710
0
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1711
0
        _internal_metadata_.unknown_fields(), output);
1712
0
  }
1713
  // @@protoc_insertion_point(serialize_end:yb.consensus.ConsensusMetadataPB)
1714
0
}
1715
1716
::google::protobuf::uint8* ConsensusMetadataPB::InternalSerializeWithCachedSizesToArray(
1717
525k
    bool deterministic, ::google::protobuf::uint8* target) const {
1718
525k
  (void)deterministic; // Unused
1719
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.ConsensusMetadataPB)
1720
525k
  ::google::protobuf::uint32 cached_has_bits = 0;
1721
525k
  (void) cached_has_bits;
1722
1723
525k
  cached_has_bits = _has_bits_[0];
1724
  // required .yb.consensus.RaftConfigPB committed_config = 1;
1725
525k
  if (cached_has_bits & 0x00000004u) {
1726
525k
    target = ::google::protobuf::internal::WireFormatLite::
1727
525k
      InternalWriteMessageToArray(
1728
525k
        1, *this->committed_config_, deterministic, target);
1729
525k
  }
1730
1731
  // required int64 current_term = 2;
1732
525k
  if (cached_has_bits & 0x00000008u) {
1733
525k
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->current_term(), target);
1734
525k
  }
1735
1736
  // optional string voted_for = 3;
1737
525k
  if (cached_has_bits & 0x00000001u) {
1738
184k
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1739
184k
      this->voted_for().data(), static_cast<int>(this->voted_for().length()),
1740
184k
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1741
184k
      "yb.consensus.ConsensusMetadataPB.voted_for");
1742
184k
    target =
1743
184k
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1744
184k
        3, this->voted_for(), target);
1745
184k
  }
1746
1747
  // optional bytes split_parent_tablet_id = 4;
1748
525k
  if (cached_has_bits & 0x00000002u) {
1749
573
    target =
1750
573
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
1751
573
        4, this->split_parent_tablet_id(), target);
1752
573
  }
1753
1754
525k
  if (_internal_metadata_.have_unknown_fields()) {
1755
0
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1756
0
        _internal_metadata_.unknown_fields(), target);
1757
0
  }
1758
  // @@protoc_insertion_point(serialize_to_array_end:yb.consensus.ConsensusMetadataPB)
1759
525k
  return target;
1760
525k
}
1761
1762
0
size_t ConsensusMetadataPB::RequiredFieldsByteSizeFallback() const {
1763
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:yb.consensus.ConsensusMetadataPB)
1764
0
  size_t total_size = 0;
1765
1766
0
  if (has_committed_config()) {
1767
    // required .yb.consensus.RaftConfigPB committed_config = 1;
1768
0
    total_size += 1 +
1769
0
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1770
0
        *this->committed_config_);
1771
0
  }
1772
1773
0
  if (has_current_term()) {
1774
    // required int64 current_term = 2;
1775
0
    total_size += 1 +
1776
0
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1777
0
        this->current_term());
1778
0
  }
1779
1780
0
  return total_size;
1781
0
}
1782
525k
size_t ConsensusMetadataPB::ByteSizeLong() const {
1783
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.ConsensusMetadataPB)
1784
525k
  size_t total_size = 0;
1785
1786
525k
  if (_internal_metadata_.have_unknown_fields()) {
1787
0
    total_size +=
1788
0
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1789
0
        _internal_metadata_.unknown_fields());
1790
0
  }
1791
525k
  if (((_has_bits_[0] & 0x0000000c) ^ 0x0000000c) == 0) {  // All required fields are present.
1792
    // required .yb.consensus.RaftConfigPB committed_config = 1;
1793
525k
    total_size += 1 +
1794
525k
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1795
525k
        *this->committed_config_);
1796
1797
    // required int64 current_term = 2;
1798
525k
    total_size += 1 +
1799
525k
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1800
525k
        this->current_term());
1801
1802
525k
  } else {
1803
130
    total_size += RequiredFieldsByteSizeFallback();
1804
130
  }
1805
525k
  if (_has_bits_[0 / 32] & 3u) {
1806
    // optional string voted_for = 3;
1807
185k
    if (has_voted_for()) {
1808
184k
      total_size += 1 +
1809
184k
        ::google::protobuf::internal::WireFormatLite::StringSize(
1810
184k
          this->voted_for());
1811
184k
    }
1812
1813
    // optional bytes split_parent_tablet_id = 4;
1814
185k
    if (has_split_parent_tablet_id()) {
1815
574
      total_size += 1 +
1816
574
        ::google::protobuf::internal::WireFormatLite::BytesSize(
1817
574
          this->split_parent_tablet_id());
1818
574
    }
1819
1820
185k
  }
1821
525k
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1822
525k
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1823
525k
  _cached_size_ = cached_size;
1824
525k
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1825
525k
  return total_size;
1826
525k
}
1827
1828
0
void ConsensusMetadataPB::MergeFrom(const ::google::protobuf::Message& from) {
1829
// @@protoc_insertion_point(generalized_merge_from_start:yb.consensus.ConsensusMetadataPB)
1830
0
  GOOGLE_DCHECK_NE(&from, this);
1831
0
  const ConsensusMetadataPB* source =
1832
0
      ::google::protobuf::internal::DynamicCastToGenerated<const ConsensusMetadataPB>(
1833
0
          &from);
1834
0
  if (source == NULL) {
1835
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:yb.consensus.ConsensusMetadataPB)
1836
0
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1837
0
  } else {
1838
  // @@protoc_insertion_point(generalized_merge_from_cast_success:yb.consensus.ConsensusMetadataPB)
1839
0
    MergeFrom(*source);
1840
0
  }
1841
0
}
1842
1843
0
void ConsensusMetadataPB::MergeFrom(const ConsensusMetadataPB& from) {
1844
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.ConsensusMetadataPB)
1845
0
  GOOGLE_DCHECK_NE(&from, this);
1846
0
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1847
0
  ::google::protobuf::uint32 cached_has_bits = 0;
1848
0
  (void) cached_has_bits;
1849
1850
0
  cached_has_bits = from._has_bits_[0];
1851
0
  if (cached_has_bits & 15u) {
1852
0
    if (cached_has_bits & 0x00000001u) {
1853
0
      set_has_voted_for();
1854
0
      voted_for_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.voted_for_);
1855
0
    }
1856
0
    if (cached_has_bits & 0x00000002u) {
1857
0
      set_has_split_parent_tablet_id();
1858
0
      split_parent_tablet_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.split_parent_tablet_id_);
1859
0
    }
1860
0
    if (cached_has_bits & 0x00000004u) {
1861
0
      mutable_committed_config()->::yb::consensus::RaftConfigPB::MergeFrom(from.committed_config());
1862
0
    }
1863
0
    if (cached_has_bits & 0x00000008u) {
1864
0
      current_term_ = from.current_term_;
1865
0
    }
1866
0
    _has_bits_[0] |= cached_has_bits;
1867
0
  }
1868
0
}
1869
1870
0
void ConsensusMetadataPB::CopyFrom(const ::google::protobuf::Message& from) {
1871
// @@protoc_insertion_point(generalized_copy_from_start:yb.consensus.ConsensusMetadataPB)
1872
0
  if (&from == this) return;
1873
0
  Clear();
1874
0
  MergeFrom(from);
1875
0
}
1876
1877
0
void ConsensusMetadataPB::CopyFrom(const ConsensusMetadataPB& from) {
1878
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.ConsensusMetadataPB)
1879
0
  if (&from == this) return;
1880
0
  Clear();
1881
0
  MergeFrom(from);
1882
0
}
1883
1884
826k
bool ConsensusMetadataPB::IsInitialized() const {
1885
826k
  if ((_has_bits_[0] & 0x0000000c) != 0x0000000c) 
return false0
;
1886
826k
  if (has_committed_config()) {
1887
826k
    if (!this->committed_config_->IsInitialized()) 
return false0
;
1888
826k
  }
1889
826k
  return true;
1890
826k
}
1891
1892
0
void ConsensusMetadataPB::Swap(ConsensusMetadataPB* other) {
1893
0
  if (other == this) return;
1894
0
  InternalSwap(other);
1895
0
}
1896
0
void ConsensusMetadataPB::InternalSwap(ConsensusMetadataPB* other) {
1897
0
  using std::swap;
1898
0
  voted_for_.Swap(&other->voted_for_);
1899
0
  split_parent_tablet_id_.Swap(&other->split_parent_tablet_id_);
1900
0
  swap(committed_config_, other->committed_config_);
1901
0
  swap(current_term_, other->current_term_);
1902
0
  swap(_has_bits_[0], other->_has_bits_[0]);
1903
0
  _internal_metadata_.Swap(&other->_internal_metadata_);
1904
0
  swap(_cached_size_, other->_cached_size_);
1905
0
}
1906
1907
1.05M
::google::protobuf::Metadata ConsensusMetadataPB::GetMetadata() const {
1908
1.05M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1909
1.05M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1910
1.05M
}
1911
1912
1913
// @@protoc_insertion_point(namespace_scope)
1914
}  // namespace consensus
1915
}  // namespace yb
1916
1917
// @@protoc_insertion_point(global_scope)