|
|
@@ -254,16 +254,17 @@ func init() {
|
|
|
proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value)
|
|
|
}
|
|
|
func (m *Entry) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -277,68 +278,71 @@ func (m *Entry) Unmarshal(data []byte) error {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Type |= (EntryType(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
case 2:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Term |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000002)
|
|
|
case 3:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Index |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000004)
|
|
|
case 4:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
|
|
}
|
|
|
var byteLen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
byteLen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + byteLen
|
|
|
+ postIndex := iNdEx + byteLen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.Data = append([]byte{}, data[index:postIndex]...)
|
|
|
- index = postIndex
|
|
|
+ m.Data = append([]byte{}, data[iNdEx:postIndex]...)
|
|
|
+ iNdEx = postIndex
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -348,31 +352,42 @@ func (m *Entry) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Type")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000002) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Term")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000004) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Index")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *SnapshotMetadata) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -387,54 +402,57 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var msglen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + msglen
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- if err := m.ConfState.Unmarshal(data[index:postIndex]); err != nil {
|
|
|
+ if err := m.ConfState.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- index = postIndex
|
|
|
+ iNdEx = postIndex
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
case 2:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Index |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000002)
|
|
|
case 3:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Term |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000004)
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -444,31 +462,42 @@ func (m *SnapshotMetadata) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("conf_state")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000002) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("index")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000004) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("term")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *Snapshot) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -483,46 +512,47 @@ func (m *Snapshot) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var byteLen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
byteLen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + byteLen
|
|
|
+ postIndex := iNdEx + byteLen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.Data = append([]byte{}, data[index:postIndex]...)
|
|
|
- index = postIndex
|
|
|
+ m.Data = append([]byte{}, data[iNdEx:postIndex]...)
|
|
|
+ iNdEx = postIndex
|
|
|
case 2:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
|
|
|
}
|
|
|
var msglen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + msglen
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- if err := m.Metadata.Unmarshal(data[index:postIndex]); err != nil {
|
|
|
+ if err := m.Metadata.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- index = postIndex
|
|
|
+ iNdEx = postIndex
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -532,31 +562,36 @@ func (m *Snapshot) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("metadata")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *Message) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -570,185 +605,197 @@ func (m *Message) Unmarshal(data []byte) error {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Type |= (MessageType(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
case 2:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.To |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000002)
|
|
|
case 3:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.From |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000004)
|
|
|
case 4:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Term |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000008)
|
|
|
case 5:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.LogTerm |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000010)
|
|
|
case 6:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Index |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000020)
|
|
|
case 7:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
|
|
|
}
|
|
|
var msglen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + msglen
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
m.Entries = append(m.Entries, Entry{})
|
|
|
- m.Entries[len(m.Entries)-1].Unmarshal(data[index:postIndex])
|
|
|
- index = postIndex
|
|
|
+ if err := m.Entries[len(m.Entries)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
case 8:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Commit |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000040)
|
|
|
case 9:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
|
|
|
}
|
|
|
var msglen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + msglen
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- if err := m.Snapshot.Unmarshal(data[index:postIndex]); err != nil {
|
|
|
+ if err := m.Snapshot.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- index = postIndex
|
|
|
+ iNdEx = postIndex
|
|
|
+ hasFields[0] |= uint64(0x00000080)
|
|
|
case 10:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType)
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
v |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
m.Reject = bool(v != 0)
|
|
|
+ hasFields[0] |= uint64(0x00000100)
|
|
|
case 11:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.RejectHint |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000200)
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -758,31 +805,63 @@ func (m *Message) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000002) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("to")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000004) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("from")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000008) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("term")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000010) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("logTerm")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000020) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("index")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000040) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("commit")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000080) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("snapshot")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000100) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("reject")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000200) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("rejectHint")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *HardState) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -796,46 +875,49 @@ func (m *HardState) Unmarshal(data []byte) error {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Term |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
case 2:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Vote |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000002)
|
|
|
case 3:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Commit |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000004)
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -845,31 +927,41 @@ func (m *HardState) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("term")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000002) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("vote")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000004) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("commit")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *ConfState) Unmarshal(data []byte) error {
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -884,11 +976,11 @@ func (m *ConfState) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
v |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -904,31 +996,33 @@ func (m *ConfState) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
func (m *ConfChange) Unmarshal(data []byte) error {
|
|
|
+ var hasFields [1]uint64
|
|
|
l := len(data)
|
|
|
- index := 0
|
|
|
- for index < l {
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
@@ -942,68 +1036,71 @@ func (m *ConfChange) Unmarshal(data []byte) error {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.ID |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000001)
|
|
|
case 2:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.Type |= (ConfChangeType(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000002)
|
|
|
case 3:
|
|
|
if wireType != 0 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
|
|
|
}
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
m.NodeID |= (uint64(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ hasFields[0] |= uint64(0x00000004)
|
|
|
case 4:
|
|
|
if wireType != 2 {
|
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
|
|
|
}
|
|
|
var byteLen int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
+ if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
byteLen |= (int(b) & 0x7F) << shift
|
|
|
if b < 0x80 {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- postIndex := index + byteLen
|
|
|
+ postIndex := iNdEx + byteLen
|
|
|
if postIndex > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.Context = append([]byte{}, data[index:postIndex]...)
|
|
|
- index = postIndex
|
|
|
+ m.Context = append([]byte{}, data[iNdEx:postIndex]...)
|
|
|
+ iNdEx = postIndex
|
|
|
default:
|
|
|
var sizeOfWire int
|
|
|
for {
|
|
|
@@ -1013,20 +1110,114 @@ func (m *ConfChange) Unmarshal(data []byte) error {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:])
|
|
|
+ iNdEx -= sizeOfWire
|
|
|
+ skippy, err := skipRaft(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- if (index + skippy) > l {
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
+ m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
|
+ iNdEx += skippy
|
|
|
}
|
|
|
}
|
|
|
+ if hasFields[0]&uint64(0x00000001) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("ID")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000002) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Type")
|
|
|
+ }
|
|
|
+ if hasFields[0]&uint64(0x00000004) == 0 {
|
|
|
+ return github_com_gogo_protobuf_proto.NewRequiredNotSetError("NodeID")
|
|
|
+ }
|
|
|
+
|
|
|
return nil
|
|
|
}
|
|
|
+func skipRaft(data []byte) (n int, err error) {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if iNdEx >= l {
|
|
|
+ return 0, io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ switch wireType {
|
|
|
+ case 0:
|
|
|
+ for {
|
|
|
+ if iNdEx >= l {
|
|
|
+ return 0, io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx++
|
|
|
+ if data[iNdEx-1] < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return iNdEx, nil
|
|
|
+ case 1:
|
|
|
+ iNdEx += 8
|
|
|
+ return iNdEx, nil
|
|
|
+ case 2:
|
|
|
+ var length int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if iNdEx >= l {
|
|
|
+ return 0, io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ length |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ iNdEx += length
|
|
|
+ return iNdEx, nil
|
|
|
+ case 3:
|
|
|
+ for {
|
|
|
+ var innerWire uint64
|
|
|
+ var start int = iNdEx
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if iNdEx >= l {
|
|
|
+ return 0, io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ innerWire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ innerWireType := int(innerWire & 0x7)
|
|
|
+ if innerWireType == 4 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ next, err := skipRaft(data[start:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ iNdEx = start + next
|
|
|
+ }
|
|
|
+ return iNdEx, nil
|
|
|
+ case 4:
|
|
|
+ return iNdEx, nil
|
|
|
+ case 5:
|
|
|
+ iNdEx += 4
|
|
|
+ return iNdEx, nil
|
|
|
+ default:
|
|
|
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ panic("unreachable")
|
|
|
+}
|
|
|
func (m *Entry) Size() (n int) {
|
|
|
var l int
|
|
|
_ = l
|