github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/roachpb/internal_raft.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: roachpb/internal_raft.proto 3 4 package roachpb 5 6 import proto "github.com/gogo/protobuf/proto" 7 import fmt "fmt" 8 import math "math" 9 import hlc "github.com/cockroachdb/cockroach/pkg/util/hlc" 10 11 import io "io" 12 13 // Reference imports to suppress errors if they are not otherwise used. 14 var _ = proto.Marshal 15 var _ = fmt.Errorf 16 var _ = math.Inf 17 18 // This is a compile-time assertion to ensure that this generated file 19 // is compatible with the proto package it is being compiled against. 20 // A compilation error at this line likely means your copy of the 21 // proto package needs to be updated. 22 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 23 24 // RaftTruncatedState contains metadata about the truncated portion of the raft log. 25 // Raft requires access to the term of the last truncated log entry even after the 26 // rest of the entry has been discarded. 27 type RaftTruncatedState struct { 28 // The highest index that has been removed from the log. 29 Index uint64 `protobuf:"varint,1,opt,name=index" json:"index"` 30 // The term corresponding to 'index'. 31 Term uint64 `protobuf:"varint,2,opt,name=term" json:"term"` 32 } 33 34 func (m *RaftTruncatedState) Reset() { *m = RaftTruncatedState{} } 35 func (m *RaftTruncatedState) String() string { return proto.CompactTextString(m) } 36 func (*RaftTruncatedState) ProtoMessage() {} 37 func (*RaftTruncatedState) Descriptor() ([]byte, []int) { 38 return fileDescriptor_internal_raft_eb225e3f0789b512, []int{0} 39 } 40 func (m *RaftTruncatedState) XXX_Unmarshal(b []byte) error { 41 return m.Unmarshal(b) 42 } 43 func (m *RaftTruncatedState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 44 b = b[:cap(b)] 45 n, err := m.MarshalTo(b) 46 if err != nil { 47 return nil, err 48 } 49 return b[:n], nil 50 } 51 func (dst *RaftTruncatedState) XXX_Merge(src proto.Message) { 52 xxx_messageInfo_RaftTruncatedState.Merge(dst, src) 53 } 54 func (m *RaftTruncatedState) XXX_Size() int { 55 return m.Size() 56 } 57 func (m *RaftTruncatedState) XXX_DiscardUnknown() { 58 xxx_messageInfo_RaftTruncatedState.DiscardUnknown(m) 59 } 60 61 var xxx_messageInfo_RaftTruncatedState proto.InternalMessageInfo 62 63 // RangeTombstone contains information about a replica that has been deleted. 64 type RangeTombstone struct { 65 NextReplicaID ReplicaID `protobuf:"varint,1,opt,name=next_replica_id,json=nextReplicaId,casttype=ReplicaID" json:"next_replica_id"` 66 } 67 68 func (m *RangeTombstone) Reset() { *m = RangeTombstone{} } 69 func (m *RangeTombstone) String() string { return proto.CompactTextString(m) } 70 func (*RangeTombstone) ProtoMessage() {} 71 func (*RangeTombstone) Descriptor() ([]byte, []int) { 72 return fileDescriptor_internal_raft_eb225e3f0789b512, []int{1} 73 } 74 func (m *RangeTombstone) XXX_Unmarshal(b []byte) error { 75 return m.Unmarshal(b) 76 } 77 func (m *RangeTombstone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 78 b = b[:cap(b)] 79 n, err := m.MarshalTo(b) 80 if err != nil { 81 return nil, err 82 } 83 return b[:n], nil 84 } 85 func (dst *RangeTombstone) XXX_Merge(src proto.Message) { 86 xxx_messageInfo_RangeTombstone.Merge(dst, src) 87 } 88 func (m *RangeTombstone) XXX_Size() int { 89 return m.Size() 90 } 91 func (m *RangeTombstone) XXX_DiscardUnknown() { 92 xxx_messageInfo_RangeTombstone.DiscardUnknown(m) 93 } 94 95 var xxx_messageInfo_RangeTombstone proto.InternalMessageInfo 96 97 // RaftSnapshotData is the payload of a raftpb.Snapshot. It contains a raw copy of 98 // all of the range's data and metadata, including the raft log, abort span, etc. 99 type RaftSnapshotData struct { 100 KV []RaftSnapshotData_KeyValue `protobuf:"bytes,2,rep,name=KV" json:"KV"` 101 // These are really raftpb.Entry, but we model them as raw bytes to avoid 102 // roundtripping through memory. 103 LogEntries [][]byte `protobuf:"bytes,3,rep,name=log_entries,json=logEntries" json:"log_entries,omitempty"` 104 } 105 106 func (m *RaftSnapshotData) Reset() { *m = RaftSnapshotData{} } 107 func (m *RaftSnapshotData) String() string { return proto.CompactTextString(m) } 108 func (*RaftSnapshotData) ProtoMessage() {} 109 func (*RaftSnapshotData) Descriptor() ([]byte, []int) { 110 return fileDescriptor_internal_raft_eb225e3f0789b512, []int{2} 111 } 112 func (m *RaftSnapshotData) XXX_Unmarshal(b []byte) error { 113 return m.Unmarshal(b) 114 } 115 func (m *RaftSnapshotData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 116 b = b[:cap(b)] 117 n, err := m.MarshalTo(b) 118 if err != nil { 119 return nil, err 120 } 121 return b[:n], nil 122 } 123 func (dst *RaftSnapshotData) XXX_Merge(src proto.Message) { 124 xxx_messageInfo_RaftSnapshotData.Merge(dst, src) 125 } 126 func (m *RaftSnapshotData) XXX_Size() int { 127 return m.Size() 128 } 129 func (m *RaftSnapshotData) XXX_DiscardUnknown() { 130 xxx_messageInfo_RaftSnapshotData.DiscardUnknown(m) 131 } 132 133 var xxx_messageInfo_RaftSnapshotData proto.InternalMessageInfo 134 135 type RaftSnapshotData_KeyValue struct { 136 Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` 137 Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` 138 Timestamp hlc.Timestamp `protobuf:"bytes,3,opt,name=timestamp" json:"timestamp"` 139 } 140 141 func (m *RaftSnapshotData_KeyValue) Reset() { *m = RaftSnapshotData_KeyValue{} } 142 func (m *RaftSnapshotData_KeyValue) String() string { return proto.CompactTextString(m) } 143 func (*RaftSnapshotData_KeyValue) ProtoMessage() {} 144 func (*RaftSnapshotData_KeyValue) Descriptor() ([]byte, []int) { 145 return fileDescriptor_internal_raft_eb225e3f0789b512, []int{2, 0} 146 } 147 func (m *RaftSnapshotData_KeyValue) XXX_Unmarshal(b []byte) error { 148 return m.Unmarshal(b) 149 } 150 func (m *RaftSnapshotData_KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 151 b = b[:cap(b)] 152 n, err := m.MarshalTo(b) 153 if err != nil { 154 return nil, err 155 } 156 return b[:n], nil 157 } 158 func (dst *RaftSnapshotData_KeyValue) XXX_Merge(src proto.Message) { 159 xxx_messageInfo_RaftSnapshotData_KeyValue.Merge(dst, src) 160 } 161 func (m *RaftSnapshotData_KeyValue) XXX_Size() int { 162 return m.Size() 163 } 164 func (m *RaftSnapshotData_KeyValue) XXX_DiscardUnknown() { 165 xxx_messageInfo_RaftSnapshotData_KeyValue.DiscardUnknown(m) 166 } 167 168 var xxx_messageInfo_RaftSnapshotData_KeyValue proto.InternalMessageInfo 169 170 func init() { 171 proto.RegisterType((*RaftTruncatedState)(nil), "cockroach.roachpb.RaftTruncatedState") 172 proto.RegisterType((*RangeTombstone)(nil), "cockroach.roachpb.RangeTombstone") 173 proto.RegisterType((*RaftSnapshotData)(nil), "cockroach.roachpb.RaftSnapshotData") 174 proto.RegisterType((*RaftSnapshotData_KeyValue)(nil), "cockroach.roachpb.RaftSnapshotData.KeyValue") 175 } 176 func (this *RaftTruncatedState) Equal(that interface{}) bool { 177 if that == nil { 178 return this == nil 179 } 180 181 that1, ok := that.(*RaftTruncatedState) 182 if !ok { 183 that2, ok := that.(RaftTruncatedState) 184 if ok { 185 that1 = &that2 186 } else { 187 return false 188 } 189 } 190 if that1 == nil { 191 return this == nil 192 } else if this == nil { 193 return false 194 } 195 if this.Index != that1.Index { 196 return false 197 } 198 if this.Term != that1.Term { 199 return false 200 } 201 return true 202 } 203 func (m *RaftTruncatedState) Marshal() (dAtA []byte, err error) { 204 size := m.Size() 205 dAtA = make([]byte, size) 206 n, err := m.MarshalTo(dAtA) 207 if err != nil { 208 return nil, err 209 } 210 return dAtA[:n], nil 211 } 212 213 func (m *RaftTruncatedState) MarshalTo(dAtA []byte) (int, error) { 214 var i int 215 _ = i 216 var l int 217 _ = l 218 dAtA[i] = 0x8 219 i++ 220 i = encodeVarintInternalRaft(dAtA, i, uint64(m.Index)) 221 dAtA[i] = 0x10 222 i++ 223 i = encodeVarintInternalRaft(dAtA, i, uint64(m.Term)) 224 return i, nil 225 } 226 227 func (m *RangeTombstone) Marshal() (dAtA []byte, err error) { 228 size := m.Size() 229 dAtA = make([]byte, size) 230 n, err := m.MarshalTo(dAtA) 231 if err != nil { 232 return nil, err 233 } 234 return dAtA[:n], nil 235 } 236 237 func (m *RangeTombstone) MarshalTo(dAtA []byte) (int, error) { 238 var i int 239 _ = i 240 var l int 241 _ = l 242 dAtA[i] = 0x8 243 i++ 244 i = encodeVarintInternalRaft(dAtA, i, uint64(m.NextReplicaID)) 245 return i, nil 246 } 247 248 func (m *RaftSnapshotData) Marshal() (dAtA []byte, err error) { 249 size := m.Size() 250 dAtA = make([]byte, size) 251 n, err := m.MarshalTo(dAtA) 252 if err != nil { 253 return nil, err 254 } 255 return dAtA[:n], nil 256 } 257 258 func (m *RaftSnapshotData) MarshalTo(dAtA []byte) (int, error) { 259 var i int 260 _ = i 261 var l int 262 _ = l 263 if len(m.KV) > 0 { 264 for _, msg := range m.KV { 265 dAtA[i] = 0x12 266 i++ 267 i = encodeVarintInternalRaft(dAtA, i, uint64(msg.Size())) 268 n, err := msg.MarshalTo(dAtA[i:]) 269 if err != nil { 270 return 0, err 271 } 272 i += n 273 } 274 } 275 if len(m.LogEntries) > 0 { 276 for _, b := range m.LogEntries { 277 dAtA[i] = 0x1a 278 i++ 279 i = encodeVarintInternalRaft(dAtA, i, uint64(len(b))) 280 i += copy(dAtA[i:], b) 281 } 282 } 283 return i, nil 284 } 285 286 func (m *RaftSnapshotData_KeyValue) Marshal() (dAtA []byte, err error) { 287 size := m.Size() 288 dAtA = make([]byte, size) 289 n, err := m.MarshalTo(dAtA) 290 if err != nil { 291 return nil, err 292 } 293 return dAtA[:n], nil 294 } 295 296 func (m *RaftSnapshotData_KeyValue) MarshalTo(dAtA []byte) (int, error) { 297 var i int 298 _ = i 299 var l int 300 _ = l 301 if m.Key != nil { 302 dAtA[i] = 0xa 303 i++ 304 i = encodeVarintInternalRaft(dAtA, i, uint64(len(m.Key))) 305 i += copy(dAtA[i:], m.Key) 306 } 307 if m.Value != nil { 308 dAtA[i] = 0x12 309 i++ 310 i = encodeVarintInternalRaft(dAtA, i, uint64(len(m.Value))) 311 i += copy(dAtA[i:], m.Value) 312 } 313 dAtA[i] = 0x1a 314 i++ 315 i = encodeVarintInternalRaft(dAtA, i, uint64(m.Timestamp.Size())) 316 n1, err := m.Timestamp.MarshalTo(dAtA[i:]) 317 if err != nil { 318 return 0, err 319 } 320 i += n1 321 return i, nil 322 } 323 324 func encodeVarintInternalRaft(dAtA []byte, offset int, v uint64) int { 325 for v >= 1<<7 { 326 dAtA[offset] = uint8(v&0x7f | 0x80) 327 v >>= 7 328 offset++ 329 } 330 dAtA[offset] = uint8(v) 331 return offset + 1 332 } 333 func NewPopulatedRaftTruncatedState(r randyInternalRaft, easy bool) *RaftTruncatedState { 334 this := &RaftTruncatedState{} 335 this.Index = uint64(uint64(r.Uint32())) 336 this.Term = uint64(uint64(r.Uint32())) 337 if !easy && r.Intn(10) != 0 { 338 } 339 return this 340 } 341 342 type randyInternalRaft interface { 343 Float32() float32 344 Float64() float64 345 Int63() int64 346 Int31() int32 347 Uint32() uint32 348 Intn(n int) int 349 } 350 351 func randUTF8RuneInternalRaft(r randyInternalRaft) rune { 352 ru := r.Intn(62) 353 if ru < 10 { 354 return rune(ru + 48) 355 } else if ru < 36 { 356 return rune(ru + 55) 357 } 358 return rune(ru + 61) 359 } 360 func randStringInternalRaft(r randyInternalRaft) string { 361 v1 := r.Intn(100) 362 tmps := make([]rune, v1) 363 for i := 0; i < v1; i++ { 364 tmps[i] = randUTF8RuneInternalRaft(r) 365 } 366 return string(tmps) 367 } 368 func randUnrecognizedInternalRaft(r randyInternalRaft, maxFieldNumber int) (dAtA []byte) { 369 l := r.Intn(5) 370 for i := 0; i < l; i++ { 371 wire := r.Intn(4) 372 if wire == 3 { 373 wire = 5 374 } 375 fieldNumber := maxFieldNumber + r.Intn(100) 376 dAtA = randFieldInternalRaft(dAtA, r, fieldNumber, wire) 377 } 378 return dAtA 379 } 380 func randFieldInternalRaft(dAtA []byte, r randyInternalRaft, fieldNumber int, wire int) []byte { 381 key := uint32(fieldNumber)<<3 | uint32(wire) 382 switch wire { 383 case 0: 384 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(key)) 385 v2 := r.Int63() 386 if r.Intn(2) == 0 { 387 v2 *= -1 388 } 389 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(v2)) 390 case 1: 391 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(key)) 392 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 393 case 2: 394 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(key)) 395 ll := r.Intn(100) 396 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(ll)) 397 for j := 0; j < ll; j++ { 398 dAtA = append(dAtA, byte(r.Intn(256))) 399 } 400 default: 401 dAtA = encodeVarintPopulateInternalRaft(dAtA, uint64(key)) 402 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 403 } 404 return dAtA 405 } 406 func encodeVarintPopulateInternalRaft(dAtA []byte, v uint64) []byte { 407 for v >= 1<<7 { 408 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 409 v >>= 7 410 } 411 dAtA = append(dAtA, uint8(v)) 412 return dAtA 413 } 414 func (m *RaftTruncatedState) Size() (n int) { 415 if m == nil { 416 return 0 417 } 418 var l int 419 _ = l 420 n += 1 + sovInternalRaft(uint64(m.Index)) 421 n += 1 + sovInternalRaft(uint64(m.Term)) 422 return n 423 } 424 425 func (m *RangeTombstone) Size() (n int) { 426 if m == nil { 427 return 0 428 } 429 var l int 430 _ = l 431 n += 1 + sovInternalRaft(uint64(m.NextReplicaID)) 432 return n 433 } 434 435 func (m *RaftSnapshotData) Size() (n int) { 436 if m == nil { 437 return 0 438 } 439 var l int 440 _ = l 441 if len(m.KV) > 0 { 442 for _, e := range m.KV { 443 l = e.Size() 444 n += 1 + l + sovInternalRaft(uint64(l)) 445 } 446 } 447 if len(m.LogEntries) > 0 { 448 for _, b := range m.LogEntries { 449 l = len(b) 450 n += 1 + l + sovInternalRaft(uint64(l)) 451 } 452 } 453 return n 454 } 455 456 func (m *RaftSnapshotData_KeyValue) Size() (n int) { 457 if m == nil { 458 return 0 459 } 460 var l int 461 _ = l 462 if m.Key != nil { 463 l = len(m.Key) 464 n += 1 + l + sovInternalRaft(uint64(l)) 465 } 466 if m.Value != nil { 467 l = len(m.Value) 468 n += 1 + l + sovInternalRaft(uint64(l)) 469 } 470 l = m.Timestamp.Size() 471 n += 1 + l + sovInternalRaft(uint64(l)) 472 return n 473 } 474 475 func sovInternalRaft(x uint64) (n int) { 476 for { 477 n++ 478 x >>= 7 479 if x == 0 { 480 break 481 } 482 } 483 return n 484 } 485 func sozInternalRaft(x uint64) (n int) { 486 return sovInternalRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 487 } 488 func (m *RaftTruncatedState) Unmarshal(dAtA []byte) error { 489 l := len(dAtA) 490 iNdEx := 0 491 for iNdEx < l { 492 preIndex := iNdEx 493 var wire uint64 494 for shift := uint(0); ; shift += 7 { 495 if shift >= 64 { 496 return ErrIntOverflowInternalRaft 497 } 498 if iNdEx >= l { 499 return io.ErrUnexpectedEOF 500 } 501 b := dAtA[iNdEx] 502 iNdEx++ 503 wire |= (uint64(b) & 0x7F) << shift 504 if b < 0x80 { 505 break 506 } 507 } 508 fieldNum := int32(wire >> 3) 509 wireType := int(wire & 0x7) 510 if wireType == 4 { 511 return fmt.Errorf("proto: RaftTruncatedState: wiretype end group for non-group") 512 } 513 if fieldNum <= 0 { 514 return fmt.Errorf("proto: RaftTruncatedState: illegal tag %d (wire type %d)", fieldNum, wire) 515 } 516 switch fieldNum { 517 case 1: 518 if wireType != 0 { 519 return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) 520 } 521 m.Index = 0 522 for shift := uint(0); ; shift += 7 { 523 if shift >= 64 { 524 return ErrIntOverflowInternalRaft 525 } 526 if iNdEx >= l { 527 return io.ErrUnexpectedEOF 528 } 529 b := dAtA[iNdEx] 530 iNdEx++ 531 m.Index |= (uint64(b) & 0x7F) << shift 532 if b < 0x80 { 533 break 534 } 535 } 536 case 2: 537 if wireType != 0 { 538 return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType) 539 } 540 m.Term = 0 541 for shift := uint(0); ; shift += 7 { 542 if shift >= 64 { 543 return ErrIntOverflowInternalRaft 544 } 545 if iNdEx >= l { 546 return io.ErrUnexpectedEOF 547 } 548 b := dAtA[iNdEx] 549 iNdEx++ 550 m.Term |= (uint64(b) & 0x7F) << shift 551 if b < 0x80 { 552 break 553 } 554 } 555 default: 556 iNdEx = preIndex 557 skippy, err := skipInternalRaft(dAtA[iNdEx:]) 558 if err != nil { 559 return err 560 } 561 if skippy < 0 { 562 return ErrInvalidLengthInternalRaft 563 } 564 if (iNdEx + skippy) > l { 565 return io.ErrUnexpectedEOF 566 } 567 iNdEx += skippy 568 } 569 } 570 571 if iNdEx > l { 572 return io.ErrUnexpectedEOF 573 } 574 return nil 575 } 576 func (m *RangeTombstone) Unmarshal(dAtA []byte) error { 577 l := len(dAtA) 578 iNdEx := 0 579 for iNdEx < l { 580 preIndex := iNdEx 581 var wire uint64 582 for shift := uint(0); ; shift += 7 { 583 if shift >= 64 { 584 return ErrIntOverflowInternalRaft 585 } 586 if iNdEx >= l { 587 return io.ErrUnexpectedEOF 588 } 589 b := dAtA[iNdEx] 590 iNdEx++ 591 wire |= (uint64(b) & 0x7F) << shift 592 if b < 0x80 { 593 break 594 } 595 } 596 fieldNum := int32(wire >> 3) 597 wireType := int(wire & 0x7) 598 if wireType == 4 { 599 return fmt.Errorf("proto: RangeTombstone: wiretype end group for non-group") 600 } 601 if fieldNum <= 0 { 602 return fmt.Errorf("proto: RangeTombstone: illegal tag %d (wire type %d)", fieldNum, wire) 603 } 604 switch fieldNum { 605 case 1: 606 if wireType != 0 { 607 return fmt.Errorf("proto: wrong wireType = %d for field NextReplicaID", wireType) 608 } 609 m.NextReplicaID = 0 610 for shift := uint(0); ; shift += 7 { 611 if shift >= 64 { 612 return ErrIntOverflowInternalRaft 613 } 614 if iNdEx >= l { 615 return io.ErrUnexpectedEOF 616 } 617 b := dAtA[iNdEx] 618 iNdEx++ 619 m.NextReplicaID |= (ReplicaID(b) & 0x7F) << shift 620 if b < 0x80 { 621 break 622 } 623 } 624 default: 625 iNdEx = preIndex 626 skippy, err := skipInternalRaft(dAtA[iNdEx:]) 627 if err != nil { 628 return err 629 } 630 if skippy < 0 { 631 return ErrInvalidLengthInternalRaft 632 } 633 if (iNdEx + skippy) > l { 634 return io.ErrUnexpectedEOF 635 } 636 iNdEx += skippy 637 } 638 } 639 640 if iNdEx > l { 641 return io.ErrUnexpectedEOF 642 } 643 return nil 644 } 645 func (m *RaftSnapshotData) Unmarshal(dAtA []byte) error { 646 l := len(dAtA) 647 iNdEx := 0 648 for iNdEx < l { 649 preIndex := iNdEx 650 var wire uint64 651 for shift := uint(0); ; shift += 7 { 652 if shift >= 64 { 653 return ErrIntOverflowInternalRaft 654 } 655 if iNdEx >= l { 656 return io.ErrUnexpectedEOF 657 } 658 b := dAtA[iNdEx] 659 iNdEx++ 660 wire |= (uint64(b) & 0x7F) << shift 661 if b < 0x80 { 662 break 663 } 664 } 665 fieldNum := int32(wire >> 3) 666 wireType := int(wire & 0x7) 667 if wireType == 4 { 668 return fmt.Errorf("proto: RaftSnapshotData: wiretype end group for non-group") 669 } 670 if fieldNum <= 0 { 671 return fmt.Errorf("proto: RaftSnapshotData: illegal tag %d (wire type %d)", fieldNum, wire) 672 } 673 switch fieldNum { 674 case 2: 675 if wireType != 2 { 676 return fmt.Errorf("proto: wrong wireType = %d for field KV", wireType) 677 } 678 var msglen int 679 for shift := uint(0); ; shift += 7 { 680 if shift >= 64 { 681 return ErrIntOverflowInternalRaft 682 } 683 if iNdEx >= l { 684 return io.ErrUnexpectedEOF 685 } 686 b := dAtA[iNdEx] 687 iNdEx++ 688 msglen |= (int(b) & 0x7F) << shift 689 if b < 0x80 { 690 break 691 } 692 } 693 if msglen < 0 { 694 return ErrInvalidLengthInternalRaft 695 } 696 postIndex := iNdEx + msglen 697 if postIndex > l { 698 return io.ErrUnexpectedEOF 699 } 700 m.KV = append(m.KV, RaftSnapshotData_KeyValue{}) 701 if err := m.KV[len(m.KV)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 702 return err 703 } 704 iNdEx = postIndex 705 case 3: 706 if wireType != 2 { 707 return fmt.Errorf("proto: wrong wireType = %d for field LogEntries", wireType) 708 } 709 var byteLen int 710 for shift := uint(0); ; shift += 7 { 711 if shift >= 64 { 712 return ErrIntOverflowInternalRaft 713 } 714 if iNdEx >= l { 715 return io.ErrUnexpectedEOF 716 } 717 b := dAtA[iNdEx] 718 iNdEx++ 719 byteLen |= (int(b) & 0x7F) << shift 720 if b < 0x80 { 721 break 722 } 723 } 724 if byteLen < 0 { 725 return ErrInvalidLengthInternalRaft 726 } 727 postIndex := iNdEx + byteLen 728 if postIndex > l { 729 return io.ErrUnexpectedEOF 730 } 731 m.LogEntries = append(m.LogEntries, make([]byte, postIndex-iNdEx)) 732 copy(m.LogEntries[len(m.LogEntries)-1], dAtA[iNdEx:postIndex]) 733 iNdEx = postIndex 734 default: 735 iNdEx = preIndex 736 skippy, err := skipInternalRaft(dAtA[iNdEx:]) 737 if err != nil { 738 return err 739 } 740 if skippy < 0 { 741 return ErrInvalidLengthInternalRaft 742 } 743 if (iNdEx + skippy) > l { 744 return io.ErrUnexpectedEOF 745 } 746 iNdEx += skippy 747 } 748 } 749 750 if iNdEx > l { 751 return io.ErrUnexpectedEOF 752 } 753 return nil 754 } 755 func (m *RaftSnapshotData_KeyValue) Unmarshal(dAtA []byte) error { 756 l := len(dAtA) 757 iNdEx := 0 758 for iNdEx < l { 759 preIndex := iNdEx 760 var wire uint64 761 for shift := uint(0); ; shift += 7 { 762 if shift >= 64 { 763 return ErrIntOverflowInternalRaft 764 } 765 if iNdEx >= l { 766 return io.ErrUnexpectedEOF 767 } 768 b := dAtA[iNdEx] 769 iNdEx++ 770 wire |= (uint64(b) & 0x7F) << shift 771 if b < 0x80 { 772 break 773 } 774 } 775 fieldNum := int32(wire >> 3) 776 wireType := int(wire & 0x7) 777 if wireType == 4 { 778 return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") 779 } 780 if fieldNum <= 0 { 781 return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) 782 } 783 switch fieldNum { 784 case 1: 785 if wireType != 2 { 786 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 787 } 788 var byteLen int 789 for shift := uint(0); ; shift += 7 { 790 if shift >= 64 { 791 return ErrIntOverflowInternalRaft 792 } 793 if iNdEx >= l { 794 return io.ErrUnexpectedEOF 795 } 796 b := dAtA[iNdEx] 797 iNdEx++ 798 byteLen |= (int(b) & 0x7F) << shift 799 if b < 0x80 { 800 break 801 } 802 } 803 if byteLen < 0 { 804 return ErrInvalidLengthInternalRaft 805 } 806 postIndex := iNdEx + byteLen 807 if postIndex > l { 808 return io.ErrUnexpectedEOF 809 } 810 m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) 811 if m.Key == nil { 812 m.Key = []byte{} 813 } 814 iNdEx = postIndex 815 case 2: 816 if wireType != 2 { 817 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 818 } 819 var byteLen int 820 for shift := uint(0); ; shift += 7 { 821 if shift >= 64 { 822 return ErrIntOverflowInternalRaft 823 } 824 if iNdEx >= l { 825 return io.ErrUnexpectedEOF 826 } 827 b := dAtA[iNdEx] 828 iNdEx++ 829 byteLen |= (int(b) & 0x7F) << shift 830 if b < 0x80 { 831 break 832 } 833 } 834 if byteLen < 0 { 835 return ErrInvalidLengthInternalRaft 836 } 837 postIndex := iNdEx + byteLen 838 if postIndex > l { 839 return io.ErrUnexpectedEOF 840 } 841 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 842 if m.Value == nil { 843 m.Value = []byte{} 844 } 845 iNdEx = postIndex 846 case 3: 847 if wireType != 2 { 848 return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) 849 } 850 var msglen int 851 for shift := uint(0); ; shift += 7 { 852 if shift >= 64 { 853 return ErrIntOverflowInternalRaft 854 } 855 if iNdEx >= l { 856 return io.ErrUnexpectedEOF 857 } 858 b := dAtA[iNdEx] 859 iNdEx++ 860 msglen |= (int(b) & 0x7F) << shift 861 if b < 0x80 { 862 break 863 } 864 } 865 if msglen < 0 { 866 return ErrInvalidLengthInternalRaft 867 } 868 postIndex := iNdEx + msglen 869 if postIndex > l { 870 return io.ErrUnexpectedEOF 871 } 872 if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 873 return err 874 } 875 iNdEx = postIndex 876 default: 877 iNdEx = preIndex 878 skippy, err := skipInternalRaft(dAtA[iNdEx:]) 879 if err != nil { 880 return err 881 } 882 if skippy < 0 { 883 return ErrInvalidLengthInternalRaft 884 } 885 if (iNdEx + skippy) > l { 886 return io.ErrUnexpectedEOF 887 } 888 iNdEx += skippy 889 } 890 } 891 892 if iNdEx > l { 893 return io.ErrUnexpectedEOF 894 } 895 return nil 896 } 897 func skipInternalRaft(dAtA []byte) (n int, err error) { 898 l := len(dAtA) 899 iNdEx := 0 900 for iNdEx < l { 901 var wire uint64 902 for shift := uint(0); ; shift += 7 { 903 if shift >= 64 { 904 return 0, ErrIntOverflowInternalRaft 905 } 906 if iNdEx >= l { 907 return 0, io.ErrUnexpectedEOF 908 } 909 b := dAtA[iNdEx] 910 iNdEx++ 911 wire |= (uint64(b) & 0x7F) << shift 912 if b < 0x80 { 913 break 914 } 915 } 916 wireType := int(wire & 0x7) 917 switch wireType { 918 case 0: 919 for shift := uint(0); ; shift += 7 { 920 if shift >= 64 { 921 return 0, ErrIntOverflowInternalRaft 922 } 923 if iNdEx >= l { 924 return 0, io.ErrUnexpectedEOF 925 } 926 iNdEx++ 927 if dAtA[iNdEx-1] < 0x80 { 928 break 929 } 930 } 931 return iNdEx, nil 932 case 1: 933 iNdEx += 8 934 return iNdEx, nil 935 case 2: 936 var length int 937 for shift := uint(0); ; shift += 7 { 938 if shift >= 64 { 939 return 0, ErrIntOverflowInternalRaft 940 } 941 if iNdEx >= l { 942 return 0, io.ErrUnexpectedEOF 943 } 944 b := dAtA[iNdEx] 945 iNdEx++ 946 length |= (int(b) & 0x7F) << shift 947 if b < 0x80 { 948 break 949 } 950 } 951 iNdEx += length 952 if length < 0 { 953 return 0, ErrInvalidLengthInternalRaft 954 } 955 return iNdEx, nil 956 case 3: 957 for { 958 var innerWire uint64 959 var start int = iNdEx 960 for shift := uint(0); ; shift += 7 { 961 if shift >= 64 { 962 return 0, ErrIntOverflowInternalRaft 963 } 964 if iNdEx >= l { 965 return 0, io.ErrUnexpectedEOF 966 } 967 b := dAtA[iNdEx] 968 iNdEx++ 969 innerWire |= (uint64(b) & 0x7F) << shift 970 if b < 0x80 { 971 break 972 } 973 } 974 innerWireType := int(innerWire & 0x7) 975 if innerWireType == 4 { 976 break 977 } 978 next, err := skipInternalRaft(dAtA[start:]) 979 if err != nil { 980 return 0, err 981 } 982 iNdEx = start + next 983 } 984 return iNdEx, nil 985 case 4: 986 return iNdEx, nil 987 case 5: 988 iNdEx += 4 989 return iNdEx, nil 990 default: 991 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 992 } 993 } 994 panic("unreachable") 995 } 996 997 var ( 998 ErrInvalidLengthInternalRaft = fmt.Errorf("proto: negative length found during unmarshaling") 999 ErrIntOverflowInternalRaft = fmt.Errorf("proto: integer overflow") 1000 ) 1001 1002 func init() { 1003 proto.RegisterFile("roachpb/internal_raft.proto", fileDescriptor_internal_raft_eb225e3f0789b512) 1004 } 1005 1006 var fileDescriptor_internal_raft_eb225e3f0789b512 = []byte{ 1007 // 422 bytes of a gzipped FileDescriptorProto 1008 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x51, 0xcd, 0x6a, 0xdb, 0x40, 1009 0x10, 0xd6, 0x4a, 0x36, 0x75, 0xd6, 0x4e, 0xeb, 0x2e, 0x39, 0x08, 0x97, 0xae, 0x8c, 0x4f, 0x2e, 1010 0x14, 0x19, 0x72, 0xec, 0xad, 0x26, 0x85, 0x36, 0x86, 0x1e, 0x36, 0xc6, 0x87, 0x52, 0x30, 0x1b, 1011 0x79, 0x22, 0x8b, 0xac, 0x77, 0xc5, 0x7a, 0x54, 0x9c, 0xb7, 0xe8, 0x23, 0xe4, 0x31, 0xfa, 0x08, 1012 0x3e, 0xe6, 0x98, 0x93, 0x69, 0xe5, 0x4b, 0x9f, 0x21, 0xa7, 0xa2, 0x9f, 0xa4, 0xa6, 0xbd, 0xcd, 1013 0x7c, 0xdf, 0x37, 0xc3, 0x37, 0xdf, 0xd0, 0x57, 0xd6, 0xc8, 0x68, 0x99, 0x5e, 0x8e, 0x12, 0x8d, 1014 0x60, 0xb5, 0x54, 0x73, 0x2b, 0xaf, 0x30, 0x4c, 0xad, 0x41, 0xc3, 0x5e, 0x46, 0x26, 0xba, 0x2e, 1015 0x05, 0x61, 0x2d, 0xeb, 0xf9, 0x19, 0x26, 0x6a, 0xb4, 0x54, 0xd1, 0x08, 0x93, 0x15, 0xac, 0x51, 1016 0xae, 0xd2, 0x4a, 0xdc, 0x3b, 0x89, 0x4d, 0x6c, 0xca, 0x72, 0x54, 0x54, 0x15, 0x3a, 0x98, 0x52, 1017 0x26, 0xe4, 0x15, 0x4e, 0x6d, 0xa6, 0x23, 0x89, 0xb0, 0xb8, 0x40, 0x89, 0xc0, 0x7a, 0xb4, 0x99, 1018 0xe8, 0x05, 0x6c, 0x7c, 0xd2, 0x27, 0xc3, 0xc6, 0xb8, 0xb1, 0xdd, 0x05, 0x8e, 0xa8, 0x20, 0xe6, 1019 0xd3, 0x06, 0x82, 0x5d, 0xf9, 0xee, 0x01, 0x55, 0x22, 0xef, 0x5a, 0x3f, 0x6e, 0x03, 0xf2, 0xfb, 1020 0x36, 0x20, 0x83, 0xaf, 0xf4, 0xb9, 0x90, 0x3a, 0x86, 0xa9, 0x59, 0x5d, 0xae, 0xd1, 0x68, 0x60, 1021 0xe7, 0xf4, 0x85, 0x86, 0x0d, 0xce, 0x2d, 0xa4, 0x2a, 0x89, 0xe4, 0x3c, 0x59, 0x94, 0xbb, 0x9b, 1022 0xe3, 0x41, 0xb1, 0x20, 0xdf, 0x05, 0xc7, 0x9f, 0x61, 0x83, 0xa2, 0x62, 0x3f, 0x9d, 0x3d, 0xec, 1023 0x82, 0xa3, 0xa7, 0x46, 0x1c, 0xeb, 0x03, 0x6e, 0x31, 0x78, 0x20, 0xb4, 0x5b, 0x98, 0xbe, 0xd0, 1024 0x32, 0x5d, 0x2f, 0x0d, 0x9e, 0x49, 0x94, 0xec, 0x23, 0x75, 0x27, 0x33, 0xdf, 0xed, 0x7b, 0xc3, 1025 0xf6, 0xe9, 0xdb, 0xf0, 0xbf, 0x60, 0xc2, 0x7f, 0x07, 0xc2, 0x09, 0xdc, 0xcc, 0xa4, 0xca, 0x60, 1026 0x4c, 0x6b, 0x07, 0xee, 0x64, 0x26, 0xdc, 0xc9, 0x8c, 0x05, 0xb4, 0xad, 0x4c, 0x3c, 0x07, 0x8d, 1027 0x36, 0x81, 0xb5, 0xef, 0xf5, 0xbd, 0x61, 0x47, 0x50, 0x65, 0xe2, 0x0f, 0x15, 0xd2, 0xcb, 0x68, 1028 0xeb, 0x71, 0x98, 0x75, 0xa9, 0x77, 0x0d, 0x37, 0xe5, 0x2d, 0x1d, 0x51, 0x94, 0xec, 0x84, 0x36, 1029 0xbf, 0x15, 0x54, 0x19, 0x50, 0x47, 0x54, 0x0d, 0x7b, 0x4f, 0x8f, 0x9e, 0x1e, 0xe2, 0x7b, 0x7d, 1030 0x32, 0x6c, 0x9f, 0xbe, 0x3e, 0x70, 0x59, 0x7c, 0x2d, 0x5c, 0xaa, 0x28, 0x9c, 0x3e, 0x8a, 0xea, 1031 0x64, 0xff, 0x4e, 0x9d, 0x37, 0x5a, 0xa4, 0xeb, 0x8e, 0xdf, 0x6c, 0x7f, 0x71, 0x67, 0x9b, 0x73, 1032 0x72, 0x97, 0x73, 0x72, 0x9f, 0x73, 0xf2, 0x33, 0xe7, 0xe4, 0xfb, 0x9e, 0x3b, 0x77, 0x7b, 0xee, 1033 0xdc, 0xef, 0xb9, 0xf3, 0xe5, 0x59, 0x7d, 0xf2, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xde, 1034 0x36, 0x90, 0x3c, 0x02, 0x00, 0x00, 1035 }