YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/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
17.1k
void InitDefaultsRaftPeerPBImpl() {
49
17.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
50
51
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
52
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
53
#else
54
17.1k
  ::google::protobuf::internal::InitProtobufDefaults();
55
17.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
56
17.1k
  protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::InitDefaultsHostPortPB();
57
17.1k
  protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::InitDefaultsCloudInfoPB();
58
17.1k
  {
59
17.1k
    void* ptr = &::yb::consensus::_RaftPeerPB_default_instance_;
60
17.1k
    new (ptr) ::yb::consensus::RaftPeerPB();
61
17.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
62
17.1k
  }
63
17.1k
  ::yb::consensus::RaftPeerPB::InitAsDefaultInstance();
64
17.1k
}
65
66
185M
void InitDefaultsRaftPeerPB() {
67
185M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
68
185M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsRaftPeerPBImpl);
69
185M
}
70
71
17.1k
void InitDefaultsRaftConfigPBImpl() {
72
17.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
73
74
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
75
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
76
#else
77
17.1k
  ::google::protobuf::internal::InitProtobufDefaults();
78
17.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
79
17.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftPeerPB();
80
17.1k
  {
81
17.1k
    void* ptr = &::yb::consensus::_RaftConfigPB_default_instance_;
82
17.1k
    new (ptr) ::yb::consensus::RaftConfigPB();
83
17.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
84
17.1k
  }
85
17.1k
  ::yb::consensus::RaftConfigPB::InitAsDefaultInstance();
86
17.1k
}
87
88
9.11M
void InitDefaultsRaftConfigPB() {
89
9.11M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
90
9.11M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsRaftConfigPBImpl);
91
9.11M
}
92
93
17.1k
void InitDefaultsConsensusStatePBImpl() {
94
17.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
95
96
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
97
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
98
#else
99
17.1k
  ::google::protobuf::internal::InitProtobufDefaults();
100
17.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
101
17.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
102
17.1k
  {
103
17.1k
    void* ptr = &::yb::consensus::_ConsensusStatePB_default_instance_;
104
17.1k
    new (ptr) ::yb::consensus::ConsensusStatePB();
105
17.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
106
17.1k
  }
107
17.1k
  ::yb::consensus::ConsensusStatePB::InitAsDefaultInstance();
108
17.1k
}
109
110
9.37M
void InitDefaultsConsensusStatePB() {
111
9.37M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
112
9.37M
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConsensusStatePBImpl);
113
9.37M
}
114
115
17.1k
void InitDefaultsConsensusMetadataPBImpl() {
116
17.1k
  GOOGLE_PROTOBUF_VERIFY_VERSION;
117
118
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
119
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
120
#else
121
17.1k
  ::google::protobuf::internal::InitProtobufDefaults();
122
17.1k
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
123
17.1k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
124
17.1k
  {
125
17.1k
    void* ptr = &::yb::consensus::_ConsensusMetadataPB_default_instance_;
126
17.1k
    new (ptr) ::yb::consensus::ConsensusMetadataPB();
127
17.1k
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
128
17.1k
  }
129
17.1k
  ::yb::consensus::ConsensusMetadataPB::InitAsDefaultInstance();
130
17.1k
}
131
132
283k
void InitDefaultsConsensusMetadataPB() {
133
283k
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
134
283k
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsConsensusMetadataPBImpl);
135
283k
}
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
9.56k
void protobuf_AssignDescriptors() {
207
9.56k
  AddDescriptors();
208
9.56k
  ::google::protobuf::MessageFactory* factory = NULL;
209
9.56k
  AssignDescriptors(
210
9.56k
      "yb/consensus/metadata.proto", schemas, file_default_instances, TableStruct::offsets, factory,
211
9.56k
      file_level_metadata, file_level_enum_descriptors, NULL);
212
9.56k
}
213
214
122M
void protobuf_AssignDescriptorsOnce() {
215
122M
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
216
122M
  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
217
122M
}
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
17.1k
void AddDescriptorsImpl() {
226
17.1k
  InitDefaults();
227
17.1k
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
228
17.1k
      "\n\033yb/consensus/metadata.proto\022\014yb.consen"
229
17.1k
      "sus\032\032yb/common/common_net.proto\"\340\001\n\nRaft"
230
17.1k
      "PeerPB\022\026\n\016permanent_uuid\030\001 \001(\014\0221\n\013member"
231
17.1k
      "_type\030\002 \001(\0162\034.yb.consensus.PeerMemberTyp"
232
17.1k
      "e\022/\n\027last_known_private_addr\030\003 \003(\0132\016.yb."
233
17.1k
      "HostPortPB\0221\n\031last_known_broadcast_addr\030"
234
17.1k
      "\004 \003(\0132\016.yb.HostPortPB\022#\n\ncloud_info\030\005 \001("
235
17.1k
      "\0132\017.yb.CloudInfoPB\"p\n\014RaftConfigPB\022\022\n\nop"
236
17.1k
      "id_index\030\001 \001(\003\022#\n\024unsafe_config_change\030\004"
237
17.1k
      " \001(\010:\005false\022\'\n\005peers\030\002 \003(\0132\030.yb.consensu"
238
17.1k
      "s.RaftPeerPB\"i\n\020ConsensusStatePB\022\024\n\014curr"
239
17.1k
      "ent_term\030\001 \002(\003\022\023\n\013leader_uuid\030\002 \001(\t\022*\n\006c"
240
17.1k
      "onfig\030\003 \002(\0132\032.yb.consensus.RaftConfigPB\""
241
17.1k
      "\224\001\n\023ConsensusMetadataPB\0224\n\020committed_con"
242
17.1k
      "fig\030\001 \002(\0132\032.yb.consensus.RaftConfigPB\022\024\n"
243
17.1k
      "\014current_term\030\002 \002(\003\022\021\n\tvoted_for\030\003 \001(\t\022\036"
244
17.1k
      "\n\026split_parent_tablet_id\030\004 \001(\014*d\n\016PeerMe"
245
17.1k
      "mberType\022\030\n\023UNKNOWN_MEMBER_TYPE\020\347\007\022\r\n\tPR"
246
17.1k
      "E_VOTER\020\000\022\t\n\005VOTER\020\001\022\020\n\014PRE_OBSERVER\020\002\022\014"
247
17.1k
      "\n\010OBSERVER\020\003*q\n\023ConsensusConfigType\022\035\n\030C"
248
17.1k
      "ONSENSUS_CONFIG_UNKNOWN\020\347\007\022\036\n\032CONSENSUS_"
249
17.1k
      "CONFIG_COMMITTED\020\001\022\033\n\027CONSENSUS_CONFIG_A"
250
17.1k
      "CTIVE\020\002B\022\n\020org.yb.consensus"
251
17.1k
  };
252
17.1k
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
253
17.1k
      descriptor, 907);
254
17.1k
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
255
17.1k
    "yb/consensus/metadata.proto", &protobuf_RegisterTypes);
256
17.1k
  ::protobuf_yb_2fcommon_2fcommon_5fnet_2eproto::AddDescriptors();
257
17.1k
}
258
259
137k
void AddDescriptors() {
260
137k
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
261
137k
  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
262
137k
}
263
// Force AddDescriptors() to be called at dynamic initialization time.
264
struct StaticDescriptorInitializer {
265
17.1k
  StaticDescriptorInitializer() {
266
17.1k
    AddDescriptors();
267
17.1k
  }
268
} static_descriptor_initializer;
269
}  // namespace protobuf_yb_2fconsensus_2fmetadata_2eproto
270
namespace yb {
271
namespace consensus {
272
394k
const ::google::protobuf::EnumDescriptor* PeerMemberType_descriptor() {
273
394k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
274
394k
  return protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_enum_descriptors[0];
275
394k
}
276
5.77M
bool PeerMemberType_IsValid(int value) {
277
5.77M
  switch (value) {
278
42.8k
    case 0:
279
5.66M
    case 1:
280
5.67M
    case 2:
281
5.77M
    case 3:
282
5.77M
    case 999:
283
5.77M
      return true;
284
0
    default:
285
0
      return false;
286
5.77M
  }
287
5.77M
}
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
9.99k
bool ConsensusConfigType_IsValid(int value) {
294
9.99k
  switch (value) {
295
1.98k
    case 1:
296
10.0k
    case 2:
297
10.0k
    case 999:
298
10.0k
      return true;
299
0
    default:
300
0
      return false;
301
9.99k
  }
302
9.99k
}
303
304
305
// ===================================================================
306
307
17.1k
void RaftPeerPB::InitAsDefaultInstance() {
308
17.1k
  ::yb::consensus::_RaftPeerPB_default_instance_._instance.get_mutable()->cloud_info_ = const_cast< ::yb::CloudInfoPB*>(
309
17.1k
      ::yb::CloudInfoPB::internal_default_instance());
310
17.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
185M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
331
185M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
332
185M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftPeerPB();
333
185M
  }
334
185M
  SharedCtor();
335
  // @@protoc_insertion_point(constructor:yb.consensus.RaftPeerPB)
336
185M
}
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
505k
      last_known_broadcast_addr_(from.last_known_broadcast_addr_) {
344
505k
  _internal_metadata_.MergeFrom(from._internal_metadata_);
345
505k
  permanent_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
346
505k
  if (from.has_permanent_uuid()) {
347
505k
    permanent_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.permanent_uuid_);
348
505k
  }
349
505k
  if (from.has_cloud_info()) {
350
502k
    cloud_info_ = new ::yb::CloudInfoPB(*from.cloud_info_);
351
2.64k
  } else {
352
2.64k
    cloud_info_ = NULL;
353
2.64k
  }
354
505k
  member_type_ = from.member_type_;
355
  // @@protoc_insertion_point(copy_constructor:yb.consensus.RaftPeerPB)
356
505k
}
357
358
185M
void RaftPeerPB::SharedCtor() {
359
185M
  _cached_size_ = 0;
360
185M
  permanent_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
361
185M
  cloud_info_ = NULL;
362
185M
  member_type_ = 999;
363
185M
}
364
365
185M
RaftPeerPB::~RaftPeerPB() {
366
  // @@protoc_insertion_point(destructor:yb.consensus.RaftPeerPB)
367
185M
  SharedDtor();
368
185M
}
369
370
185M
void RaftPeerPB::SharedDtor() {
371
185M
  permanent_uuid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
372
185M
  if (this != internal_default_instance()) delete cloud_info_;
373
185M
}
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
15.4M
void RaftPeerPB::Clear() {
399
// @@protoc_insertion_point(message_clear_start:yb.consensus.RaftPeerPB)
400
15.4M
  ::google::protobuf::uint32 cached_has_bits = 0;
401
  // Prevent compiler warnings about cached_has_bits being unused
402
15.4M
  (void) cached_has_bits;
403
404
15.4M
  last_known_private_addr_.Clear();
405
15.4M
  last_known_broadcast_addr_.Clear();
406
15.4M
  cached_has_bits = _has_bits_[0];
407
15.4M
  if (cached_has_bits & 7u) {
408
196k
    if (cached_has_bits & 0x00000001u) {
409
196k
      GOOGLE_DCHECK(!permanent_uuid_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
410
196k
      (*permanent_uuid_.UnsafeRawStringPointer())->clear();
411
196k
    }
412
196k
    if (cached_has_bits & 0x00000002u) {
413
194k
      GOOGLE_DCHECK(cloud_info_ != NULL);
414
194k
      cloud_info_->Clear();
415
194k
    }
416
196k
    member_type_ = 999;
417
196k
  }
418
15.4M
  _has_bits_.Clear();
419
15.4M
  _internal_metadata_.Clear();
420
15.4M
}
421
422
bool RaftPeerPB::MergePartialFromCodedStream(
423
1.71M
    ::google::protobuf::io::CodedInputStream* input) {
424
6.84M
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
425
1.71M
  ::google::protobuf::uint32 tag;
426
  // @@protoc_insertion_point(parse_start:yb.consensus.RaftPeerPB)
427
8.53M
  for (;;) {
428
8.53M
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
429
8.53M
    tag = p.first;
430
8.53M
    if (!p.second) goto handle_unusual;
431
6.82M
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
432
      // optional bytes permanent_uuid = 1;
433
1.71M
      case 1: {
434
1.71M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
435
1.71M
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
436
1.71M
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
437
1.71M
                input, this->mutable_permanent_uuid()));
438
18.4E
        } else {
439
18.4E
          goto handle_unusual;
440
18.4E
        }
441
1.71M
        break;
442
1.71M
      }
443
444
      // optional .yb.consensus.PeerMemberType member_type = 2;
445
1.71M
      case 2: {
446
1.71M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
447
1.71M
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
448
1.71M
          int value;
449
1.71M
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
450
1.71M
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
451
1.71M
                 input, &value)));
452
1.71M
          if (::yb::consensus::PeerMemberType_IsValid(value)) {
453
1.71M
            set_member_type(static_cast< ::yb::consensus::PeerMemberType >(value));
454
298
          } else {
455
298
            mutable_unknown_fields()->AddVarint(
456
298
                2, static_cast< ::google::protobuf::uint64>(value));
457
298
          }
458
18.4E
        } else {
459
18.4E
          goto handle_unusual;
460
18.4E
        }
461
1.71M
        break;
462
1.71M
      }
463
464
      // repeated .yb.HostPortPB last_known_private_addr = 3;
465
1.71M
      case 3: {
466
1.71M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
467
1.71M
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
468
1.71M
          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
1.71M
        break;
473
1.71M
      }
474
475
      // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
476
860
      case 4: {
477
860
        if (static_cast< ::google::protobuf::uint8>(tag) ==
478
860
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
479
860
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_last_known_broadcast_addr()));
480
0
        } else {
481
0
          goto handle_unusual;
482
0
        }
483
860
        break;
484
860
      }
485
486
      // optional .yb.CloudInfoPB cloud_info = 5;
487
1.70M
      case 5: {
488
1.70M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
489
1.70M
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
490
1.70M
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
491
1.70M
               input, mutable_cloud_info()));
492
18.4E
        } else {
493
18.4E
          goto handle_unusual;
494
18.4E
        }
495
1.70M
        break;
496
1.71M
      }
497
498
0
      default: {
499
1.71M
      handle_unusual:
500
1.71M
        if (tag == 0) {
501
1.71M
          goto success;
502
1.71M
        }
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
6.82M
    }
508
6.82M
  }
509
1.71M
success:
510
  // @@protoc_insertion_point(parse_success:yb.consensus.RaftPeerPB)
511
1.71M
  return true;
512
0
failure:
513
  // @@protoc_insertion_point(parse_failure:yb.consensus.RaftPeerPB)
514
0
  return false;
515
1.71M
#undef DO_
516
1.71M
}
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
2.45M
    bool deterministic, ::google::protobuf::uint8* target) const {
566
2.45M
  (void)deterministic; // Unused
567
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.RaftPeerPB)
568
2.45M
  ::google::protobuf::uint32 cached_has_bits = 0;
569
2.45M
  (void) cached_has_bits;
570
571
2.45M
  cached_has_bits = _has_bits_[0];
572
  // optional bytes permanent_uuid = 1;
573
2.45M
  if (cached_has_bits & 0x00000001u) {
574
2.45M
    target =
575
2.45M
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
576
2.45M
        1, this->permanent_uuid(), target);
577
2.45M
  }
578
579
  // optional .yb.consensus.PeerMemberType member_type = 2;
580
2.45M
  if (cached_has_bits & 0x00000004u) {
581
2.45M
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
582
2.45M
      2, this->member_type(), target);
583
2.45M
  }
584
585
  // repeated .yb.HostPortPB last_known_private_addr = 3;
586
2.45M
  for (unsigned int i = 0,
587
4.90M
      n = static_cast<unsigned int>(this->last_known_private_addr_size()); i < n; i++) {
588
2.45M
    target = ::google::protobuf::internal::WireFormatLite::
589
2.45M
      InternalWriteMessageToArray(
590
2.45M
        3, this->last_known_private_addr(static_cast<int>(i)), deterministic, target);
591
2.45M
  }
592
593
  // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
594
2.45M
  for (unsigned int i = 0,
595
2.45M
      n = static_cast<unsigned int>(this->last_known_broadcast_addr_size()); i < n; i++) {
596
760
    target = ::google::protobuf::internal::WireFormatLite::
597
760
      InternalWriteMessageToArray(
598
760
        4, this->last_known_broadcast_addr(static_cast<int>(i)), deterministic, target);
599
760
  }
600
601
  // optional .yb.CloudInfoPB cloud_info = 5;
602
2.45M
  if (cached_has_bits & 0x00000002u) {
603
2.44M
    target = ::google::protobuf::internal::WireFormatLite::
604
2.44M
      InternalWriteMessageToArray(
605
2.44M
        5, *this->cloud_info_, deterministic, target);
606
2.44M
  }
607
608
2.45M
  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
2.45M
  return target;
614
2.45M
}
615
616
3.72M
size_t RaftPeerPB::ByteSizeLong() const {
617
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.RaftPeerPB)
618
3.72M
  size_t total_size = 0;
619
620
3.72M
  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
3.72M
  {
627
3.72M
    unsigned int count = static_cast<unsigned int>(this->last_known_private_addr_size());
628
3.72M
    total_size += 1UL * count;
629
7.44M
    for (unsigned int i = 0; i < count; i++) {
630
3.71M
      total_size +=
631
3.71M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
632
3.71M
          this->last_known_private_addr(static_cast<int>(i)));
633
3.71M
    }
634
3.72M
  }
635
636
  // repeated .yb.HostPortPB last_known_broadcast_addr = 4;
637
3.72M
  {
638
3.72M
    unsigned int count = static_cast<unsigned int>(this->last_known_broadcast_addr_size());
639
3.72M
    total_size += 1UL * count;
640
3.72M
    for (unsigned int i = 0; i < count; i++) {
641
783
      total_size +=
642
783
        ::google::protobuf::internal::WireFormatLite::MessageSize(
643
783
          this->last_known_broadcast_addr(static_cast<int>(i)));
644
783
    }
645
3.72M
  }
646
647
3.72M
  if (_has_bits_[0 / 32] & 7u) {
648
    // optional bytes permanent_uuid = 1;
649
3.71M
    if (has_permanent_uuid()) {
650
3.71M
      total_size += 1 +
651
3.71M
        ::google::protobuf::internal::WireFormatLite::BytesSize(
652
3.71M
          this->permanent_uuid());
653
3.71M
    }
654
655
    // optional .yb.CloudInfoPB cloud_info = 5;
656
3.71M
    if (has_cloud_info()) {
657
3.70M
      total_size += 1 +
658
3.70M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
659
3.70M
          *this->cloud_info_);
660
3.70M
    }
661
662
    // optional .yb.consensus.PeerMemberType member_type = 2;
663
3.71M
    if (has_member_type()) {
664
3.71M
      total_size += 1 +
665
3.71M
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->member_type());
666
3.71M
    }
667
668
3.71M
  }
669
3.72M
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
670
3.72M
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
671
3.72M
  _cached_size_ = cached_size;
672
3.72M
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
673
3.72M
  return total_size;
674
3.72M
}
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
180M
void RaftPeerPB::MergeFrom(const RaftPeerPB& from) {
692
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.RaftPeerPB)
693
180M
  GOOGLE_DCHECK_NE(&from, this);
694
180M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
695
180M
  ::google::protobuf::uint32 cached_has_bits = 0;
696
180M
  (void) cached_has_bits;
697
698
180M
  last_known_private_addr_.MergeFrom(from.last_known_private_addr_);
699
180M
  last_known_broadcast_addr_.MergeFrom(from.last_known_broadcast_addr_);
700
180M
  cached_has_bits = from._has_bits_[0];
701
180M
  if (cached_has_bits & 7u) {
702
180M
    if (cached_has_bits & 0x00000001u) {
703
180M
      set_has_permanent_uuid();
704
180M
      permanent_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.permanent_uuid_);
705
180M
    }
706
180M
    if (cached_has_bits & 0x00000002u) {
707
180M
      mutable_cloud_info()->::yb::CloudInfoPB::MergeFrom(from.cloud_info());
708
180M
    }
709
180M
    if (cached_has_bits & 0x00000004u) {
710
180M
      member_type_ = from.member_type_;
711
180M
    }
712
180M
    _has_bits_[0] |= cached_has_bits;
713
180M
  }
714
180M
}
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
15.2M
void RaftPeerPB::CopyFrom(const RaftPeerPB& from) {
724
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.RaftPeerPB)
725
15.2M
  if (&from == this) return;
726
15.2M
  Clear();
727
15.2M
  MergeFrom(from);
728
15.2M
}
729
730
4.39M
bool RaftPeerPB::IsInitialized() const {
731
4.39M
  if (!::google::protobuf::internal::AllAreInitialized(this->last_known_private_addr())) return false;
732
4.39M
  if (!::google::protobuf::internal::AllAreInitialized(this->last_known_broadcast_addr())) return false;
733
4.39M
  return true;
734
4.39M
}
735
736
14.5k
void RaftPeerPB::Swap(RaftPeerPB* other) {
737
14.5k
  if (other == this) return;
738
14.5k
  InternalSwap(other);
739
14.5k
}
740
28.3k
void RaftPeerPB::InternalSwap(RaftPeerPB* other) {
741
28.3k
  using std::swap;
742
28.3k
  last_known_private_addr_.InternalSwap(&other->last_known_private_addr_);
743
28.3k
  last_known_broadcast_addr_.InternalSwap(&other->last_known_broadcast_addr_);
744
28.3k
  permanent_uuid_.Swap(&other->permanent_uuid_);
745
28.3k
  swap(cloud_info_, other->cloud_info_);
746
28.3k
  swap(member_type_, other->member_type_);
747
28.3k
  swap(_has_bits_[0], other->_has_bits_[0]);
748
28.3k
  _internal_metadata_.Swap(&other->_internal_metadata_);
749
28.3k
  swap(_cached_size_, other->_cached_size_);
750
28.3k
}
751
752
83.1M
::google::protobuf::Metadata RaftPeerPB::GetMetadata() const {
753
83.1M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
754
83.1M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
755
83.1M
}
756
757
758
// ===================================================================
759
760
17.1k
void RaftConfigPB::InitAsDefaultInstance() {
761
17.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
9.01M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
770
8.99M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
771
8.99M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsRaftConfigPB();
772
8.99M
  }
773
9.01M
  SharedCtor();
774
  // @@protoc_insertion_point(constructor:yb.consensus.RaftConfigPB)
775
9.01M
}
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
51.4M
      peers_(from.peers_) {
782
51.4M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
783
51.4M
  ::memcpy(&opid_index_, &from.opid_index_,
784
51.4M
    static_cast<size_t>(reinterpret_cast<char*>(&unsafe_config_change_) -
785
51.4M
    reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
786
  // @@protoc_insertion_point(copy_constructor:yb.consensus.RaftConfigPB)
787
51.4M
}
788
789
9.01M
void RaftConfigPB::SharedCtor() {
790
9.01M
  _cached_size_ = 0;
791
9.01M
  ::memset(&opid_index_, 0, static_cast<size_t>(
792
9.01M
      reinterpret_cast<char*>(&unsafe_config_change_) -
793
9.01M
      reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
794
9.01M
}
795
796
60.2M
RaftConfigPB::~RaftConfigPB() {
797
  // @@protoc_insertion_point(destructor:yb.consensus.RaftConfigPB)
798
60.2M
  SharedDtor();
799
60.2M
}
800
801
60.2M
void RaftConfigPB::SharedDtor() {
802
60.2M
}
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
6.31M
void RaftConfigPB::Clear() {
828
// @@protoc_insertion_point(message_clear_start:yb.consensus.RaftConfigPB)
829
6.31M
  ::google::protobuf::uint32 cached_has_bits = 0;
830
  // Prevent compiler warnings about cached_has_bits being unused
831
6.31M
  (void) cached_has_bits;
832
833
6.31M
  peers_.Clear();
834
6.31M
  cached_has_bits = _has_bits_[0];
835
6.31M
  if (cached_has_bits & 3u) {
836
42.2k
    ::memset(&opid_index_, 0, static_cast<size_t>(
837
42.2k
        reinterpret_cast<char*>(&unsafe_config_change_) -
838
42.2k
        reinterpret_cast<char*>(&opid_index_)) + sizeof(unsafe_config_change_));
839
42.2k
  }
840
6.31M
  _has_bits_.Clear();
841
6.31M
  _internal_metadata_.Clear();
842
6.31M
}
843
844
bool RaftConfigPB::MergePartialFromCodedStream(
845
518k
    ::google::protobuf::io::CodedInputStream* input) {
846
2.11M
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
847
518k
  ::google::protobuf::uint32 tag;
848
  // @@protoc_insertion_point(parse_start:yb.consensus.RaftConfigPB)
849
2.63M
  for (;;) {
850
2.63M
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
851
2.63M
    tag = p.first;
852
2.63M
    if (!p.second) goto handle_unusual;
853
2.11M
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
854
      // optional int64 opid_index = 1;
855
506k
      case 1: {
856
506k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
857
506k
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
858
506k
          set_has_opid_index();
859
506k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
860
506k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
861
506k
                 input, &opid_index_)));
862
18.4E
        } else {
863
18.4E
          goto handle_unusual;
864
18.4E
        }
865
506k
        break;
866
506k
      }
867
868
      // repeated .yb.consensus.RaftPeerPB peers = 2;
869
1.60M
      case 2: {
870
1.60M
        if (static_cast< ::google::protobuf::uint8>(tag) ==
871
1.60M
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
872
1.60M
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_peers()));
873
10
        } else {
874
10
          goto handle_unusual;
875
10
        }
876
1.60M
        break;
877
1.60M
      }
878
879
      // optional bool unsafe_config_change = 4 [default = false];
880
0
      case 4: {
881
0
        if (static_cast< ::google::protobuf::uint8>(tag) ==
882
0
            static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
883
0
          set_has_unsafe_config_change();
884
0
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
885
0
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
886
0
                 input, &unsafe_config_change_)));
887
0
        } else {
888
0
          goto handle_unusual;
889
0
        }
890
0
        break;
891
519k
      }
892
893
0
      default: {
894
519k
      handle_unusual:
895
519k
        if (tag == 0) {
896
519k
          goto success;
897
519k
        }
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
2.11M
    }
903
2.11M
  }
904
519k
success:
905
  // @@protoc_insertion_point(parse_success:yb.consensus.RaftConfigPB)
906
519k
  return true;
907
0
failure:
908
  // @@protoc_insertion_point(parse_failure:yb.consensus.RaftConfigPB)
909
0
  return false;
910
518k
#undef DO_
911
518k
}
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
733k
    bool deterministic, ::google::protobuf::uint8* target) const {
946
733k
  (void)deterministic; // Unused
947
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.RaftConfigPB)
948
733k
  ::google::protobuf::uint32 cached_has_bits = 0;
949
733k
  (void) cached_has_bits;
950
951
733k
  cached_has_bits = _has_bits_[0];
952
  // optional int64 opid_index = 1;
953
733k
  if (cached_has_bits & 0x00000001u) {
954
701k
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->opid_index(), target);
955
701k
  }
956
957
  // repeated .yb.consensus.RaftPeerPB peers = 2;
958
733k
  for (unsigned int i = 0,
959
3.03M
      n = static_cast<unsigned int>(this->peers_size()); i < n; i++) {
960
2.30M
    target = ::google::protobuf::internal::WireFormatLite::
961
2.30M
      InternalWriteMessageToArray(
962
2.30M
        2, this->peers(static_cast<int>(i)), deterministic, target);
963
2.30M
  }
964
965
  // optional bool unsafe_config_change = 4 [default = false];
966
733k
  if (cached_has_bits & 0x00000002u) {
967
0
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->unsafe_config_change(), target);
968
0
  }
969
970
733k
  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
733k
  return target;
976
733k
}
977
978
1.09M
size_t RaftConfigPB::ByteSizeLong() const {
979
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.RaftConfigPB)
980
1.09M
  size_t total_size = 0;
981
982
1.09M
  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
1.09M
  {
989
1.09M
    unsigned int count = static_cast<unsigned int>(this->peers_size());
990
1.09M
    total_size += 1UL * count;
991
4.56M
    for (unsigned int i = 0; i < count; i++) {
992
3.46M
      total_size +=
993
3.46M
        ::google::protobuf::internal::WireFormatLite::MessageSize(
994
3.46M
          this->peers(static_cast<int>(i)));
995
3.46M
    }
996
1.09M
  }
997
998
1.09M
  if (_has_bits_[0 / 32] & 3u) {
999
    // optional int64 opid_index = 1;
1000
1.04M
    if (has_opid_index()) {
1001
1.04M
      total_size += 1 +
1002
1.04M
        ::google::protobuf::internal::WireFormatLite::Int64Size(
1003
1.04M
          this->opid_index());
1004
1.04M
    }
1005
1006
    // optional bool unsafe_config_change = 4 [default = false];
1007
1.04M
    if (has_unsafe_config_change()) {
1008
0
      total_size += 1 + 1;
1009
0
    }
1010
1011
1.04M
  }
1012
1.09M
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1013
1.09M
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1014
1.09M
  _cached_size_ = cached_size;
1015
1.09M
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1016
1.09M
  return total_size;
1017
1.09M
}
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
6.30M
void RaftConfigPB::MergeFrom(const RaftConfigPB& from) {
1035
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.RaftConfigPB)
1036
6.30M
  GOOGLE_DCHECK_NE(&from, this);
1037
6.30M
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1038
6.30M
  ::google::protobuf::uint32 cached_has_bits = 0;
1039
6.30M
  (void) cached_has_bits;
1040
1041
6.30M
  peers_.MergeFrom(from.peers_);
1042
6.30M
  cached_has_bits = from._has_bits_[0];
1043
6.30M
  if (cached_has_bits & 3u) {
1044
6.28M
    if (cached_has_bits & 0x00000001u) {
1045
6.28M
      opid_index_ = from.opid_index_;
1046
6.28M
    }
1047
6.28M
    if (cached_has_bits & 0x00000002u) {
1048
0
      unsafe_config_change_ = from.unsafe_config_change_;
1049
0
    }
1050
6.28M
    _has_bits_[0] |= cached_has_bits;
1051
6.28M
  }
1052
6.30M
}
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
8.15M
void RaftConfigPB::CopyFrom(const RaftConfigPB& from) {
1062
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.RaftConfigPB)
1063
8.15M
  if (&from == this) return;
1064
8.15M
  Clear();
1065
8.15M
  MergeFrom(from);
1066
8.15M
}
1067
1068
1.39M
bool RaftConfigPB::IsInitialized() const {
1069
1.39M
  if (!::google::protobuf::internal::AllAreInitialized(this->peers())) return false;
1070
1.39M
  return true;
1071
1.39M
}
1072
1073
0
void RaftConfigPB::Swap(RaftConfigPB* other) {
1074
0
  if (other == this) return;
1075
0
  InternalSwap(other);
1076
0
}
1077
50.5M
void RaftConfigPB::InternalSwap(RaftConfigPB* other) {
1078
50.5M
  using std::swap;
1079
50.5M
  peers_.InternalSwap(&other->peers_);
1080
50.5M
  swap(opid_index_, other->opid_index_);
1081
50.5M
  swap(unsafe_config_change_, other->unsafe_config_change_);
1082
50.5M
  swap(_has_bits_[0], other->_has_bits_[0]);
1083
50.5M
  _internal_metadata_.Swap(&other->_internal_metadata_);
1084
50.5M
  swap(_cached_size_, other->_cached_size_);
1085
50.5M
}
1086
1087
26.2M
::google::protobuf::Metadata RaftConfigPB::GetMetadata() const {
1088
26.2M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1089
26.2M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1090
26.2M
}
1091
1092
1093
// ===================================================================
1094
1095
17.1k
void ConsensusStatePB::InitAsDefaultInstance() {
1096
17.1k
  ::yb::consensus::_ConsensusStatePB_default_instance_._instance.get_mutable()->config_ = const_cast< ::yb::consensus::RaftConfigPB*>(
1097
17.1k
      ::yb::consensus::RaftConfigPB::internal_default_instance());
1098
17.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
9.31M
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
1107
9.29M
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
1108
9.29M
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusStatePB();
1109
9.29M
  }
1110
9.31M
  SharedCtor();
1111
  // @@protoc_insertion_point(constructor:yb.consensus.ConsensusStatePB)
1112
9.31M
}
1113
ConsensusStatePB::ConsensusStatePB(const ConsensusStatePB& from)
1114
  : ::google::protobuf::Message(),
1115
      _internal_metadata_(NULL),
1116
      _has_bits_(from._has_bits_),
1117
573k
      _cached_size_(0) {
1118
573k
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1119
573k
  leader_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1120
573k
  if (from.has_leader_uuid()) {
1121
321k
    leader_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leader_uuid_);
1122
321k
  }
1123
573k
  if (from.has_config()) {
1124
572k
    config_ = new ::yb::consensus::RaftConfigPB(*from.config_);
1125
42
  } else {
1126
42
    config_ = NULL;
1127
42
  }
1128
573k
  current_term_ = from.current_term_;
1129
  // @@protoc_insertion_point(copy_constructor:yb.consensus.ConsensusStatePB)
1130
573k
}
1131
1132
9.31M
void ConsensusStatePB::SharedCtor() {
1133
9.31M
  _cached_size_ = 0;
1134
9.31M
  leader_uuid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1135
9.31M
  ::memset(&config_, 0, static_cast<size_t>(
1136
9.31M
      reinterpret_cast<char*>(&current_term_) -
1137
9.31M
      reinterpret_cast<char*>(&config_)) + sizeof(current_term_));
1138
9.31M
}
1139
1140
9.83M
ConsensusStatePB::~ConsensusStatePB() {
1141
  // @@protoc_insertion_point(destructor:yb.consensus.ConsensusStatePB)
1142
9.83M
  SharedDtor();
1143
9.83M
}
1144
1145
9.83M
void ConsensusStatePB::SharedDtor() {
1146
9.83M
  leader_uuid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1147
9.83M
  if (this != internal_default_instance()) delete config_;
1148
9.83M
}
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
40.7k
void ConsensusStatePB::Clear() {
1174
// @@protoc_insertion_point(message_clear_start:yb.consensus.ConsensusStatePB)
1175
40.7k
  ::google::protobuf::uint32 cached_has_bits = 0;
1176
  // Prevent compiler warnings about cached_has_bits being unused
1177
40.7k
  (void) cached_has_bits;
1178
1179
40.7k
  cached_has_bits = _has_bits_[0];
1180
40.7k
  if (cached_has_bits & 3u) {
1181
36.2k
    if (cached_has_bits & 0x00000001u) {
1182
8.22k
      GOOGLE_DCHECK(!leader_uuid_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
1183
8.22k
      (*leader_uuid_.UnsafeRawStringPointer())->clear();
1184
8.22k
    }
1185
36.2k
    if (cached_has_bits & 0x00000002u) {
1186
36.2k
      GOOGLE_DCHECK(config_ != NULL);
1187
36.2k
      config_->Clear();
1188
36.2k
    }
1189
36.2k
  }
1190
40.7k
  current_term_ = GOOGLE_LONGLONG(0);
1191
40.7k
  _has_bits_.Clear();
1192
40.7k
  _internal_metadata_.Clear();
1193
40.7k
}
1194
1195
bool ConsensusStatePB::MergePartialFromCodedStream(
1196
265k
    ::google::protobuf::io::CodedInputStream* input) {
1197
693k
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
1198
265k
  ::google::protobuf::uint32 tag;
1199
  // @@protoc_insertion_point(parse_start:yb.consensus.ConsensusStatePB)
1200
958k
  for (;;) {
1201
958k
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1202
958k
    tag = p.first;
1203
958k
    if (!p.second) goto handle_unusual;
1204
692k
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1205
      // required int64 current_term = 1;
1206
265k
      case 1: {
1207
265k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1208
265k
            static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
1209
265k
          set_has_current_term();
1210
265k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1211
265k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1212
265k
                 input, &current_term_)));
1213
18.4E
        } else {
1214
18.4E
          goto handle_unusual;
1215
18.4E
        }
1216
265k
        break;
1217
265k
      }
1218
1219
      // optional string leader_uuid = 2;
1220
162k
      case 2: {
1221
162k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1222
162k
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
1223
162k
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1224
162k
                input, this->mutable_leader_uuid()));
1225
162k
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1226
162k
            this->leader_uuid().data(), static_cast<int>(this->leader_uuid().length()),
1227
162k
            ::google::protobuf::internal::WireFormat::PARSE,
1228
162k
            "yb.consensus.ConsensusStatePB.leader_uuid");
1229
18.4E
        } else {
1230
18.4E
          goto handle_unusual;
1231
18.4E
        }
1232
162k
        break;
1233
162k
      }
1234
1235
      // required .yb.consensus.RaftConfigPB config = 3;
1236
265k
      case 3: {
1237
265k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1238
265k
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
1239
265k
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
1240
265k
               input, mutable_config()));
1241
18.4E
        } else {
1242
18.4E
          goto handle_unusual;
1243
18.4E
        }
1244
265k
        break;
1245
265k
      }
1246
1247
0
      default: {
1248
265k
      handle_unusual:
1249
265k
        if (tag == 0) {
1250
265k
          goto success;
1251
265k
        }
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
692k
    }
1257
692k
  }
1258
265k
success:
1259
  // @@protoc_insertion_point(parse_success:yb.consensus.ConsensusStatePB)
1260
265k
  return true;
1261
0
failure:
1262
  // @@protoc_insertion_point(parse_failure:yb.consensus.ConsensusStatePB)
1263
0
  return false;
1264
265k
#undef DO_
1265
265k
}
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
350k
    bool deterministic, ::google::protobuf::uint8* target) const {
1304
350k
  (void)deterministic; // Unused
1305
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.ConsensusStatePB)
1306
350k
  ::google::protobuf::uint32 cached_has_bits = 0;
1307
350k
  (void) cached_has_bits;
1308
1309
350k
  cached_has_bits = _has_bits_[0];
1310
  // required int64 current_term = 1;
1311
350k
  if (cached_has_bits & 0x00000004u) {
1312
350k
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->current_term(), target);
1313
350k
  }
1314
1315
  // optional string leader_uuid = 2;
1316
350k
  if (cached_has_bits & 0x00000001u) {
1317
218k
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1318
218k
      this->leader_uuid().data(), static_cast<int>(this->leader_uuid().length()),
1319
218k
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1320
218k
      "yb.consensus.ConsensusStatePB.leader_uuid");
1321
218k
    target =
1322
218k
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1323
218k
        2, this->leader_uuid(), target);
1324
218k
  }
1325
1326
  // required .yb.consensus.RaftConfigPB config = 3;
1327
350k
  if (cached_has_bits & 0x00000002u) {
1328
350k
    target = ::google::protobuf::internal::WireFormatLite::
1329
350k
      InternalWriteMessageToArray(
1330
350k
        3, *this->config_, deterministic, target);
1331
350k
  }
1332
1333
350k
  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
350k
  return target;
1339
350k
}
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
616k
size_t ConsensusStatePB::ByteSizeLong() const {
1362
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.ConsensusStatePB)
1363
616k
  size_t total_size = 0;
1364
1365
616k
  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
616k
  if (((_has_bits_[0] & 0x00000006) ^ 0x00000006) == 0) {  // All required fields are present.
1371
    // required .yb.consensus.RaftConfigPB config = 3;
1372
616k
    total_size += 1 +
1373
616k
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1374
616k
        *this->config_);
1375
1376
    // required int64 current_term = 1;
1377
616k
    total_size += 1 +
1378
616k
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1379
616k
        this->current_term());
1380
1381
37
  } else {
1382
37
    total_size += RequiredFieldsByteSizeFallback();
1383
37
  }
1384
  // optional string leader_uuid = 2;
1385
616k
  if (has_leader_uuid()) {
1386
381k
    total_size += 1 +
1387
381k
      ::google::protobuf::internal::WireFormatLite::StringSize(
1388
381k
        this->leader_uuid());
1389
381k
  }
1390
1391
616k
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1392
616k
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1393
616k
  _cached_size_ = cached_size;
1394
616k
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1395
616k
  return total_size;
1396
616k
}
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
41.1k
void ConsensusStatePB::MergeFrom(const ConsensusStatePB& from) {
1414
// @@protoc_insertion_point(class_specific_merge_from_start:yb.consensus.ConsensusStatePB)
1415
41.1k
  GOOGLE_DCHECK_NE(&from, this);
1416
41.1k
  _internal_metadata_.MergeFrom(from._internal_metadata_);
1417
41.1k
  ::google::protobuf::uint32 cached_has_bits = 0;
1418
41.1k
  (void) cached_has_bits;
1419
1420
41.1k
  cached_has_bits = from._has_bits_[0];
1421
41.1k
  if (cached_has_bits & 7u) {
1422
41.1k
    if (cached_has_bits & 0x00000001u) {
1423
41.1k
      set_has_leader_uuid();
1424
41.1k
      leader_uuid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leader_uuid_);
1425
41.1k
    }
1426
41.1k
    if (cached_has_bits & 0x00000002u) {
1427
41.1k
      mutable_config()->::yb::consensus::RaftConfigPB::MergeFrom(from.config());
1428
41.1k
    }
1429
41.1k
    if (cached_has_bits & 0x00000004u) {
1430
41.1k
      current_term_ = from.current_term_;
1431
41.1k
    }
1432
41.1k
    _has_bits_[0] |= cached_has_bits;
1433
41.1k
  }
1434
41.1k
}
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
40.7k
void ConsensusStatePB::CopyFrom(const ConsensusStatePB& from) {
1444
// @@protoc_insertion_point(class_specific_copy_from_start:yb.consensus.ConsensusStatePB)
1445
40.7k
  if (&from == this) return;
1446
40.7k
  Clear();
1447
40.7k
  MergeFrom(from);
1448
40.7k
}
1449
1450
813k
bool ConsensusStatePB::IsInitialized() const {
1451
813k
  if ((_has_bits_[0] & 0x00000006) != 0x00000006) return false;
1452
616k
  if (has_config()) {
1453
615k
    if (!this->config_->IsInitialized()) return false;
1454
616k
  }
1455
616k
  return true;
1456
616k
}
1457
1458
0
void ConsensusStatePB::Swap(ConsensusStatePB* other) {
1459
0
  if (other == this) return;
1460
0
  InternalSwap(other);
1461
0
}
1462
822k
void ConsensusStatePB::InternalSwap(ConsensusStatePB* other) {
1463
822k
  using std::swap;
1464
822k
  leader_uuid_.Swap(&other->leader_uuid_);
1465
822k
  swap(config_, other->config_);
1466
822k
  swap(current_term_, other->current_term_);
1467
822k
  swap(_has_bits_[0], other->_has_bits_[0]);
1468
822k
  _internal_metadata_.Swap(&other->_internal_metadata_);
1469
822k
  swap(_cached_size_, other->_cached_size_);
1470
822k
}
1471
1472
11.9M
::google::protobuf::Metadata ConsensusStatePB::GetMetadata() const {
1473
11.9M
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1474
11.9M
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1475
11.9M
}
1476
1477
1478
// ===================================================================
1479
1480
17.1k
void ConsensusMetadataPB::InitAsDefaultInstance() {
1481
17.1k
  ::yb::consensus::_ConsensusMetadataPB_default_instance_._instance.get_mutable()->committed_config_ = const_cast< ::yb::consensus::RaftConfigPB*>(
1482
17.1k
      ::yb::consensus::RaftConfigPB::internal_default_instance());
1483
17.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
284k
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
1493
266k
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
1494
266k
    ::protobuf_yb_2fconsensus_2fmetadata_2eproto::InitDefaultsConsensusMetadataPB();
1495
266k
  }
1496
284k
  SharedCtor();
1497
  // @@protoc_insertion_point(constructor:yb.consensus.ConsensusMetadataPB)
1498
284k
}
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
283k
void ConsensusMetadataPB::SharedCtor() {
1523
283k
  _cached_size_ = 0;
1524
283k
  voted_for_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1525
283k
  split_parent_tablet_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1526
283k
  ::memset(&committed_config_, 0, static_cast<size_t>(
1527
283k
      reinterpret_cast<char*>(&current_term_) -
1528
283k
      reinterpret_cast<char*>(&committed_config_)) + sizeof(current_term_));
1529
283k
}
1530
1531
226k
ConsensusMetadataPB::~ConsensusMetadataPB() {
1532
  // @@protoc_insertion_point(destructor:yb.consensus.ConsensusMetadataPB)
1533
226k
  SharedDtor();
1534
226k
}
1535
1536
226k
void ConsensusMetadataPB::SharedDtor() {
1537
226k
  voted_for_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1538
226k
  split_parent_tablet_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
1539
226k
  if (this != internal_default_instance()) delete committed_config_;
1540
226k
}
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
178k
void ConsensusMetadataPB::Clear() {
1566
// @@protoc_insertion_point(message_clear_start:yb.consensus.ConsensusMetadataPB)
1567
178k
  ::google::protobuf::uint32 cached_has_bits = 0;
1568
  // Prevent compiler warnings about cached_has_bits being unused
1569
178k
  (void) cached_has_bits;
1570
1571
178k
  cached_has_bits = _has_bits_[0];
1572
178k
  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
178k
  current_term_ = GOOGLE_LONGLONG(0);
1587
178k
  _has_bits_.Clear();
1588
178k
  _internal_metadata_.Clear();
1589
178k
}
1590
1591
bool ConsensusMetadataPB::MergePartialFromCodedStream(
1592
177k
    ::google::protobuf::io::CodedInputStream* input) {
1593
356k
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
1594
177k
  ::google::protobuf::uint32 tag;
1595
  // @@protoc_insertion_point(parse_start:yb.consensus.ConsensusMetadataPB)
1596
535k
  for (;;) {
1597
535k
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1598
535k
    tag = p.first;
1599
535k
    if (!p.second) goto handle_unusual;
1600
357k
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1601
      // required .yb.consensus.RaftConfigPB committed_config = 1;
1602
177k
      case 1: {
1603
177k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1604
177k
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
1605
177k
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
1606
177k
               input, mutable_committed_config()));
1607
18.4E
        } else {
1608
18.4E
          goto handle_unusual;
1609
18.4E
        }
1610
177k
        break;
1611
177k
      }
1612
1613
      // required int64 current_term = 2;
1614
178k
      case 2: {
1615
178k
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1616
178k
            static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
1617
178k
          set_has_current_term();
1618
178k
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1619
178k
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
1620
178k
                 input, &current_term_)));
1621
1
        } else {
1622
1
          goto handle_unusual;
1623
1
        }
1624
178k
        break;
1625
178k
      }
1626
1627
      // optional string voted_for = 3;
1628
862
      case 3: {
1629
862
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1630
863
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
1631
863
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1632
863
                input, this->mutable_voted_for()));
1633
863
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1634
863
            this->voted_for().data(), static_cast<int>(this->voted_for().length()),
1635
863
            ::google::protobuf::internal::WireFormat::PARSE,
1636
863
            "yb.consensus.ConsensusMetadataPB.voted_for");
1637
18.4E
        } else {
1638
18.4E
          goto handle_unusual;
1639
18.4E
        }
1640
863
        break;
1641
863
      }
1642
1643
      // optional bytes split_parent_tablet_id = 4;
1644
205
      case 4: {
1645
205
        if (static_cast< ::google::protobuf::uint8>(tag) ==
1646
205
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
1647
205
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1648
205
                input, this->mutable_split_parent_tablet_id()));
1649
0
        } else {
1650
0
          goto handle_unusual;
1651
0
        }
1652
205
        break;
1653
178k
      }
1654
1655
0
      default: {
1656
178k
      handle_unusual:
1657
178k
        if (tag == 0) {
1658
178k
          goto success;
1659
178k
        }
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
357k
    }
1665
357k
  }
1666
178k
success:
1667
  // @@protoc_insertion_point(parse_success:yb.consensus.ConsensusMetadataPB)
1668
178k
  return true;
1669
0
failure:
1670
  // @@protoc_insertion_point(parse_failure:yb.consensus.ConsensusMetadataPB)
1671
0
  return false;
1672
177k
#undef DO_
1673
177k
}
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
299k
    bool deterministic, ::google::protobuf::uint8* target) const {
1718
299k
  (void)deterministic; // Unused
1719
  // @@protoc_insertion_point(serialize_to_array_start:yb.consensus.ConsensusMetadataPB)
1720
299k
  ::google::protobuf::uint32 cached_has_bits = 0;
1721
299k
  (void) cached_has_bits;
1722
1723
299k
  cached_has_bits = _has_bits_[0];
1724
  // required .yb.consensus.RaftConfigPB committed_config = 1;
1725
299k
  if (cached_has_bits & 0x00000004u) {
1726
299k
    target = ::google::protobuf::internal::WireFormatLite::
1727
299k
      InternalWriteMessageToArray(
1728
299k
        1, *this->committed_config_, deterministic, target);
1729
299k
  }
1730
1731
  // required int64 current_term = 2;
1732
299k
  if (cached_has_bits & 0x00000008u) {
1733
299k
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->current_term(), target);
1734
299k
  }
1735
1736
  // optional string voted_for = 3;
1737
299k
  if (cached_has_bits & 0x00000001u) {
1738
103k
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
1739
103k
      this->voted_for().data(), static_cast<int>(this->voted_for().length()),
1740
103k
      ::google::protobuf::internal::WireFormat::SERIALIZE,
1741
103k
      "yb.consensus.ConsensusMetadataPB.voted_for");
1742
103k
    target =
1743
103k
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1744
103k
        3, this->voted_for(), target);
1745
103k
  }
1746
1747
  // optional bytes split_parent_tablet_id = 4;
1748
299k
  if (cached_has_bits & 0x00000002u) {
1749
429
    target =
1750
429
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
1751
429
        4, this->split_parent_tablet_id(), target);
1752
429
  }
1753
1754
299k
  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
299k
  return target;
1760
299k
}
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
299k
size_t ConsensusMetadataPB::ByteSizeLong() const {
1783
// @@protoc_insertion_point(message_byte_size_start:yb.consensus.ConsensusMetadataPB)
1784
299k
  size_t total_size = 0;
1785
1786
299k
  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
299k
  if (((_has_bits_[0] & 0x0000000c) ^ 0x0000000c) == 0) {  // All required fields are present.
1792
    // required .yb.consensus.RaftConfigPB committed_config = 1;
1793
299k
    total_size += 1 +
1794
299k
      ::google::protobuf::internal::WireFormatLite::MessageSize(
1795
299k
        *this->committed_config_);
1796
1797
    // required int64 current_term = 2;
1798
299k
    total_size += 1 +
1799
299k
      ::google::protobuf::internal::WireFormatLite::Int64Size(
1800
299k
        this->current_term());
1801
1802
203
  } else {
1803
203
    total_size += RequiredFieldsByteSizeFallback();
1804
203
  }
1805
299k
  if (_has_bits_[0 / 32] & 3u) {
1806
    // optional string voted_for = 3;
1807
103k
    if (has_voted_for()) {
1808
103k
      total_size += 1 +
1809
103k
        ::google::protobuf::internal::WireFormatLite::StringSize(
1810
103k
          this->voted_for());
1811
103k
    }
1812
1813
    // optional bytes split_parent_tablet_id = 4;
1814
103k
    if (has_split_parent_tablet_id()) {
1815
431
      total_size += 1 +
1816
431
        ::google::protobuf::internal::WireFormatLite::BytesSize(
1817
431
          this->split_parent_tablet_id());
1818
431
    }
1819
1820
103k
  }
1821
299k
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1822
299k
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1823
299k
  _cached_size_ = cached_size;
1824
299k
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
1825
299k
  return total_size;
1826
299k
}
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
477k
bool ConsensusMetadataPB::IsInitialized() const {
1885
477k
  if ((_has_bits_[0] & 0x0000000c) != 0x0000000c) return false;
1886
477k
  if (has_committed_config()) {
1887
477k
    if (!this->committed_config_->IsInitialized()) return false;
1888
477k
  }
1889
477k
  return true;
1890
477k
}
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
599k
::google::protobuf::Metadata ConsensusMetadataPB::GetMetadata() const {
1908
599k
  protobuf_yb_2fconsensus_2fmetadata_2eproto::protobuf_AssignDescriptorsOnce();
1909
599k
  return ::protobuf_yb_2fconsensus_2fmetadata_2eproto::file_level_metadata[kIndexInFileMessages];
1910
599k
}
1911
1912
1913
// @@protoc_insertion_point(namespace_scope)
1914
}  // namespace consensus
1915
}  // namespace yb
1916
1917
// @@protoc_insertion_point(global_scope)