khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 1 | // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 2 | // source: raft.proto |
| 3 | |
| 4 | package raftpb |
| 5 | |
| 6 | import ( |
| 7 | fmt "fmt" |
| 8 | io "io" |
| 9 | math "math" |
| 10 | math_bits "math/bits" |
| 11 | |
| 12 | _ "github.com/gogo/protobuf/gogoproto" |
| 13 | proto "github.com/golang/protobuf/proto" |
| 14 | ) |
| 15 | |
| 16 | // Reference imports to suppress errors if they are not otherwise used. |
| 17 | var _ = proto.Marshal |
| 18 | var _ = fmt.Errorf |
| 19 | var _ = math.Inf |
| 20 | |
| 21 | // This is a compile-time assertion to ensure that this generated file |
| 22 | // is compatible with the proto package it is being compiled against. |
| 23 | // A compilation error at this line likely means your copy of the |
| 24 | // proto package needs to be updated. |
| 25 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package |
| 26 | |
| 27 | type EntryType int32 |
| 28 | |
| 29 | const ( |
| 30 | EntryNormal EntryType = 0 |
| 31 | EntryConfChange EntryType = 1 |
| 32 | ) |
| 33 | |
| 34 | var EntryType_name = map[int32]string{ |
| 35 | 0: "EntryNormal", |
| 36 | 1: "EntryConfChange", |
| 37 | } |
| 38 | |
| 39 | var EntryType_value = map[string]int32{ |
| 40 | "EntryNormal": 0, |
| 41 | "EntryConfChange": 1, |
| 42 | } |
| 43 | |
| 44 | func (x EntryType) Enum() *EntryType { |
| 45 | p := new(EntryType) |
| 46 | *p = x |
| 47 | return p |
| 48 | } |
| 49 | |
| 50 | func (x EntryType) String() string { |
| 51 | return proto.EnumName(EntryType_name, int32(x)) |
| 52 | } |
| 53 | |
| 54 | func (x *EntryType) UnmarshalJSON(data []byte) error { |
| 55 | value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType") |
| 56 | if err != nil { |
| 57 | return err |
| 58 | } |
| 59 | *x = EntryType(value) |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | func (EntryType) EnumDescriptor() ([]byte, []int) { |
| 64 | return fileDescriptor_b042552c306ae59b, []int{0} |
| 65 | } |
| 66 | |
| 67 | type MessageType int32 |
| 68 | |
| 69 | const ( |
| 70 | MsgHup MessageType = 0 |
| 71 | MsgBeat MessageType = 1 |
| 72 | MsgProp MessageType = 2 |
| 73 | MsgApp MessageType = 3 |
| 74 | MsgAppResp MessageType = 4 |
| 75 | MsgVote MessageType = 5 |
| 76 | MsgVoteResp MessageType = 6 |
| 77 | MsgSnap MessageType = 7 |
| 78 | MsgHeartbeat MessageType = 8 |
| 79 | MsgHeartbeatResp MessageType = 9 |
| 80 | MsgUnreachable MessageType = 10 |
| 81 | MsgSnapStatus MessageType = 11 |
| 82 | MsgCheckQuorum MessageType = 12 |
| 83 | MsgTransferLeader MessageType = 13 |
| 84 | MsgTimeoutNow MessageType = 14 |
| 85 | MsgReadIndex MessageType = 15 |
| 86 | MsgReadIndexResp MessageType = 16 |
| 87 | MsgPreVote MessageType = 17 |
| 88 | MsgPreVoteResp MessageType = 18 |
| 89 | ) |
| 90 | |
| 91 | var MessageType_name = map[int32]string{ |
| 92 | 0: "MsgHup", |
| 93 | 1: "MsgBeat", |
| 94 | 2: "MsgProp", |
| 95 | 3: "MsgApp", |
| 96 | 4: "MsgAppResp", |
| 97 | 5: "MsgVote", |
| 98 | 6: "MsgVoteResp", |
| 99 | 7: "MsgSnap", |
| 100 | 8: "MsgHeartbeat", |
| 101 | 9: "MsgHeartbeatResp", |
| 102 | 10: "MsgUnreachable", |
| 103 | 11: "MsgSnapStatus", |
| 104 | 12: "MsgCheckQuorum", |
| 105 | 13: "MsgTransferLeader", |
| 106 | 14: "MsgTimeoutNow", |
| 107 | 15: "MsgReadIndex", |
| 108 | 16: "MsgReadIndexResp", |
| 109 | 17: "MsgPreVote", |
| 110 | 18: "MsgPreVoteResp", |
| 111 | } |
| 112 | |
| 113 | var MessageType_value = map[string]int32{ |
| 114 | "MsgHup": 0, |
| 115 | "MsgBeat": 1, |
| 116 | "MsgProp": 2, |
| 117 | "MsgApp": 3, |
| 118 | "MsgAppResp": 4, |
| 119 | "MsgVote": 5, |
| 120 | "MsgVoteResp": 6, |
| 121 | "MsgSnap": 7, |
| 122 | "MsgHeartbeat": 8, |
| 123 | "MsgHeartbeatResp": 9, |
| 124 | "MsgUnreachable": 10, |
| 125 | "MsgSnapStatus": 11, |
| 126 | "MsgCheckQuorum": 12, |
| 127 | "MsgTransferLeader": 13, |
| 128 | "MsgTimeoutNow": 14, |
| 129 | "MsgReadIndex": 15, |
| 130 | "MsgReadIndexResp": 16, |
| 131 | "MsgPreVote": 17, |
| 132 | "MsgPreVoteResp": 18, |
| 133 | } |
| 134 | |
| 135 | func (x MessageType) Enum() *MessageType { |
| 136 | p := new(MessageType) |
| 137 | *p = x |
| 138 | return p |
| 139 | } |
| 140 | |
| 141 | func (x MessageType) String() string { |
| 142 | return proto.EnumName(MessageType_name, int32(x)) |
| 143 | } |
| 144 | |
| 145 | func (x *MessageType) UnmarshalJSON(data []byte) error { |
| 146 | value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType") |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | *x = MessageType(value) |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | func (MessageType) EnumDescriptor() ([]byte, []int) { |
| 155 | return fileDescriptor_b042552c306ae59b, []int{1} |
| 156 | } |
| 157 | |
| 158 | type ConfChangeType int32 |
| 159 | |
| 160 | const ( |
| 161 | ConfChangeAddNode ConfChangeType = 0 |
| 162 | ConfChangeRemoveNode ConfChangeType = 1 |
| 163 | ConfChangeUpdateNode ConfChangeType = 2 |
| 164 | ConfChangeAddLearnerNode ConfChangeType = 3 |
| 165 | ) |
| 166 | |
| 167 | var ConfChangeType_name = map[int32]string{ |
| 168 | 0: "ConfChangeAddNode", |
| 169 | 1: "ConfChangeRemoveNode", |
| 170 | 2: "ConfChangeUpdateNode", |
| 171 | 3: "ConfChangeAddLearnerNode", |
| 172 | } |
| 173 | |
| 174 | var ConfChangeType_value = map[string]int32{ |
| 175 | "ConfChangeAddNode": 0, |
| 176 | "ConfChangeRemoveNode": 1, |
| 177 | "ConfChangeUpdateNode": 2, |
| 178 | "ConfChangeAddLearnerNode": 3, |
| 179 | } |
| 180 | |
| 181 | func (x ConfChangeType) Enum() *ConfChangeType { |
| 182 | p := new(ConfChangeType) |
| 183 | *p = x |
| 184 | return p |
| 185 | } |
| 186 | |
| 187 | func (x ConfChangeType) String() string { |
| 188 | return proto.EnumName(ConfChangeType_name, int32(x)) |
| 189 | } |
| 190 | |
| 191 | func (x *ConfChangeType) UnmarshalJSON(data []byte) error { |
| 192 | value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType") |
| 193 | if err != nil { |
| 194 | return err |
| 195 | } |
| 196 | *x = ConfChangeType(value) |
| 197 | return nil |
| 198 | } |
| 199 | |
| 200 | func (ConfChangeType) EnumDescriptor() ([]byte, []int) { |
| 201 | return fileDescriptor_b042552c306ae59b, []int{2} |
| 202 | } |
| 203 | |
| 204 | type Entry struct { |
| 205 | Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"` |
| 206 | Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"` |
| 207 | Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"` |
| 208 | Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"` |
| 209 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 210 | XXX_unrecognized []byte `json:"-"` |
| 211 | XXX_sizecache int32 `json:"-"` |
| 212 | } |
| 213 | |
| 214 | func (m *Entry) Reset() { *m = Entry{} } |
| 215 | func (m *Entry) String() string { return proto.CompactTextString(m) } |
| 216 | func (*Entry) ProtoMessage() {} |
| 217 | func (*Entry) Descriptor() ([]byte, []int) { |
| 218 | return fileDescriptor_b042552c306ae59b, []int{0} |
| 219 | } |
| 220 | func (m *Entry) XXX_Unmarshal(b []byte) error { |
| 221 | return m.Unmarshal(b) |
| 222 | } |
| 223 | func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 224 | if deterministic { |
| 225 | return xxx_messageInfo_Entry.Marshal(b, m, deterministic) |
| 226 | } else { |
| 227 | b = b[:cap(b)] |
| 228 | n, err := m.MarshalToSizedBuffer(b) |
| 229 | if err != nil { |
| 230 | return nil, err |
| 231 | } |
| 232 | return b[:n], nil |
| 233 | } |
| 234 | } |
| 235 | func (m *Entry) XXX_Merge(src proto.Message) { |
| 236 | xxx_messageInfo_Entry.Merge(m, src) |
| 237 | } |
| 238 | func (m *Entry) XXX_Size() int { |
| 239 | return m.Size() |
| 240 | } |
| 241 | func (m *Entry) XXX_DiscardUnknown() { |
| 242 | xxx_messageInfo_Entry.DiscardUnknown(m) |
| 243 | } |
| 244 | |
| 245 | var xxx_messageInfo_Entry proto.InternalMessageInfo |
| 246 | |
| 247 | type SnapshotMetadata struct { |
| 248 | ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"` |
| 249 | Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"` |
| 250 | Term uint64 `protobuf:"varint,3,opt,name=term" json:"term"` |
| 251 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 252 | XXX_unrecognized []byte `json:"-"` |
| 253 | XXX_sizecache int32 `json:"-"` |
| 254 | } |
| 255 | |
| 256 | func (m *SnapshotMetadata) Reset() { *m = SnapshotMetadata{} } |
| 257 | func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) } |
| 258 | func (*SnapshotMetadata) ProtoMessage() {} |
| 259 | func (*SnapshotMetadata) Descriptor() ([]byte, []int) { |
| 260 | return fileDescriptor_b042552c306ae59b, []int{1} |
| 261 | } |
| 262 | func (m *SnapshotMetadata) XXX_Unmarshal(b []byte) error { |
| 263 | return m.Unmarshal(b) |
| 264 | } |
| 265 | func (m *SnapshotMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 266 | if deterministic { |
| 267 | return xxx_messageInfo_SnapshotMetadata.Marshal(b, m, deterministic) |
| 268 | } else { |
| 269 | b = b[:cap(b)] |
| 270 | n, err := m.MarshalToSizedBuffer(b) |
| 271 | if err != nil { |
| 272 | return nil, err |
| 273 | } |
| 274 | return b[:n], nil |
| 275 | } |
| 276 | } |
| 277 | func (m *SnapshotMetadata) XXX_Merge(src proto.Message) { |
| 278 | xxx_messageInfo_SnapshotMetadata.Merge(m, src) |
| 279 | } |
| 280 | func (m *SnapshotMetadata) XXX_Size() int { |
| 281 | return m.Size() |
| 282 | } |
| 283 | func (m *SnapshotMetadata) XXX_DiscardUnknown() { |
| 284 | xxx_messageInfo_SnapshotMetadata.DiscardUnknown(m) |
| 285 | } |
| 286 | |
| 287 | var xxx_messageInfo_SnapshotMetadata proto.InternalMessageInfo |
| 288 | |
| 289 | type Snapshot struct { |
| 290 | Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` |
| 291 | Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"` |
| 292 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 293 | XXX_unrecognized []byte `json:"-"` |
| 294 | XXX_sizecache int32 `json:"-"` |
| 295 | } |
| 296 | |
| 297 | func (m *Snapshot) Reset() { *m = Snapshot{} } |
| 298 | func (m *Snapshot) String() string { return proto.CompactTextString(m) } |
| 299 | func (*Snapshot) ProtoMessage() {} |
| 300 | func (*Snapshot) Descriptor() ([]byte, []int) { |
| 301 | return fileDescriptor_b042552c306ae59b, []int{2} |
| 302 | } |
| 303 | func (m *Snapshot) XXX_Unmarshal(b []byte) error { |
| 304 | return m.Unmarshal(b) |
| 305 | } |
| 306 | func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 307 | if deterministic { |
| 308 | return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) |
| 309 | } else { |
| 310 | b = b[:cap(b)] |
| 311 | n, err := m.MarshalToSizedBuffer(b) |
| 312 | if err != nil { |
| 313 | return nil, err |
| 314 | } |
| 315 | return b[:n], nil |
| 316 | } |
| 317 | } |
| 318 | func (m *Snapshot) XXX_Merge(src proto.Message) { |
| 319 | xxx_messageInfo_Snapshot.Merge(m, src) |
| 320 | } |
| 321 | func (m *Snapshot) XXX_Size() int { |
| 322 | return m.Size() |
| 323 | } |
| 324 | func (m *Snapshot) XXX_DiscardUnknown() { |
| 325 | xxx_messageInfo_Snapshot.DiscardUnknown(m) |
| 326 | } |
| 327 | |
| 328 | var xxx_messageInfo_Snapshot proto.InternalMessageInfo |
| 329 | |
| 330 | type Message struct { |
| 331 | Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"` |
| 332 | To uint64 `protobuf:"varint,2,opt,name=to" json:"to"` |
| 333 | From uint64 `protobuf:"varint,3,opt,name=from" json:"from"` |
| 334 | Term uint64 `protobuf:"varint,4,opt,name=term" json:"term"` |
| 335 | LogTerm uint64 `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"` |
| 336 | Index uint64 `protobuf:"varint,6,opt,name=index" json:"index"` |
| 337 | Entries []Entry `protobuf:"bytes,7,rep,name=entries" json:"entries"` |
| 338 | Commit uint64 `protobuf:"varint,8,opt,name=commit" json:"commit"` |
| 339 | Snapshot Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"` |
| 340 | Reject bool `protobuf:"varint,10,opt,name=reject" json:"reject"` |
| 341 | RejectHint uint64 `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"` |
| 342 | Context []byte `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"` |
| 343 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 344 | XXX_unrecognized []byte `json:"-"` |
| 345 | XXX_sizecache int32 `json:"-"` |
| 346 | } |
| 347 | |
| 348 | func (m *Message) Reset() { *m = Message{} } |
| 349 | func (m *Message) String() string { return proto.CompactTextString(m) } |
| 350 | func (*Message) ProtoMessage() {} |
| 351 | func (*Message) Descriptor() ([]byte, []int) { |
| 352 | return fileDescriptor_b042552c306ae59b, []int{3} |
| 353 | } |
| 354 | func (m *Message) XXX_Unmarshal(b []byte) error { |
| 355 | return m.Unmarshal(b) |
| 356 | } |
| 357 | func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 358 | if deterministic { |
| 359 | return xxx_messageInfo_Message.Marshal(b, m, deterministic) |
| 360 | } else { |
| 361 | b = b[:cap(b)] |
| 362 | n, err := m.MarshalToSizedBuffer(b) |
| 363 | if err != nil { |
| 364 | return nil, err |
| 365 | } |
| 366 | return b[:n], nil |
| 367 | } |
| 368 | } |
| 369 | func (m *Message) XXX_Merge(src proto.Message) { |
| 370 | xxx_messageInfo_Message.Merge(m, src) |
| 371 | } |
| 372 | func (m *Message) XXX_Size() int { |
| 373 | return m.Size() |
| 374 | } |
| 375 | func (m *Message) XXX_DiscardUnknown() { |
| 376 | xxx_messageInfo_Message.DiscardUnknown(m) |
| 377 | } |
| 378 | |
| 379 | var xxx_messageInfo_Message proto.InternalMessageInfo |
| 380 | |
| 381 | type HardState struct { |
| 382 | Term uint64 `protobuf:"varint,1,opt,name=term" json:"term"` |
| 383 | Vote uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"` |
| 384 | Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"` |
| 385 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 386 | XXX_unrecognized []byte `json:"-"` |
| 387 | XXX_sizecache int32 `json:"-"` |
| 388 | } |
| 389 | |
| 390 | func (m *HardState) Reset() { *m = HardState{} } |
| 391 | func (m *HardState) String() string { return proto.CompactTextString(m) } |
| 392 | func (*HardState) ProtoMessage() {} |
| 393 | func (*HardState) Descriptor() ([]byte, []int) { |
| 394 | return fileDescriptor_b042552c306ae59b, []int{4} |
| 395 | } |
| 396 | func (m *HardState) XXX_Unmarshal(b []byte) error { |
| 397 | return m.Unmarshal(b) |
| 398 | } |
| 399 | func (m *HardState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 400 | if deterministic { |
| 401 | return xxx_messageInfo_HardState.Marshal(b, m, deterministic) |
| 402 | } else { |
| 403 | b = b[:cap(b)] |
| 404 | n, err := m.MarshalToSizedBuffer(b) |
| 405 | if err != nil { |
| 406 | return nil, err |
| 407 | } |
| 408 | return b[:n], nil |
| 409 | } |
| 410 | } |
| 411 | func (m *HardState) XXX_Merge(src proto.Message) { |
| 412 | xxx_messageInfo_HardState.Merge(m, src) |
| 413 | } |
| 414 | func (m *HardState) XXX_Size() int { |
| 415 | return m.Size() |
| 416 | } |
| 417 | func (m *HardState) XXX_DiscardUnknown() { |
| 418 | xxx_messageInfo_HardState.DiscardUnknown(m) |
| 419 | } |
| 420 | |
| 421 | var xxx_messageInfo_HardState proto.InternalMessageInfo |
| 422 | |
| 423 | type ConfState struct { |
| 424 | Nodes []uint64 `protobuf:"varint,1,rep,name=nodes" json:"nodes,omitempty"` |
| 425 | Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"` |
| 426 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 427 | XXX_unrecognized []byte `json:"-"` |
| 428 | XXX_sizecache int32 `json:"-"` |
| 429 | } |
| 430 | |
| 431 | func (m *ConfState) Reset() { *m = ConfState{} } |
| 432 | func (m *ConfState) String() string { return proto.CompactTextString(m) } |
| 433 | func (*ConfState) ProtoMessage() {} |
| 434 | func (*ConfState) Descriptor() ([]byte, []int) { |
| 435 | return fileDescriptor_b042552c306ae59b, []int{5} |
| 436 | } |
| 437 | func (m *ConfState) XXX_Unmarshal(b []byte) error { |
| 438 | return m.Unmarshal(b) |
| 439 | } |
| 440 | func (m *ConfState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 441 | if deterministic { |
| 442 | return xxx_messageInfo_ConfState.Marshal(b, m, deterministic) |
| 443 | } else { |
| 444 | b = b[:cap(b)] |
| 445 | n, err := m.MarshalToSizedBuffer(b) |
| 446 | if err != nil { |
| 447 | return nil, err |
| 448 | } |
| 449 | return b[:n], nil |
| 450 | } |
| 451 | } |
| 452 | func (m *ConfState) XXX_Merge(src proto.Message) { |
| 453 | xxx_messageInfo_ConfState.Merge(m, src) |
| 454 | } |
| 455 | func (m *ConfState) XXX_Size() int { |
| 456 | return m.Size() |
| 457 | } |
| 458 | func (m *ConfState) XXX_DiscardUnknown() { |
| 459 | xxx_messageInfo_ConfState.DiscardUnknown(m) |
| 460 | } |
| 461 | |
| 462 | var xxx_messageInfo_ConfState proto.InternalMessageInfo |
| 463 | |
| 464 | type ConfChange struct { |
| 465 | ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` |
| 466 | Type ConfChangeType `protobuf:"varint,2,opt,name=Type,enum=raftpb.ConfChangeType" json:"Type"` |
| 467 | NodeID uint64 `protobuf:"varint,3,opt,name=NodeID" json:"NodeID"` |
| 468 | Context []byte `protobuf:"bytes,4,opt,name=Context" json:"Context,omitempty"` |
| 469 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 470 | XXX_unrecognized []byte `json:"-"` |
| 471 | XXX_sizecache int32 `json:"-"` |
| 472 | } |
| 473 | |
| 474 | func (m *ConfChange) Reset() { *m = ConfChange{} } |
| 475 | func (m *ConfChange) String() string { return proto.CompactTextString(m) } |
| 476 | func (*ConfChange) ProtoMessage() {} |
| 477 | func (*ConfChange) Descriptor() ([]byte, []int) { |
| 478 | return fileDescriptor_b042552c306ae59b, []int{6} |
| 479 | } |
| 480 | func (m *ConfChange) XXX_Unmarshal(b []byte) error { |
| 481 | return m.Unmarshal(b) |
| 482 | } |
| 483 | func (m *ConfChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 484 | if deterministic { |
| 485 | return xxx_messageInfo_ConfChange.Marshal(b, m, deterministic) |
| 486 | } else { |
| 487 | b = b[:cap(b)] |
| 488 | n, err := m.MarshalToSizedBuffer(b) |
| 489 | if err != nil { |
| 490 | return nil, err |
| 491 | } |
| 492 | return b[:n], nil |
| 493 | } |
| 494 | } |
| 495 | func (m *ConfChange) XXX_Merge(src proto.Message) { |
| 496 | xxx_messageInfo_ConfChange.Merge(m, src) |
| 497 | } |
| 498 | func (m *ConfChange) XXX_Size() int { |
| 499 | return m.Size() |
| 500 | } |
| 501 | func (m *ConfChange) XXX_DiscardUnknown() { |
| 502 | xxx_messageInfo_ConfChange.DiscardUnknown(m) |
| 503 | } |
| 504 | |
| 505 | var xxx_messageInfo_ConfChange proto.InternalMessageInfo |
| 506 | |
| 507 | func init() { |
| 508 | proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value) |
| 509 | proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value) |
| 510 | proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value) |
| 511 | proto.RegisterType((*Entry)(nil), "raftpb.Entry") |
| 512 | proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata") |
| 513 | proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot") |
| 514 | proto.RegisterType((*Message)(nil), "raftpb.Message") |
| 515 | proto.RegisterType((*HardState)(nil), "raftpb.HardState") |
| 516 | proto.RegisterType((*ConfState)(nil), "raftpb.ConfState") |
| 517 | proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange") |
| 518 | } |
| 519 | |
| 520 | func init() { proto.RegisterFile("raft.proto", fileDescriptor_b042552c306ae59b) } |
| 521 | |
| 522 | var fileDescriptor_b042552c306ae59b = []byte{ |
| 523 | // 816 bytes of a gzipped FileDescriptorProto |
| 524 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x54, 0xcd, 0x6e, 0x23, 0x45, |
| 525 | 0x10, 0xf6, 0x8c, 0xc7, 0x7f, 0x35, 0x8e, 0xd3, 0xa9, 0x35, 0xa8, 0x15, 0x45, 0xc6, 0xb2, 0x38, |
| 526 | 0x58, 0x41, 0x1b, 0x20, 0x07, 0x0e, 0x48, 0x1c, 0x36, 0x09, 0x52, 0x22, 0xad, 0xa3, 0xc5, 0x9b, |
| 527 | 0xe5, 0x80, 0x84, 0x50, 0xc7, 0x53, 0x9e, 0x18, 0x32, 0xd3, 0xa3, 0x9e, 0xf6, 0xb2, 0xb9, 0x20, |
| 528 | 0x1e, 0x80, 0x07, 0xe0, 0xc2, 0xfb, 0xe4, 0xb8, 0x12, 0x77, 0xc4, 0x86, 0x17, 0x41, 0xdd, 0xd3, |
| 529 | 0x63, 0xcf, 0x24, 0xb7, 0xae, 0xaf, 0x6a, 0xbe, 0xfa, 0xbe, 0xea, 0xea, 0x01, 0x50, 0x62, 0xa9, |
| 530 | 0x8f, 0x32, 0x25, 0xb5, 0xc4, 0xb6, 0x39, 0x67, 0xd7, 0xfb, 0xc3, 0x58, 0xc6, 0xd2, 0x42, 0x9f, |
| 531 | 0x9b, 0x53, 0x91, 0x9d, 0xfc, 0x06, 0xad, 0x6f, 0x53, 0xad, 0xee, 0x90, 0x43, 0x70, 0x45, 0x2a, |
| 532 | 0xe1, 0xfe, 0xd8, 0x9b, 0x06, 0x27, 0xc1, 0xfd, 0x3f, 0x9f, 0x34, 0xe6, 0x16, 0xc1, 0x7d, 0x68, |
| 533 | 0x5d, 0xa4, 0x11, 0xbd, 0xe3, 0xcd, 0x4a, 0xaa, 0x80, 0xf0, 0x33, 0x08, 0xae, 0xee, 0x32, 0xe2, |
| 534 | 0xde, 0xd8, 0x9b, 0x0e, 0x8e, 0xf7, 0x8e, 0x8a, 0x5e, 0x47, 0x96, 0xd2, 0x24, 0x36, 0x44, 0x77, |
| 535 | 0x19, 0x21, 0x42, 0x70, 0x26, 0xb4, 0xe0, 0xc1, 0xd8, 0x9b, 0xf6, 0xe7, 0xf6, 0x3c, 0xf9, 0xdd, |
| 536 | 0x03, 0xf6, 0x3a, 0x15, 0x59, 0x7e, 0x23, 0xf5, 0x8c, 0xb4, 0x88, 0x84, 0x16, 0xf8, 0x15, 0xc0, |
| 537 | 0x42, 0xa6, 0xcb, 0x9f, 0x72, 0x2d, 0x74, 0xc1, 0x1d, 0x6e, 0xb9, 0x4f, 0x65, 0xba, 0x7c, 0x6d, |
| 538 | 0x12, 0x8e, 0xbb, 0xb7, 0x28, 0x01, 0xa3, 0x74, 0x65, 0x95, 0x56, 0x4d, 0x14, 0x90, 0xf1, 0xa7, |
| 539 | 0x8d, 0xbf, 0xaa, 0x09, 0x8b, 0x4c, 0x7e, 0x80, 0x6e, 0xa9, 0xc0, 0x48, 0x34, 0x0a, 0x6c, 0xcf, |
| 540 | 0xfe, 0xdc, 0x9e, 0xf1, 0x6b, 0xe8, 0x26, 0x4e, 0x99, 0x25, 0x0e, 0x8f, 0x79, 0xa9, 0xe5, 0xb1, |
| 541 | 0x72, 0xc7, 0xbb, 0xa9, 0x9f, 0xfc, 0xd5, 0x84, 0xce, 0x8c, 0xf2, 0x5c, 0xc4, 0x84, 0xcf, 0x21, |
| 542 | 0xd0, 0xdb, 0x59, 0x3d, 0x2b, 0x39, 0x5c, 0xba, 0x3a, 0x2d, 0x53, 0x86, 0x43, 0xf0, 0xb5, 0xac, |
| 543 | 0x39, 0xf1, 0xb5, 0x34, 0x36, 0x96, 0x4a, 0x3e, 0xb2, 0x61, 0x90, 0x8d, 0xc1, 0xe0, 0xb1, 0x41, |
| 544 | 0x1c, 0x41, 0xe7, 0x56, 0xc6, 0xf6, 0x76, 0x5b, 0x95, 0x64, 0x09, 0x6e, 0xc7, 0xd6, 0x7e, 0x3a, |
| 545 | 0xb6, 0xe7, 0xd0, 0xa1, 0x54, 0xab, 0x15, 0xe5, 0xbc, 0x33, 0x6e, 0x4e, 0xc3, 0xe3, 0x9d, 0xda, |
| 546 | 0x1d, 0x97, 0x54, 0xae, 0x06, 0x0f, 0xa0, 0xbd, 0x90, 0x49, 0xb2, 0xd2, 0xbc, 0x5b, 0xe1, 0x72, |
| 547 | 0x18, 0x1e, 0x43, 0x37, 0x77, 0x13, 0xe3, 0x3d, 0x3b, 0x49, 0xf6, 0x78, 0x92, 0xe5, 0x04, 0xcb, |
| 548 | 0x3a, 0xc3, 0xa8, 0xe8, 0x67, 0x5a, 0x68, 0x0e, 0x63, 0x6f, 0xda, 0x2d, 0x19, 0x0b, 0x0c, 0x3f, |
| 549 | 0x05, 0x28, 0x4e, 0xe7, 0xab, 0x54, 0xf3, 0xb0, 0xd2, 0xb3, 0x82, 0x23, 0x87, 0xce, 0x42, 0xa6, |
| 550 | 0x9a, 0xde, 0x69, 0xde, 0xb7, 0x17, 0x5b, 0x86, 0x93, 0x1f, 0xa1, 0x77, 0x2e, 0x54, 0x54, 0xac, |
| 551 | 0x4f, 0x39, 0x41, 0xef, 0xc9, 0x04, 0x39, 0x04, 0x6f, 0xa5, 0xa6, 0xfa, 0xe3, 0x30, 0x48, 0xc5, |
| 552 | 0x70, 0xf3, 0xa9, 0xe1, 0xc9, 0x37, 0xd0, 0xdb, 0xac, 0x2b, 0x0e, 0xa1, 0x95, 0xca, 0x88, 0x72, |
| 553 | 0xee, 0x8d, 0x9b, 0xd3, 0x60, 0x5e, 0x04, 0xb8, 0x0f, 0xdd, 0x5b, 0x12, 0x2a, 0x25, 0x95, 0x73, |
| 554 | 0xdf, 0x26, 0x36, 0xf1, 0xe4, 0x0f, 0x0f, 0xc0, 0x7c, 0x7f, 0x7a, 0x23, 0xd2, 0xd8, 0x6e, 0xc4, |
| 555 | 0xc5, 0x59, 0x4d, 0x9d, 0x7f, 0x71, 0x86, 0x5f, 0xb8, 0x27, 0xe8, 0xdb, 0xb5, 0xfa, 0xb8, 0xfa, |
| 556 | 0x4c, 0x8a, 0xef, 0x9e, 0xbc, 0xc3, 0x03, 0x68, 0x5f, 0xca, 0x88, 0x2e, 0xce, 0xea, 0x9a, 0x0b, |
| 557 | 0xcc, 0x0c, 0xeb, 0xd4, 0x0d, 0xab, 0x78, 0xa8, 0x65, 0x78, 0xf8, 0x25, 0xf4, 0x36, 0x0f, 0x1b, |
| 558 | 0x77, 0x21, 0xb4, 0xc1, 0xa5, 0x54, 0x89, 0xb8, 0x65, 0x0d, 0x7c, 0x06, 0xbb, 0x16, 0xd8, 0x36, |
| 559 | 0x66, 0xde, 0xe1, 0xdf, 0x3e, 0x84, 0x95, 0x05, 0x47, 0x80, 0xf6, 0x2c, 0x8f, 0xcf, 0xd7, 0x19, |
| 560 | 0x6b, 0x60, 0x08, 0x9d, 0x59, 0x1e, 0x9f, 0x90, 0xd0, 0xcc, 0x73, 0xc1, 0x2b, 0x25, 0x33, 0xe6, |
| 561 | 0xbb, 0xaa, 0x17, 0x59, 0xc6, 0x9a, 0x38, 0x00, 0x28, 0xce, 0x73, 0xca, 0x33, 0x16, 0xb8, 0xc2, |
| 562 | 0xef, 0xa5, 0x26, 0xd6, 0x32, 0x22, 0x5c, 0x60, 0xb3, 0x6d, 0x97, 0x35, 0xcb, 0xc4, 0x3a, 0xc8, |
| 563 | 0xa0, 0x6f, 0x9a, 0x91, 0x50, 0xfa, 0xda, 0x74, 0xe9, 0xe2, 0x10, 0x58, 0x15, 0xb1, 0x1f, 0xf5, |
| 564 | 0x10, 0x61, 0x30, 0xcb, 0xe3, 0x37, 0xa9, 0x22, 0xb1, 0xb8, 0x11, 0xd7, 0xb7, 0xc4, 0x00, 0xf7, |
| 565 | 0x60, 0xc7, 0x11, 0x99, 0xcb, 0x5b, 0xe7, 0x2c, 0x74, 0x65, 0xa7, 0x37, 0xb4, 0xf8, 0xe5, 0xbb, |
| 566 | 0xb5, 0x54, 0xeb, 0x84, 0xf5, 0xf1, 0x23, 0xd8, 0x9b, 0xe5, 0xf1, 0x95, 0x12, 0x69, 0xbe, 0x24, |
| 567 | 0xf5, 0x92, 0x44, 0x44, 0x8a, 0xed, 0xb8, 0xaf, 0xaf, 0x56, 0x09, 0xc9, 0xb5, 0xbe, 0x94, 0xbf, |
| 568 | 0xb2, 0x81, 0x13, 0x33, 0x27, 0x11, 0xd9, 0x3f, 0x27, 0xdb, 0x75, 0x62, 0x36, 0x88, 0x15, 0xc3, |
| 569 | 0x9c, 0xdf, 0x57, 0x8a, 0xac, 0xc5, 0x3d, 0xd7, 0xd5, 0xc5, 0xb6, 0x06, 0x0f, 0xef, 0x60, 0x50, |
| 570 | 0xbf, 0x5e, 0xa3, 0x63, 0x8b, 0xbc, 0x88, 0x22, 0x73, 0x97, 0xac, 0x81, 0x1c, 0x86, 0x5b, 0x78, |
| 571 | 0x4e, 0x89, 0x7c, 0x4b, 0x36, 0xe3, 0xd5, 0x33, 0x6f, 0xb2, 0x48, 0xe8, 0x22, 0xe3, 0xe3, 0x01, |
| 572 | 0xf0, 0x1a, 0xd5, 0xcb, 0x62, 0x1b, 0x6d, 0xb6, 0x79, 0xc2, 0xef, 0x3f, 0x8c, 0x1a, 0xef, 0x3f, |
| 573 | 0x8c, 0x1a, 0xf7, 0x0f, 0x23, 0xef, 0xfd, 0xc3, 0xc8, 0xfb, 0xf7, 0x61, 0xe4, 0xfd, 0xf9, 0xdf, |
| 574 | 0xa8, 0xf1, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0xe1, 0x02, 0x69, 0x74, 0x06, 0x00, 0x00, |
| 575 | } |
| 576 | |
| 577 | func (m *Entry) Marshal() (dAtA []byte, err error) { |
| 578 | size := m.Size() |
| 579 | dAtA = make([]byte, size) |
| 580 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 581 | if err != nil { |
| 582 | return nil, err |
| 583 | } |
| 584 | return dAtA[:n], nil |
| 585 | } |
| 586 | |
| 587 | func (m *Entry) MarshalTo(dAtA []byte) (int, error) { |
| 588 | size := m.Size() |
| 589 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 590 | } |
| 591 | |
| 592 | func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 593 | i := len(dAtA) |
| 594 | _ = i |
| 595 | var l int |
| 596 | _ = l |
| 597 | if m.XXX_unrecognized != nil { |
| 598 | i -= len(m.XXX_unrecognized) |
| 599 | copy(dAtA[i:], m.XXX_unrecognized) |
| 600 | } |
| 601 | if m.Data != nil { |
| 602 | i -= len(m.Data) |
| 603 | copy(dAtA[i:], m.Data) |
| 604 | i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) |
| 605 | i-- |
| 606 | dAtA[i] = 0x22 |
| 607 | } |
| 608 | i = encodeVarintRaft(dAtA, i, uint64(m.Index)) |
| 609 | i-- |
| 610 | dAtA[i] = 0x18 |
| 611 | i = encodeVarintRaft(dAtA, i, uint64(m.Term)) |
| 612 | i-- |
| 613 | dAtA[i] = 0x10 |
| 614 | i = encodeVarintRaft(dAtA, i, uint64(m.Type)) |
| 615 | i-- |
| 616 | dAtA[i] = 0x8 |
| 617 | return len(dAtA) - i, nil |
| 618 | } |
| 619 | |
| 620 | func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) { |
| 621 | size := m.Size() |
| 622 | dAtA = make([]byte, size) |
| 623 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 624 | if err != nil { |
| 625 | return nil, err |
| 626 | } |
| 627 | return dAtA[:n], nil |
| 628 | } |
| 629 | |
| 630 | func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) { |
| 631 | size := m.Size() |
| 632 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 633 | } |
| 634 | |
| 635 | func (m *SnapshotMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 636 | i := len(dAtA) |
| 637 | _ = i |
| 638 | var l int |
| 639 | _ = l |
| 640 | if m.XXX_unrecognized != nil { |
| 641 | i -= len(m.XXX_unrecognized) |
| 642 | copy(dAtA[i:], m.XXX_unrecognized) |
| 643 | } |
| 644 | i = encodeVarintRaft(dAtA, i, uint64(m.Term)) |
| 645 | i-- |
| 646 | dAtA[i] = 0x18 |
| 647 | i = encodeVarintRaft(dAtA, i, uint64(m.Index)) |
| 648 | i-- |
| 649 | dAtA[i] = 0x10 |
| 650 | { |
| 651 | size, err := m.ConfState.MarshalToSizedBuffer(dAtA[:i]) |
| 652 | if err != nil { |
| 653 | return 0, err |
| 654 | } |
| 655 | i -= size |
| 656 | i = encodeVarintRaft(dAtA, i, uint64(size)) |
| 657 | } |
| 658 | i-- |
| 659 | dAtA[i] = 0xa |
| 660 | return len(dAtA) - i, nil |
| 661 | } |
| 662 | |
| 663 | func (m *Snapshot) Marshal() (dAtA []byte, err error) { |
| 664 | size := m.Size() |
| 665 | dAtA = make([]byte, size) |
| 666 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 667 | if err != nil { |
| 668 | return nil, err |
| 669 | } |
| 670 | return dAtA[:n], nil |
| 671 | } |
| 672 | |
| 673 | func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { |
| 674 | size := m.Size() |
| 675 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 676 | } |
| 677 | |
| 678 | func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 679 | i := len(dAtA) |
| 680 | _ = i |
| 681 | var l int |
| 682 | _ = l |
| 683 | if m.XXX_unrecognized != nil { |
| 684 | i -= len(m.XXX_unrecognized) |
| 685 | copy(dAtA[i:], m.XXX_unrecognized) |
| 686 | } |
| 687 | { |
| 688 | size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) |
| 689 | if err != nil { |
| 690 | return 0, err |
| 691 | } |
| 692 | i -= size |
| 693 | i = encodeVarintRaft(dAtA, i, uint64(size)) |
| 694 | } |
| 695 | i-- |
| 696 | dAtA[i] = 0x12 |
| 697 | if m.Data != nil { |
| 698 | i -= len(m.Data) |
| 699 | copy(dAtA[i:], m.Data) |
| 700 | i = encodeVarintRaft(dAtA, i, uint64(len(m.Data))) |
| 701 | i-- |
| 702 | dAtA[i] = 0xa |
| 703 | } |
| 704 | return len(dAtA) - i, nil |
| 705 | } |
| 706 | |
| 707 | func (m *Message) Marshal() (dAtA []byte, err error) { |
| 708 | size := m.Size() |
| 709 | dAtA = make([]byte, size) |
| 710 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 711 | if err != nil { |
| 712 | return nil, err |
| 713 | } |
| 714 | return dAtA[:n], nil |
| 715 | } |
| 716 | |
| 717 | func (m *Message) MarshalTo(dAtA []byte) (int, error) { |
| 718 | size := m.Size() |
| 719 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 720 | } |
| 721 | |
| 722 | func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 723 | i := len(dAtA) |
| 724 | _ = i |
| 725 | var l int |
| 726 | _ = l |
| 727 | if m.XXX_unrecognized != nil { |
| 728 | i -= len(m.XXX_unrecognized) |
| 729 | copy(dAtA[i:], m.XXX_unrecognized) |
| 730 | } |
| 731 | if m.Context != nil { |
| 732 | i -= len(m.Context) |
| 733 | copy(dAtA[i:], m.Context) |
| 734 | i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) |
| 735 | i-- |
| 736 | dAtA[i] = 0x62 |
| 737 | } |
| 738 | i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint)) |
| 739 | i-- |
| 740 | dAtA[i] = 0x58 |
| 741 | i-- |
| 742 | if m.Reject { |
| 743 | dAtA[i] = 1 |
| 744 | } else { |
| 745 | dAtA[i] = 0 |
| 746 | } |
| 747 | i-- |
| 748 | dAtA[i] = 0x50 |
| 749 | { |
| 750 | size, err := m.Snapshot.MarshalToSizedBuffer(dAtA[:i]) |
| 751 | if err != nil { |
| 752 | return 0, err |
| 753 | } |
| 754 | i -= size |
| 755 | i = encodeVarintRaft(dAtA, i, uint64(size)) |
| 756 | } |
| 757 | i-- |
| 758 | dAtA[i] = 0x4a |
| 759 | i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) |
| 760 | i-- |
| 761 | dAtA[i] = 0x40 |
| 762 | if len(m.Entries) > 0 { |
| 763 | for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { |
| 764 | { |
| 765 | size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) |
| 766 | if err != nil { |
| 767 | return 0, err |
| 768 | } |
| 769 | i -= size |
| 770 | i = encodeVarintRaft(dAtA, i, uint64(size)) |
| 771 | } |
| 772 | i-- |
| 773 | dAtA[i] = 0x3a |
| 774 | } |
| 775 | } |
| 776 | i = encodeVarintRaft(dAtA, i, uint64(m.Index)) |
| 777 | i-- |
| 778 | dAtA[i] = 0x30 |
| 779 | i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm)) |
| 780 | i-- |
| 781 | dAtA[i] = 0x28 |
| 782 | i = encodeVarintRaft(dAtA, i, uint64(m.Term)) |
| 783 | i-- |
| 784 | dAtA[i] = 0x20 |
| 785 | i = encodeVarintRaft(dAtA, i, uint64(m.From)) |
| 786 | i-- |
| 787 | dAtA[i] = 0x18 |
| 788 | i = encodeVarintRaft(dAtA, i, uint64(m.To)) |
| 789 | i-- |
| 790 | dAtA[i] = 0x10 |
| 791 | i = encodeVarintRaft(dAtA, i, uint64(m.Type)) |
| 792 | i-- |
| 793 | dAtA[i] = 0x8 |
| 794 | return len(dAtA) - i, nil |
| 795 | } |
| 796 | |
| 797 | func (m *HardState) Marshal() (dAtA []byte, err error) { |
| 798 | size := m.Size() |
| 799 | dAtA = make([]byte, size) |
| 800 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 801 | if err != nil { |
| 802 | return nil, err |
| 803 | } |
| 804 | return dAtA[:n], nil |
| 805 | } |
| 806 | |
| 807 | func (m *HardState) MarshalTo(dAtA []byte) (int, error) { |
| 808 | size := m.Size() |
| 809 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 810 | } |
| 811 | |
| 812 | func (m *HardState) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 813 | i := len(dAtA) |
| 814 | _ = i |
| 815 | var l int |
| 816 | _ = l |
| 817 | if m.XXX_unrecognized != nil { |
| 818 | i -= len(m.XXX_unrecognized) |
| 819 | copy(dAtA[i:], m.XXX_unrecognized) |
| 820 | } |
| 821 | i = encodeVarintRaft(dAtA, i, uint64(m.Commit)) |
| 822 | i-- |
| 823 | dAtA[i] = 0x18 |
| 824 | i = encodeVarintRaft(dAtA, i, uint64(m.Vote)) |
| 825 | i-- |
| 826 | dAtA[i] = 0x10 |
| 827 | i = encodeVarintRaft(dAtA, i, uint64(m.Term)) |
| 828 | i-- |
| 829 | dAtA[i] = 0x8 |
| 830 | return len(dAtA) - i, nil |
| 831 | } |
| 832 | |
| 833 | func (m *ConfState) Marshal() (dAtA []byte, err error) { |
| 834 | size := m.Size() |
| 835 | dAtA = make([]byte, size) |
| 836 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 837 | if err != nil { |
| 838 | return nil, err |
| 839 | } |
| 840 | return dAtA[:n], nil |
| 841 | } |
| 842 | |
| 843 | func (m *ConfState) MarshalTo(dAtA []byte) (int, error) { |
| 844 | size := m.Size() |
| 845 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 846 | } |
| 847 | |
| 848 | func (m *ConfState) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 849 | i := len(dAtA) |
| 850 | _ = i |
| 851 | var l int |
| 852 | _ = l |
| 853 | if m.XXX_unrecognized != nil { |
| 854 | i -= len(m.XXX_unrecognized) |
| 855 | copy(dAtA[i:], m.XXX_unrecognized) |
| 856 | } |
| 857 | if len(m.Learners) > 0 { |
| 858 | for iNdEx := len(m.Learners) - 1; iNdEx >= 0; iNdEx-- { |
| 859 | i = encodeVarintRaft(dAtA, i, uint64(m.Learners[iNdEx])) |
| 860 | i-- |
| 861 | dAtA[i] = 0x10 |
| 862 | } |
| 863 | } |
| 864 | if len(m.Nodes) > 0 { |
| 865 | for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { |
| 866 | i = encodeVarintRaft(dAtA, i, uint64(m.Nodes[iNdEx])) |
| 867 | i-- |
| 868 | dAtA[i] = 0x8 |
| 869 | } |
| 870 | } |
| 871 | return len(dAtA) - i, nil |
| 872 | } |
| 873 | |
| 874 | func (m *ConfChange) Marshal() (dAtA []byte, err error) { |
| 875 | size := m.Size() |
| 876 | dAtA = make([]byte, size) |
| 877 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 878 | if err != nil { |
| 879 | return nil, err |
| 880 | } |
| 881 | return dAtA[:n], nil |
| 882 | } |
| 883 | |
| 884 | func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) { |
| 885 | size := m.Size() |
| 886 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 887 | } |
| 888 | |
| 889 | func (m *ConfChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 890 | i := len(dAtA) |
| 891 | _ = i |
| 892 | var l int |
| 893 | _ = l |
| 894 | if m.XXX_unrecognized != nil { |
| 895 | i -= len(m.XXX_unrecognized) |
| 896 | copy(dAtA[i:], m.XXX_unrecognized) |
| 897 | } |
| 898 | if m.Context != nil { |
| 899 | i -= len(m.Context) |
| 900 | copy(dAtA[i:], m.Context) |
| 901 | i = encodeVarintRaft(dAtA, i, uint64(len(m.Context))) |
| 902 | i-- |
| 903 | dAtA[i] = 0x22 |
| 904 | } |
| 905 | i = encodeVarintRaft(dAtA, i, uint64(m.NodeID)) |
| 906 | i-- |
| 907 | dAtA[i] = 0x18 |
| 908 | i = encodeVarintRaft(dAtA, i, uint64(m.Type)) |
| 909 | i-- |
| 910 | dAtA[i] = 0x10 |
| 911 | i = encodeVarintRaft(dAtA, i, uint64(m.ID)) |
| 912 | i-- |
| 913 | dAtA[i] = 0x8 |
| 914 | return len(dAtA) - i, nil |
| 915 | } |
| 916 | |
| 917 | func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { |
| 918 | offset -= sovRaft(v) |
| 919 | base := offset |
| 920 | for v >= 1<<7 { |
| 921 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 922 | v >>= 7 |
| 923 | offset++ |
| 924 | } |
| 925 | dAtA[offset] = uint8(v) |
| 926 | return base |
| 927 | } |
| 928 | func (m *Entry) Size() (n int) { |
| 929 | if m == nil { |
| 930 | return 0 |
| 931 | } |
| 932 | var l int |
| 933 | _ = l |
| 934 | n += 1 + sovRaft(uint64(m.Type)) |
| 935 | n += 1 + sovRaft(uint64(m.Term)) |
| 936 | n += 1 + sovRaft(uint64(m.Index)) |
| 937 | if m.Data != nil { |
| 938 | l = len(m.Data) |
| 939 | n += 1 + l + sovRaft(uint64(l)) |
| 940 | } |
| 941 | if m.XXX_unrecognized != nil { |
| 942 | n += len(m.XXX_unrecognized) |
| 943 | } |
| 944 | return n |
| 945 | } |
| 946 | |
| 947 | func (m *SnapshotMetadata) Size() (n int) { |
| 948 | if m == nil { |
| 949 | return 0 |
| 950 | } |
| 951 | var l int |
| 952 | _ = l |
| 953 | l = m.ConfState.Size() |
| 954 | n += 1 + l + sovRaft(uint64(l)) |
| 955 | n += 1 + sovRaft(uint64(m.Index)) |
| 956 | n += 1 + sovRaft(uint64(m.Term)) |
| 957 | if m.XXX_unrecognized != nil { |
| 958 | n += len(m.XXX_unrecognized) |
| 959 | } |
| 960 | return n |
| 961 | } |
| 962 | |
| 963 | func (m *Snapshot) Size() (n int) { |
| 964 | if m == nil { |
| 965 | return 0 |
| 966 | } |
| 967 | var l int |
| 968 | _ = l |
| 969 | if m.Data != nil { |
| 970 | l = len(m.Data) |
| 971 | n += 1 + l + sovRaft(uint64(l)) |
| 972 | } |
| 973 | l = m.Metadata.Size() |
| 974 | n += 1 + l + sovRaft(uint64(l)) |
| 975 | if m.XXX_unrecognized != nil { |
| 976 | n += len(m.XXX_unrecognized) |
| 977 | } |
| 978 | return n |
| 979 | } |
| 980 | |
| 981 | func (m *Message) Size() (n int) { |
| 982 | if m == nil { |
| 983 | return 0 |
| 984 | } |
| 985 | var l int |
| 986 | _ = l |
| 987 | n += 1 + sovRaft(uint64(m.Type)) |
| 988 | n += 1 + sovRaft(uint64(m.To)) |
| 989 | n += 1 + sovRaft(uint64(m.From)) |
| 990 | n += 1 + sovRaft(uint64(m.Term)) |
| 991 | n += 1 + sovRaft(uint64(m.LogTerm)) |
| 992 | n += 1 + sovRaft(uint64(m.Index)) |
| 993 | if len(m.Entries) > 0 { |
| 994 | for _, e := range m.Entries { |
| 995 | l = e.Size() |
| 996 | n += 1 + l + sovRaft(uint64(l)) |
| 997 | } |
| 998 | } |
| 999 | n += 1 + sovRaft(uint64(m.Commit)) |
| 1000 | l = m.Snapshot.Size() |
| 1001 | n += 1 + l + sovRaft(uint64(l)) |
| 1002 | n += 2 |
| 1003 | n += 1 + sovRaft(uint64(m.RejectHint)) |
| 1004 | if m.Context != nil { |
| 1005 | l = len(m.Context) |
| 1006 | n += 1 + l + sovRaft(uint64(l)) |
| 1007 | } |
| 1008 | if m.XXX_unrecognized != nil { |
| 1009 | n += len(m.XXX_unrecognized) |
| 1010 | } |
| 1011 | return n |
| 1012 | } |
| 1013 | |
| 1014 | func (m *HardState) Size() (n int) { |
| 1015 | if m == nil { |
| 1016 | return 0 |
| 1017 | } |
| 1018 | var l int |
| 1019 | _ = l |
| 1020 | n += 1 + sovRaft(uint64(m.Term)) |
| 1021 | n += 1 + sovRaft(uint64(m.Vote)) |
| 1022 | n += 1 + sovRaft(uint64(m.Commit)) |
| 1023 | if m.XXX_unrecognized != nil { |
| 1024 | n += len(m.XXX_unrecognized) |
| 1025 | } |
| 1026 | return n |
| 1027 | } |
| 1028 | |
| 1029 | func (m *ConfState) Size() (n int) { |
| 1030 | if m == nil { |
| 1031 | return 0 |
| 1032 | } |
| 1033 | var l int |
| 1034 | _ = l |
| 1035 | if len(m.Nodes) > 0 { |
| 1036 | for _, e := range m.Nodes { |
| 1037 | n += 1 + sovRaft(uint64(e)) |
| 1038 | } |
| 1039 | } |
| 1040 | if len(m.Learners) > 0 { |
| 1041 | for _, e := range m.Learners { |
| 1042 | n += 1 + sovRaft(uint64(e)) |
| 1043 | } |
| 1044 | } |
| 1045 | if m.XXX_unrecognized != nil { |
| 1046 | n += len(m.XXX_unrecognized) |
| 1047 | } |
| 1048 | return n |
| 1049 | } |
| 1050 | |
| 1051 | func (m *ConfChange) Size() (n int) { |
| 1052 | if m == nil { |
| 1053 | return 0 |
| 1054 | } |
| 1055 | var l int |
| 1056 | _ = l |
| 1057 | n += 1 + sovRaft(uint64(m.ID)) |
| 1058 | n += 1 + sovRaft(uint64(m.Type)) |
| 1059 | n += 1 + sovRaft(uint64(m.NodeID)) |
| 1060 | if m.Context != nil { |
| 1061 | l = len(m.Context) |
| 1062 | n += 1 + l + sovRaft(uint64(l)) |
| 1063 | } |
| 1064 | if m.XXX_unrecognized != nil { |
| 1065 | n += len(m.XXX_unrecognized) |
| 1066 | } |
| 1067 | return n |
| 1068 | } |
| 1069 | |
| 1070 | func sovRaft(x uint64) (n int) { |
| 1071 | return (math_bits.Len64(x|1) + 6) / 7 |
| 1072 | } |
| 1073 | func sozRaft(x uint64) (n int) { |
| 1074 | return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 1075 | } |
| 1076 | func (m *Entry) Unmarshal(dAtA []byte) error { |
| 1077 | l := len(dAtA) |
| 1078 | iNdEx := 0 |
| 1079 | for iNdEx < l { |
| 1080 | preIndex := iNdEx |
| 1081 | var wire uint64 |
| 1082 | for shift := uint(0); ; shift += 7 { |
| 1083 | if shift >= 64 { |
| 1084 | return ErrIntOverflowRaft |
| 1085 | } |
| 1086 | if iNdEx >= l { |
| 1087 | return io.ErrUnexpectedEOF |
| 1088 | } |
| 1089 | b := dAtA[iNdEx] |
| 1090 | iNdEx++ |
| 1091 | wire |= uint64(b&0x7F) << shift |
| 1092 | if b < 0x80 { |
| 1093 | break |
| 1094 | } |
| 1095 | } |
| 1096 | fieldNum := int32(wire >> 3) |
| 1097 | wireType := int(wire & 0x7) |
| 1098 | if wireType == 4 { |
| 1099 | return fmt.Errorf("proto: Entry: wiretype end group for non-group") |
| 1100 | } |
| 1101 | if fieldNum <= 0 { |
| 1102 | return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1103 | } |
| 1104 | switch fieldNum { |
| 1105 | case 1: |
| 1106 | if wireType != 0 { |
| 1107 | return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) |
| 1108 | } |
| 1109 | m.Type = 0 |
| 1110 | for shift := uint(0); ; shift += 7 { |
| 1111 | if shift >= 64 { |
| 1112 | return ErrIntOverflowRaft |
| 1113 | } |
| 1114 | if iNdEx >= l { |
| 1115 | return io.ErrUnexpectedEOF |
| 1116 | } |
| 1117 | b := dAtA[iNdEx] |
| 1118 | iNdEx++ |
| 1119 | m.Type |= EntryType(b&0x7F) << shift |
| 1120 | if b < 0x80 { |
| 1121 | break |
| 1122 | } |
| 1123 | } |
| 1124 | case 2: |
| 1125 | if wireType != 0 { |
| 1126 | return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) |
| 1127 | } |
| 1128 | m.Term = 0 |
| 1129 | for shift := uint(0); ; shift += 7 { |
| 1130 | if shift >= 64 { |
| 1131 | return ErrIntOverflowRaft |
| 1132 | } |
| 1133 | if iNdEx >= l { |
| 1134 | return io.ErrUnexpectedEOF |
| 1135 | } |
| 1136 | b := dAtA[iNdEx] |
| 1137 | iNdEx++ |
| 1138 | m.Term |= uint64(b&0x7F) << shift |
| 1139 | if b < 0x80 { |
| 1140 | break |
| 1141 | } |
| 1142 | } |
| 1143 | case 3: |
| 1144 | if wireType != 0 { |
| 1145 | return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) |
| 1146 | } |
| 1147 | m.Index = 0 |
| 1148 | for shift := uint(0); ; shift += 7 { |
| 1149 | if shift >= 64 { |
| 1150 | return ErrIntOverflowRaft |
| 1151 | } |
| 1152 | if iNdEx >= l { |
| 1153 | return io.ErrUnexpectedEOF |
| 1154 | } |
| 1155 | b := dAtA[iNdEx] |
| 1156 | iNdEx++ |
| 1157 | m.Index |= uint64(b&0x7F) << shift |
| 1158 | if b < 0x80 { |
| 1159 | break |
| 1160 | } |
| 1161 | } |
| 1162 | case 4: |
| 1163 | if wireType != 2 { |
| 1164 | return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) |
| 1165 | } |
| 1166 | var byteLen int |
| 1167 | for shift := uint(0); ; shift += 7 { |
| 1168 | if shift >= 64 { |
| 1169 | return ErrIntOverflowRaft |
| 1170 | } |
| 1171 | if iNdEx >= l { |
| 1172 | return io.ErrUnexpectedEOF |
| 1173 | } |
| 1174 | b := dAtA[iNdEx] |
| 1175 | iNdEx++ |
| 1176 | byteLen |= int(b&0x7F) << shift |
| 1177 | if b < 0x80 { |
| 1178 | break |
| 1179 | } |
| 1180 | } |
| 1181 | if byteLen < 0 { |
| 1182 | return ErrInvalidLengthRaft |
| 1183 | } |
| 1184 | postIndex := iNdEx + byteLen |
| 1185 | if postIndex < 0 { |
| 1186 | return ErrInvalidLengthRaft |
| 1187 | } |
| 1188 | if postIndex > l { |
| 1189 | return io.ErrUnexpectedEOF |
| 1190 | } |
| 1191 | m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) |
| 1192 | if m.Data == nil { |
| 1193 | m.Data = []byte{} |
| 1194 | } |
| 1195 | iNdEx = postIndex |
| 1196 | default: |
| 1197 | iNdEx = preIndex |
| 1198 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 1199 | if err != nil { |
| 1200 | return err |
| 1201 | } |
| 1202 | if skippy < 0 { |
| 1203 | return ErrInvalidLengthRaft |
| 1204 | } |
| 1205 | if (iNdEx + skippy) < 0 { |
| 1206 | return ErrInvalidLengthRaft |
| 1207 | } |
| 1208 | if (iNdEx + skippy) > l { |
| 1209 | return io.ErrUnexpectedEOF |
| 1210 | } |
| 1211 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1212 | iNdEx += skippy |
| 1213 | } |
| 1214 | } |
| 1215 | |
| 1216 | if iNdEx > l { |
| 1217 | return io.ErrUnexpectedEOF |
| 1218 | } |
| 1219 | return nil |
| 1220 | } |
| 1221 | func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error { |
| 1222 | l := len(dAtA) |
| 1223 | iNdEx := 0 |
| 1224 | for iNdEx < l { |
| 1225 | preIndex := iNdEx |
| 1226 | var wire uint64 |
| 1227 | for shift := uint(0); ; shift += 7 { |
| 1228 | if shift >= 64 { |
| 1229 | return ErrIntOverflowRaft |
| 1230 | } |
| 1231 | if iNdEx >= l { |
| 1232 | return io.ErrUnexpectedEOF |
| 1233 | } |
| 1234 | b := dAtA[iNdEx] |
| 1235 | iNdEx++ |
| 1236 | wire |= uint64(b&0x7F) << shift |
| 1237 | if b < 0x80 { |
| 1238 | break |
| 1239 | } |
| 1240 | } |
| 1241 | fieldNum := int32(wire >> 3) |
| 1242 | wireType := int(wire & 0x7) |
| 1243 | if wireType == 4 { |
| 1244 | return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group") |
| 1245 | } |
| 1246 | if fieldNum <= 0 { |
| 1247 | return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1248 | } |
| 1249 | switch fieldNum { |
| 1250 | case 1: |
| 1251 | if wireType != 2 { |
| 1252 | return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType) |
| 1253 | } |
| 1254 | var msglen int |
| 1255 | for shift := uint(0); ; shift += 7 { |
| 1256 | if shift >= 64 { |
| 1257 | return ErrIntOverflowRaft |
| 1258 | } |
| 1259 | if iNdEx >= l { |
| 1260 | return io.ErrUnexpectedEOF |
| 1261 | } |
| 1262 | b := dAtA[iNdEx] |
| 1263 | iNdEx++ |
| 1264 | msglen |= int(b&0x7F) << shift |
| 1265 | if b < 0x80 { |
| 1266 | break |
| 1267 | } |
| 1268 | } |
| 1269 | if msglen < 0 { |
| 1270 | return ErrInvalidLengthRaft |
| 1271 | } |
| 1272 | postIndex := iNdEx + msglen |
| 1273 | if postIndex < 0 { |
| 1274 | return ErrInvalidLengthRaft |
| 1275 | } |
| 1276 | if postIndex > l { |
| 1277 | return io.ErrUnexpectedEOF |
| 1278 | } |
| 1279 | if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1280 | return err |
| 1281 | } |
| 1282 | iNdEx = postIndex |
| 1283 | case 2: |
| 1284 | if wireType != 0 { |
| 1285 | return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) |
| 1286 | } |
| 1287 | m.Index = 0 |
| 1288 | for shift := uint(0); ; shift += 7 { |
| 1289 | if shift >= 64 { |
| 1290 | return ErrIntOverflowRaft |
| 1291 | } |
| 1292 | if iNdEx >= l { |
| 1293 | return io.ErrUnexpectedEOF |
| 1294 | } |
| 1295 | b := dAtA[iNdEx] |
| 1296 | iNdEx++ |
| 1297 | m.Index |= uint64(b&0x7F) << shift |
| 1298 | if b < 0x80 { |
| 1299 | break |
| 1300 | } |
| 1301 | } |
| 1302 | case 3: |
| 1303 | if wireType != 0 { |
| 1304 | return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) |
| 1305 | } |
| 1306 | m.Term = 0 |
| 1307 | for shift := uint(0); ; shift += 7 { |
| 1308 | if shift >= 64 { |
| 1309 | return ErrIntOverflowRaft |
| 1310 | } |
| 1311 | if iNdEx >= l { |
| 1312 | return io.ErrUnexpectedEOF |
| 1313 | } |
| 1314 | b := dAtA[iNdEx] |
| 1315 | iNdEx++ |
| 1316 | m.Term |= uint64(b&0x7F) << shift |
| 1317 | if b < 0x80 { |
| 1318 | break |
| 1319 | } |
| 1320 | } |
| 1321 | default: |
| 1322 | iNdEx = preIndex |
| 1323 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 1324 | if err != nil { |
| 1325 | return err |
| 1326 | } |
| 1327 | if skippy < 0 { |
| 1328 | return ErrInvalidLengthRaft |
| 1329 | } |
| 1330 | if (iNdEx + skippy) < 0 { |
| 1331 | return ErrInvalidLengthRaft |
| 1332 | } |
| 1333 | if (iNdEx + skippy) > l { |
| 1334 | return io.ErrUnexpectedEOF |
| 1335 | } |
| 1336 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1337 | iNdEx += skippy |
| 1338 | } |
| 1339 | } |
| 1340 | |
| 1341 | if iNdEx > l { |
| 1342 | return io.ErrUnexpectedEOF |
| 1343 | } |
| 1344 | return nil |
| 1345 | } |
| 1346 | func (m *Snapshot) Unmarshal(dAtA []byte) error { |
| 1347 | l := len(dAtA) |
| 1348 | iNdEx := 0 |
| 1349 | for iNdEx < l { |
| 1350 | preIndex := iNdEx |
| 1351 | var wire uint64 |
| 1352 | for shift := uint(0); ; shift += 7 { |
| 1353 | if shift >= 64 { |
| 1354 | return ErrIntOverflowRaft |
| 1355 | } |
| 1356 | if iNdEx >= l { |
| 1357 | return io.ErrUnexpectedEOF |
| 1358 | } |
| 1359 | b := dAtA[iNdEx] |
| 1360 | iNdEx++ |
| 1361 | wire |= uint64(b&0x7F) << shift |
| 1362 | if b < 0x80 { |
| 1363 | break |
| 1364 | } |
| 1365 | } |
| 1366 | fieldNum := int32(wire >> 3) |
| 1367 | wireType := int(wire & 0x7) |
| 1368 | if wireType == 4 { |
| 1369 | return fmt.Errorf("proto: Snapshot: wiretype end group for non-group") |
| 1370 | } |
| 1371 | if fieldNum <= 0 { |
| 1372 | return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1373 | } |
| 1374 | switch fieldNum { |
| 1375 | case 1: |
| 1376 | if wireType != 2 { |
| 1377 | return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) |
| 1378 | } |
| 1379 | var byteLen int |
| 1380 | for shift := uint(0); ; shift += 7 { |
| 1381 | if shift >= 64 { |
| 1382 | return ErrIntOverflowRaft |
| 1383 | } |
| 1384 | if iNdEx >= l { |
| 1385 | return io.ErrUnexpectedEOF |
| 1386 | } |
| 1387 | b := dAtA[iNdEx] |
| 1388 | iNdEx++ |
| 1389 | byteLen |= int(b&0x7F) << shift |
| 1390 | if b < 0x80 { |
| 1391 | break |
| 1392 | } |
| 1393 | } |
| 1394 | if byteLen < 0 { |
| 1395 | return ErrInvalidLengthRaft |
| 1396 | } |
| 1397 | postIndex := iNdEx + byteLen |
| 1398 | if postIndex < 0 { |
| 1399 | return ErrInvalidLengthRaft |
| 1400 | } |
| 1401 | if postIndex > l { |
| 1402 | return io.ErrUnexpectedEOF |
| 1403 | } |
| 1404 | m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) |
| 1405 | if m.Data == nil { |
| 1406 | m.Data = []byte{} |
| 1407 | } |
| 1408 | iNdEx = postIndex |
| 1409 | case 2: |
| 1410 | if wireType != 2 { |
| 1411 | return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) |
| 1412 | } |
| 1413 | var msglen int |
| 1414 | for shift := uint(0); ; shift += 7 { |
| 1415 | if shift >= 64 { |
| 1416 | return ErrIntOverflowRaft |
| 1417 | } |
| 1418 | if iNdEx >= l { |
| 1419 | return io.ErrUnexpectedEOF |
| 1420 | } |
| 1421 | b := dAtA[iNdEx] |
| 1422 | iNdEx++ |
| 1423 | msglen |= int(b&0x7F) << shift |
| 1424 | if b < 0x80 { |
| 1425 | break |
| 1426 | } |
| 1427 | } |
| 1428 | if msglen < 0 { |
| 1429 | return ErrInvalidLengthRaft |
| 1430 | } |
| 1431 | postIndex := iNdEx + msglen |
| 1432 | if postIndex < 0 { |
| 1433 | return ErrInvalidLengthRaft |
| 1434 | } |
| 1435 | if postIndex > l { |
| 1436 | return io.ErrUnexpectedEOF |
| 1437 | } |
| 1438 | if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1439 | return err |
| 1440 | } |
| 1441 | iNdEx = postIndex |
| 1442 | default: |
| 1443 | iNdEx = preIndex |
| 1444 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 1445 | if err != nil { |
| 1446 | return err |
| 1447 | } |
| 1448 | if skippy < 0 { |
| 1449 | return ErrInvalidLengthRaft |
| 1450 | } |
| 1451 | if (iNdEx + skippy) < 0 { |
| 1452 | return ErrInvalidLengthRaft |
| 1453 | } |
| 1454 | if (iNdEx + skippy) > l { |
| 1455 | return io.ErrUnexpectedEOF |
| 1456 | } |
| 1457 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1458 | iNdEx += skippy |
| 1459 | } |
| 1460 | } |
| 1461 | |
| 1462 | if iNdEx > l { |
| 1463 | return io.ErrUnexpectedEOF |
| 1464 | } |
| 1465 | return nil |
| 1466 | } |
| 1467 | func (m *Message) Unmarshal(dAtA []byte) error { |
| 1468 | l := len(dAtA) |
| 1469 | iNdEx := 0 |
| 1470 | for iNdEx < l { |
| 1471 | preIndex := iNdEx |
| 1472 | var wire uint64 |
| 1473 | for shift := uint(0); ; shift += 7 { |
| 1474 | if shift >= 64 { |
| 1475 | return ErrIntOverflowRaft |
| 1476 | } |
| 1477 | if iNdEx >= l { |
| 1478 | return io.ErrUnexpectedEOF |
| 1479 | } |
| 1480 | b := dAtA[iNdEx] |
| 1481 | iNdEx++ |
| 1482 | wire |= uint64(b&0x7F) << shift |
| 1483 | if b < 0x80 { |
| 1484 | break |
| 1485 | } |
| 1486 | } |
| 1487 | fieldNum := int32(wire >> 3) |
| 1488 | wireType := int(wire & 0x7) |
| 1489 | if wireType == 4 { |
| 1490 | return fmt.Errorf("proto: Message: wiretype end group for non-group") |
| 1491 | } |
| 1492 | if fieldNum <= 0 { |
| 1493 | return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1494 | } |
| 1495 | switch fieldNum { |
| 1496 | case 1: |
| 1497 | if wireType != 0 { |
| 1498 | return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) |
| 1499 | } |
| 1500 | m.Type = 0 |
| 1501 | for shift := uint(0); ; shift += 7 { |
| 1502 | if shift >= 64 { |
| 1503 | return ErrIntOverflowRaft |
| 1504 | } |
| 1505 | if iNdEx >= l { |
| 1506 | return io.ErrUnexpectedEOF |
| 1507 | } |
| 1508 | b := dAtA[iNdEx] |
| 1509 | iNdEx++ |
| 1510 | m.Type |= MessageType(b&0x7F) << shift |
| 1511 | if b < 0x80 { |
| 1512 | break |
| 1513 | } |
| 1514 | } |
| 1515 | case 2: |
| 1516 | if wireType != 0 { |
| 1517 | return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) |
| 1518 | } |
| 1519 | m.To = 0 |
| 1520 | for shift := uint(0); ; shift += 7 { |
| 1521 | if shift >= 64 { |
| 1522 | return ErrIntOverflowRaft |
| 1523 | } |
| 1524 | if iNdEx >= l { |
| 1525 | return io.ErrUnexpectedEOF |
| 1526 | } |
| 1527 | b := dAtA[iNdEx] |
| 1528 | iNdEx++ |
| 1529 | m.To |= uint64(b&0x7F) << shift |
| 1530 | if b < 0x80 { |
| 1531 | break |
| 1532 | } |
| 1533 | } |
| 1534 | case 3: |
| 1535 | if wireType != 0 { |
| 1536 | return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) |
| 1537 | } |
| 1538 | m.From = 0 |
| 1539 | for shift := uint(0); ; shift += 7 { |
| 1540 | if shift >= 64 { |
| 1541 | return ErrIntOverflowRaft |
| 1542 | } |
| 1543 | if iNdEx >= l { |
| 1544 | return io.ErrUnexpectedEOF |
| 1545 | } |
| 1546 | b := dAtA[iNdEx] |
| 1547 | iNdEx++ |
| 1548 | m.From |= uint64(b&0x7F) << shift |
| 1549 | if b < 0x80 { |
| 1550 | break |
| 1551 | } |
| 1552 | } |
| 1553 | case 4: |
| 1554 | if wireType != 0 { |
| 1555 | return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) |
| 1556 | } |
| 1557 | m.Term = 0 |
| 1558 | for shift := uint(0); ; shift += 7 { |
| 1559 | if shift >= 64 { |
| 1560 | return ErrIntOverflowRaft |
| 1561 | } |
| 1562 | if iNdEx >= l { |
| 1563 | return io.ErrUnexpectedEOF |
| 1564 | } |
| 1565 | b := dAtA[iNdEx] |
| 1566 | iNdEx++ |
| 1567 | m.Term |= uint64(b&0x7F) << shift |
| 1568 | if b < 0x80 { |
| 1569 | break |
| 1570 | } |
| 1571 | } |
| 1572 | case 5: |
| 1573 | if wireType != 0 { |
| 1574 | return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType) |
| 1575 | } |
| 1576 | m.LogTerm = 0 |
| 1577 | for shift := uint(0); ; shift += 7 { |
| 1578 | if shift >= 64 { |
| 1579 | return ErrIntOverflowRaft |
| 1580 | } |
| 1581 | if iNdEx >= l { |
| 1582 | return io.ErrUnexpectedEOF |
| 1583 | } |
| 1584 | b := dAtA[iNdEx] |
| 1585 | iNdEx++ |
| 1586 | m.LogTerm |= uint64(b&0x7F) << shift |
| 1587 | if b < 0x80 { |
| 1588 | break |
| 1589 | } |
| 1590 | } |
| 1591 | case 6: |
| 1592 | if wireType != 0 { |
| 1593 | return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) |
| 1594 | } |
| 1595 | m.Index = 0 |
| 1596 | for shift := uint(0); ; shift += 7 { |
| 1597 | if shift >= 64 { |
| 1598 | return ErrIntOverflowRaft |
| 1599 | } |
| 1600 | if iNdEx >= l { |
| 1601 | return io.ErrUnexpectedEOF |
| 1602 | } |
| 1603 | b := dAtA[iNdEx] |
| 1604 | iNdEx++ |
| 1605 | m.Index |= uint64(b&0x7F) << shift |
| 1606 | if b < 0x80 { |
| 1607 | break |
| 1608 | } |
| 1609 | } |
| 1610 | case 7: |
| 1611 | if wireType != 2 { |
| 1612 | return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) |
| 1613 | } |
| 1614 | var msglen int |
| 1615 | for shift := uint(0); ; shift += 7 { |
| 1616 | if shift >= 64 { |
| 1617 | return ErrIntOverflowRaft |
| 1618 | } |
| 1619 | if iNdEx >= l { |
| 1620 | return io.ErrUnexpectedEOF |
| 1621 | } |
| 1622 | b := dAtA[iNdEx] |
| 1623 | iNdEx++ |
| 1624 | msglen |= int(b&0x7F) << shift |
| 1625 | if b < 0x80 { |
| 1626 | break |
| 1627 | } |
| 1628 | } |
| 1629 | if msglen < 0 { |
| 1630 | return ErrInvalidLengthRaft |
| 1631 | } |
| 1632 | postIndex := iNdEx + msglen |
| 1633 | if postIndex < 0 { |
| 1634 | return ErrInvalidLengthRaft |
| 1635 | } |
| 1636 | if postIndex > l { |
| 1637 | return io.ErrUnexpectedEOF |
| 1638 | } |
| 1639 | m.Entries = append(m.Entries, Entry{}) |
| 1640 | if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1641 | return err |
| 1642 | } |
| 1643 | iNdEx = postIndex |
| 1644 | case 8: |
| 1645 | if wireType != 0 { |
| 1646 | return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) |
| 1647 | } |
| 1648 | m.Commit = 0 |
| 1649 | for shift := uint(0); ; shift += 7 { |
| 1650 | if shift >= 64 { |
| 1651 | return ErrIntOverflowRaft |
| 1652 | } |
| 1653 | if iNdEx >= l { |
| 1654 | return io.ErrUnexpectedEOF |
| 1655 | } |
| 1656 | b := dAtA[iNdEx] |
| 1657 | iNdEx++ |
| 1658 | m.Commit |= uint64(b&0x7F) << shift |
| 1659 | if b < 0x80 { |
| 1660 | break |
| 1661 | } |
| 1662 | } |
| 1663 | case 9: |
| 1664 | if wireType != 2 { |
| 1665 | return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) |
| 1666 | } |
| 1667 | var msglen int |
| 1668 | for shift := uint(0); ; shift += 7 { |
| 1669 | if shift >= 64 { |
| 1670 | return ErrIntOverflowRaft |
| 1671 | } |
| 1672 | if iNdEx >= l { |
| 1673 | return io.ErrUnexpectedEOF |
| 1674 | } |
| 1675 | b := dAtA[iNdEx] |
| 1676 | iNdEx++ |
| 1677 | msglen |= int(b&0x7F) << shift |
| 1678 | if b < 0x80 { |
| 1679 | break |
| 1680 | } |
| 1681 | } |
| 1682 | if msglen < 0 { |
| 1683 | return ErrInvalidLengthRaft |
| 1684 | } |
| 1685 | postIndex := iNdEx + msglen |
| 1686 | if postIndex < 0 { |
| 1687 | return ErrInvalidLengthRaft |
| 1688 | } |
| 1689 | if postIndex > l { |
| 1690 | return io.ErrUnexpectedEOF |
| 1691 | } |
| 1692 | if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1693 | return err |
| 1694 | } |
| 1695 | iNdEx = postIndex |
| 1696 | case 10: |
| 1697 | if wireType != 0 { |
| 1698 | return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType) |
| 1699 | } |
| 1700 | var v int |
| 1701 | for shift := uint(0); ; shift += 7 { |
| 1702 | if shift >= 64 { |
| 1703 | return ErrIntOverflowRaft |
| 1704 | } |
| 1705 | if iNdEx >= l { |
| 1706 | return io.ErrUnexpectedEOF |
| 1707 | } |
| 1708 | b := dAtA[iNdEx] |
| 1709 | iNdEx++ |
| 1710 | v |= int(b&0x7F) << shift |
| 1711 | if b < 0x80 { |
| 1712 | break |
| 1713 | } |
| 1714 | } |
| 1715 | m.Reject = bool(v != 0) |
| 1716 | case 11: |
| 1717 | if wireType != 0 { |
| 1718 | return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType) |
| 1719 | } |
| 1720 | m.RejectHint = 0 |
| 1721 | for shift := uint(0); ; shift += 7 { |
| 1722 | if shift >= 64 { |
| 1723 | return ErrIntOverflowRaft |
| 1724 | } |
| 1725 | if iNdEx >= l { |
| 1726 | return io.ErrUnexpectedEOF |
| 1727 | } |
| 1728 | b := dAtA[iNdEx] |
| 1729 | iNdEx++ |
| 1730 | m.RejectHint |= uint64(b&0x7F) << shift |
| 1731 | if b < 0x80 { |
| 1732 | break |
| 1733 | } |
| 1734 | } |
| 1735 | case 12: |
| 1736 | if wireType != 2 { |
| 1737 | return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) |
| 1738 | } |
| 1739 | var byteLen int |
| 1740 | for shift := uint(0); ; shift += 7 { |
| 1741 | if shift >= 64 { |
| 1742 | return ErrIntOverflowRaft |
| 1743 | } |
| 1744 | if iNdEx >= l { |
| 1745 | return io.ErrUnexpectedEOF |
| 1746 | } |
| 1747 | b := dAtA[iNdEx] |
| 1748 | iNdEx++ |
| 1749 | byteLen |= int(b&0x7F) << shift |
| 1750 | if b < 0x80 { |
| 1751 | break |
| 1752 | } |
| 1753 | } |
| 1754 | if byteLen < 0 { |
| 1755 | return ErrInvalidLengthRaft |
| 1756 | } |
| 1757 | postIndex := iNdEx + byteLen |
| 1758 | if postIndex < 0 { |
| 1759 | return ErrInvalidLengthRaft |
| 1760 | } |
| 1761 | if postIndex > l { |
| 1762 | return io.ErrUnexpectedEOF |
| 1763 | } |
| 1764 | m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) |
| 1765 | if m.Context == nil { |
| 1766 | m.Context = []byte{} |
| 1767 | } |
| 1768 | iNdEx = postIndex |
| 1769 | default: |
| 1770 | iNdEx = preIndex |
| 1771 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 1772 | if err != nil { |
| 1773 | return err |
| 1774 | } |
| 1775 | if skippy < 0 { |
| 1776 | return ErrInvalidLengthRaft |
| 1777 | } |
| 1778 | if (iNdEx + skippy) < 0 { |
| 1779 | return ErrInvalidLengthRaft |
| 1780 | } |
| 1781 | if (iNdEx + skippy) > l { |
| 1782 | return io.ErrUnexpectedEOF |
| 1783 | } |
| 1784 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1785 | iNdEx += skippy |
| 1786 | } |
| 1787 | } |
| 1788 | |
| 1789 | if iNdEx > l { |
| 1790 | return io.ErrUnexpectedEOF |
| 1791 | } |
| 1792 | return nil |
| 1793 | } |
| 1794 | func (m *HardState) Unmarshal(dAtA []byte) error { |
| 1795 | l := len(dAtA) |
| 1796 | iNdEx := 0 |
| 1797 | for iNdEx < l { |
| 1798 | preIndex := iNdEx |
| 1799 | var wire uint64 |
| 1800 | for shift := uint(0); ; shift += 7 { |
| 1801 | if shift >= 64 { |
| 1802 | return ErrIntOverflowRaft |
| 1803 | } |
| 1804 | if iNdEx >= l { |
| 1805 | return io.ErrUnexpectedEOF |
| 1806 | } |
| 1807 | b := dAtA[iNdEx] |
| 1808 | iNdEx++ |
| 1809 | wire |= uint64(b&0x7F) << shift |
| 1810 | if b < 0x80 { |
| 1811 | break |
| 1812 | } |
| 1813 | } |
| 1814 | fieldNum := int32(wire >> 3) |
| 1815 | wireType := int(wire & 0x7) |
| 1816 | if wireType == 4 { |
| 1817 | return fmt.Errorf("proto: HardState: wiretype end group for non-group") |
| 1818 | } |
| 1819 | if fieldNum <= 0 { |
| 1820 | return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1821 | } |
| 1822 | switch fieldNum { |
| 1823 | case 1: |
| 1824 | if wireType != 0 { |
| 1825 | return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) |
| 1826 | } |
| 1827 | m.Term = 0 |
| 1828 | for shift := uint(0); ; shift += 7 { |
| 1829 | if shift >= 64 { |
| 1830 | return ErrIntOverflowRaft |
| 1831 | } |
| 1832 | if iNdEx >= l { |
| 1833 | return io.ErrUnexpectedEOF |
| 1834 | } |
| 1835 | b := dAtA[iNdEx] |
| 1836 | iNdEx++ |
| 1837 | m.Term |= uint64(b&0x7F) << shift |
| 1838 | if b < 0x80 { |
| 1839 | break |
| 1840 | } |
| 1841 | } |
| 1842 | case 2: |
| 1843 | if wireType != 0 { |
| 1844 | return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) |
| 1845 | } |
| 1846 | m.Vote = 0 |
| 1847 | for shift := uint(0); ; shift += 7 { |
| 1848 | if shift >= 64 { |
| 1849 | return ErrIntOverflowRaft |
| 1850 | } |
| 1851 | if iNdEx >= l { |
| 1852 | return io.ErrUnexpectedEOF |
| 1853 | } |
| 1854 | b := dAtA[iNdEx] |
| 1855 | iNdEx++ |
| 1856 | m.Vote |= uint64(b&0x7F) << shift |
| 1857 | if b < 0x80 { |
| 1858 | break |
| 1859 | } |
| 1860 | } |
| 1861 | case 3: |
| 1862 | if wireType != 0 { |
| 1863 | return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) |
| 1864 | } |
| 1865 | m.Commit = 0 |
| 1866 | for shift := uint(0); ; shift += 7 { |
| 1867 | if shift >= 64 { |
| 1868 | return ErrIntOverflowRaft |
| 1869 | } |
| 1870 | if iNdEx >= l { |
| 1871 | return io.ErrUnexpectedEOF |
| 1872 | } |
| 1873 | b := dAtA[iNdEx] |
| 1874 | iNdEx++ |
| 1875 | m.Commit |= uint64(b&0x7F) << shift |
| 1876 | if b < 0x80 { |
| 1877 | break |
| 1878 | } |
| 1879 | } |
| 1880 | default: |
| 1881 | iNdEx = preIndex |
| 1882 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 1883 | if err != nil { |
| 1884 | return err |
| 1885 | } |
| 1886 | if skippy < 0 { |
| 1887 | return ErrInvalidLengthRaft |
| 1888 | } |
| 1889 | if (iNdEx + skippy) < 0 { |
| 1890 | return ErrInvalidLengthRaft |
| 1891 | } |
| 1892 | if (iNdEx + skippy) > l { |
| 1893 | return io.ErrUnexpectedEOF |
| 1894 | } |
| 1895 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 1896 | iNdEx += skippy |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | if iNdEx > l { |
| 1901 | return io.ErrUnexpectedEOF |
| 1902 | } |
| 1903 | return nil |
| 1904 | } |
| 1905 | func (m *ConfState) Unmarshal(dAtA []byte) error { |
| 1906 | l := len(dAtA) |
| 1907 | iNdEx := 0 |
| 1908 | for iNdEx < l { |
| 1909 | preIndex := iNdEx |
| 1910 | var wire uint64 |
| 1911 | for shift := uint(0); ; shift += 7 { |
| 1912 | if shift >= 64 { |
| 1913 | return ErrIntOverflowRaft |
| 1914 | } |
| 1915 | if iNdEx >= l { |
| 1916 | return io.ErrUnexpectedEOF |
| 1917 | } |
| 1918 | b := dAtA[iNdEx] |
| 1919 | iNdEx++ |
| 1920 | wire |= uint64(b&0x7F) << shift |
| 1921 | if b < 0x80 { |
| 1922 | break |
| 1923 | } |
| 1924 | } |
| 1925 | fieldNum := int32(wire >> 3) |
| 1926 | wireType := int(wire & 0x7) |
| 1927 | if wireType == 4 { |
| 1928 | return fmt.Errorf("proto: ConfState: wiretype end group for non-group") |
| 1929 | } |
| 1930 | if fieldNum <= 0 { |
| 1931 | return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1932 | } |
| 1933 | switch fieldNum { |
| 1934 | case 1: |
| 1935 | if wireType == 0 { |
| 1936 | var v uint64 |
| 1937 | for shift := uint(0); ; shift += 7 { |
| 1938 | if shift >= 64 { |
| 1939 | return ErrIntOverflowRaft |
| 1940 | } |
| 1941 | if iNdEx >= l { |
| 1942 | return io.ErrUnexpectedEOF |
| 1943 | } |
| 1944 | b := dAtA[iNdEx] |
| 1945 | iNdEx++ |
| 1946 | v |= uint64(b&0x7F) << shift |
| 1947 | if b < 0x80 { |
| 1948 | break |
| 1949 | } |
| 1950 | } |
| 1951 | m.Nodes = append(m.Nodes, v) |
| 1952 | } else if wireType == 2 { |
| 1953 | var packedLen int |
| 1954 | for shift := uint(0); ; shift += 7 { |
| 1955 | if shift >= 64 { |
| 1956 | return ErrIntOverflowRaft |
| 1957 | } |
| 1958 | if iNdEx >= l { |
| 1959 | return io.ErrUnexpectedEOF |
| 1960 | } |
| 1961 | b := dAtA[iNdEx] |
| 1962 | iNdEx++ |
| 1963 | packedLen |= int(b&0x7F) << shift |
| 1964 | if b < 0x80 { |
| 1965 | break |
| 1966 | } |
| 1967 | } |
| 1968 | if packedLen < 0 { |
| 1969 | return ErrInvalidLengthRaft |
| 1970 | } |
| 1971 | postIndex := iNdEx + packedLen |
| 1972 | if postIndex < 0 { |
| 1973 | return ErrInvalidLengthRaft |
| 1974 | } |
| 1975 | if postIndex > l { |
| 1976 | return io.ErrUnexpectedEOF |
| 1977 | } |
| 1978 | var elementCount int |
| 1979 | var count int |
| 1980 | for _, integer := range dAtA[iNdEx:postIndex] { |
| 1981 | if integer < 128 { |
| 1982 | count++ |
| 1983 | } |
| 1984 | } |
| 1985 | elementCount = count |
| 1986 | if elementCount != 0 && len(m.Nodes) == 0 { |
| 1987 | m.Nodes = make([]uint64, 0, elementCount) |
| 1988 | } |
| 1989 | for iNdEx < postIndex { |
| 1990 | var v uint64 |
| 1991 | for shift := uint(0); ; shift += 7 { |
| 1992 | if shift >= 64 { |
| 1993 | return ErrIntOverflowRaft |
| 1994 | } |
| 1995 | if iNdEx >= l { |
| 1996 | return io.ErrUnexpectedEOF |
| 1997 | } |
| 1998 | b := dAtA[iNdEx] |
| 1999 | iNdEx++ |
| 2000 | v |= uint64(b&0x7F) << shift |
| 2001 | if b < 0x80 { |
| 2002 | break |
| 2003 | } |
| 2004 | } |
| 2005 | m.Nodes = append(m.Nodes, v) |
| 2006 | } |
| 2007 | } else { |
| 2008 | return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) |
| 2009 | } |
| 2010 | case 2: |
| 2011 | if wireType == 0 { |
| 2012 | var v uint64 |
| 2013 | for shift := uint(0); ; shift += 7 { |
| 2014 | if shift >= 64 { |
| 2015 | return ErrIntOverflowRaft |
| 2016 | } |
| 2017 | if iNdEx >= l { |
| 2018 | return io.ErrUnexpectedEOF |
| 2019 | } |
| 2020 | b := dAtA[iNdEx] |
| 2021 | iNdEx++ |
| 2022 | v |= uint64(b&0x7F) << shift |
| 2023 | if b < 0x80 { |
| 2024 | break |
| 2025 | } |
| 2026 | } |
| 2027 | m.Learners = append(m.Learners, v) |
| 2028 | } else if wireType == 2 { |
| 2029 | var packedLen int |
| 2030 | for shift := uint(0); ; shift += 7 { |
| 2031 | if shift >= 64 { |
| 2032 | return ErrIntOverflowRaft |
| 2033 | } |
| 2034 | if iNdEx >= l { |
| 2035 | return io.ErrUnexpectedEOF |
| 2036 | } |
| 2037 | b := dAtA[iNdEx] |
| 2038 | iNdEx++ |
| 2039 | packedLen |= int(b&0x7F) << shift |
| 2040 | if b < 0x80 { |
| 2041 | break |
| 2042 | } |
| 2043 | } |
| 2044 | if packedLen < 0 { |
| 2045 | return ErrInvalidLengthRaft |
| 2046 | } |
| 2047 | postIndex := iNdEx + packedLen |
| 2048 | if postIndex < 0 { |
| 2049 | return ErrInvalidLengthRaft |
| 2050 | } |
| 2051 | if postIndex > l { |
| 2052 | return io.ErrUnexpectedEOF |
| 2053 | } |
| 2054 | var elementCount int |
| 2055 | var count int |
| 2056 | for _, integer := range dAtA[iNdEx:postIndex] { |
| 2057 | if integer < 128 { |
| 2058 | count++ |
| 2059 | } |
| 2060 | } |
| 2061 | elementCount = count |
| 2062 | if elementCount != 0 && len(m.Learners) == 0 { |
| 2063 | m.Learners = make([]uint64, 0, elementCount) |
| 2064 | } |
| 2065 | for iNdEx < postIndex { |
| 2066 | var v uint64 |
| 2067 | for shift := uint(0); ; shift += 7 { |
| 2068 | if shift >= 64 { |
| 2069 | return ErrIntOverflowRaft |
| 2070 | } |
| 2071 | if iNdEx >= l { |
| 2072 | return io.ErrUnexpectedEOF |
| 2073 | } |
| 2074 | b := dAtA[iNdEx] |
| 2075 | iNdEx++ |
| 2076 | v |= uint64(b&0x7F) << shift |
| 2077 | if b < 0x80 { |
| 2078 | break |
| 2079 | } |
| 2080 | } |
| 2081 | m.Learners = append(m.Learners, v) |
| 2082 | } |
| 2083 | } else { |
| 2084 | return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType) |
| 2085 | } |
| 2086 | default: |
| 2087 | iNdEx = preIndex |
| 2088 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 2089 | if err != nil { |
| 2090 | return err |
| 2091 | } |
| 2092 | if skippy < 0 { |
| 2093 | return ErrInvalidLengthRaft |
| 2094 | } |
| 2095 | if (iNdEx + skippy) < 0 { |
| 2096 | return ErrInvalidLengthRaft |
| 2097 | } |
| 2098 | if (iNdEx + skippy) > l { |
| 2099 | return io.ErrUnexpectedEOF |
| 2100 | } |
| 2101 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 2102 | iNdEx += skippy |
| 2103 | } |
| 2104 | } |
| 2105 | |
| 2106 | if iNdEx > l { |
| 2107 | return io.ErrUnexpectedEOF |
| 2108 | } |
| 2109 | return nil |
| 2110 | } |
| 2111 | func (m *ConfChange) Unmarshal(dAtA []byte) error { |
| 2112 | l := len(dAtA) |
| 2113 | iNdEx := 0 |
| 2114 | for iNdEx < l { |
| 2115 | preIndex := iNdEx |
| 2116 | var wire uint64 |
| 2117 | for shift := uint(0); ; shift += 7 { |
| 2118 | if shift >= 64 { |
| 2119 | return ErrIntOverflowRaft |
| 2120 | } |
| 2121 | if iNdEx >= l { |
| 2122 | return io.ErrUnexpectedEOF |
| 2123 | } |
| 2124 | b := dAtA[iNdEx] |
| 2125 | iNdEx++ |
| 2126 | wire |= uint64(b&0x7F) << shift |
| 2127 | if b < 0x80 { |
| 2128 | break |
| 2129 | } |
| 2130 | } |
| 2131 | fieldNum := int32(wire >> 3) |
| 2132 | wireType := int(wire & 0x7) |
| 2133 | if wireType == 4 { |
| 2134 | return fmt.Errorf("proto: ConfChange: wiretype end group for non-group") |
| 2135 | } |
| 2136 | if fieldNum <= 0 { |
| 2137 | return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire) |
| 2138 | } |
| 2139 | switch fieldNum { |
| 2140 | case 1: |
| 2141 | if wireType != 0 { |
| 2142 | return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) |
| 2143 | } |
| 2144 | m.ID = 0 |
| 2145 | for shift := uint(0); ; shift += 7 { |
| 2146 | if shift >= 64 { |
| 2147 | return ErrIntOverflowRaft |
| 2148 | } |
| 2149 | if iNdEx >= l { |
| 2150 | return io.ErrUnexpectedEOF |
| 2151 | } |
| 2152 | b := dAtA[iNdEx] |
| 2153 | iNdEx++ |
| 2154 | m.ID |= uint64(b&0x7F) << shift |
| 2155 | if b < 0x80 { |
| 2156 | break |
| 2157 | } |
| 2158 | } |
| 2159 | case 2: |
| 2160 | if wireType != 0 { |
| 2161 | return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) |
| 2162 | } |
| 2163 | m.Type = 0 |
| 2164 | for shift := uint(0); ; shift += 7 { |
| 2165 | if shift >= 64 { |
| 2166 | return ErrIntOverflowRaft |
| 2167 | } |
| 2168 | if iNdEx >= l { |
| 2169 | return io.ErrUnexpectedEOF |
| 2170 | } |
| 2171 | b := dAtA[iNdEx] |
| 2172 | iNdEx++ |
| 2173 | m.Type |= ConfChangeType(b&0x7F) << shift |
| 2174 | if b < 0x80 { |
| 2175 | break |
| 2176 | } |
| 2177 | } |
| 2178 | case 3: |
| 2179 | if wireType != 0 { |
| 2180 | return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) |
| 2181 | } |
| 2182 | m.NodeID = 0 |
| 2183 | for shift := uint(0); ; shift += 7 { |
| 2184 | if shift >= 64 { |
| 2185 | return ErrIntOverflowRaft |
| 2186 | } |
| 2187 | if iNdEx >= l { |
| 2188 | return io.ErrUnexpectedEOF |
| 2189 | } |
| 2190 | b := dAtA[iNdEx] |
| 2191 | iNdEx++ |
| 2192 | m.NodeID |= uint64(b&0x7F) << shift |
| 2193 | if b < 0x80 { |
| 2194 | break |
| 2195 | } |
| 2196 | } |
| 2197 | case 4: |
| 2198 | if wireType != 2 { |
| 2199 | return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) |
| 2200 | } |
| 2201 | var byteLen int |
| 2202 | for shift := uint(0); ; shift += 7 { |
| 2203 | if shift >= 64 { |
| 2204 | return ErrIntOverflowRaft |
| 2205 | } |
| 2206 | if iNdEx >= l { |
| 2207 | return io.ErrUnexpectedEOF |
| 2208 | } |
| 2209 | b := dAtA[iNdEx] |
| 2210 | iNdEx++ |
| 2211 | byteLen |= int(b&0x7F) << shift |
| 2212 | if b < 0x80 { |
| 2213 | break |
| 2214 | } |
| 2215 | } |
| 2216 | if byteLen < 0 { |
| 2217 | return ErrInvalidLengthRaft |
| 2218 | } |
| 2219 | postIndex := iNdEx + byteLen |
| 2220 | if postIndex < 0 { |
| 2221 | return ErrInvalidLengthRaft |
| 2222 | } |
| 2223 | if postIndex > l { |
| 2224 | return io.ErrUnexpectedEOF |
| 2225 | } |
| 2226 | m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...) |
| 2227 | if m.Context == nil { |
| 2228 | m.Context = []byte{} |
| 2229 | } |
| 2230 | iNdEx = postIndex |
| 2231 | default: |
| 2232 | iNdEx = preIndex |
| 2233 | skippy, err := skipRaft(dAtA[iNdEx:]) |
| 2234 | if err != nil { |
| 2235 | return err |
| 2236 | } |
| 2237 | if skippy < 0 { |
| 2238 | return ErrInvalidLengthRaft |
| 2239 | } |
| 2240 | if (iNdEx + skippy) < 0 { |
| 2241 | return ErrInvalidLengthRaft |
| 2242 | } |
| 2243 | if (iNdEx + skippy) > l { |
| 2244 | return io.ErrUnexpectedEOF |
| 2245 | } |
| 2246 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 2247 | iNdEx += skippy |
| 2248 | } |
| 2249 | } |
| 2250 | |
| 2251 | if iNdEx > l { |
| 2252 | return io.ErrUnexpectedEOF |
| 2253 | } |
| 2254 | return nil |
| 2255 | } |
| 2256 | func skipRaft(dAtA []byte) (n int, err error) { |
| 2257 | l := len(dAtA) |
| 2258 | iNdEx := 0 |
| 2259 | for iNdEx < l { |
| 2260 | var wire uint64 |
| 2261 | for shift := uint(0); ; shift += 7 { |
| 2262 | if shift >= 64 { |
| 2263 | return 0, ErrIntOverflowRaft |
| 2264 | } |
| 2265 | if iNdEx >= l { |
| 2266 | return 0, io.ErrUnexpectedEOF |
| 2267 | } |
| 2268 | b := dAtA[iNdEx] |
| 2269 | iNdEx++ |
| 2270 | wire |= (uint64(b) & 0x7F) << shift |
| 2271 | if b < 0x80 { |
| 2272 | break |
| 2273 | } |
| 2274 | } |
| 2275 | wireType := int(wire & 0x7) |
| 2276 | switch wireType { |
| 2277 | case 0: |
| 2278 | for shift := uint(0); ; shift += 7 { |
| 2279 | if shift >= 64 { |
| 2280 | return 0, ErrIntOverflowRaft |
| 2281 | } |
| 2282 | if iNdEx >= l { |
| 2283 | return 0, io.ErrUnexpectedEOF |
| 2284 | } |
| 2285 | iNdEx++ |
| 2286 | if dAtA[iNdEx-1] < 0x80 { |
| 2287 | break |
| 2288 | } |
| 2289 | } |
| 2290 | return iNdEx, nil |
| 2291 | case 1: |
| 2292 | iNdEx += 8 |
| 2293 | return iNdEx, nil |
| 2294 | case 2: |
| 2295 | var length int |
| 2296 | for shift := uint(0); ; shift += 7 { |
| 2297 | if shift >= 64 { |
| 2298 | return 0, ErrIntOverflowRaft |
| 2299 | } |
| 2300 | if iNdEx >= l { |
| 2301 | return 0, io.ErrUnexpectedEOF |
| 2302 | } |
| 2303 | b := dAtA[iNdEx] |
| 2304 | iNdEx++ |
| 2305 | length |= (int(b) & 0x7F) << shift |
| 2306 | if b < 0x80 { |
| 2307 | break |
| 2308 | } |
| 2309 | } |
| 2310 | if length < 0 { |
| 2311 | return 0, ErrInvalidLengthRaft |
| 2312 | } |
| 2313 | iNdEx += length |
| 2314 | if iNdEx < 0 { |
| 2315 | return 0, ErrInvalidLengthRaft |
| 2316 | } |
| 2317 | return iNdEx, nil |
| 2318 | case 3: |
| 2319 | for { |
| 2320 | var innerWire uint64 |
| 2321 | var start int = iNdEx |
| 2322 | for shift := uint(0); ; shift += 7 { |
| 2323 | if shift >= 64 { |
| 2324 | return 0, ErrIntOverflowRaft |
| 2325 | } |
| 2326 | if iNdEx >= l { |
| 2327 | return 0, io.ErrUnexpectedEOF |
| 2328 | } |
| 2329 | b := dAtA[iNdEx] |
| 2330 | iNdEx++ |
| 2331 | innerWire |= (uint64(b) & 0x7F) << shift |
| 2332 | if b < 0x80 { |
| 2333 | break |
| 2334 | } |
| 2335 | } |
| 2336 | innerWireType := int(innerWire & 0x7) |
| 2337 | if innerWireType == 4 { |
| 2338 | break |
| 2339 | } |
| 2340 | next, err := skipRaft(dAtA[start:]) |
| 2341 | if err != nil { |
| 2342 | return 0, err |
| 2343 | } |
| 2344 | iNdEx = start + next |
| 2345 | if iNdEx < 0 { |
| 2346 | return 0, ErrInvalidLengthRaft |
| 2347 | } |
| 2348 | } |
| 2349 | return iNdEx, nil |
| 2350 | case 4: |
| 2351 | return iNdEx, nil |
| 2352 | case 5: |
| 2353 | iNdEx += 4 |
| 2354 | return iNdEx, nil |
| 2355 | default: |
| 2356 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 2357 | } |
| 2358 | } |
| 2359 | panic("unreachable") |
| 2360 | } |
| 2361 | |
| 2362 | var ( |
| 2363 | ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") |
| 2364 | ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") |
| 2365 | ) |