diff --git a/backup.go b/backup.go index dd5c5d0a4..e9811e1db 100644 --- a/backup.go +++ b/backup.go @@ -23,8 +23,8 @@ import ( "encoding/binary" "io" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/y" diff --git a/badger/cmd/bank.go b/badger/cmd/bank.go index 329a32d6b..8d98dc3c1 100644 --- a/badger/cmd/bank.go +++ b/badger/cmd/bank.go @@ -32,6 +32,7 @@ import ( "time" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4" "github.com/dgraph-io/badger/v4/pb" @@ -504,7 +505,7 @@ func runTest(cmd *cobra.Command, args []string) error { stream.Send = func(buf *z.Buffer) error { err := buf.SliceIterate(func(s []byte) error { var kv pb.KV - if err := kv.Unmarshal(s); err != nil { + if err := proto.Unmarshal(s, &kv); err != nil { return err } return batch.Set(kv.Key, kv.Value) diff --git a/badger/cmd/read_bench.go b/badger/cmd/read_bench.go index 62304fa02..f6e48c599 100644 --- a/badger/cmd/read_bench.go +++ b/badger/cmd/read_bench.go @@ -27,6 +27,7 @@ import ( humanize "github.com/dustin/go-humanize" "github.com/pkg/errors" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4" "github.com/dgraph-io/badger/v4/pb" @@ -214,7 +215,7 @@ func getSampleKeys(db *badger.DB, sampleSize int) ([][]byte, error) { } err := buf.SliceIterate(func(s []byte) error { var kv pb.KV - if err := kv.Unmarshal(s); err != nil { + if err := proto.Unmarshal(s, &kv); err != nil { return err } keys = append(keys, kv.Key) diff --git a/batch.go b/batch.go index a9974d29b..ea7a81f1f 100644 --- a/batch.go +++ b/batch.go @@ -21,6 +21,7 @@ import ( "sync/atomic" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/y" @@ -113,7 +114,7 @@ func (wb *WriteBatch) Write(buf *z.Buffer) error { err := buf.SliceIterate(func(s []byte) error { kv := &pb.KV{} - if err := kv.Unmarshal(s); err != nil { + if err := proto.Unmarshal(s, kv); err != nil { return err } return wb.writeKV(kv) diff --git a/go.mod b/go.mod index ad9b19acd..07d85e73c 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,6 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 github.com/dgraph-io/ristretto/v2 v2.0.0 github.com/dustin/go-humanize v1.0.1 - github.com/gogo/protobuf v1.3.2 - github.com/golang/protobuf v1.5.4 github.com/google/flatbuffers v24.3.25+incompatible github.com/klauspost/compress v1.17.11 github.com/pkg/errors v0.9.1 @@ -18,17 +16,18 @@ require ( go.opencensus.io v0.24.0 golang.org/x/net v0.31.0 golang.org/x/sys v0.27.0 + google.golang.org/protobuf v1.33.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e02133332..197655498 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -49,8 +47,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -71,27 +67,19 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= @@ -99,8 +87,6 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -116,13 +102,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= diff --git a/key_registry.go b/key_registry.go index a1be0435d..ddca6501a 100644 --- a/key_registry.go +++ b/key_registry.go @@ -30,6 +30,7 @@ import ( "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/y" + "google.golang.org/protobuf/proto" ) const ( @@ -195,7 +196,7 @@ func (kri *keyRegistryIterator) next() (*pb.DataKey, error) { return nil, y.Wrapf(y.ErrChecksumMismatch, "Error while checking checksum for data key.") } dataKey := &pb.DataKey{} - if err = dataKey.Unmarshal(data); err != nil { + if err = proto.Unmarshal(data, dataKey); err != nil { return nil, y.Wrapf(err, "While unmarshal of datakey in keyRegistryIterator.next") } if len(kri.encryptionKey) > 0 { @@ -404,7 +405,7 @@ func storeDataKey(buf *bytes.Buffer, storageKey []byte, k *pb.DataKey) error { return y.Wrapf(err, "Error while encrypting datakey in storeDataKey") } var data []byte - if data, err = k.Marshal(); err != nil { + if data, err = proto.Marshal(k); err != nil { err = y.Wrapf(err, "Error while marshaling datakey in storeDataKey") var err2 error // decrypting the datakey back. diff --git a/manifest.go b/manifest.go index 2355f281e..ffe145529 100644 --- a/manifest.go +++ b/manifest.go @@ -29,8 +29,8 @@ import ( "path/filepath" "sync" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/options" "github.com/dgraph-io/badger/v4/pb" diff --git a/pb/badgerpb4.pb.go b/pb/badgerpb4.pb.go index 521f99293..17bbfc36e 100644 --- a/pb/badgerpb4.pb.go +++ b/pb/badgerpb4.pb.go @@ -1,26 +1,41 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// +// Copyright (C) 2017 Dgraph Labs, Inc. and Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Use protos/gen.sh to generate .pb.go files. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 // source: badgerpb4.proto package pb import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type EncryptionAlgo int32 @@ -28,20 +43,41 @@ const ( EncryptionAlgo_aes EncryptionAlgo = 0 ) -var EncryptionAlgo_name = map[int32]string{ - 0: "aes", -} +// Enum value maps for EncryptionAlgo. +var ( + EncryptionAlgo_name = map[int32]string{ + 0: "aes", + } + EncryptionAlgo_value = map[string]int32{ + "aes": 0, + } +) -var EncryptionAlgo_value = map[string]int32{ - "aes": 0, +func (x EncryptionAlgo) Enum() *EncryptionAlgo { + p := new(EncryptionAlgo) + *p = x + return p } func (x EncryptionAlgo) String() string { - return proto.EnumName(EncryptionAlgo_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EncryptionAlgo) Descriptor() protoreflect.EnumDescriptor { + return file_badgerpb4_proto_enumTypes[0].Descriptor() +} + +func (EncryptionAlgo) Type() protoreflect.EnumType { + return &file_badgerpb4_proto_enumTypes[0] +} + +func (x EncryptionAlgo) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use EncryptionAlgo.Descriptor instead. func (EncryptionAlgo) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_452c1d780baa15ef, []int{0} + return file_badgerpb4_proto_rawDescGZIP(), []int{0} } type ManifestChange_Operation int32 @@ -51,22 +87,43 @@ const ( ManifestChange_DELETE ManifestChange_Operation = 1 ) -var ManifestChange_Operation_name = map[int32]string{ - 0: "CREATE", - 1: "DELETE", -} +// Enum value maps for ManifestChange_Operation. +var ( + ManifestChange_Operation_name = map[int32]string{ + 0: "CREATE", + 1: "DELETE", + } + ManifestChange_Operation_value = map[string]int32{ + "CREATE": 0, + "DELETE": 1, + } +) -var ManifestChange_Operation_value = map[string]int32{ - "CREATE": 0, - "DELETE": 1, +func (x ManifestChange_Operation) Enum() *ManifestChange_Operation { + p := new(ManifestChange_Operation) + *p = x + return p } func (x ManifestChange_Operation) String() string { - return proto.EnumName(ManifestChange_Operation_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ManifestChange_Operation) Descriptor() protoreflect.EnumDescriptor { + return file_badgerpb4_proto_enumTypes[1].Descriptor() } +func (ManifestChange_Operation) Type() protoreflect.EnumType { + return &file_badgerpb4_proto_enumTypes[1] +} + +func (x ManifestChange_Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ManifestChange_Operation.Descriptor instead. func (ManifestChange_Operation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_452c1d780baa15ef, []int{3, 0} + return file_badgerpb4_proto_rawDescGZIP(), []int{3, 0} } type Checksum_Algorithm int32 @@ -76,25 +133,50 @@ const ( Checksum_XXHash64 Checksum_Algorithm = 1 ) -var Checksum_Algorithm_name = map[int32]string{ - 0: "CRC32C", - 1: "XXHash64", -} +// Enum value maps for Checksum_Algorithm. +var ( + Checksum_Algorithm_name = map[int32]string{ + 0: "CRC32C", + 1: "XXHash64", + } + Checksum_Algorithm_value = map[string]int32{ + "CRC32C": 0, + "XXHash64": 1, + } +) -var Checksum_Algorithm_value = map[string]int32{ - "CRC32C": 0, - "XXHash64": 1, +func (x Checksum_Algorithm) Enum() *Checksum_Algorithm { + p := new(Checksum_Algorithm) + *p = x + return p } func (x Checksum_Algorithm) String() string { - return proto.EnumName(Checksum_Algorithm_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Checksum_Algorithm) Descriptor() protoreflect.EnumDescriptor { + return file_badgerpb4_proto_enumTypes[2].Descriptor() +} + +func (Checksum_Algorithm) Type() protoreflect.EnumType { + return &file_badgerpb4_proto_enumTypes[2] } +func (x Checksum_Algorithm) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Checksum_Algorithm.Descriptor instead. func (Checksum_Algorithm) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_452c1d780baa15ef, []int{4, 0} + return file_badgerpb4_proto_rawDescGZIP(), []int{4, 0} } type KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` UserMeta []byte `protobuf:"bytes,3,opt,name=user_meta,json=userMeta,proto3" json:"user_meta,omitempty"` @@ -107,2058 +189,682 @@ type KV struct { StreamDone bool `protobuf:"varint,11,opt,name=stream_done,json=streamDone,proto3" json:"stream_done,omitempty"` } -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_452c1d780baa15ef, []int{0} -} -func (m *KV) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KV.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *KV) Reset() { + *x = KV{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *KV) XXX_Merge(src proto.Message) { - xxx_messageInfo_KV.Merge(m, src) -} -func (m *KV) XXX_Size() int { - return m.Size() + +func (x *KV) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KV) XXX_DiscardUnknown() { - xxx_messageInfo_KV.DiscardUnknown(m) + +func (*KV) ProtoMessage() {} + +func (x *KV) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KV proto.InternalMessageInfo +// Deprecated: Use KV.ProtoReflect.Descriptor instead. +func (*KV) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{0} +} -func (m *KV) GetKey() []byte { - if m != nil { - return m.Key +func (x *KV) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *KV) GetValue() []byte { - if m != nil { - return m.Value +func (x *KV) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *KV) GetUserMeta() []byte { - if m != nil { - return m.UserMeta +func (x *KV) GetUserMeta() []byte { + if x != nil { + return x.UserMeta } return nil } -func (m *KV) GetVersion() uint64 { - if m != nil { - return m.Version +func (x *KV) GetVersion() uint64 { + if x != nil { + return x.Version } return 0 } -func (m *KV) GetExpiresAt() uint64 { - if m != nil { - return m.ExpiresAt +func (x *KV) GetExpiresAt() uint64 { + if x != nil { + return x.ExpiresAt } return 0 } -func (m *KV) GetMeta() []byte { - if m != nil { - return m.Meta +func (x *KV) GetMeta() []byte { + if x != nil { + return x.Meta } return nil } -func (m *KV) GetStreamId() uint32 { - if m != nil { - return m.StreamId +func (x *KV) GetStreamId() uint32 { + if x != nil { + return x.StreamId } return 0 } -func (m *KV) GetStreamDone() bool { - if m != nil { - return m.StreamDone +func (x *KV) GetStreamDone() bool { + if x != nil { + return x.StreamDone } return false } type KVList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Kv []*KV `protobuf:"bytes,1,rep,name=kv,proto3" json:"kv,omitempty"` // alloc_ref used internally for memory management. AllocRef uint64 `protobuf:"varint,10,opt,name=alloc_ref,json=allocRef,proto3" json:"alloc_ref,omitempty"` } -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_452c1d780baa15ef, []int{1} -} -func (m *KVList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *KVList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KVList.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *KVList) Reset() { + *x = KVList{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *KVList) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVList.Merge(m, src) -} -func (m *KVList) XXX_Size() int { - return m.Size() + +func (x *KVList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KVList) XXX_DiscardUnknown() { - xxx_messageInfo_KVList.DiscardUnknown(m) + +func (*KVList) ProtoMessage() {} + +func (x *KVList) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KVList proto.InternalMessageInfo +// Deprecated: Use KVList.ProtoReflect.Descriptor instead. +func (*KVList) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{1} +} -func (m *KVList) GetKv() []*KV { - if m != nil { - return m.Kv +func (x *KVList) GetKv() []*KV { + if x != nil { + return x.Kv } return nil } -func (m *KVList) GetAllocRef() uint64 { - if m != nil { - return m.AllocRef +func (x *KVList) GetAllocRef() uint64 { + if x != nil { + return x.AllocRef } return 0 } type ManifestChangeSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // A set of changes that are applied atomically. Changes []*ManifestChange `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"` } -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_452c1d780baa15ef, []int{2} -} -func (m *ManifestChangeSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ManifestChangeSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ManifestChangeSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ManifestChangeSet) Reset() { + *x = ManifestChangeSet{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } } -func (m *ManifestChangeSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManifestChangeSet.Merge(m, src) -} -func (m *ManifestChangeSet) XXX_Size() int { - return m.Size() -} -func (m *ManifestChangeSet) XXX_DiscardUnknown() { - xxx_messageInfo_ManifestChangeSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ManifestChangeSet proto.InternalMessageInfo -func (m *ManifestChangeSet) GetChanges() []*ManifestChange { - if m != nil { - return m.Changes - } - return nil +func (x *ManifestChangeSet) String() string { + return protoimpl.X.MessageStringOf(x) } -type ManifestChange struct { - Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` - Op ManifestChange_Operation `protobuf:"varint,2,opt,name=Op,proto3,enum=badgerpb4.ManifestChange_Operation" json:"Op,omitempty"` - Level uint32 `protobuf:"varint,3,opt,name=Level,proto3" json:"Level,omitempty"` - KeyId uint64 `protobuf:"varint,4,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - EncryptionAlgo EncryptionAlgo `protobuf:"varint,5,opt,name=encryption_algo,json=encryptionAlgo,proto3,enum=badgerpb4.EncryptionAlgo" json:"encryption_algo,omitempty"` - Compression uint32 `protobuf:"varint,6,opt,name=compression,proto3" json:"compression,omitempty"` -} +func (*ManifestChangeSet) ProtoMessage() {} -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_452c1d780baa15ef, []int{3} -} -func (m *ManifestChange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ManifestChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ManifestChange.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ManifestChangeSet) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *ManifestChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManifestChange.Merge(m, src) -} -func (m *ManifestChange) XXX_Size() int { - return m.Size() -} -func (m *ManifestChange) XXX_DiscardUnknown() { - xxx_messageInfo_ManifestChange.DiscardUnknown(m) -} - -var xxx_messageInfo_ManifestChange proto.InternalMessageInfo -func (m *ManifestChange) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 +// Deprecated: Use ManifestChangeSet.ProtoReflect.Descriptor instead. +func (*ManifestChangeSet) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{2} } -func (m *ManifestChange) GetOp() ManifestChange_Operation { - if m != nil { - return m.Op +func (x *ManifestChangeSet) GetChanges() []*ManifestChange { + if x != nil { + return x.Changes } - return ManifestChange_CREATE + return nil } -func (m *ManifestChange) GetLevel() uint32 { - if m != nil { - return m.Level - } - return 0 -} +type ManifestChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ManifestChange) GetKeyId() uint64 { - if m != nil { - return m.KeyId - } - return 0 + Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // Table ID. + Op ManifestChange_Operation `protobuf:"varint,2,opt,name=Op,proto3,enum=badgerpb4.ManifestChange_Operation" json:"Op,omitempty"` + Level uint32 `protobuf:"varint,3,opt,name=Level,proto3" json:"Level,omitempty"` // Only used for CREATE. + KeyId uint64 `protobuf:"varint,4,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + EncryptionAlgo EncryptionAlgo `protobuf:"varint,5,opt,name=encryption_algo,json=encryptionAlgo,proto3,enum=badgerpb4.EncryptionAlgo" json:"encryption_algo,omitempty"` + Compression uint32 `protobuf:"varint,6,opt,name=compression,proto3" json:"compression,omitempty"` // Only used for CREATE Op. } -func (m *ManifestChange) GetEncryptionAlgo() EncryptionAlgo { - if m != nil { - return m.EncryptionAlgo +func (x *ManifestChange) Reset() { + *x = ManifestChange{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return EncryptionAlgo_aes } -func (m *ManifestChange) GetCompression() uint32 { - if m != nil { - return m.Compression - } - return 0 +func (x *ManifestChange) String() string { + return protoimpl.X.MessageStringOf(x) } -type Checksum struct { - Algo Checksum_Algorithm `protobuf:"varint,1,opt,name=algo,proto3,enum=badgerpb4.Checksum_Algorithm" json:"algo,omitempty"` - Sum uint64 `protobuf:"varint,2,opt,name=sum,proto3" json:"sum,omitempty"` -} +func (*ManifestChange) ProtoMessage() {} -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_452c1d780baa15ef, []int{4} -} -func (m *Checksum) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Checksum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Checksum.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err +func (x *ManifestChange) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - return b[:n], nil + return ms } + return mi.MessageOf(x) } -func (m *Checksum) XXX_Merge(src proto.Message) { - xxx_messageInfo_Checksum.Merge(m, src) -} -func (m *Checksum) XXX_Size() int { - return m.Size() -} -func (m *Checksum) XXX_DiscardUnknown() { - xxx_messageInfo_Checksum.DiscardUnknown(m) -} - -var xxx_messageInfo_Checksum proto.InternalMessageInfo -func (m *Checksum) GetAlgo() Checksum_Algorithm { - if m != nil { - return m.Algo - } - return Checksum_CRC32C +// Deprecated: Use ManifestChange.ProtoReflect.Descriptor instead. +func (*ManifestChange) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{3} } -func (m *Checksum) GetSum() uint64 { - if m != nil { - return m.Sum +func (x *ManifestChange) GetId() uint64 { + if x != nil { + return x.Id } return 0 } -type DataKey struct { - KeyId uint64 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Iv []byte `protobuf:"bytes,3,opt,name=iv,proto3" json:"iv,omitempty"` - CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` -} - -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_452c1d780baa15ef, []int{5} -} -func (m *DataKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DataKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DataKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (x *ManifestChange) GetOp() ManifestChange_Operation { + if x != nil { + return x.Op } + return ManifestChange_CREATE } -func (m *DataKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataKey.Merge(m, src) -} -func (m *DataKey) XXX_Size() int { - return m.Size() -} -func (m *DataKey) XXX_DiscardUnknown() { - xxx_messageInfo_DataKey.DiscardUnknown(m) -} - -var xxx_messageInfo_DataKey proto.InternalMessageInfo -func (m *DataKey) GetKeyId() uint64 { - if m != nil { - return m.KeyId +func (x *ManifestChange) GetLevel() uint32 { + if x != nil { + return x.Level } return 0 } -func (m *DataKey) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *DataKey) GetIv() []byte { - if m != nil { - return m.Iv - } - return nil -} - -func (m *DataKey) GetCreatedAt() int64 { - if m != nil { - return m.CreatedAt +func (x *ManifestChange) GetKeyId() uint64 { + if x != nil { + return x.KeyId } return 0 } -type Match struct { - Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` - IgnoreBytes string `protobuf:"bytes,2,opt,name=ignore_bytes,json=ignoreBytes,proto3" json:"ignore_bytes,omitempty"` -} - -func (m *Match) Reset() { *m = Match{} } -func (m *Match) String() string { return proto.CompactTextString(m) } -func (*Match) ProtoMessage() {} -func (*Match) Descriptor() ([]byte, []int) { - return fileDescriptor_452c1d780baa15ef, []int{6} -} -func (m *Match) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Match) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Match.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Match) XXX_Merge(src proto.Message) { - xxx_messageInfo_Match.Merge(m, src) -} -func (m *Match) XXX_Size() int { - return m.Size() -} -func (m *Match) XXX_DiscardUnknown() { - xxx_messageInfo_Match.DiscardUnknown(m) -} - -var xxx_messageInfo_Match proto.InternalMessageInfo - -func (m *Match) GetPrefix() []byte { - if m != nil { - return m.Prefix +func (x *ManifestChange) GetEncryptionAlgo() EncryptionAlgo { + if x != nil { + return x.EncryptionAlgo } - return nil + return EncryptionAlgo_aes } -func (m *Match) GetIgnoreBytes() string { - if m != nil { - return m.IgnoreBytes +func (x *ManifestChange) GetCompression() uint32 { + if x != nil { + return x.Compression } - return "" + return 0 } -func init() { - proto.RegisterEnum("badgerpb4.EncryptionAlgo", EncryptionAlgo_name, EncryptionAlgo_value) - proto.RegisterEnum("badgerpb4.ManifestChange_Operation", ManifestChange_Operation_name, ManifestChange_Operation_value) - proto.RegisterEnum("badgerpb4.Checksum_Algorithm", Checksum_Algorithm_name, Checksum_Algorithm_value) - proto.RegisterType((*KV)(nil), "badgerpb4.KV") - proto.RegisterType((*KVList)(nil), "badgerpb4.KVList") - proto.RegisterType((*ManifestChangeSet)(nil), "badgerpb4.ManifestChangeSet") - proto.RegisterType((*ManifestChange)(nil), "badgerpb4.ManifestChange") - proto.RegisterType((*Checksum)(nil), "badgerpb4.Checksum") - proto.RegisterType((*DataKey)(nil), "badgerpb4.DataKey") - proto.RegisterType((*Match)(nil), "badgerpb4.Match") -} - -func init() { proto.RegisterFile("badgerpb4.proto", fileDescriptor_452c1d780baa15ef) } - -var fileDescriptor_452c1d780baa15ef = []byte{ - // 653 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4f, 0x6b, 0xdb, 0x4e, - 0x10, 0xf5, 0xca, 0xf2, 0xbf, 0x71, 0xe2, 0xf8, 0xb7, 0xfc, 0x5a, 0x14, 0x4a, 0x5c, 0x47, 0xa1, - 0x60, 0x0a, 0xb5, 0x69, 0x1c, 0x7a, 0xe9, 0xc9, 0xff, 0x20, 0xc6, 0x09, 0x81, 0x6d, 0x08, 0xa1, - 0x17, 0xb3, 0x96, 0xc6, 0xb6, 0xb0, 0x2d, 0x89, 0xd5, 0x5a, 0xc4, 0x1f, 0xa2, 0xd0, 0x8f, 0xd5, - 0x63, 0x0e, 0x3d, 0xf4, 0x58, 0x92, 0x2f, 0x52, 0x76, 0xa5, 0xb8, 0xf6, 0xa1, 0xb7, 0x99, 0x37, - 0xa3, 0x79, 0xa3, 0xf7, 0x46, 0x82, 0xa3, 0x09, 0x77, 0x67, 0x28, 0xc2, 0xc9, 0x45, 0x33, 0x14, - 0x81, 0x0c, 0x68, 0x69, 0x0b, 0xd8, 0x3f, 0x09, 0x18, 0xa3, 0x3b, 0x5a, 0x85, 0xec, 0x02, 0x37, - 0x16, 0xa9, 0x93, 0xc6, 0x01, 0x53, 0x21, 0xfd, 0x1f, 0x72, 0x31, 0x5f, 0xae, 0xd1, 0x32, 0x34, - 0x96, 0x24, 0xf4, 0x0d, 0x94, 0xd6, 0x11, 0x8a, 0xf1, 0x0a, 0x25, 0xb7, 0xb2, 0xba, 0x52, 0x54, - 0xc0, 0x35, 0x4a, 0x4e, 0x2d, 0x28, 0xc4, 0x28, 0x22, 0x2f, 0xf0, 0x2d, 0xb3, 0x4e, 0x1a, 0x26, - 0x7b, 0x49, 0xe9, 0x09, 0x00, 0x3e, 0x84, 0x9e, 0xc0, 0x68, 0xcc, 0xa5, 0x95, 0xd3, 0xc5, 0x52, - 0x8a, 0x74, 0x24, 0xa5, 0x60, 0xea, 0x81, 0x79, 0x3d, 0x50, 0xc7, 0x8a, 0x29, 0x92, 0x02, 0xf9, - 0x6a, 0xec, 0xb9, 0x16, 0xd4, 0x49, 0xe3, 0x90, 0x15, 0x13, 0x60, 0xe8, 0xd2, 0xb7, 0x50, 0x4e, - 0x8b, 0x6e, 0xe0, 0xa3, 0x55, 0xae, 0x93, 0x46, 0x91, 0x41, 0x02, 0xf5, 0x03, 0x1f, 0xed, 0x3e, - 0xe4, 0x47, 0x77, 0x57, 0x5e, 0x24, 0xe9, 0x09, 0x18, 0x8b, 0xd8, 0x22, 0xf5, 0x6c, 0xa3, 0x7c, - 0x7e, 0xd8, 0xfc, 0xab, 0xc4, 0xe8, 0x8e, 0x19, 0x8b, 0x58, 0xd1, 0xf0, 0xe5, 0x32, 0x70, 0xc6, - 0x02, 0xa7, 0x9a, 0xc6, 0x64, 0x45, 0x0d, 0x30, 0x9c, 0xda, 0x97, 0xf0, 0xdf, 0x35, 0xf7, 0xbd, - 0x29, 0x46, 0xb2, 0x37, 0xe7, 0xfe, 0x0c, 0xbf, 0xa0, 0xa4, 0x6d, 0x28, 0x38, 0x3a, 0x89, 0xd2, - 0xa9, 0xc7, 0x3b, 0x53, 0xf7, 0xdb, 0xd9, 0x4b, 0xa7, 0xfd, 0xcd, 0x80, 0xca, 0x7e, 0x8d, 0x56, - 0xc0, 0x18, 0xba, 0x5a, 0x71, 0x93, 0x19, 0x43, 0x97, 0xb6, 0xc1, 0xb8, 0x09, 0xb5, 0xda, 0x95, - 0xf3, 0xb3, 0x7f, 0x8e, 0x6c, 0xde, 0x84, 0x28, 0xb8, 0xf4, 0x02, 0x9f, 0x19, 0x37, 0xa1, 0x72, - 0xe9, 0x0a, 0x63, 0x5c, 0x6a, 0x2f, 0x0e, 0x59, 0x92, 0xd0, 0x57, 0x90, 0x5f, 0xe0, 0x46, 0x09, - 0x97, 0xf8, 0x90, 0x5b, 0xe0, 0x66, 0xe8, 0xd2, 0x2e, 0x1c, 0xa1, 0xef, 0x88, 0x4d, 0xa8, 0x1e, - 0x1f, 0xf3, 0xe5, 0x2c, 0xd0, 0x56, 0x54, 0xf6, 0xde, 0x60, 0xb0, 0xed, 0xe8, 0x2c, 0x67, 0x01, - 0xab, 0xe0, 0x5e, 0x4e, 0xeb, 0x50, 0x76, 0x82, 0x55, 0x28, 0x30, 0xd2, 0x3e, 0xe7, 0x35, 0xed, - 0x2e, 0x64, 0x9f, 0x41, 0x69, 0xbb, 0x23, 0x05, 0xc8, 0xf7, 0xd8, 0xa0, 0x73, 0x3b, 0xa8, 0x66, - 0x54, 0xdc, 0x1f, 0x5c, 0x0d, 0x6e, 0x07, 0x55, 0x62, 0xc7, 0x50, 0xec, 0xcd, 0xd1, 0x59, 0x44, - 0xeb, 0x15, 0xfd, 0x08, 0xa6, 0xde, 0x85, 0xe8, 0x5d, 0x4e, 0x76, 0x76, 0x79, 0x69, 0x69, 0x2a, - 0x6a, 0xe1, 0xc9, 0xf9, 0x8a, 0xe9, 0x56, 0x75, 0xae, 0xd1, 0x7a, 0xa5, 0xc5, 0x32, 0x99, 0x0a, - 0xed, 0x77, 0x50, 0xda, 0x36, 0x25, 0xac, 0xbd, 0xf6, 0x79, 0xaf, 0x9a, 0xa1, 0x07, 0x50, 0xbc, - 0xbf, 0xbf, 0xe4, 0xd1, 0xfc, 0xd3, 0x45, 0x95, 0xd8, 0x0e, 0x14, 0xfa, 0x5c, 0xf2, 0x11, 0x6e, - 0x76, 0x44, 0x22, 0xbb, 0x22, 0x51, 0x30, 0x5d, 0x2e, 0x79, 0x7a, 0xf6, 0x3a, 0x56, 0x56, 0x79, - 0x71, 0x7a, 0xee, 0x86, 0x17, 0xab, 0x73, 0x76, 0x04, 0x72, 0x89, 0xae, 0x3a, 0x67, 0xa5, 0x71, - 0x96, 0x95, 0x52, 0xa4, 0x23, 0xed, 0x2e, 0xe4, 0xae, 0xb9, 0x74, 0xe6, 0xf4, 0x35, 0xe4, 0x43, - 0x81, 0x53, 0xef, 0x21, 0xfd, 0xb0, 0xd2, 0x8c, 0x9e, 0xc2, 0x81, 0x37, 0xf3, 0x03, 0x81, 0xe3, - 0xc9, 0x46, 0x62, 0xa4, 0xb9, 0x4a, 0xac, 0x9c, 0x60, 0x5d, 0x05, 0xbd, 0x3f, 0x86, 0xca, 0xbe, - 0x13, 0xb4, 0x00, 0x59, 0x8e, 0x51, 0x35, 0xd3, 0xfd, 0xfc, 0xe3, 0xa9, 0x46, 0x1e, 0x9f, 0x6a, - 0xe4, 0xf7, 0x53, 0x8d, 0x7c, 0x7f, 0xae, 0x65, 0x1e, 0x9f, 0x6b, 0x99, 0x5f, 0xcf, 0xb5, 0xcc, - 0xd7, 0xd3, 0x99, 0x27, 0xe7, 0xeb, 0x49, 0xd3, 0x09, 0x56, 0x2d, 0x77, 0x26, 0x78, 0x38, 0xff, - 0xe0, 0x05, 0xad, 0x44, 0xcf, 0x56, 0x7c, 0xd1, 0x0a, 0x27, 0x93, 0xbc, 0xfe, 0x03, 0xb4, 0xff, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xec, 0x26, 0x3b, 0x76, 0x14, 0x04, 0x00, 0x00, -} - -func (m *KV) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type Checksum struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *KV) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + Algo Checksum_Algorithm `protobuf:"varint,1,opt,name=algo,proto3,enum=badgerpb4.Checksum_Algorithm" json:"algo,omitempty"` // For storing type of Checksum algorithm used + Sum uint64 `protobuf:"varint,2,opt,name=sum,proto3" json:"sum,omitempty"` } -func (m *KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.StreamDone { - i-- - if m.StreamDone { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 +func (x *Checksum) Reset() { + *x = Checksum{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if m.StreamId != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.StreamId)) - i-- - dAtA[i] = 0x50 - } - if len(m.Meta) > 0 { - i -= len(m.Meta) - copy(dAtA[i:], m.Meta) - i = encodeVarintBadgerpb4(dAtA, i, uint64(len(m.Meta))) - i-- - dAtA[i] = 0x32 - } - if m.ExpiresAt != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.ExpiresAt)) - i-- - dAtA[i] = 0x28 - } - if m.Version != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x20 - } - if len(m.UserMeta) > 0 { - i -= len(m.UserMeta) - copy(dAtA[i:], m.UserMeta) - i = encodeVarintBadgerpb4(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 = encodeVarintBadgerpb4(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 = encodeVarintBadgerpb4(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil } -func (m *KVList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *Checksum) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KVList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*Checksum) ProtoMessage() {} -func (m *KVList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AllocRef != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.AllocRef)) - i-- - dAtA[i] = 0x50 - } - if len(m.Kv) > 0 { - 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 = encodeVarintBadgerpb4(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa +func (x *Checksum) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } + return ms } - return len(dAtA) - i, nil + return mi.MessageOf(x) } -func (m *ManifestChangeSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ManifestChangeSet) MarshalTo(dAtA []byte) (int, error) { - 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 len(m.Changes) > 0 { - 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 = encodeVarintBadgerpb4(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil +// Deprecated: Use Checksum.ProtoReflect.Descriptor instead. +func (*Checksum) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{4} } -func (m *ManifestChange) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *Checksum) GetAlgo() Checksum_Algorithm { + if x != nil { + return x.Algo } - return dAtA[:n], nil -} - -func (m *ManifestChange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return Checksum_CRC32C } -func (m *ManifestChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Compression != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Compression)) - i-- - dAtA[i] = 0x30 - } - if m.EncryptionAlgo != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.EncryptionAlgo)) - i-- - dAtA[i] = 0x28 +func (x *Checksum) GetSum() uint64 { + if x != nil { + return x.Sum } - if m.KeyId != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.KeyId)) - i-- - dAtA[i] = 0x20 - } - if m.Level != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Level)) - i-- - dAtA[i] = 0x18 - } - if m.Op != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Op)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return 0 } -func (m *Checksum) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} +type DataKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Checksum) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + KeyId uint64 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Iv []byte `protobuf:"bytes,3,opt,name=iv,proto3" json:"iv,omitempty"` + CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } -func (m *Checksum) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Sum)) - i-- - dAtA[i] = 0x10 - } - if m.Algo != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.Algo)) - i-- - dAtA[i] = 0x8 +func (x *DataKey) Reset() { + *x = DataKey{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return len(dAtA) - i, nil } -func (m *DataKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func (x *DataKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DataKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func (*DataKey) ProtoMessage() {} -func (m *DataKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CreatedAt != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x20 - } - if len(m.Iv) > 0 { - i -= len(m.Iv) - copy(dAtA[i:], m.Iv) - i = encodeVarintBadgerpb4(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 = encodeVarintBadgerpb4(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.KeyId != 0 { - i = encodeVarintBadgerpb4(dAtA, i, uint64(m.KeyId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Match) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (x *DataKey) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return dAtA[:n], nil -} - -func (m *Match) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return mi.MessageOf(x) } -func (m *Match) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.IgnoreBytes) > 0 { - i -= len(m.IgnoreBytes) - copy(dAtA[i:], m.IgnoreBytes) - i = encodeVarintBadgerpb4(dAtA, i, uint64(len(m.IgnoreBytes))) - i-- - dAtA[i] = 0x12 - } - if len(m.Prefix) > 0 { - i -= len(m.Prefix) - copy(dAtA[i:], m.Prefix) - i = encodeVarintBadgerpb4(dAtA, i, uint64(len(m.Prefix))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +// Deprecated: Use DataKey.ProtoReflect.Descriptor instead. +func (*DataKey) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{5} } -func encodeVarintBadgerpb4(dAtA []byte, offset int, v uint64) int { - offset -= sovBadgerpb4(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *KV) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - l = len(m.UserMeta) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - if m.Version != 0 { - n += 1 + sovBadgerpb4(uint64(m.Version)) +func (x *DataKey) GetKeyId() uint64 { + if x != nil { + return x.KeyId } - if m.ExpiresAt != 0 { - n += 1 + sovBadgerpb4(uint64(m.ExpiresAt)) - } - l = len(m.Meta) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - if m.StreamId != 0 { - n += 1 + sovBadgerpb4(uint64(m.StreamId)) - } - if m.StreamDone { - n += 2 - } - return n + return 0 } -func (m *KVList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Kv) > 0 { - for _, e := range m.Kv { - l = e.Size() - n += 1 + l + sovBadgerpb4(uint64(l)) - } +func (x *DataKey) GetData() []byte { + if x != nil { + return x.Data } - if m.AllocRef != 0 { - n += 1 + sovBadgerpb4(uint64(m.AllocRef)) - } - return n + return nil } -func (m *ManifestChangeSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovBadgerpb4(uint64(l)) - } +func (x *DataKey) GetIv() []byte { + if x != nil { + return x.Iv } - return n + return nil } -func (m *ManifestChange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovBadgerpb4(uint64(m.Id)) +func (x *DataKey) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt } - if m.Op != 0 { - n += 1 + sovBadgerpb4(uint64(m.Op)) - } - if m.Level != 0 { - n += 1 + sovBadgerpb4(uint64(m.Level)) - } - if m.KeyId != 0 { - n += 1 + sovBadgerpb4(uint64(m.KeyId)) - } - if m.EncryptionAlgo != 0 { - n += 1 + sovBadgerpb4(uint64(m.EncryptionAlgo)) - } - if m.Compression != 0 { - n += 1 + sovBadgerpb4(uint64(m.Compression)) - } - return n + return 0 } -func (m *Checksum) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Algo != 0 { - n += 1 + sovBadgerpb4(uint64(m.Algo)) - } - if m.Sum != 0 { - n += 1 + sovBadgerpb4(uint64(m.Sum)) - } - return n -} +type Match struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DataKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.KeyId != 0 { - n += 1 + sovBadgerpb4(uint64(m.KeyId)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - l = len(m.Iv) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - if m.CreatedAt != 0 { - n += 1 + sovBadgerpb4(uint64(m.CreatedAt)) - } - return n + Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` + IgnoreBytes string `protobuf:"bytes,2,opt,name=ignore_bytes,json=ignoreBytes,proto3" json:"ignore_bytes,omitempty"` // Comma separated with dash to represent ranges "1, 2-3, 4-7, 9" } -func (m *Match) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Prefix) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) +func (x *Match) Reset() { + *x = Match{} + if protoimpl.UnsafeEnabled { + mi := &file_badgerpb4_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - l = len(m.IgnoreBytes) - if l > 0 { - n += 1 + l + sovBadgerpb4(uint64(l)) - } - return n } -func sovBadgerpb4(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBadgerpb4(x uint64) (n int) { - return sovBadgerpb4(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (x *Match) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KV) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KV: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KV: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserMeta", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserMeta = append(m.UserMeta[:0], dAtA[iNdEx:postIndex]...) - if m.UserMeta == nil { - m.UserMeta = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) - } - m.ExpiresAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpiresAt |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Meta = append(m.Meta[:0], dAtA[iNdEx:postIndex]...) - if m.Meta == nil { - m.Meta = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StreamId", wireType) - } - m.StreamId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StreamId |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StreamDone", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StreamDone = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *KVList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KVList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KVList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kv = append(m.Kv, &KV{}) - if err := m.Kv[len(m.Kv)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocRef", wireType) - } - m.AllocRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AllocRef |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } +func (*Match) ProtoMessage() {} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ManifestChangeSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ManifestChangeSet: wiretype end group for non-group") +func (x *Match) ProtoReflect() protoreflect.Message { + mi := &file_badgerpb4_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - if fieldNum <= 0 { - return fmt.Errorf("proto: ManifestChangeSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, &ManifestChange{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF + return ms } - return nil + return mi.MessageOf(x) } -func (m *ManifestChange) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ManifestChange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ManifestChange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) - } - m.Op = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Op |= ManifestChange_Operation(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) - } - m.Level = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Level |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyId", wireType) - } - m.KeyId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeyId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionAlgo", wireType) - } - m.EncryptionAlgo = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EncryptionAlgo |= EncryptionAlgo(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Compression", wireType) - } - m.Compression = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Compression |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +// Deprecated: Use Match.ProtoReflect.Descriptor instead. +func (*Match) Descriptor() ([]byte, []int) { + return file_badgerpb4_proto_rawDescGZIP(), []int{6} } -func (m *Checksum) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Checksum: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Checksum: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Algo", wireType) - } - m.Algo = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Algo |= Checksum_Algorithm(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) - } - m.Sum = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Sum |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *Match) GetPrefix() []byte { + if x != nil { + return x.Prefix } return nil } -func (m *DataKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DataKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DataKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyId", wireType) - } - m.KeyId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeyId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Iv", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Iv = append(m.Iv[:0], dAtA[iNdEx:postIndex]...) - if m.Iv == nil { - m.Iv = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - m.CreatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF +func (x *Match) GetIgnoreBytes() string { + if x != nil { + return x.IgnoreBytes } - return nil + return "" } -func (m *Match) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Match: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Match: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prefix = append(m.Prefix[:0], dAtA[iNdEx:postIndex]...) - if m.Prefix == nil { - m.Prefix = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreBytes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthBadgerpb4 - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBadgerpb4 - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IgnoreBytes = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBadgerpb4(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBadgerpb4 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBadgerpb4(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 { - if shift >= 64 { - return 0, ErrIntOverflowBadgerpb4 - } - 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 shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBadgerpb4 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthBadgerpb4 - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBadgerpb4 - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBadgerpb4 - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF +var File_badgerpb4_proto protoreflect.FileDescriptor + +var file_badgerpb4_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x22, 0xd4, 0x01, 0x0a, + 0x02, 0x4b, 0x56, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x64, 0x6f, 0x6e, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x44, + 0x6f, 0x6e, 0x65, 0x22, 0x44, 0x0a, 0x06, 0x4b, 0x56, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x02, 0x6b, 0x76, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x64, 0x67, + 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x4b, 0x56, 0x52, 0x02, 0x6b, 0x76, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x52, 0x65, 0x66, 0x22, 0x48, 0x0a, 0x11, 0x4d, 0x61, 0x6e, + 0x69, 0x66, 0x65, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x12, 0x33, + 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x4d, 0x61, 0x6e, 0x69, + 0x66, 0x65, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x22, 0x8d, 0x02, 0x0a, 0x0e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x02, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x02, 0x4f, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x4d, + 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x4f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0f, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x45, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x52, 0x0e, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x12, 0x20, 0x0a, 0x0b, + 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x23, + 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x43, + 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, + 0x45, 0x10, 0x01, 0x22, 0x76, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, + 0x31, 0x0a, 0x04, 0x61, 0x6c, 0x67, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, + 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x70, 0x62, 0x34, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x2e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x04, 0x61, 0x6c, + 0x67, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x73, 0x75, 0x6d, 0x22, 0x25, 0x0a, 0x09, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x43, 0x33, 0x32, 0x43, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x58, 0x58, 0x48, 0x61, 0x73, 0x68, 0x36, 0x34, 0x10, 0x01, 0x22, 0x63, 0x0a, 0x07, 0x44, + 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, + 0x76, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x22, 0x42, 0x0a, 0x05, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x2a, 0x19, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x12, 0x07, 0x0a, 0x03, 0x61, 0x65, 0x73, 0x10, 0x00, 0x42, + 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x2d, 0x69, 0x6f, 0x2f, 0x62, 0x61, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x76, + 0x34, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - ErrInvalidLengthBadgerpb4 = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBadgerpb4 = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBadgerpb4 = fmt.Errorf("proto: unexpected end of group") + file_badgerpb4_proto_rawDescOnce sync.Once + file_badgerpb4_proto_rawDescData = file_badgerpb4_proto_rawDesc ) + +func file_badgerpb4_proto_rawDescGZIP() []byte { + file_badgerpb4_proto_rawDescOnce.Do(func() { + file_badgerpb4_proto_rawDescData = protoimpl.X.CompressGZIP(file_badgerpb4_proto_rawDescData) + }) + return file_badgerpb4_proto_rawDescData +} + +var file_badgerpb4_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_badgerpb4_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_badgerpb4_proto_goTypes = []interface{}{ + (EncryptionAlgo)(0), // 0: badgerpb4.EncryptionAlgo + (ManifestChange_Operation)(0), // 1: badgerpb4.ManifestChange.Operation + (Checksum_Algorithm)(0), // 2: badgerpb4.Checksum.Algorithm + (*KV)(nil), // 3: badgerpb4.KV + (*KVList)(nil), // 4: badgerpb4.KVList + (*ManifestChangeSet)(nil), // 5: badgerpb4.ManifestChangeSet + (*ManifestChange)(nil), // 6: badgerpb4.ManifestChange + (*Checksum)(nil), // 7: badgerpb4.Checksum + (*DataKey)(nil), // 8: badgerpb4.DataKey + (*Match)(nil), // 9: badgerpb4.Match +} +var file_badgerpb4_proto_depIdxs = []int32{ + 3, // 0: badgerpb4.KVList.kv:type_name -> badgerpb4.KV + 6, // 1: badgerpb4.ManifestChangeSet.changes:type_name -> badgerpb4.ManifestChange + 1, // 2: badgerpb4.ManifestChange.Op:type_name -> badgerpb4.ManifestChange.Operation + 0, // 3: badgerpb4.ManifestChange.encryption_algo:type_name -> badgerpb4.EncryptionAlgo + 2, // 4: badgerpb4.Checksum.algo:type_name -> badgerpb4.Checksum.Algorithm + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_badgerpb4_proto_init() } +func file_badgerpb4_proto_init() { + if File_badgerpb4_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_badgerpb4_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManifestChangeSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManifestChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Checksum); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_badgerpb4_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Match); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_badgerpb4_proto_rawDesc, + NumEnums: 3, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_badgerpb4_proto_goTypes, + DependencyIndexes: file_badgerpb4_proto_depIdxs, + EnumInfos: file_badgerpb4_proto_enumTypes, + MessageInfos: file_badgerpb4_proto_msgTypes, + }.Build() + File_badgerpb4_proto = out.File + file_badgerpb4_proto_rawDesc = nil + file_badgerpb4_proto_goTypes = nil + file_badgerpb4_proto_depIdxs = nil +} diff --git a/pb/badgerpb4.proto b/pb/badgerpb4.proto index 079c1cfee..62bfc90b6 100644 --- a/pb/badgerpb4.proto +++ b/pb/badgerpb4.proto @@ -54,8 +54,8 @@ enum EncryptionAlgo { message ManifestChange { uint64 Id = 1; // Table ID. enum Operation { - CREATE = 0; - DELETE = 1; + CREATE = 0; + DELETE = 1; } Operation Op = 2; uint32 Level = 3; // Only used for CREATE. diff --git a/pb/gen.sh b/pb/gen.sh index 864845bcf..f09cb24ee 100755 --- a/pb/gen.sh +++ b/pb/gen.sh @@ -3,5 +3,5 @@ # Run this script from its directory, so that badgerpb4.proto is where it's expected to # be. -go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest -protoc --gogofaster_out=. --gogofaster_opt=paths=source_relative -I=. badgerpb4.proto +go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 +protoc --go_out=. --go_opt=paths=source_relative badgerpb4.proto diff --git a/stream.go b/stream.go index 017ddb4ed..934c8abcf 100644 --- a/stream.go +++ b/stream.go @@ -25,6 +25,7 @@ import ( "time" humanize "github.com/dustin/go-humanize" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/y" @@ -486,7 +487,7 @@ func BufferToKVList(buf *z.Buffer) (*pb.KVList, error) { var list pb.KVList err := buf.SliceIterate(func(s []byte) error { kv := new(pb.KV) - if err := kv.Unmarshal(s); err != nil { + if err := proto.Unmarshal(s, kv); err != nil { return err } list.Kv = append(list.Kv, kv) @@ -496,6 +497,7 @@ func BufferToKVList(buf *z.Buffer) (*pb.KVList, error) { } func KVToBuffer(kv *pb.KV, buf *z.Buffer) { - out := buf.SliceAllocate(kv.Size()) - y.Check2(kv.MarshalToSizedBuffer(out)) + in := buf.SliceAllocate(proto.Size(kv))[:0] + _, err := proto.MarshalOptions{}.MarshalAppend(in, kv) + y.AssertTrue(err == nil) } diff --git a/stream_test.go b/stream_test.go index d89a59236..d69d7d2d5 100644 --- a/stream_test.go +++ b/stream_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" bpb "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/y" diff --git a/stream_writer.go b/stream_writer.go index 36cc5b86d..0059c1eae 100644 --- a/stream_writer.go +++ b/stream_writer.go @@ -23,6 +23,7 @@ import ( humanize "github.com/dustin/go-humanize" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/badger/v4/table" @@ -152,7 +153,7 @@ func (sw *StreamWriter) Write(buf *z.Buffer) error { err := buf.SliceIterate(func(s []byte) error { var kv pb.KV - if err := kv.Unmarshal(s); err != nil { + if err := proto.Unmarshal(s, &kv); err != nil { return err } if kv.StreamDone { diff --git a/table/builder.go b/table/builder.go index 14a357cf1..7d439f338 100644 --- a/table/builder.go +++ b/table/builder.go @@ -24,10 +24,10 @@ import ( "sync/atomic" "unsafe" - "github.com/golang/protobuf/proto" fbs "github.com/google/flatbuffers/go" "github.com/klauspost/compress/s2" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/fb" "github.com/dgraph-io/badger/v4/options" diff --git a/table/table.go b/table/table.go index 3eabae4d0..1f90a73e5 100644 --- a/table/table.go +++ b/table/table.go @@ -31,10 +31,10 @@ import ( "time" "unsafe" - "github.com/golang/protobuf/proto" "github.com/klauspost/compress/snappy" "github.com/klauspost/compress/zstd" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/fb" "github.com/dgraph-io/badger/v4/options" diff --git a/y/y_test.go b/y/y_test.go index 79eb0771e..3fc923b70 100644 --- a/y/y_test.go +++ b/y/y_test.go @@ -10,6 +10,7 @@ import ( "time" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "github.com/dgraph-io/badger/v4/pb" "github.com/dgraph-io/ristretto/v2/z" @@ -317,7 +318,7 @@ func TestAllocatorReuse(t *testing.T) { kv.Version = uint64(sz) list.Kv = append(list.Kv, kv) } - _, err := list.Marshal() + _, err := proto.Marshal(&list) require.NoError(t, err) } t.Logf("Allocator: %s\n", a)