diff --git a/pb/pb.pb.go b/pb/pb.pb.go index 5c9e6cdc5..8542709e8 100644 --- a/pb/pb.pb.go +++ b/pb/pb.pb.go @@ -20,7 +20,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type EncryptionAlgo int32 @@ -103,7 +103,7 @@ type KV struct { Meta []byte `protobuf:"bytes,6,opt,name=meta,proto3" json:"meta,omitempty"` // Stream id is used to identify which stream the KV came from. StreamId uint32 `protobuf:"varint,10,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - // Stream done is to indicate end of stream. + // Stream done is used to indicate end of stream. StreamDone bool `protobuf:"varint,11,opt,name=stream_done,json=streamDone,proto3" json:"stream_done,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -124,7 +124,7 @@ func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KV.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -220,7 +220,7 @@ func (m *KVList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KVList.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -268,7 +268,7 @@ func (m *ManifestChangeSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ManifestChangeSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -320,7 +320,7 @@ func (m *ManifestChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ManifestChange.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -404,7 +404,7 @@ func (m *BlockOffset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_BlockOffset.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -466,7 +466,7 @@ func (m *TableIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TableIndex.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -521,7 +521,7 @@ func (m *Checksum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Checksum.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -578,7 +578,7 @@ func (m *DataKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DataKey.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -688,7 +688,7 @@ var fileDescriptor_f80abaa17e25ccc8 = []byte{ func (m *KV) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -696,69 +696,79 @@ func (m *KV) Marshal() (dAtA []byte, err error) { } func (m *KV) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + if m.StreamDone { + i-- + if m.StreamDone { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 } - if len(m.UserMeta) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.UserMeta))) - i += copy(dAtA[i:], m.UserMeta) + if m.StreamId != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.StreamId)) + i-- + dAtA[i] = 0x50 } - if m.Version != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Version)) + if len(m.Meta) > 0 { + i -= len(m.Meta) + copy(dAtA[i:], m.Meta) + i = encodeVarintPb(dAtA, i, uint64(len(m.Meta))) + i-- + dAtA[i] = 0x32 } if m.ExpiresAt != 0 { - dAtA[i] = 0x28 - i++ i = encodeVarintPb(dAtA, i, uint64(m.ExpiresAt)) + i-- + dAtA[i] = 0x28 } - if len(m.Meta) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.Meta))) - i += copy(dAtA[i:], m.Meta) + if m.Version != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x20 } - if m.StreamId != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.StreamId)) + if len(m.UserMeta) > 0 { + i -= len(m.UserMeta) + copy(dAtA[i:], m.UserMeta) + i = encodeVarintPb(dAtA, i, uint64(len(m.UserMeta))) + i-- + dAtA[i] = 0x1a } - if m.StreamDone { - dAtA[i] = 0x58 - i++ - if m.StreamDone { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintPb(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *KVList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -766,32 +776,40 @@ func (m *KVList) Marshal() (dAtA []byte, err error) { } func (m *KVList) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KVList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Kv) > 0 { - for _, msg := range m.Kv { - dAtA[i] = 0xa - i++ - i = encodeVarintPb(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Kv) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Kv[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPb(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ManifestChangeSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -799,32 +817,40 @@ func (m *ManifestChangeSet) Marshal() (dAtA []byte, err error) { } func (m *ManifestChangeSet) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ManifestChangeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Changes) > 0 { - for _, msg := range m.Changes { - dAtA[i] = 0xa - i++ - i = encodeVarintPb(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPb(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ManifestChange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -832,50 +858,56 @@ func (m *ManifestChange) Marshal() (dAtA []byte, err error) { } func (m *ManifestChange) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ManifestChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Id != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Id)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Op != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Op)) + if m.Compression != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Compression)) + i-- + dAtA[i] = 0x30 } - if m.Level != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Level)) + if m.EncryptionAlgo != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.EncryptionAlgo)) + i-- + dAtA[i] = 0x28 } if m.KeyId != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintPb(dAtA, i, uint64(m.KeyId)) + i-- + dAtA[i] = 0x20 } - if m.EncryptionAlgo != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.EncryptionAlgo)) + if m.Level != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Level)) + i-- + dAtA[i] = 0x18 } - if m.Compression != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Compression)) + if m.Op != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Op)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Id != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *BlockOffset) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -883,36 +915,43 @@ func (m *BlockOffset) Marshal() (dAtA []byte, err error) { } func (m *BlockOffset) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockOffset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if m.Offset != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Offset)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Len != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintPb(dAtA, i, uint64(m.Len)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Offset != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x10 } - return i, nil + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *TableIndex) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -920,38 +959,47 @@ func (m *TableIndex) Marshal() (dAtA []byte, err error) { } func (m *TableIndex) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TableIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Offsets) > 0 { - for _, msg := range m.Offsets { - dAtA[i] = 0xa - i++ - i = encodeVarintPb(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.BloomFilter) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.BloomFilter) + copy(dAtA[i:], m.BloomFilter) i = encodeVarintPb(dAtA, i, uint64(len(m.BloomFilter))) - i += copy(dAtA[i:], m.BloomFilter) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Offsets) > 0 { + for iNdEx := len(m.Offsets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Offsets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPb(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Checksum) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -959,30 +1007,36 @@ func (m *Checksum) Marshal() (dAtA []byte, err error) { } func (m *Checksum) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Checksum) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Algo != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.Algo)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Sum != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintPb(dAtA, i, uint64(m.Sum)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Algo != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.Algo)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *DataKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -990,46 +1044,56 @@ func (m *DataKey) Marshal() (dAtA []byte, err error) { } func (m *DataKey) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DataKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.KeyId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.KeyId)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Data) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintPb(dAtA, i, uint64(len(m.Data))) - i += copy(dAtA[i:], m.Data) + if m.CreatedAt != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x20 } if len(m.Iv) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.Iv) + copy(dAtA[i:], m.Iv) i = encodeVarintPb(dAtA, i, uint64(len(m.Iv))) - i += copy(dAtA[i:], m.Iv) + i-- + dAtA[i] = 0x1a } - if m.CreatedAt != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintPb(dAtA, i, uint64(m.CreatedAt)) + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintPb(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.KeyId != 0 { + i = encodeVarintPb(dAtA, i, uint64(m.KeyId)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintPb(dAtA []byte, offset int, v uint64) int { + offset -= sovPb(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *KV) Size() (n int) { if m == nil { @@ -2345,6 +2409,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { func skipPb(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2376,10 +2441,8 @@ func skipPb(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2400,55 +2463,30 @@ func skipPb(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthPb } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthPb - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPb - } - 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 := skipPb(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthPb - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPb + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthPb + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthPb = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPb = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthPb = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPb = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPb = fmt.Errorf("proto: unexpected end of group") )