From 159776d081b2941db306372a3707f7befb8b875e Mon Sep 17 00:00:00 2001 From: Dane Strandboge Date: Thu, 21 Oct 2021 14:18:14 -0500 Subject: [PATCH] chore: upgrade `influx_tools` to new protobuf library (#22727) --- .../internal/format/binary/binary.pb.go | 2460 ----------------- .../internal/format/binary/common.go | 8 +- .../internal/format/binary/reader.go | 27 +- .../internal/format/binary/reader_test.go | 20 +- .../internal/format/binary/tools_binary.pb.go | 909 ++++++ .../{binary.proto => tools_binary.proto} | 23 +- .../internal/format/binary/writer.go | 33 +- .../internal/format/binary/writer_test.go | 22 +- cmd/influxd/backup_util/backup_util.go | 2 +- .../{data.pb.go => backup_util.pb.go} | 72 +- .../{data.proto => backup_util.proto} | 0 go.mod | 2 +- go.sum | 1 - services/httpd/handler.go | 7 +- services/httpd/handler_test.go | 23 +- tests/server_test.go | 7 +- tools.go | 3 - 17 files changed, 1020 insertions(+), 2599 deletions(-) delete mode 100644 cmd/influx_tools/internal/format/binary/binary.pb.go create mode 100644 cmd/influx_tools/internal/format/binary/tools_binary.pb.go rename cmd/influx_tools/internal/format/binary/{binary.proto => tools_binary.proto} (56%) rename cmd/influxd/backup_util/internal/{data.pb.go => backup_util.pb.go} (52%) rename cmd/influxd/backup_util/internal/{data.proto => backup_util.proto} (100%) diff --git a/cmd/influx_tools/internal/format/binary/binary.pb.go b/cmd/influx_tools/internal/format/binary/binary.pb.go deleted file mode 100644 index b2994cfcbc9..00000000000 --- a/cmd/influx_tools/internal/format/binary/binary.pb.go +++ /dev/null @@ -1,2460 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: binary.proto - -package binary - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type FieldType int32 - -const ( - FloatFieldType FieldType = 0 - IntegerFieldType FieldType = 1 - UnsignedFieldType FieldType = 2 - BooleanFieldType FieldType = 3 - StringFieldType FieldType = 4 -) - -var FieldType_name = map[int32]string{ - 0: "FLOAT", - 1: "INTEGER", - 2: "UNSIGNED", - 3: "BOOLEAN", - 4: "STRING", -} - -var FieldType_value = map[string]int32{ - "FLOAT": 0, - "INTEGER": 1, - "UNSIGNED": 2, - "BOOLEAN": 3, - "STRING": 4, -} - -func (x FieldType) String() string { - return proto.EnumName(FieldType_name, int32(x)) -} - -func (FieldType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{0} -} - -type Header_Version int32 - -const ( - Version0 Header_Version = 0 -) - -var Header_Version_name = map[int32]string{ - 0: "VERSION_0", -} - -var Header_Version_value = map[string]int32{ - "VERSION_0": 0, -} - -func (x Header_Version) String() string { - return proto.EnumName(Header_Version_name, int32(x)) -} - -func (Header_Version) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{0, 0} -} - -type Header struct { - Version Header_Version `protobuf:"varint,1,opt,name=version,proto3,enum=binary.Header_Version" json:"version,omitempty"` - Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"` - RetentionPolicy string `protobuf:"bytes,3,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"` - ShardDuration time.Duration `protobuf:"varint,4,opt,name=shard_duration,json=shardDuration,proto3,stdduration" json:"shard_duration,omitempty"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{0} -} -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.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 *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return m.Size() -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -type BucketHeader struct { - Start int64 `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"` - End int64 `protobuf:"fixed64,2,opt,name=end,proto3" json:"end,omitempty"` -} - -func (m *BucketHeader) Reset() { *m = BucketHeader{} } -func (m *BucketHeader) String() string { return proto.CompactTextString(m) } -func (*BucketHeader) ProtoMessage() {} -func (*BucketHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{1} -} -func (m *BucketHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BucketHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BucketHeader.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 *BucketHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketHeader.Merge(m, src) -} -func (m *BucketHeader) XXX_Size() int { - return m.Size() -} -func (m *BucketHeader) XXX_DiscardUnknown() { - xxx_messageInfo_BucketHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_BucketHeader proto.InternalMessageInfo - -type BucketFooter struct { -} - -func (m *BucketFooter) Reset() { *m = BucketFooter{} } -func (m *BucketFooter) String() string { return proto.CompactTextString(m) } -func (*BucketFooter) ProtoMessage() {} -func (*BucketFooter) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{2} -} -func (m *BucketFooter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BucketFooter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BucketFooter.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 *BucketFooter) XXX_Merge(src proto.Message) { - xxx_messageInfo_BucketFooter.Merge(m, src) -} -func (m *BucketFooter) XXX_Size() int { - return m.Size() -} -func (m *BucketFooter) XXX_DiscardUnknown() { - xxx_messageInfo_BucketFooter.DiscardUnknown(m) -} - -var xxx_messageInfo_BucketFooter proto.InternalMessageInfo - -type FloatPoints struct { - Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` - Values []float64 `protobuf:"fixed64,2,rep,packed,name=values,proto3" json:"values,omitempty"` -} - -func (m *FloatPoints) Reset() { *m = FloatPoints{} } -func (m *FloatPoints) String() string { return proto.CompactTextString(m) } -func (*FloatPoints) ProtoMessage() {} -func (*FloatPoints) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{3} -} -func (m *FloatPoints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FloatPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FloatPoints.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 *FloatPoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_FloatPoints.Merge(m, src) -} -func (m *FloatPoints) XXX_Size() int { - return m.Size() -} -func (m *FloatPoints) XXX_DiscardUnknown() { - xxx_messageInfo_FloatPoints.DiscardUnknown(m) -} - -var xxx_messageInfo_FloatPoints proto.InternalMessageInfo - -type IntegerPoints struct { - Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` - Values []int64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` -} - -func (m *IntegerPoints) Reset() { *m = IntegerPoints{} } -func (m *IntegerPoints) String() string { return proto.CompactTextString(m) } -func (*IntegerPoints) ProtoMessage() {} -func (*IntegerPoints) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{4} -} -func (m *IntegerPoints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IntegerPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IntegerPoints.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 *IntegerPoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_IntegerPoints.Merge(m, src) -} -func (m *IntegerPoints) XXX_Size() int { - return m.Size() -} -func (m *IntegerPoints) XXX_DiscardUnknown() { - xxx_messageInfo_IntegerPoints.DiscardUnknown(m) -} - -var xxx_messageInfo_IntegerPoints proto.InternalMessageInfo - -type UnsignedPoints struct { - Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` - Values []uint64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` -} - -func (m *UnsignedPoints) Reset() { *m = UnsignedPoints{} } -func (m *UnsignedPoints) String() string { return proto.CompactTextString(m) } -func (*UnsignedPoints) ProtoMessage() {} -func (*UnsignedPoints) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{5} -} -func (m *UnsignedPoints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnsignedPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnsignedPoints.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 *UnsignedPoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnsignedPoints.Merge(m, src) -} -func (m *UnsignedPoints) XXX_Size() int { - return m.Size() -} -func (m *UnsignedPoints) XXX_DiscardUnknown() { - xxx_messageInfo_UnsignedPoints.DiscardUnknown(m) -} - -var xxx_messageInfo_UnsignedPoints proto.InternalMessageInfo - -type BooleanPoints struct { - Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` - Values []bool `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` -} - -func (m *BooleanPoints) Reset() { *m = BooleanPoints{} } -func (m *BooleanPoints) String() string { return proto.CompactTextString(m) } -func (*BooleanPoints) ProtoMessage() {} -func (*BooleanPoints) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{6} -} -func (m *BooleanPoints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BooleanPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BooleanPoints.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 *BooleanPoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_BooleanPoints.Merge(m, src) -} -func (m *BooleanPoints) XXX_Size() int { - return m.Size() -} -func (m *BooleanPoints) XXX_DiscardUnknown() { - xxx_messageInfo_BooleanPoints.DiscardUnknown(m) -} - -var xxx_messageInfo_BooleanPoints proto.InternalMessageInfo - -type StringPoints struct { - Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` - Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` -} - -func (m *StringPoints) Reset() { *m = StringPoints{} } -func (m *StringPoints) String() string { return proto.CompactTextString(m) } -func (*StringPoints) ProtoMessage() {} -func (*StringPoints) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{7} -} -func (m *StringPoints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StringPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StringPoints.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 *StringPoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringPoints.Merge(m, src) -} -func (m *StringPoints) XXX_Size() int { - return m.Size() -} -func (m *StringPoints) XXX_DiscardUnknown() { - xxx_messageInfo_StringPoints.DiscardUnknown(m) -} - -var xxx_messageInfo_StringPoints proto.InternalMessageInfo - -type SeriesHeader struct { - FieldType FieldType `protobuf:"varint,1,opt,name=field_type,json=fieldType,proto3,enum=binary.FieldType" json:"field_type,omitempty"` - SeriesKey []byte `protobuf:"bytes,2,opt,name=series_key,json=seriesKey,proto3" json:"series_key,omitempty"` - Field []byte `protobuf:"bytes,3,opt,name=field,proto3" json:"field,omitempty"` -} - -func (m *SeriesHeader) Reset() { *m = SeriesHeader{} } -func (m *SeriesHeader) String() string { return proto.CompactTextString(m) } -func (*SeriesHeader) ProtoMessage() {} -func (*SeriesHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{8} -} -func (m *SeriesHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesHeader.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 *SeriesHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesHeader.Merge(m, src) -} -func (m *SeriesHeader) XXX_Size() int { - return m.Size() -} -func (m *SeriesHeader) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_SeriesHeader proto.InternalMessageInfo - -type SeriesFooter struct { -} - -func (m *SeriesFooter) Reset() { *m = SeriesFooter{} } -func (m *SeriesFooter) String() string { return proto.CompactTextString(m) } -func (*SeriesFooter) ProtoMessage() {} -func (*SeriesFooter) Descriptor() ([]byte, []int) { - return fileDescriptor_3aeef8c45497084a, []int{9} -} -func (m *SeriesFooter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesFooter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesFooter.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 *SeriesFooter) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesFooter.Merge(m, src) -} -func (m *SeriesFooter) XXX_Size() int { - return m.Size() -} -func (m *SeriesFooter) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesFooter.DiscardUnknown(m) -} - -var xxx_messageInfo_SeriesFooter proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("binary.FieldType", FieldType_name, FieldType_value) - proto.RegisterEnum("binary.Header_Version", Header_Version_name, Header_Version_value) - proto.RegisterType((*Header)(nil), "binary.Header") - proto.RegisterType((*BucketHeader)(nil), "binary.BucketHeader") - proto.RegisterType((*BucketFooter)(nil), "binary.BucketFooter") - proto.RegisterType((*FloatPoints)(nil), "binary.FloatPoints") - proto.RegisterType((*IntegerPoints)(nil), "binary.IntegerPoints") - proto.RegisterType((*UnsignedPoints)(nil), "binary.UnsignedPoints") - proto.RegisterType((*BooleanPoints)(nil), "binary.BooleanPoints") - proto.RegisterType((*StringPoints)(nil), "binary.StringPoints") - proto.RegisterType((*SeriesHeader)(nil), "binary.SeriesHeader") - proto.RegisterType((*SeriesFooter)(nil), "binary.SeriesFooter") -} - -func init() { proto.RegisterFile("binary.proto", fileDescriptor_3aeef8c45497084a) } - -var fileDescriptor_3aeef8c45497084a = []byte{ - // 577 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x4e, 0xdb, 0x40, - 0x10, 0xc6, 0xbd, 0x38, 0x84, 0x64, 0x6a, 0xc2, 0xe2, 0x52, 0x14, 0xb9, 0xad, 0x71, 0xd3, 0x4b, - 0xfa, 0x47, 0x14, 0xb5, 0x52, 0xef, 0x44, 0x24, 0x21, 0x2a, 0x72, 0xd0, 0x26, 0x70, 0x8d, 0x16, - 0xbc, 0xa4, 0x16, 0xc1, 0x1b, 0xad, 0x37, 0x48, 0x7e, 0x83, 0x2a, 0xa7, 0x1e, 0x7b, 0xc9, 0xa9, - 0xaf, 0xd1, 0x07, 0xe0, 0xc8, 0xb1, 0x87, 0x4a, 0x6d, 0xe1, 0x45, 0x2a, 0xef, 0x3a, 0x26, 0xbd, - 0xe6, 0xb6, 0x33, 0xdf, 0xe7, 0x9f, 0x77, 0x3c, 0x9f, 0xc1, 0x3a, 0x0b, 0x23, 0x2a, 0x92, 0xdd, - 0xb1, 0xe0, 0x92, 0xdb, 0x45, 0x5d, 0x39, 0x5b, 0x43, 0x3e, 0xe4, 0xaa, 0xf5, 0x2e, 0x3d, 0x69, - 0xb5, 0xf6, 0x0b, 0x41, 0xf1, 0x90, 0xd1, 0x80, 0x09, 0x7b, 0x0f, 0xd6, 0xae, 0x99, 0x88, 0x43, - 0x1e, 0x55, 0x91, 0x87, 0xea, 0x95, 0xf7, 0xdb, 0xbb, 0x19, 0x48, 0x1b, 0x76, 0x4f, 0xb5, 0x4a, - 0xe6, 0x36, 0xdb, 0x81, 0x52, 0x40, 0x25, 0x3d, 0xa3, 0x31, 0xab, 0xae, 0x78, 0xa8, 0x5e, 0x26, - 0x79, 0x6d, 0xbf, 0x02, 0x2c, 0x98, 0x64, 0x91, 0x0c, 0x79, 0x34, 0x18, 0xf3, 0x51, 0x78, 0x9e, - 0x54, 0x4d, 0xe5, 0xd9, 0xc8, 0xfb, 0xc7, 0xaa, 0x6d, 0xbf, 0x81, 0x4a, 0xfc, 0x99, 0x8a, 0x60, - 0x10, 0x4c, 0x04, 0x4d, 0xfb, 0xd5, 0x82, 0x87, 0xea, 0x66, 0xa3, 0xf0, 0xed, 0xf7, 0x0e, 0x22, - 0xeb, 0x4a, 0x3b, 0xc8, 0xa4, 0xda, 0x5b, 0x58, 0xcb, 0xee, 0x61, 0x3f, 0x85, 0xf2, 0x69, 0x93, - 0xf4, 0x3a, 0x5d, 0x7f, 0xb0, 0x87, 0x0d, 0xc7, 0x9a, 0xce, 0xbc, 0x52, 0xa6, 0xed, 0x39, 0x85, - 0x2f, 0xdf, 0x5d, 0xa3, 0xf6, 0x11, 0xac, 0xc6, 0xe4, 0xfc, 0x92, 0xc9, 0x6c, 0xc6, 0x2d, 0x58, - 0x8d, 0x25, 0x15, 0x52, 0x4d, 0x88, 0x89, 0x2e, 0x6c, 0x0c, 0x26, 0x8b, 0x02, 0x35, 0x02, 0x26, - 0xe9, 0xb1, 0x56, 0x99, 0x3f, 0xd7, 0xe2, 0x5c, 0x32, 0x51, 0x6b, 0xc2, 0xa3, 0xd6, 0x88, 0x53, - 0x79, 0xcc, 0xc3, 0x48, 0xc6, 0xb6, 0x0b, 0x20, 0xc3, 0x2b, 0x16, 0x4b, 0x7a, 0x35, 0x8e, 0xab, - 0xc8, 0x33, 0xeb, 0x98, 0x2c, 0x74, 0xec, 0x6d, 0x28, 0x5e, 0xd3, 0xd1, 0x84, 0xc5, 0xd5, 0x15, - 0xcf, 0xac, 0x23, 0x92, 0x55, 0xb5, 0x36, 0xac, 0x77, 0x22, 0xc9, 0x86, 0x4c, 0x2c, 0x05, 0x32, - 0x73, 0xd0, 0x21, 0x54, 0x4e, 0xa2, 0x38, 0x1c, 0x46, 0x2c, 0x58, 0x8a, 0x54, 0x58, 0xbc, 0x52, - 0x83, 0xf3, 0x11, 0xa3, 0xd1, 0x52, 0xa0, 0x52, 0x0e, 0x6a, 0x81, 0xd5, 0x93, 0x22, 0x8c, 0x86, - 0x4b, 0x71, 0xca, 0x39, 0x67, 0x02, 0x56, 0x8f, 0x89, 0x90, 0xc5, 0x79, 0x2c, 0xe1, 0x22, 0x64, - 0xa3, 0x60, 0x20, 0x93, 0x31, 0xcb, 0x92, 0xb9, 0x39, 0x4f, 0x66, 0x2b, 0x55, 0xfa, 0xc9, 0x98, - 0x91, 0xf2, 0xc5, 0xfc, 0x68, 0x3f, 0x07, 0x88, 0x15, 0x61, 0x70, 0xc9, 0x12, 0xb5, 0x55, 0x8b, - 0x94, 0x75, 0xe7, 0x13, 0x4b, 0xd2, 0x0c, 0x28, 0xaf, 0x8a, 0xa3, 0x45, 0x74, 0x91, 0x6e, 0x5c, - 0xbf, 0x56, 0x6f, 0xfc, 0xf5, 0x0f, 0x04, 0xe5, 0xd6, 0x02, 0x72, 0xb5, 0x75, 0xd4, 0xdd, 0xef, - 0x63, 0xc3, 0xb1, 0xa7, 0x33, 0xaf, 0xa2, 0xc2, 0xf0, 0x20, 0xbf, 0x80, 0xb5, 0x8e, 0xdf, 0x6f, - 0xb6, 0x9b, 0x04, 0x23, 0x67, 0x6b, 0x3a, 0xf3, 0x70, 0xb6, 0xe6, 0x07, 0xcb, 0x4b, 0x28, 0x9d, - 0xf8, 0xbd, 0x4e, 0xdb, 0x6f, 0x1e, 0xe0, 0x15, 0xe7, 0xc9, 0x74, 0xe6, 0x6d, 0xce, 0x37, 0xf8, - 0x1f, 0xa7, 0xd1, 0xed, 0x1e, 0x35, 0xf7, 0x7d, 0x6c, 0x6a, 0x4e, 0xb6, 0x9b, 0x07, 0xcb, 0x0e, - 0x14, 0x7b, 0x7d, 0xd2, 0xf1, 0xdb, 0xb8, 0xe0, 0x3c, 0x9e, 0xce, 0xbc, 0x0d, 0xfd, 0xd1, 0x73, - 0x83, 0x0e, 0x7e, 0xe3, 0xd9, 0xcd, 0x5f, 0xd7, 0xb8, 0xb9, 0x73, 0xd1, 0xed, 0x9d, 0x8b, 0xfe, - 0xdc, 0xb9, 0xe8, 0xeb, 0xbd, 0x6b, 0xdc, 0xde, 0xbb, 0xc6, 0xcf, 0x7b, 0xd7, 0x38, 0x2b, 0xaa, - 0x9f, 0xff, 0xc3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x8d, 0x3a, 0x2c, 0x2a, 0x04, 0x00, - 0x00, -} - -func (m *Header) 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 *Header) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ShardDuration != 0 { - i = encodeVarintBinary(dAtA, i, uint64(m.ShardDuration)) - i-- - dAtA[i] = 0x20 - } - if len(m.RetentionPolicy) > 0 { - i -= len(m.RetentionPolicy) - copy(dAtA[i:], m.RetentionPolicy) - i = encodeVarintBinary(dAtA, i, uint64(len(m.RetentionPolicy))) - i-- - dAtA[i] = 0x1a - } - if len(m.Database) > 0 { - i -= len(m.Database) - copy(dAtA[i:], m.Database) - i = encodeVarintBinary(dAtA, i, uint64(len(m.Database))) - i-- - dAtA[i] = 0x12 - } - if m.Version != 0 { - i = encodeVarintBinary(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BucketHeader) 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 *BucketHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BucketHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.End != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.End)) - i-- - dAtA[i] = 0x11 - } - if m.Start != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Start)) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *BucketFooter) 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 *BucketFooter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BucketFooter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *FloatPoints) 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 *FloatPoints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FloatPoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - f1 := math.Float64bits(float64(m.Values[iNdEx])) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Values)*8)) - i-- - dAtA[i] = 0x12 - } - if len(m.Timestamps) > 0 { - for iNdEx := len(m.Timestamps) - 1; iNdEx >= 0; iNdEx-- { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Timestamps[iNdEx])) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Timestamps)*8)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IntegerPoints) 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 *IntegerPoints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IntegerPoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - dAtA3 := make([]byte, len(m.Values)*10) - var j2 int - for _, num1 := range m.Values { - num := uint64(num1) - for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j2++ - } - dAtA3[j2] = uint8(num) - j2++ - } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintBinary(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x12 - } - if len(m.Timestamps) > 0 { - for iNdEx := len(m.Timestamps) - 1; iNdEx >= 0; iNdEx-- { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Timestamps[iNdEx])) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Timestamps)*8)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UnsignedPoints) 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 *UnsignedPoints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UnsignedPoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - dAtA5 := make([]byte, len(m.Values)*10) - var j4 int - for _, num := range m.Values { - for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j4++ - } - dAtA5[j4] = uint8(num) - j4++ - } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintBinary(dAtA, i, uint64(j4)) - i-- - dAtA[i] = 0x12 - } - if len(m.Timestamps) > 0 { - for iNdEx := len(m.Timestamps) - 1; iNdEx >= 0; iNdEx-- { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Timestamps[iNdEx])) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Timestamps)*8)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BooleanPoints) 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 *BooleanPoints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BooleanPoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i-- - if m.Values[iNdEx] { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Values))) - i-- - dAtA[i] = 0x12 - } - if len(m.Timestamps) > 0 { - for iNdEx := len(m.Timestamps) - 1; iNdEx >= 0; iNdEx-- { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Timestamps[iNdEx])) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Timestamps)*8)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StringPoints) 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 *StringPoints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StringPoints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintBinary(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Timestamps) > 0 { - for iNdEx := len(m.Timestamps) - 1; iNdEx >= 0; iNdEx-- { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Timestamps[iNdEx])) - } - i = encodeVarintBinary(dAtA, i, uint64(len(m.Timestamps)*8)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SeriesHeader) 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 *SeriesHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Field) > 0 { - i -= len(m.Field) - copy(dAtA[i:], m.Field) - i = encodeVarintBinary(dAtA, i, uint64(len(m.Field))) - i-- - dAtA[i] = 0x1a - } - if len(m.SeriesKey) > 0 { - i -= len(m.SeriesKey) - copy(dAtA[i:], m.SeriesKey) - i = encodeVarintBinary(dAtA, i, uint64(len(m.SeriesKey))) - i-- - dAtA[i] = 0x12 - } - if m.FieldType != 0 { - i = encodeVarintBinary(dAtA, i, uint64(m.FieldType)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SeriesFooter) 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 *SeriesFooter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesFooter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintBinary(dAtA []byte, offset int, v uint64) int { - offset -= sovBinary(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Version != 0 { - n += 1 + sovBinary(uint64(m.Version)) - } - l = len(m.Database) - if l > 0 { - n += 1 + l + sovBinary(uint64(l)) - } - l = len(m.RetentionPolicy) - if l > 0 { - n += 1 + l + sovBinary(uint64(l)) - } - if m.ShardDuration != 0 { - n += 1 + sovBinary(uint64(m.ShardDuration)) - } - return n -} - -func (m *BucketHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Start != 0 { - n += 9 - } - if m.End != 0 { - n += 9 - } - return n -} - -func (m *BucketFooter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *FloatPoints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timestamps) > 0 { - n += 1 + sovBinary(uint64(len(m.Timestamps)*8)) + len(m.Timestamps)*8 - } - if len(m.Values) > 0 { - n += 1 + sovBinary(uint64(len(m.Values)*8)) + len(m.Values)*8 - } - return n -} - -func (m *IntegerPoints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timestamps) > 0 { - n += 1 + sovBinary(uint64(len(m.Timestamps)*8)) + len(m.Timestamps)*8 - } - if len(m.Values) > 0 { - l = 0 - for _, e := range m.Values { - l += sovBinary(uint64(e)) - } - n += 1 + sovBinary(uint64(l)) + l - } - return n -} - -func (m *UnsignedPoints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timestamps) > 0 { - n += 1 + sovBinary(uint64(len(m.Timestamps)*8)) + len(m.Timestamps)*8 - } - if len(m.Values) > 0 { - l = 0 - for _, e := range m.Values { - l += sovBinary(uint64(e)) - } - n += 1 + sovBinary(uint64(l)) + l - } - return n -} - -func (m *BooleanPoints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timestamps) > 0 { - n += 1 + sovBinary(uint64(len(m.Timestamps)*8)) + len(m.Timestamps)*8 - } - if len(m.Values) > 0 { - n += 1 + sovBinary(uint64(len(m.Values))) + len(m.Values)*1 - } - return n -} - -func (m *StringPoints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timestamps) > 0 { - n += 1 + sovBinary(uint64(len(m.Timestamps)*8)) + len(m.Timestamps)*8 - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovBinary(uint64(l)) - } - } - return n -} - -func (m *SeriesHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.FieldType != 0 { - n += 1 + sovBinary(uint64(m.FieldType)) - } - l = len(m.SeriesKey) - if l > 0 { - n += 1 + l + sovBinary(uint64(l)) - } - l = len(m.Field) - if l > 0 { - n += 1 + l + sovBinary(uint64(l)) - } - return n -} - -func (m *SeriesFooter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovBinary(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBinary(x uint64) (n int) { - return sovBinary(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Header) 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 ErrIntOverflowBinary - } - 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: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= Header_Version(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Database", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - 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 ErrInvalidLengthBinary - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Database = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RetentionPolicy", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - 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 ErrInvalidLengthBinary - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RetentionPolicy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardDuration", wireType) - } - m.ShardDuration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ShardDuration |= time.Duration(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BucketHeader) 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 ErrIntOverflowBinary - } - 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: BucketHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BucketHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Start = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.End = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BucketFooter) 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 ErrIntOverflowBinary - } - 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: BucketFooter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BucketFooter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FloatPoints) 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 ErrIntOverflowBinary - } - 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: FloatPoints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FloatPoints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 1 { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Timestamps) == 0 { - m.Timestamps = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType) - } - case 2: - if wireType == 1 { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Values = append(m.Values, v2) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]float64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - v2 := float64(math.Float64frombits(v)) - m.Values = append(m.Values, v2) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IntegerPoints) 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 ErrIntOverflowBinary - } - 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: IntegerPoints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IntegerPoints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 1 { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Timestamps) == 0 { - m.Timestamps = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType) - } - case 2: - if wireType == 0 { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UnsignedPoints) 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 ErrIntOverflowBinary - } - 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: UnsignedPoints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnsignedPoints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 1 { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Timestamps) == 0 { - m.Timestamps = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType) - } - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BooleanPoints) 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 ErrIntOverflowBinary - } - 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: BooleanPoints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BooleanPoints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 1 { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Timestamps) == 0 { - m.Timestamps = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType) - } - case 2: - if wireType == 0 { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, bool(v != 0)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen - if elementCount != 0 && len(m.Values) == 0 { - m.Values = make([]bool, 0, elementCount) - } - for iNdEx < postIndex { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Values = append(m.Values, bool(v != 0)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StringPoints) 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 ErrIntOverflowBinary - } - 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: StringPoints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StringPoints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 1 { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen / 8 - if elementCount != 0 && len(m.Timestamps) == 0 { - m.Timestamps = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Timestamps = append(m.Timestamps, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType) - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - 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 ErrInvalidLengthBinary - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SeriesHeader) 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 ErrIntOverflowBinary - } - 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: SeriesHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldType", wireType) - } - m.FieldType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FieldType |= FieldType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SeriesKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SeriesKey = append(m.SeriesKey[:0], dAtA[iNdEx:postIndex]...) - if m.SeriesKey == nil { - m.SeriesKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBinary - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthBinary - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthBinary - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Field = append(m.Field[:0], dAtA[iNdEx:postIndex]...) - if m.Field == nil { - m.Field = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SeriesFooter) 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 ErrIntOverflowBinary - } - 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: SeriesFooter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesFooter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipBinary(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBinary - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBinary(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, ErrIntOverflowBinary - } - 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, ErrIntOverflowBinary - } - 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, ErrIntOverflowBinary - } - 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, ErrInvalidLengthBinary - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBinary - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBinary - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBinary = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBinary = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBinary = fmt.Errorf("proto: unexpected end of group") -) diff --git a/cmd/influx_tools/internal/format/binary/common.go b/cmd/influx_tools/internal/format/binary/common.go index 60f27e3968d..f66df02ac14 100644 --- a/cmd/influx_tools/internal/format/binary/common.go +++ b/cmd/influx_tools/internal/format/binary/common.go @@ -1,7 +1,6 @@ package binary -// TODO(dstrand1): re-enable codegen for binary.proto when influx_tools is ported to new protobuf lib -// go:generate sh -c "protoc -I$(go list -f '{{ .Dir }}' -m github.com/gogo/protobuf) -I. --gogofaster_out=Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types:. binary.proto" +//go:generate protoc --go_out=. tools_binary.proto //go:generate stringer -type=MessageType import "errors" @@ -30,11 +29,6 @@ const ( SeriesFooterType ) -type message interface { - Size() int - MarshalTo(dAtA []byte) (int, error) -} - /* Stream format diff --git a/cmd/influx_tools/internal/format/binary/reader.go b/cmd/influx_tools/internal/format/binary/reader.go index 0a40bb7e434..5f0f8fe0366 100644 --- a/cmd/influx_tools/internal/format/binary/reader.go +++ b/cmd/influx_tools/internal/format/binary/reader.go @@ -9,6 +9,7 @@ import ( "github.com/influxdata/influxdb/cmd/influx_tools/internal/tlv" "github.com/influxdata/influxdb/tsdb" "github.com/influxdata/influxdb/tsdb/engine/tsm1" + "google.golang.org/protobuf/proto" ) type Reader struct { @@ -65,7 +66,7 @@ func (r *Reader) ReadHeader() (*Header, error) { return nil, fmt.Errorf("expected header type, got %v", t) } h := &Header{} - err = h.Unmarshal(lv) + err = proto.Unmarshal(lv, h) *r.state = readBucket return h, err @@ -93,7 +94,7 @@ func (r *Reader) NextBucket() (*BucketHeader, error) { } bh := &BucketHeader{} - err = bh.Unmarshal(lv) + err = proto.Unmarshal(lv, bh) if err != nil { return nil, err } @@ -119,7 +120,7 @@ func (r *Reader) NextSeries() (*SeriesHeader, error) { return nil, fmt.Errorf("expected series header type, got %v", t) } sh := &SeriesHeader{} - err = sh.Unmarshal(lv) + err = proto.Unmarshal(lv, sh) if err != nil { return nil, err } @@ -128,15 +129,15 @@ func (r *Reader) NextSeries() (*SeriesHeader, error) { var pointsType MessageType switch sh.FieldType { - case FloatFieldType: + case FieldType_FloatFieldType: pointsType = FloatPointsType - case IntegerFieldType: + case FieldType_IntegerFieldType: pointsType = IntegerPointsType - case UnsignedFieldType: + case FieldType_UnsignedFieldType: pointsType = UnsignedPointsType - case BooleanFieldType: + case FieldType_BooleanFieldType: pointsType = BooleanPointsType - case StringFieldType: + case FieldType_StringFieldType: pointsType = StringPointsType default: return nil, fmt.Errorf("unsupported series field type %v", sh.FieldType) @@ -212,7 +213,7 @@ func (pr *PointsReader) marshalValues(lv []byte) error { func (pr *PointsReader) marshalFloats(lv []byte) error { fp := &FloatPoints{} - err := fp.Unmarshal(lv) + err := proto.Unmarshal(lv, fp) if err != nil { return err } @@ -226,7 +227,7 @@ func (pr *PointsReader) marshalFloats(lv []byte) error { func (pr *PointsReader) marshalIntegers(lv []byte) error { ip := &IntegerPoints{} - err := ip.Unmarshal(lv) + err := proto.Unmarshal(lv, ip) if err != nil { return err } @@ -240,7 +241,7 @@ func (pr *PointsReader) marshalIntegers(lv []byte) error { func (pr *PointsReader) marshalUnsigned(lv []byte) error { up := &UnsignedPoints{} - err := up.Unmarshal(lv) + err := proto.Unmarshal(lv, up) if err != nil { return err } @@ -254,7 +255,7 @@ func (pr *PointsReader) marshalUnsigned(lv []byte) error { func (pr *PointsReader) marshalBooleans(lv []byte) error { bp := &BooleanPoints{} - err := bp.Unmarshal(lv) + err := proto.Unmarshal(lv, bp) if err != nil { return err } @@ -268,7 +269,7 @@ func (pr *PointsReader) marshalBooleans(lv []byte) error { func (pr *PointsReader) marshalStrings(lv []byte) error { sp := &StringPoints{} - err := sp.Unmarshal(lv) + err := proto.Unmarshal(lv, sp) if err != nil { return err } diff --git a/cmd/influx_tools/internal/format/binary/reader_test.go b/cmd/influx_tools/internal/format/binary/reader_test.go index 1f69a2cba91..6ca5d104a8d 100644 --- a/cmd/influx_tools/internal/format/binary/reader_test.go +++ b/cmd/influx_tools/internal/format/binary/reader_test.go @@ -30,7 +30,7 @@ func TestReader_OneBucketOneIntegerSeries(t *testing.T) { seriesName: []byte("series"), seriesField: []byte("field"), seriesTags: models.NewTags(map[string]string{"k": "v"}), - fieldType: binary.IntegerFieldType, + fieldType: binary.FieldType_IntegerFieldType, ts: ts, vs: vs, } @@ -63,7 +63,7 @@ func TestReader_OneBucketOneFloatSeries(t *testing.T) { seriesName: []byte("series"), seriesField: []byte("field"), seriesTags: models.NewTags(map[string]string{"k": "v"}), - fieldType: binary.FloatFieldType, + fieldType: binary.FieldType_FloatFieldType, ts: ts, vs: vs, } @@ -96,7 +96,7 @@ func TestReader_OneBucketOneUnsignedSeries(t *testing.T) { seriesName: []byte("series"), seriesField: []byte("field"), seriesTags: models.NewTags(map[string]string{"k": "v"}), - fieldType: binary.UnsignedFieldType, + fieldType: binary.FieldType_UnsignedFieldType, ts: ts, vs: vs, } @@ -129,7 +129,7 @@ func TestReader_OneBucketOneBooleanSeries(t *testing.T) { seriesName: []byte("series"), seriesField: []byte("field"), seriesTags: models.NewTags(map[string]string{"k": "v"}), - fieldType: binary.BooleanFieldType, + fieldType: binary.FieldType_BooleanFieldType, ts: ts, vs: vs, } @@ -162,7 +162,7 @@ func TestReader_OneBucketOneStringSeries(t *testing.T) { seriesName: []byte("series"), seriesField: []byte("field"), seriesTags: models.NewTags(map[string]string{"k": "v"}), - fieldType: binary.StringFieldType, + fieldType: binary.FieldType_StringFieldType, ts: ts, vs: vs, } @@ -197,7 +197,7 @@ func verifySingleSeries(t *testing.T, buf bytes.Buffer, s *oneSeriesData) { r := binary.NewReader(&buf) h, err := r.ReadHeader() assertNoError(t, err) - assertEqual(t, h, &binary.Header{Database: s.db, RetentionPolicy: s.rp, ShardDuration: s.sd}) + assertEqual(t, h, &binary.Header{Database: s.db, RetentionPolicy: s.rp, ShardDuration: int64(s.sd)}) bh, err := r.NextBucket() assertNoError(t, err) @@ -262,7 +262,7 @@ func TestReader_OneBucketMixedSeries(t *testing.T) { r := binary.NewReader(&buf) h, err := r.ReadHeader() assertNoError(t, err) - assertEqual(t, h, &binary.Header{Database: db, RetentionPolicy: rp, ShardDuration: time.Hour * 24}) + assertEqual(t, h, &binary.Header{Database: db, RetentionPolicy: rp, ShardDuration: int64(time.Hour * 24)}) bh, err := r.NextBucket() assertNoError(t, err) @@ -273,7 +273,7 @@ func TestReader_OneBucketMixedSeries(t *testing.T) { seriesKey := make([]byte, 0) seriesKey = models.AppendMakeKey(seriesKey[:0], seriesName, seriesTags1) - assertEqual(t, sh, &binary.SeriesHeader{FieldType: binary.IntegerFieldType, SeriesKey: seriesKey, Field: seriesField}) + assertEqual(t, sh, &binary.SeriesHeader{FieldType: binary.FieldType_IntegerFieldType, SeriesKey: seriesKey, Field: seriesField}) for i := 0; i < len(t1s); i++ { next, err := r.Points().Next() @@ -293,7 +293,7 @@ func TestReader_OneBucketMixedSeries(t *testing.T) { assertNoError(t, err) seriesKey = models.AppendMakeKey(seriesKey[:0], seriesName, seriesTags2) - assertEqual(t, sh, &binary.SeriesHeader{FieldType: binary.FloatFieldType, SeriesKey: seriesKey, Field: seriesField}) + assertEqual(t, sh, &binary.SeriesHeader{FieldType: binary.FieldType_FloatFieldType, SeriesKey: seriesKey, Field: seriesField}) for i := 0; i < len(t2s); i++ { next, err := r.Points().Next() @@ -333,7 +333,7 @@ func TestReader_EmptyBucket(t *testing.T) { r := binary.NewReader(&buf) h, err := r.ReadHeader() assertNoError(t, err) - assertEqual(t, h, &binary.Header{Database: db, RetentionPolicy: rp, ShardDuration: time.Hour * 24}) + assertEqual(t, h, &binary.Header{Database: db, RetentionPolicy: rp, ShardDuration: int64(time.Hour * 24)}) bh, err := r.NextBucket() assertNoError(t, err) diff --git a/cmd/influx_tools/internal/format/binary/tools_binary.pb.go b/cmd/influx_tools/internal/format/binary/tools_binary.pb.go new file mode 100644 index 00000000000..e5c62d2e6c7 --- /dev/null +++ b/cmd/influx_tools/internal/format/binary/tools_binary.pb.go @@ -0,0 +1,909 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: tools_binary.proto + +package binary + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 FieldType int32 + +const ( + FieldType_FloatFieldType FieldType = 0 + FieldType_IntegerFieldType FieldType = 1 + FieldType_UnsignedFieldType FieldType = 2 + FieldType_BooleanFieldType FieldType = 3 + FieldType_StringFieldType FieldType = 4 +) + +// Enum value maps for FieldType. +var ( + FieldType_name = map[int32]string{ + 0: "FloatFieldType", + 1: "IntegerFieldType", + 2: "UnsignedFieldType", + 3: "BooleanFieldType", + 4: "StringFieldType", + } + FieldType_value = map[string]int32{ + "FloatFieldType": 0, + "IntegerFieldType": 1, + "UnsignedFieldType": 2, + "BooleanFieldType": 3, + "StringFieldType": 4, + } +) + +func (x FieldType) Enum() *FieldType { + p := new(FieldType) + *p = x + return p +} + +func (x FieldType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FieldType) Descriptor() protoreflect.EnumDescriptor { + return file_tools_binary_proto_enumTypes[0].Descriptor() +} + +func (FieldType) Type() protoreflect.EnumType { + return &file_tools_binary_proto_enumTypes[0] +} + +func (x FieldType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FieldType.Descriptor instead. +func (FieldType) EnumDescriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{0} +} + +type Header_Version int32 + +const ( + Header_Version0 Header_Version = 0 +) + +// Enum value maps for Header_Version. +var ( + Header_Version_name = map[int32]string{ + 0: "Version0", + } + Header_Version_value = map[string]int32{ + "Version0": 0, + } +) + +func (x Header_Version) Enum() *Header_Version { + p := new(Header_Version) + *p = x + return p +} + +func (x Header_Version) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Header_Version) Descriptor() protoreflect.EnumDescriptor { + return file_tools_binary_proto_enumTypes[1].Descriptor() +} + +func (Header_Version) Type() protoreflect.EnumType { + return &file_tools_binary_proto_enumTypes[1] +} + +func (x Header_Version) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Header_Version.Descriptor instead. +func (Header_Version) EnumDescriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{0, 0} +} + +type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version Header_Version `protobuf:"varint,1,opt,name=version,proto3,enum=binary.Header_Version" json:"version,omitempty"` + Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"` + RetentionPolicy string `protobuf:"bytes,3,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"` + ShardDuration int64 `protobuf:"varint,4,opt,name=shard_duration,json=shardDuration,proto3" json:"shard_duration,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_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) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{0} +} + +func (x *Header) GetVersion() Header_Version { + if x != nil { + return x.Version + } + return Header_Version0 +} + +func (x *Header) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *Header) GetRetentionPolicy() string { + if x != nil { + return x.RetentionPolicy + } + return "" +} + +func (x *Header) GetShardDuration() int64 { + if x != nil { + return x.ShardDuration + } + return 0 +} + +type BucketHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start int64 `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"` + End int64 `protobuf:"fixed64,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (x *BucketHeader) Reset() { + *x = BucketHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BucketHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BucketHeader) ProtoMessage() {} + +func (x *BucketHeader) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_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) +} + +// Deprecated: Use BucketHeader.ProtoReflect.Descriptor instead. +func (*BucketHeader) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{1} +} + +func (x *BucketHeader) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *BucketHeader) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +type BucketFooter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BucketFooter) Reset() { + *x = BucketFooter{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BucketFooter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BucketFooter) ProtoMessage() {} + +func (x *BucketFooter) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[2] + 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) +} + +// Deprecated: Use BucketFooter.ProtoReflect.Descriptor instead. +func (*BucketFooter) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{2} +} + +type FloatPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + Values []float64 `protobuf:"fixed64,2,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *FloatPoints) Reset() { + *x = FloatPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FloatPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FloatPoints) ProtoMessage() {} + +func (x *FloatPoints) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[3] + 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) +} + +// Deprecated: Use FloatPoints.ProtoReflect.Descriptor instead. +func (*FloatPoints) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{3} +} + +func (x *FloatPoints) GetTimestamps() []int64 { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *FloatPoints) GetValues() []float64 { + if x != nil { + return x.Values + } + return nil +} + +type IntegerPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + Values []int64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *IntegerPoints) Reset() { + *x = IntegerPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IntegerPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntegerPoints) ProtoMessage() {} + +func (x *IntegerPoints) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_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 mi.MessageOf(x) +} + +// Deprecated: Use IntegerPoints.ProtoReflect.Descriptor instead. +func (*IntegerPoints) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{4} +} + +func (x *IntegerPoints) GetTimestamps() []int64 { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *IntegerPoints) GetValues() []int64 { + if x != nil { + return x.Values + } + return nil +} + +type UnsignedPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + Values []uint64 `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *UnsignedPoints) Reset() { + *x = UnsignedPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnsignedPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsignedPoints) ProtoMessage() {} + +func (x *UnsignedPoints) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_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 mi.MessageOf(x) +} + +// Deprecated: Use UnsignedPoints.ProtoReflect.Descriptor instead. +func (*UnsignedPoints) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{5} +} + +func (x *UnsignedPoints) GetTimestamps() []int64 { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *UnsignedPoints) GetValues() []uint64 { + if x != nil { + return x.Values + } + return nil +} + +type BooleanPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + Values []bool `protobuf:"varint,2,rep,packed,name=values,proto3" json:"values,omitempty"` +} + +func (x *BooleanPoints) Reset() { + *x = BooleanPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BooleanPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BooleanPoints) ProtoMessage() {} + +func (x *BooleanPoints) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[6] + 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) +} + +// Deprecated: Use BooleanPoints.ProtoReflect.Descriptor instead. +func (*BooleanPoints) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{6} +} + +func (x *BooleanPoints) GetTimestamps() []int64 { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *BooleanPoints) GetValues() []bool { + if x != nil { + return x.Values + } + return nil +} + +type StringPoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamps []int64 `protobuf:"fixed64,1,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *StringPoints) Reset() { + *x = StringPoints{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StringPoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringPoints) ProtoMessage() {} + +func (x *StringPoints) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[7] + 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) +} + +// Deprecated: Use StringPoints.ProtoReflect.Descriptor instead. +func (*StringPoints) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{7} +} + +func (x *StringPoints) GetTimestamps() []int64 { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *StringPoints) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +type SeriesHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FieldType FieldType `protobuf:"varint,1,opt,name=field_type,json=fieldType,proto3,enum=binary.FieldType" json:"field_type,omitempty"` + SeriesKey []byte `protobuf:"bytes,2,opt,name=series_key,json=seriesKey,proto3" json:"series_key,omitempty"` + Field []byte `protobuf:"bytes,3,opt,name=field,proto3" json:"field,omitempty"` +} + +func (x *SeriesHeader) Reset() { + *x = SeriesHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeriesHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeriesHeader) ProtoMessage() {} + +func (x *SeriesHeader) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[8] + 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) +} + +// Deprecated: Use SeriesHeader.ProtoReflect.Descriptor instead. +func (*SeriesHeader) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{8} +} + +func (x *SeriesHeader) GetFieldType() FieldType { + if x != nil { + return x.FieldType + } + return FieldType_FloatFieldType +} + +func (x *SeriesHeader) GetSeriesKey() []byte { + if x != nil { + return x.SeriesKey + } + return nil +} + +func (x *SeriesHeader) GetField() []byte { + if x != nil { + return x.Field + } + return nil +} + +type SeriesFooter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SeriesFooter) Reset() { + *x = SeriesFooter{} + if protoimpl.UnsafeEnabled { + mi := &file_tools_binary_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeriesFooter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeriesFooter) ProtoMessage() {} + +func (x *SeriesFooter) ProtoReflect() protoreflect.Message { + mi := &file_tools_binary_proto_msgTypes[9] + 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) +} + +// Deprecated: Use SeriesFooter.ProtoReflect.Descriptor instead. +func (*SeriesFooter) Descriptor() ([]byte, []int) { + return file_tools_binary_proto_rawDescGZIP(), []int{9} +} + +var File_tools_binary_proto protoreflect.FileDescriptor + +var file_tools_binary_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x22, 0xc1, 0x01, 0x0a, + 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, + 0x79, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x64, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x17, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x30, 0x10, 0x00, + 0x22, 0x36, 0x0a, 0x0c, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x10, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x46, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x22, 0x45, 0x0a, 0x0b, 0x46, 0x6c, 0x6f, 0x61, + 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0a, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, + 0x47, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x10, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x0e, 0x55, 0x6e, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0a, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x22, 0x47, 0x0a, 0x0d, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x50, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x08, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x46, 0x0a, 0x0c, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x10, 0x52, + 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x22, 0x75, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x65, 0x72, 0x69, 0x65, + 0x73, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x46, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2a, 0x77, 0x0a, 0x09, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x46, 0x6c, 0x6f, 0x61, 0x74, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, + 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x10, + 0x01, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x6f, 0x6f, 0x6c, + 0x65, 0x61, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, 0x65, 0x10, 0x03, 0x12, 0x13, + 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x10, 0x04, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x3b, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_tools_binary_proto_rawDescOnce sync.Once + file_tools_binary_proto_rawDescData = file_tools_binary_proto_rawDesc +) + +func file_tools_binary_proto_rawDescGZIP() []byte { + file_tools_binary_proto_rawDescOnce.Do(func() { + file_tools_binary_proto_rawDescData = protoimpl.X.CompressGZIP(file_tools_binary_proto_rawDescData) + }) + return file_tools_binary_proto_rawDescData +} + +var file_tools_binary_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_tools_binary_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_tools_binary_proto_goTypes = []interface{}{ + (FieldType)(0), // 0: binary.FieldType + (Header_Version)(0), // 1: binary.Header.Version + (*Header)(nil), // 2: binary.Header + (*BucketHeader)(nil), // 3: binary.BucketHeader + (*BucketFooter)(nil), // 4: binary.BucketFooter + (*FloatPoints)(nil), // 5: binary.FloatPoints + (*IntegerPoints)(nil), // 6: binary.IntegerPoints + (*UnsignedPoints)(nil), // 7: binary.UnsignedPoints + (*BooleanPoints)(nil), // 8: binary.BooleanPoints + (*StringPoints)(nil), // 9: binary.StringPoints + (*SeriesHeader)(nil), // 10: binary.SeriesHeader + (*SeriesFooter)(nil), // 11: binary.SeriesFooter +} +var file_tools_binary_proto_depIdxs = []int32{ + 1, // 0: binary.Header.version:type_name -> binary.Header.Version + 0, // 1: binary.SeriesHeader.field_type:type_name -> binary.FieldType + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_tools_binary_proto_init() } +func file_tools_binary_proto_init() { + if File_tools_binary_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_tools_binary_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BucketHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BucketFooter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FloatPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IntegerPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnsignedPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BooleanPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StringPoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeriesHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tools_binary_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeriesFooter); 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_tools_binary_proto_rawDesc, + NumEnums: 2, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_tools_binary_proto_goTypes, + DependencyIndexes: file_tools_binary_proto_depIdxs, + EnumInfos: file_tools_binary_proto_enumTypes, + MessageInfos: file_tools_binary_proto_msgTypes, + }.Build() + File_tools_binary_proto = out.File + file_tools_binary_proto_rawDesc = nil + file_tools_binary_proto_goTypes = nil + file_tools_binary_proto_depIdxs = nil +} diff --git a/cmd/influx_tools/internal/format/binary/binary.proto b/cmd/influx_tools/internal/format/binary/tools_binary.proto similarity index 56% rename from cmd/influx_tools/internal/format/binary/binary.proto rename to cmd/influx_tools/internal/format/binary/tools_binary.proto index 5a578213639..4bb1e3510ea 100644 --- a/cmd/influx_tools/internal/format/binary/binary.proto +++ b/cmd/influx_tools/internal/format/binary/tools_binary.proto @@ -1,21 +1,16 @@ syntax = "proto3"; package binary; - -import "gogoproto/gogo.proto"; - -option (gogoproto.goproto_getters_all) = false; +option go_package = ".;binary"; message Header { enum Version { - option (gogoproto.goproto_enum_prefix) = false; - - VERSION_0 = 0 [(gogoproto.enumvalue_customname) = "Version0"]; + Version0 = 0; } Version version = 1; string database = 2; string retention_policy = 3; - int64 shard_duration = 4 [(gogoproto.stdduration) = true]; + int64 shard_duration = 4; } message BucketHeader { @@ -53,13 +48,11 @@ message StringPoints { } enum FieldType { - option (gogoproto.goproto_enum_prefix) = false; - - FLOAT = 0 [(gogoproto.enumvalue_customname) = "FloatFieldType"]; - INTEGER = 1 [(gogoproto.enumvalue_customname) = "IntegerFieldType"]; - UNSIGNED = 2 [(gogoproto.enumvalue_customname) = "UnsignedFieldType"]; - BOOLEAN = 3 [(gogoproto.enumvalue_customname) = "BooleanFieldType"]; - STRING = 4 [(gogoproto.enumvalue_customname) = "StringFieldType"]; + FloatFieldType = 0; + IntegerFieldType = 1; + UnsignedFieldType = 2; + BooleanFieldType = 3; + StringFieldType = 4; } message SeriesHeader { diff --git a/cmd/influx_tools/internal/format/binary/writer.go b/cmd/influx_tools/internal/format/binary/writer.go index 994ffb4c602..216eb656e32 100644 --- a/cmd/influx_tools/internal/format/binary/writer.go +++ b/cmd/influx_tools/internal/format/binary/writer.go @@ -11,6 +11,7 @@ import ( "github.com/influxdata/influxdb/models" "github.com/influxdata/influxdb/tsdb" "github.com/influxdata/influxql" + "google.golang.org/protobuf/proto" ) type Writer struct { @@ -105,10 +106,10 @@ func (w *Writer) writeHeader() { w.write(Magic[:]) h := Header{ - Version: Version0, + Version: Header_Version0, Database: w.db, RetentionPolicy: w.rp, - ShardDuration: w.duration, + ShardDuration: int64(w.duration), } w.writeTypeMessage(HeaderType, &h) } @@ -148,24 +149,16 @@ func (w *Writer) write(p []byte) { _, w.err = w.w.Write(p) } -func (w *Writer) writeTypeMessage(typ MessageType, msg message) { +func (w *Writer) writeTypeMessage(typ MessageType, msg proto.Message) { if w.err != nil { return } - // ensure size - n := msg.Size() - if n > cap(w.buf) { - w.buf = make([]byte, n) - } else { - w.buf = w.buf[:n] - } - - _, w.err = msg.MarshalTo(w.buf) - w.writeTypeBytes(typ, w.buf) + w.buf, w.err = proto.MarshalOptions{}.MarshalAppend(w.buf[0:0], msg) + w.writeTypeBytes(typ) } -func (w *Writer) writeTypeBytes(typ MessageType, b []byte) { +func (w *Writer) writeTypeBytes(typ MessageType) { if w.err != nil { return } @@ -216,7 +209,7 @@ func (bw *bucketWriter) EndSeries() { panic(fmt.Sprintf("writer state: got=%v, exp=%v,%v", bw.w.state, writeSeriesHeader, writePoints)) } if bw.w.state == writePoints { - bw.w.writeSeriesFooter(IntegerFieldType, bw.n) + bw.w.writeSeriesFooter(FieldType_IntegerFieldType, bw.n) } bw.w.state = writeSeries } @@ -227,7 +220,7 @@ func (bw *bucketWriter) WriteIntegerCursor(cur tsdb.IntegerArrayCursor) { } if bw.w.state == writeSeriesHeader { - bw.w.writeSeriesHeader(bw.key, bw.field, IntegerFieldType) + bw.w.writeSeriesHeader(bw.key, bw.field, FieldType_IntegerFieldType) } if bw.w.state != writePoints { @@ -254,7 +247,7 @@ func (bw *bucketWriter) WriteFloatCursor(cur tsdb.FloatArrayCursor) { } if bw.w.state == writeSeriesHeader { - bw.w.writeSeriesHeader(bw.key, bw.field, FloatFieldType) + bw.w.writeSeriesHeader(bw.key, bw.field, FieldType_FloatFieldType) } if bw.w.state != writePoints { @@ -281,7 +274,7 @@ func (bw *bucketWriter) WriteUnsignedCursor(cur tsdb.UnsignedArrayCursor) { } if bw.w.state == writeSeriesHeader { - bw.w.writeSeriesHeader(bw.key, bw.field, UnsignedFieldType) + bw.w.writeSeriesHeader(bw.key, bw.field, FieldType_UnsignedFieldType) } if bw.w.state != writePoints { @@ -308,7 +301,7 @@ func (bw *bucketWriter) WriteBooleanCursor(cur tsdb.BooleanArrayCursor) { } if bw.w.state == writeSeriesHeader { - bw.w.writeSeriesHeader(bw.key, bw.field, BooleanFieldType) + bw.w.writeSeriesHeader(bw.key, bw.field, FieldType_BooleanFieldType) } if bw.w.state != writePoints { @@ -335,7 +328,7 @@ func (bw *bucketWriter) WriteStringCursor(cur tsdb.StringArrayCursor) { } if bw.w.state == writeSeriesHeader { - bw.w.writeSeriesHeader(bw.key, bw.field, StringFieldType) + bw.w.writeSeriesHeader(bw.key, bw.field, FieldType_StringFieldType) } if bw.w.state != writePoints { diff --git a/cmd/influx_tools/internal/format/binary/writer_test.go b/cmd/influx_tools/internal/format/binary/writer_test.go index 93d1112ced8..fdadb7d4c30 100644 --- a/cmd/influx_tools/internal/format/binary/writer_test.go +++ b/cmd/influx_tools/internal/format/binary/writer_test.go @@ -12,6 +12,8 @@ import ( "github.com/influxdata/influxdb/models" "github.com/influxdata/influxdb/tsdb" "github.com/influxdata/influxql" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" ) func TestWriter_WriteOneBucketOneSeries(t *testing.T) { @@ -34,18 +36,18 @@ func TestWriter_WriteOneBucketOneSeries(t *testing.T) { // header var hdr binary.Header assertTypeValue(t, &buf, binary.HeaderType, &hdr) - assertEqual(t, hdr, binary.Header{Version: binary.Version0, Database: "db", RetentionPolicy: "rp", ShardDuration: time.Second}) + assertEqual(t, &hdr, &binary.Header{Version: binary.Header_Version0, Database: "db", RetentionPolicy: "rp", ShardDuration: int64(time.Second)}) // bucket header var bh binary.BucketHeader assertTypeValue(t, &buf, binary.BucketHeaderType, &bh) - assertEqual(t, bh, binary.BucketHeader{Start: 0, End: int64(time.Second)}) + assertEqual(t, &bh, &binary.BucketHeader{Start: 0, End: int64(time.Second)}) // series var sh binary.SeriesHeader assertTypeValue(t, &buf, binary.SeriesHeaderType, &sh) - assertEqual(t, sh, binary.SeriesHeader{ - FieldType: binary.IntegerFieldType, + assertEqual(t, &sh, &binary.SeriesHeader{ + FieldType: binary.FieldType_IntegerFieldType, SeriesKey: []byte("cpu,host=host1,region=us-west-1"), Field: []byte("idle"), }) @@ -54,7 +56,7 @@ func TestWriter_WriteOneBucketOneSeries(t *testing.T) { for i := 0; i < len(ts); i++ { var ip binary.IntegerPoints assertTypeValue(t, &buf, binary.IntegerPointsType, &ip) - assertEqual(t, ip, binary.IntegerPoints{Timestamps: ts[i : i+1], Values: vs[i : i+1]}) + assertEqual(t, &ip, &binary.IntegerPoints{Timestamps: ts[i : i+1], Values: vs[i : i+1]}) } // series footer @@ -89,7 +91,7 @@ func (c *intCursor) Next() *tsdb.IntegerArray { func assertEqual(t *testing.T, got, exp interface{}) { t.Helper() - if !cmp.Equal(got, exp) { + if !cmp.Equal(got, exp, protocmp.Transform()) { t.Fatalf("not equal: -got/+exp\n%s", cmp.Diff(got, exp)) } } @@ -102,16 +104,12 @@ func assertNoError(t *testing.T, err error) { t.Fatalf("unexpected error: %v", err) } -type message interface { - Unmarshal([]byte) error -} - -func assertTypeValue(t *testing.T, r io.Reader, expType binary.MessageType, m message) { +func assertTypeValue(t *testing.T, r io.Reader, expType binary.MessageType, m proto.Message) { t.Helper() typ, d, err := tlv.ReadTLV(r) assertNoError(t, err) assertEqual(t, typ, byte(expType)) - err = m.Unmarshal(d) + err = proto.Unmarshal(d, m) assertNoError(t, err) } diff --git a/cmd/influxd/backup_util/backup_util.go b/cmd/influxd/backup_util/backup_util.go index e36e756d8d7..f9d77fb248f 100644 --- a/cmd/influxd/backup_util/backup_util.go +++ b/cmd/influxd/backup_util/backup_util.go @@ -18,7 +18,7 @@ import ( "google.golang.org/protobuf/proto" ) -//go:generate protoc --go_out=./internal internal/data.proto +//go:generate protoc --go_out=./internal internal/backup_util.proto const ( // Suffix is a suffix added to the backup while it's in-process. diff --git a/cmd/influxd/backup_util/internal/data.pb.go b/cmd/influxd/backup_util/internal/backup_util.pb.go similarity index 52% rename from cmd/influxd/backup_util/internal/data.pb.go rename to cmd/influxd/backup_util/internal/backup_util.pb.go index 23d3d9810fe..06aada8b969 100644 --- a/cmd/influxd/backup_util/internal/data.pb.go +++ b/cmd/influxd/backup_util/internal/backup_util.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 -// source: internal/data.proto +// source: internal/backup_util.proto package backup_util @@ -32,7 +32,7 @@ type PortableData struct { func (x *PortableData) Reset() { *x = PortableData{} if protoimpl.UnsafeEnabled { - mi := &file_internal_data_proto_msgTypes[0] + mi := &file_internal_backup_util_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +45,7 @@ func (x *PortableData) String() string { func (*PortableData) ProtoMessage() {} func (x *PortableData) ProtoReflect() protoreflect.Message { - mi := &file_internal_data_proto_msgTypes[0] + mi := &file_internal_backup_util_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -58,7 +58,7 @@ func (x *PortableData) ProtoReflect() protoreflect.Message { // Deprecated: Use PortableData.ProtoReflect.Descriptor instead. func (*PortableData) Descriptor() ([]byte, []int) { - return file_internal_data_proto_rawDescGZIP(), []int{0} + return file_internal_backup_util_proto_rawDescGZIP(), []int{0} } func (x *PortableData) GetData() []byte { @@ -75,36 +75,36 @@ func (x *PortableData) GetMaxNodeID() uint64 { return 0 } -var File_internal_data_proto protoreflect.FileDescriptor - -var file_internal_data_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x75, 0x74, - 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0c, - 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x4d, 0x61, 0x78, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x02, 0x28, 0x04, 0x52, 0x09, 0x4d, 0x61, 0x78, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x44, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x3b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x5f, 0x75, 0x74, 0x69, 0x6c, +var File_internal_backup_util_proto protoreflect.FileDescriptor + +var file_internal_backup_util_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x0c, 0x50, 0x6f, 0x72, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x02, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, + 0x09, 0x4d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x02, 0x28, 0x04, + 0x52, 0x09, 0x4d, 0x61, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, + 0x3b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x75, 0x74, 0x69, 0x6c, } var ( - file_internal_data_proto_rawDescOnce sync.Once - file_internal_data_proto_rawDescData = file_internal_data_proto_rawDesc + file_internal_backup_util_proto_rawDescOnce sync.Once + file_internal_backup_util_proto_rawDescData = file_internal_backup_util_proto_rawDesc ) -func file_internal_data_proto_rawDescGZIP() []byte { - file_internal_data_proto_rawDescOnce.Do(func() { - file_internal_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_data_proto_rawDescData) +func file_internal_backup_util_proto_rawDescGZIP() []byte { + file_internal_backup_util_proto_rawDescOnce.Do(func() { + file_internal_backup_util_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_backup_util_proto_rawDescData) }) - return file_internal_data_proto_rawDescData + return file_internal_backup_util_proto_rawDescData } -var file_internal_data_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_internal_data_proto_goTypes = []interface{}{ +var file_internal_backup_util_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_internal_backup_util_proto_goTypes = []interface{}{ (*PortableData)(nil), // 0: backup_util.PortableData } -var file_internal_data_proto_depIdxs = []int32{ +var file_internal_backup_util_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -112,13 +112,13 @@ var file_internal_data_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_internal_data_proto_init() } -func file_internal_data_proto_init() { - if File_internal_data_proto != nil { +func init() { file_internal_backup_util_proto_init() } +func file_internal_backup_util_proto_init() { + if File_internal_backup_util_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_internal_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_internal_backup_util_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortableData); i { case 0: return &v.state @@ -135,18 +135,18 @@ func file_internal_data_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_data_proto_rawDesc, + RawDescriptor: file_internal_backup_util_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_internal_data_proto_goTypes, - DependencyIndexes: file_internal_data_proto_depIdxs, - MessageInfos: file_internal_data_proto_msgTypes, + GoTypes: file_internal_backup_util_proto_goTypes, + DependencyIndexes: file_internal_backup_util_proto_depIdxs, + MessageInfos: file_internal_backup_util_proto_msgTypes, }.Build() - File_internal_data_proto = out.File - file_internal_data_proto_rawDesc = nil - file_internal_data_proto_goTypes = nil - file_internal_data_proto_depIdxs = nil + File_internal_backup_util_proto = out.File + file_internal_backup_util_proto_rawDesc = nil + file_internal_backup_util_proto_goTypes = nil + file_internal_backup_util_proto_depIdxs = nil } diff --git a/cmd/influxd/backup_util/internal/data.proto b/cmd/influxd/backup_util/internal/backup_util.proto similarity index 100% rename from cmd/influxd/backup_util/internal/data.proto rename to cmd/influxd/backup_util/internal/backup_util.proto diff --git a/go.mod b/go.mod index 185d9deaccb..67f070da195 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 github.com/go-chi/chi v4.1.0+incompatible - github.com/gogo/protobuf v1.3.2 + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible github.com/golang/mock v1.4.3 github.com/golang/protobuf v1.5.2 // indirect diff --git a/go.sum b/go.sum index f36b2cbd03f..34a623d1e67 100644 --- a/go.sum +++ b/go.sum @@ -1174,7 +1174,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/services/httpd/handler.go b/services/httpd/handler.go index 2fa85974794..5849d5fc2ae 100644 --- a/services/httpd/handler.go +++ b/services/httpd/handler.go @@ -22,7 +22,6 @@ import ( "time" "github.com/bmizerany/pat" - gogoproto "github.com/gogo/protobuf/proto" // used for Prometheus only "github.com/golang-jwt/jwt" "github.com/golang/snappy" "github.com/influxdata/flux" @@ -1161,7 +1160,7 @@ func (h *Handler) servePromWrite(w http.ResponseWriter, r *http.Request, user me // Convert the Prometheus remote write request to Influx Points var req prompb.WriteRequest - if err := gogoproto.Unmarshal(reqBuf, &req); err != nil { + if err := req.Unmarshal(reqBuf); err != nil { h.httpError(w, err.Error(), http.StatusBadRequest) return } @@ -1232,7 +1231,7 @@ func (h *Handler) servePromRead(w http.ResponseWriter, r *http.Request, user met } var req prompb.ReadRequest - if err := gogoproto.Unmarshal(reqBuf, &req); err != nil { + if err := req.Unmarshal(reqBuf); err != nil { h.httpError(w, err.Error(), http.StatusBadRequest) return } @@ -1259,7 +1258,7 @@ func (h *Handler) servePromRead(w http.ResponseWriter, r *http.Request, user met } respond := func(resp *prompb.ReadResponse) { - data, err := gogoproto.Marshal(resp) + data, err := resp.Marshal() if err != nil { h.httpError(w, err.Error(), http.StatusInternalServerError) return diff --git a/services/httpd/handler_test.go b/services/httpd/handler_test.go index b73a64fdedc..d8ecec84ebd 100644 --- a/services/httpd/handler_test.go +++ b/services/httpd/handler_test.go @@ -21,7 +21,6 @@ import ( "testing" "time" - gogoproto "github.com/gogo/protobuf/proto" // used for Prometheus only "github.com/golang-jwt/jwt" "github.com/golang/snappy" "github.com/google/go-cmp/cmp" @@ -767,7 +766,7 @@ func TestHandler_PromWrite(t *testing.T) { }, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -856,7 +855,7 @@ func TestHandler_PromWrite_Dropped(t *testing.T) { }, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -940,7 +939,7 @@ func TestHandler_PromWrite_Error(t *testing.T) { }, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -989,7 +988,7 @@ func TestHandler_PromRead(t *testing.T) { EndTimestampMs: 2, }}, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -1042,7 +1041,7 @@ func TestHandler_PromRead(t *testing.T) { } var resp prompb.ReadResponse - if err := gogoproto.Unmarshal(reqBuf, &resp); err != nil { + if err := resp.Unmarshal(reqBuf); err != nil { t.Fatal(err) } @@ -1092,7 +1091,7 @@ func TestHandler_PromRead_NoResults(t *testing.T) { StartTimestampMs: 0, EndTimestampMs: models.MaxNanoTime / int64(time.Millisecond), }}} - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -1111,7 +1110,7 @@ func TestHandler_PromRead_NoResults(t *testing.T) { } var resp prompb.ReadResponse - if err := gogoproto.Unmarshal(reqBuf, &resp); err != nil { + if err := resp.Unmarshal(reqBuf); err != nil { t.Fatal(err.Error()) } } @@ -1128,7 +1127,7 @@ func TestHandler_PromRead_UnsupportedCursors(t *testing.T) { StartTimestampMs: 0, EndTimestampMs: models.MaxNanoTime / int64(time.Millisecond), }}} - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -1167,7 +1166,7 @@ func TestHandler_PromRead_UnsupportedCursors(t *testing.T) { } var resp prompb.ReadResponse - if err := gogoproto.Unmarshal(reqBuf, &resp); err != nil { + if err := resp.Unmarshal(reqBuf); err != nil { t.Fatal(err.Error()) } @@ -1207,7 +1206,7 @@ func TestHandler_PromRead_NilResultSet(t *testing.T) { EndTimestampMs: 2, }}, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { log.Fatal("couldn't marshal prometheus request") } @@ -1241,7 +1240,7 @@ func TestHandler_PromRead_NilResultSet(t *testing.T) { } resp := new(prompb.ReadResponse) - err = gogoproto.Unmarshal(decompressed, resp) + err = resp.Unmarshal(decompressed) if err != nil { t.Fatal(err) } diff --git a/tests/server_test.go b/tests/server_test.go index 269375df928..d8416f98c91 100644 --- a/tests/server_test.go +++ b/tests/server_test.go @@ -18,7 +18,6 @@ import ( "testing" "time" - gogoproto "github.com/gogo/protobuf/proto" "github.com/golang/snappy" "github.com/google/go-cmp/cmp" "github.com/influxdata/flux" @@ -9811,7 +9810,7 @@ func TestServer_Prometheus_Read(t *testing.T) { EndTimestampMs: 120010, }}, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } @@ -9834,7 +9833,7 @@ func TestServer_Prometheus_Read(t *testing.T) { } var promResp prompb.ReadResponse - if err := gogoproto.Unmarshal(reqBuf, &promResp); err != nil { + if err := promResp.Unmarshal(reqBuf); err != nil { t.Fatal(err.Error()) } @@ -9911,7 +9910,7 @@ func TestServer_Prometheus_Write(t *testing.T) { }, } - data, err := gogoproto.Marshal(req) + data, err := req.Marshal() if err != nil { t.Fatal("couldn't marshal prometheus request") } diff --git a/tools.go b/tools.go index 38a1c8e09e1..5deafcdf00c 100644 --- a/tools.go +++ b/tools.go @@ -2,11 +2,8 @@ package main -// todo(dstrand1): remove gogo generators when influx_tools is ported import ( _ "github.com/benbjohnson/tmpl" - _ "github.com/gogo/protobuf/protoc-gen-gogo" - _ "github.com/gogo/protobuf/protoc-gen-gogofaster" _ "github.com/influxdata/pkg-config" _ "golang.org/x/tools/cmd/goimports" _ "google.golang.org/protobuf/cmd/protoc-gen-go"