From 73c1ce33d1f7c731b4ccc9109e1b5a500d38100f Mon Sep 17 00:00:00 2001 From: Naman Jain Date: Wed, 21 Jul 2021 12:10:40 +0530 Subject: [PATCH] pb: avoid protobuf warning due to common filename (#1519) (#1731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a Go program imports both badger (v1) and badger/v2, a warning will be produced at init time: WARNING: proto: file "pb.proto" is already registered A future release will panic on registration conflicts. See: https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict The problem is the "pb.proto" filename; it's registered globally, which makes it very likely to cause conflicts with other protobuf-generated packages in a Go binary. Coincidentally, this is a problem with badger's pb package in the v1 module, since that too uses the name "pb.proto". Instead, call the file "badgerpb2.proto", which should be unique enough, and it's also the name we use for the Protobuf package. Finally, update gen.sh to work out of the box via just "bash gen.sh" without needing extra tweaks, thanks to the "paths=source_relative" option. It forces output files to be produced next to the input files, which is what we want. (cherry picked from commit 3e6a4b7ca9637d3e2b7522c4ef04052ef31ec6d9) Co-authored-by: Daniel Martí --- pb/{pb.pb.go => badgerpb2.pb.go} | 422 +++++++++++++++---------------- pb/{pb.proto => badgerpb2.proto} | 0 pb/gen.sh | 11 +- 3 files changed, 215 insertions(+), 218 deletions(-) rename pb/{pb.pb.go => badgerpb2.pb.go} (81%) rename pb/{pb.proto => badgerpb2.proto} (100%) diff --git a/pb/pb.pb.go b/pb/badgerpb2.pb.go similarity index 81% rename from pb/pb.pb.go rename to pb/badgerpb2.pb.go index 0d6fde3c1..edacec75d 100644 --- a/pb/pb.pb.go +++ b/pb/badgerpb2.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pb.proto +// source: badgerpb2.proto package pb @@ -41,7 +41,7 @@ func (x EncryptionAlgo) String() string { } func (EncryptionAlgo) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{0} + return fileDescriptor_e63e84f9f0d3998c, []int{0} } type ManifestChange_Operation int32 @@ -66,7 +66,7 @@ func (x ManifestChange_Operation) String() string { } func (ManifestChange_Operation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{3, 0} + return fileDescriptor_e63e84f9f0d3998c, []int{3, 0} } type Checksum_Algorithm int32 @@ -91,7 +91,7 @@ func (x Checksum_Algorithm) String() string { } func (Checksum_Algorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{6, 0} + return fileDescriptor_e63e84f9f0d3998c, []int{6, 0} } type KV struct { @@ -114,7 +114,7 @@ func (m *KV) Reset() { *m = KV{} } func (m *KV) String() string { return proto.CompactTextString(m) } func (*KV) ProtoMessage() {} func (*KV) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{0} + return fileDescriptor_e63e84f9f0d3998c, []int{0} } func (m *KV) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -210,7 +210,7 @@ func (m *KVList) Reset() { *m = KVList{} } func (m *KVList) String() string { return proto.CompactTextString(m) } func (*KVList) ProtoMessage() {} func (*KVList) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{1} + return fileDescriptor_e63e84f9f0d3998c, []int{1} } func (m *KVList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -258,7 +258,7 @@ func (m *ManifestChangeSet) Reset() { *m = ManifestChangeSet{} } func (m *ManifestChangeSet) String() string { return proto.CompactTextString(m) } func (*ManifestChangeSet) ProtoMessage() {} func (*ManifestChangeSet) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{2} + return fileDescriptor_e63e84f9f0d3998c, []int{2} } func (m *ManifestChangeSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +310,7 @@ func (m *ManifestChange) Reset() { *m = ManifestChange{} } func (m *ManifestChange) String() string { return proto.CompactTextString(m) } func (*ManifestChange) ProtoMessage() {} func (*ManifestChange) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{3} + return fileDescriptor_e63e84f9f0d3998c, []int{3} } func (m *ManifestChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -394,7 +394,7 @@ func (m *BlockOffset) Reset() { *m = BlockOffset{} } func (m *BlockOffset) String() string { return proto.CompactTextString(m) } func (*BlockOffset) ProtoMessage() {} func (*BlockOffset) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{4} + return fileDescriptor_e63e84f9f0d3998c, []int{4} } func (m *BlockOffset) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -457,7 +457,7 @@ func (m *TableIndex) Reset() { *m = TableIndex{} } func (m *TableIndex) String() string { return proto.CompactTextString(m) } func (*TableIndex) ProtoMessage() {} func (*TableIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{5} + return fileDescriptor_e63e84f9f0d3998c, []int{5} } func (m *TableIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -519,7 +519,7 @@ func (m *Checksum) Reset() { *m = Checksum{} } func (m *Checksum) String() string { return proto.CompactTextString(m) } func (*Checksum) ProtoMessage() {} func (*Checksum) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{6} + return fileDescriptor_e63e84f9f0d3998c, []int{6} } func (m *Checksum) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -576,7 +576,7 @@ func (m *DataKey) Reset() { *m = DataKey{} } func (m *DataKey) String() string { return proto.CompactTextString(m) } func (*DataKey) ProtoMessage() {} func (*DataKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f80abaa17e25ccc8, []int{7} + return fileDescriptor_e63e84f9f0d3998c, []int{7} } func (m *DataKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -647,54 +647,54 @@ func init() { proto.RegisterType((*DataKey)(nil), "badgerpb2.DataKey") } -func init() { proto.RegisterFile("pb.proto", fileDescriptor_f80abaa17e25ccc8) } - -var fileDescriptor_f80abaa17e25ccc8 = []byte{ - // 691 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xdd, 0x6e, 0xda, 0x4a, - 0x10, 0xc6, 0xc6, 0xe1, 0x67, 0x08, 0x1c, 0xce, 0xea, 0x9c, 0xc8, 0x51, 0x15, 0x4a, 0x1c, 0x45, - 0x45, 0x95, 0x0a, 0x2d, 0x54, 0xbd, 0x27, 0x84, 0x2a, 0x88, 0x44, 0x48, 0x9b, 0x28, 0x8a, 0x7a, - 0x83, 0xd6, 0xf6, 0x00, 0x16, 0xfe, 0x93, 0x77, 0xb1, 0x42, 0x9e, 0xa0, 0x37, 0xbd, 0xef, 0x23, - 0xf5, 0xb2, 0x17, 0x7d, 0x80, 0x2a, 0x7d, 0x91, 0xca, 0x6b, 0x83, 0x40, 0x6a, 0xef, 0x66, 0xbe, - 0xf9, 0x76, 0x67, 0xbf, 0x6f, 0xc6, 0x86, 0x52, 0x68, 0xb6, 0xc3, 0x28, 0x10, 0x01, 0x29, 0x9b, - 0xcc, 0x9e, 0x63, 0x14, 0x9a, 0x5d, 0xe3, 0x87, 0x02, 0xea, 0xf8, 0x9e, 0xd4, 0x21, 0xbf, 0xc4, - 0xb5, 0xae, 0x34, 0x95, 0xd6, 0x21, 0x4d, 0x42, 0xf2, 0x1f, 0x1c, 0xc4, 0xcc, 0x5d, 0xa1, 0xae, - 0x4a, 0x2c, 0x4d, 0xc8, 0x0b, 0x28, 0xaf, 0x38, 0x46, 0x53, 0x0f, 0x05, 0xd3, 0xf3, 0xb2, 0x52, - 0x4a, 0x80, 0x1b, 0x14, 0x8c, 0xe8, 0x50, 0x8c, 0x31, 0xe2, 0x4e, 0xe0, 0xeb, 0x5a, 0x53, 0x69, - 0x69, 0x74, 0x93, 0x92, 0x13, 0x00, 0x7c, 0x0c, 0x9d, 0x08, 0xf9, 0x94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x88, 0x85, 0x47, 0x25, 0x35, 0xd1, 0xc6, 0x57, 0x9e, 0xec, - 0xaf, 0xd1, 0x24, 0x34, 0xce, 0xa1, 0xbc, 0x25, 0xa5, 0x5e, 0x0e, 0x7a, 0xdd, 0x41, 0x3d, 0x47, - 0x0e, 0xa1, 0xf4, 0xf0, 0x70, 0xc5, 0xf8, 0xe2, 0xc3, 0xfb, 0xba, 0x62, 0x58, 0x50, 0xbc, 0x64, - 0x82, 0x8d, 0x71, 0xbd, 0x33, 0x7a, 0x65, 0x77, 0xf4, 0x04, 0x34, 0x9b, 0x09, 0x96, 0x69, 0x93, - 0x71, 0xb2, 0x80, 0x4e, 0x9c, 0x7d, 0xa7, 0xaa, 0x13, 0x27, 0xdf, 0xa1, 0x15, 0xa1, 0x94, 0xc8, - 0x84, 0xdc, 0x9c, 0x3c, 0x2d, 0x67, 0x48, 0x5f, 0xbc, 0x3e, 0x86, 0xda, 0xfe, 0x6e, 0x90, 0x22, - 0xe4, 0x19, 0xf2, 0x7a, 0xee, 0xa2, 0xf7, 0xed, 0xb9, 0xa1, 0x7c, 0x7f, 0x6e, 0x28, 0x3f, 0x9f, - 0x1b, 0xca, 0xd7, 0x5f, 0x8d, 0xdc, 0xa7, 0xd3, 0xb9, 0x23, 0x16, 0x2b, 0xb3, 0x6d, 0x05, 0x5e, - 0xc7, 0x9e, 0x47, 0x2c, 0x5c, 0xbc, 0x71, 0x82, 0x4e, 0xea, 0x41, 0x27, 0xee, 0x76, 0x42, 0xd3, - 0x2c, 0xc8, 0xdf, 0x4d, 0xef, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0xcd, 0x7e, 0xad, 0x7a, - 0x04, 0x00, 0x00, +func init() { proto.RegisterFile("badgerpb2.proto", fileDescriptor_e63e84f9f0d3998c) } + +var fileDescriptor_e63e84f9f0d3998c = []byte{ + // 689 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcd, 0x6e, 0xda, 0x40, + 0x10, 0xc6, 0xc6, 0xe1, 0x67, 0x08, 0x84, 0xae, 0xda, 0xc8, 0x51, 0x15, 0x4a, 0x1c, 0x45, 0x45, + 0x95, 0x0a, 0x2d, 0x54, 0xbd, 0x13, 0x42, 0x15, 0x44, 0x22, 0xa4, 0x4d, 0x14, 0x45, 0xbd, 0xa0, + 0xc5, 0x1e, 0xc0, 0xc2, 0x7f, 0xf2, 0x2e, 0x56, 0xc8, 0x13, 0xf4, 0xd2, 0x7b, 0x1f, 0xa9, 0xc7, + 0x1e, 0xfa, 0x00, 0x55, 0xfa, 0x22, 0x95, 0xd7, 0x86, 0x82, 0xd4, 0xde, 0x66, 0xbe, 0xf9, 0x76, + 0x67, 0xbf, 0x6f, 0xc6, 0x86, 0x83, 0x09, 0xb3, 0x66, 0x18, 0x06, 0x93, 0x76, 0x33, 0x08, 0x7d, + 0xe1, 0x93, 0xe2, 0x06, 0x30, 0x7e, 0x2a, 0xa0, 0x0e, 0xef, 0x48, 0x15, 0xb2, 0x0b, 0x5c, 0xe9, + 0x4a, 0x5d, 0x69, 0xec, 0xd3, 0x38, 0x24, 0xcf, 0x61, 0x2f, 0x62, 0xce, 0x12, 0x75, 0x55, 0x62, + 0x49, 0x42, 0x5e, 0x42, 0x71, 0xc9, 0x31, 0x1c, 0xbb, 0x28, 0x98, 0x9e, 0x95, 0x95, 0x42, 0x0c, + 0x5c, 0xa3, 0x60, 0x44, 0x87, 0x7c, 0x84, 0x21, 0xb7, 0x7d, 0x4f, 0xd7, 0xea, 0x4a, 0x43, 0xa3, + 0xeb, 0x94, 0x1c, 0x03, 0xe0, 0x43, 0x60, 0x87, 0xc8, 0xc7, 0x4c, 0xe8, 0x7b, 0xb2, 0x58, 0x4c, + 0x91, 0xae, 0x20, 0x04, 0x34, 0x79, 0x61, 0x4e, 0x5e, 0x28, 0xe3, 0xb8, 0x13, 0x17, 0x21, 0x32, + 0x77, 0x6c, 0x5b, 0x3a, 0xd4, 0x95, 0x46, 0x99, 0x16, 0x12, 0x60, 0x60, 0x91, 0x57, 0x50, 0x4a, + 0x8b, 0x96, 0xef, 0xa1, 0x5e, 0xaa, 0x2b, 0x8d, 0x02, 0x85, 0x04, 0xba, 0xf0, 0x3d, 0x34, 0x5e, + 0x43, 0x6e, 0x78, 0x77, 0x65, 0x73, 0x41, 0x8e, 0x41, 0x5d, 0x44, 0xba, 0x52, 0xcf, 0x36, 0x4a, + 0xed, 0x72, 0xf3, 0xaf, 0x13, 0xc3, 0x3b, 0xaa, 0x2e, 0x22, 0xe3, 0x12, 0x9e, 0x5d, 0x33, 0xcf, + 0x9e, 0x22, 0x17, 0xbd, 0x39, 0xf3, 0x66, 0x78, 0x83, 0x82, 0x74, 0x20, 0x6f, 0xca, 0x84, 0xa7, + 0x07, 0x8f, 0xb6, 0x0e, 0xee, 0xd2, 0xe9, 0x9a, 0x69, 0x7c, 0x55, 0xa1, 0xb2, 0x5b, 0x23, 0x15, + 0x50, 0x07, 0x96, 0x34, 0x55, 0xa3, 0xea, 0xc0, 0x22, 0x1d, 0x50, 0x47, 0x81, 0x34, 0xb4, 0xd2, + 0x3e, 0xfd, 0xef, 0x95, 0xcd, 0x51, 0x80, 0x21, 0x13, 0xb6, 0xef, 0x51, 0x75, 0x14, 0xc4, 0x83, + 0xb8, 0xc2, 0x08, 0x1d, 0x69, 0x77, 0x99, 0x26, 0x09, 0x79, 0x01, 0xb9, 0x05, 0xae, 0x62, 0x6f, + 0x12, 0xab, 0xf7, 0x16, 0xb8, 0x1a, 0x58, 0xe4, 0x1c, 0x0e, 0xd0, 0x33, 0xc3, 0x55, 0x10, 0x1f, + 0x1f, 0x33, 0x67, 0xe6, 0x4b, 0xb7, 0x2b, 0x3b, 0x0a, 0xfa, 0x1b, 0x46, 0xd7, 0x99, 0xf9, 0xb4, + 0x82, 0x3b, 0x39, 0xa9, 0x43, 0xc9, 0xf4, 0xdd, 0x20, 0x44, 0x2e, 0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, 0xef, 0x2f, 0x19, 0x9f, 0x7f, 0xfc, 0x50, 0x55, 0x0c, 0x13, 0xf2, 0x17, 0x4c, 0xb0, 0x21, + 0xae, 0xb6, 0x46, 0xaf, 0x6c, 0x8f, 0x9e, 0x80, 0x66, 0x31, 0xc1, 0x52, 0x6d, 0x32, 0x8e, 0x17, + 0xd0, 0x8e, 0xd2, 0xef, 0x54, 0xb5, 0xa3, 0xf8, 0x3b, 0x34, 0x43, 0x94, 0x12, 0x99, 0x90, 0x9b, + 0x93, 0xa5, 0xc5, 0x14, 0xe9, 0x8a, 0x37, 0x47, 0x50, 0xd9, 0xdd, 0x0d, 0x92, 0x87, 0x2c, 0x43, + 0x5e, 0xcd, 0x9c, 0x77, 0xbe, 0x3f, 0xd5, 0x94, 0x1f, 0x4f, 0x35, 0xe5, 0xd7, 0x53, 0x4d, 0xf9, + 0xf6, 0xbb, 0x96, 0xf9, 0x7c, 0x32, 0xb3, 0xc5, 0x7c, 0x39, 0x69, 0x9a, 0xbe, 0xdb, 0xb2, 0x66, + 0x21, 0x0b, 0xe6, 0x6f, 0x6d, 0xbf, 0x95, 0x78, 0xd0, 0x8a, 0xda, 0xad, 0x60, 0x32, 0xc9, 0xc9, + 0xdf, 0x4d, 0xe7, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x88, 0x22, 0x82, 0x98, 0x81, 0x04, 0x00, + 0x00, } func (m *KV) Marshal() (dAtA []byte, err error) { @@ -732,45 +732,45 @@ func (m *KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x58 } if m.StreamId != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.StreamId)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.StreamId)) i-- dAtA[i] = 0x50 } if len(m.Meta) > 0 { i -= len(m.Meta) copy(dAtA[i:], m.Meta) - i = encodeVarintPb(dAtA, i, uint64(len(m.Meta))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Meta))) i-- dAtA[i] = 0x32 } if m.ExpiresAt != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.ExpiresAt)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.ExpiresAt)) i-- dAtA[i] = 0x28 } if m.Version != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Version)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Version)) i-- dAtA[i] = 0x20 } if len(m.UserMeta) > 0 { i -= len(m.UserMeta) copy(dAtA[i:], m.UserMeta) - i = encodeVarintPb(dAtA, i, uint64(len(m.UserMeta))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.UserMeta))) i-- dAtA[i] = 0x1a } if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarintPb(dAtA, i, uint64(len(m.Value))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) - i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } @@ -809,7 +809,7 @@ func (m *KVList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPb(dAtA, i, uint64(size)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -850,7 +850,7 @@ func (m *ManifestChangeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPb(dAtA, i, uint64(size)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -884,32 +884,32 @@ func (m *ManifestChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } if m.Compression != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Compression)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Compression)) i-- dAtA[i] = 0x30 } if m.EncryptionAlgo != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.EncryptionAlgo)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.EncryptionAlgo)) i-- dAtA[i] = 0x28 } if m.KeyId != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.KeyId)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.KeyId)) i-- dAtA[i] = 0x20 } if m.Level != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Level)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Level)) i-- dAtA[i] = 0x18 } if m.Op != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Op)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Op)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Id)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -941,19 +941,19 @@ func (m *BlockOffset) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } if m.Len != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Len)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Len)) i-- dAtA[i] = 0x18 } if m.Offset != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Offset)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Offset)) i-- dAtA[i] = 0x10 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) - i = encodeVarintPb(dAtA, i, uint64(len(m.Key))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } @@ -985,14 +985,14 @@ func (m *TableIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } if m.EstimatedSize != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.EstimatedSize)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.EstimatedSize)) i-- dAtA[i] = 0x18 } if len(m.BloomFilter) > 0 { i -= len(m.BloomFilter) copy(dAtA[i:], m.BloomFilter) - i = encodeVarintPb(dAtA, i, uint64(len(m.BloomFilter))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.BloomFilter))) i-- dAtA[i] = 0x12 } @@ -1004,7 +1004,7 @@ func (m *TableIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPb(dAtA, i, uint64(size)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -1038,12 +1038,12 @@ func (m *Checksum) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } if m.Sum != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Sum)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Sum)) i-- dAtA[i] = 0x10 } if m.Algo != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.Algo)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.Algo)) i-- dAtA[i] = 0x8 } @@ -1075,34 +1075,34 @@ func (m *DataKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.XXX_unrecognized) } if m.CreatedAt != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.CreatedAt)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.CreatedAt)) i-- dAtA[i] = 0x20 } if len(m.Iv) > 0 { i -= len(m.Iv) copy(dAtA[i:], m.Iv) - i = encodeVarintPb(dAtA, i, uint64(len(m.Iv))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Iv))) i-- dAtA[i] = 0x1a } if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) - i = encodeVarintPb(dAtA, i, uint64(len(m.Data))) + i = encodeVarintBadgerpb2(dAtA, i, uint64(len(m.Data))) i-- dAtA[i] = 0x12 } if m.KeyId != 0 { - i = encodeVarintPb(dAtA, i, uint64(m.KeyId)) + i = encodeVarintBadgerpb2(dAtA, i, uint64(m.KeyId)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarintPb(dAtA []byte, offset int, v uint64) int { - offset -= sovPb(v) +func encodeVarintBadgerpb2(dAtA []byte, offset int, v uint64) int { + offset -= sovBadgerpb2(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -1120,28 +1120,28 @@ func (m *KV) Size() (n int) { _ = l l = len(m.Key) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } l = len(m.Value) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } l = len(m.UserMeta) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } if m.Version != 0 { - n += 1 + sovPb(uint64(m.Version)) + n += 1 + sovBadgerpb2(uint64(m.Version)) } if m.ExpiresAt != 0 { - n += 1 + sovPb(uint64(m.ExpiresAt)) + n += 1 + sovBadgerpb2(uint64(m.ExpiresAt)) } l = len(m.Meta) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } if m.StreamId != 0 { - n += 1 + sovPb(uint64(m.StreamId)) + n += 1 + sovBadgerpb2(uint64(m.StreamId)) } if m.StreamDone { n += 2 @@ -1161,7 +1161,7 @@ func (m *KVList) Size() (n int) { if len(m.Kv) > 0 { for _, e := range m.Kv { l = e.Size() - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } } if m.XXX_unrecognized != nil { @@ -1179,7 +1179,7 @@ func (m *ManifestChangeSet) Size() (n int) { if len(m.Changes) > 0 { for _, e := range m.Changes { l = e.Size() - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } } if m.XXX_unrecognized != nil { @@ -1195,22 +1195,22 @@ func (m *ManifestChange) Size() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sovPb(uint64(m.Id)) + n += 1 + sovBadgerpb2(uint64(m.Id)) } if m.Op != 0 { - n += 1 + sovPb(uint64(m.Op)) + n += 1 + sovBadgerpb2(uint64(m.Op)) } if m.Level != 0 { - n += 1 + sovPb(uint64(m.Level)) + n += 1 + sovBadgerpb2(uint64(m.Level)) } if m.KeyId != 0 { - n += 1 + sovPb(uint64(m.KeyId)) + n += 1 + sovBadgerpb2(uint64(m.KeyId)) } if m.EncryptionAlgo != 0 { - n += 1 + sovPb(uint64(m.EncryptionAlgo)) + n += 1 + sovBadgerpb2(uint64(m.EncryptionAlgo)) } if m.Compression != 0 { - n += 1 + sovPb(uint64(m.Compression)) + n += 1 + sovBadgerpb2(uint64(m.Compression)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1226,13 +1226,13 @@ func (m *BlockOffset) Size() (n int) { _ = l l = len(m.Key) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } if m.Offset != 0 { - n += 1 + sovPb(uint64(m.Offset)) + n += 1 + sovBadgerpb2(uint64(m.Offset)) } if m.Len != 0 { - n += 1 + sovPb(uint64(m.Len)) + n += 1 + sovBadgerpb2(uint64(m.Len)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1249,15 +1249,15 @@ func (m *TableIndex) Size() (n int) { if len(m.Offsets) > 0 { for _, e := range m.Offsets { l = e.Size() - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } } l = len(m.BloomFilter) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } if m.EstimatedSize != 0 { - n += 1 + sovPb(uint64(m.EstimatedSize)) + n += 1 + sovBadgerpb2(uint64(m.EstimatedSize)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1272,10 +1272,10 @@ func (m *Checksum) Size() (n int) { var l int _ = l if m.Algo != 0 { - n += 1 + sovPb(uint64(m.Algo)) + n += 1 + sovBadgerpb2(uint64(m.Algo)) } if m.Sum != 0 { - n += 1 + sovPb(uint64(m.Sum)) + n += 1 + sovBadgerpb2(uint64(m.Sum)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1290,18 +1290,18 @@ func (m *DataKey) Size() (n int) { var l int _ = l if m.KeyId != 0 { - n += 1 + sovPb(uint64(m.KeyId)) + n += 1 + sovBadgerpb2(uint64(m.KeyId)) } l = len(m.Data) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } l = len(m.Iv) if l > 0 { - n += 1 + l + sovPb(uint64(l)) + n += 1 + l + sovBadgerpb2(uint64(l)) } if m.CreatedAt != 0 { - n += 1 + sovPb(uint64(m.CreatedAt)) + n += 1 + sovBadgerpb2(uint64(m.CreatedAt)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1309,11 +1309,11 @@ func (m *DataKey) Size() (n int) { return n } -func sovPb(x uint64) (n int) { +func sovBadgerpb2(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozPb(x uint64) (n int) { - return sovPb(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozBadgerpb2(x uint64) (n int) { + return sovBadgerpb2(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *KV) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -1323,7 +1323,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1351,7 +1351,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1364,11 +1364,11 @@ func (m *KV) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1385,7 +1385,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1398,11 +1398,11 @@ func (m *KV) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1419,7 +1419,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1432,11 +1432,11 @@ func (m *KV) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1453,7 +1453,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1472,7 +1472,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { m.ExpiresAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1491,7 +1491,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1504,11 +1504,11 @@ func (m *KV) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1525,7 +1525,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { m.StreamId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1544,7 +1544,7 @@ func (m *KV) Unmarshal(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1559,15 +1559,15 @@ func (m *KV) Unmarshal(dAtA []byte) error { m.StreamDone = bool(v != 0) default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1590,7 +1590,7 @@ func (m *KVList) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1618,7 +1618,7 @@ func (m *KVList) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1631,11 +1631,11 @@ func (m *KVList) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1647,15 +1647,15 @@ func (m *KVList) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1678,7 +1678,7 @@ func (m *ManifestChangeSet) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1706,7 +1706,7 @@ func (m *ManifestChangeSet) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1719,11 +1719,11 @@ func (m *ManifestChangeSet) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1735,15 +1735,15 @@ func (m *ManifestChangeSet) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1766,7 +1766,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1794,7 +1794,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1813,7 +1813,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.Op = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1832,7 +1832,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.Level = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1851,7 +1851,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.KeyId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1870,7 +1870,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.EncryptionAlgo = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1889,7 +1889,7 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { m.Compression = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1903,15 +1903,15 @@ func (m *ManifestChange) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1934,7 +1934,7 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1962,7 +1962,7 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1975,11 +1975,11 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -1996,7 +1996,7 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2015,7 +2015,7 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { m.Len = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2029,15 +2029,15 @@ func (m *BlockOffset) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2060,7 +2060,7 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2088,7 +2088,7 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2101,11 +2101,11 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -2122,7 +2122,7 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2135,11 +2135,11 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -2156,7 +2156,7 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { m.EstimatedSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2170,15 +2170,15 @@ func (m *TableIndex) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2201,7 +2201,7 @@ func (m *Checksum) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2229,7 +2229,7 @@ func (m *Checksum) Unmarshal(dAtA []byte) error { m.Algo = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2248,7 +2248,7 @@ func (m *Checksum) Unmarshal(dAtA []byte) error { m.Sum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2262,15 +2262,15 @@ func (m *Checksum) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2293,7 +2293,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2321,7 +2321,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { m.KeyId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2340,7 +2340,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2353,11 +2353,11 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -2374,7 +2374,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2387,11 +2387,11 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if postIndex > l { return io.ErrUnexpectedEOF @@ -2408,7 +2408,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPb + return ErrIntOverflowBadgerpb2 } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2422,15 +2422,15 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPb(dAtA[iNdEx:]) + skippy, err := skipBadgerpb2(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPb + return ErrInvalidLengthBadgerpb2 } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2445,7 +2445,7 @@ func (m *DataKey) Unmarshal(dAtA []byte) error { } return nil } -func skipPb(dAtA []byte) (n int, err error) { +func skipBadgerpb2(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -2453,7 +2453,7 @@ func skipPb(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPb + return 0, ErrIntOverflowBadgerpb2 } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -2470,7 +2470,7 @@ func skipPb(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPb + return 0, ErrIntOverflowBadgerpb2 } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -2486,7 +2486,7 @@ func skipPb(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPb + return 0, ErrIntOverflowBadgerpb2 } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -2499,14 +2499,14 @@ func skipPb(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthPb + return 0, ErrInvalidLengthBadgerpb2 } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPb + return 0, ErrUnexpectedEndOfGroupBadgerpb2 } depth-- case 5: @@ -2515,7 +2515,7 @@ func skipPb(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthPb + return 0, ErrInvalidLengthBadgerpb2 } if depth == 0 { return iNdEx, nil @@ -2525,7 +2525,7 @@ func skipPb(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthPb = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPb = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPb = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthBadgerpb2 = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBadgerpb2 = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBadgerpb2 = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pb/pb.proto b/pb/badgerpb2.proto similarity index 100% rename from pb/pb.proto rename to pb/badgerpb2.proto diff --git a/pb/gen.sh b/pb/gen.sh index 18e2d29f1..0b0176922 100755 --- a/pb/gen.sh +++ b/pb/gen.sh @@ -1,11 +1,8 @@ #!/bin/bash -# You might need to go get -v github.com/gogo/protobuf/... +# Run this script from its directory, so that badgerpb2.proto is where it's expected to +# be. -protos=${GOPATH-$HOME/go}/src/github.com/dgraph-io/badger/pb -pushd $protos > /dev/null -protoc --gofast_out=plugins=grpc:. -I=. pb.proto +# You might need to go get -v github.com/gogo/protobuf/... -# Move pb.pb.go file to the correct directory. This is necessary because protoc -# would generate the pb.pb.go file inside a different directory. -mv $protos/github.com/dgraph-io/badger/v2/pb/pb.pb.go ./ +protoc --gofast_out=plugins=grpc:. --gofast_opt=paths=source_relative -I=. badgerpb2.proto