diff --git a/pkg/rules/rulespb/rpc.pb.go b/pkg/rules/rulespb/rpc.pb.go index 84ef29d3..572f46a4 100644 --- a/pkg/rules/rulespb/rpc.pb.go +++ b/pkg/rules/rulespb/rpc.pb.go @@ -12,12 +12,9 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" - math_bits "math/bits" time "time" storepb "github.com/thanos-io/thanos/pkg/store/storepb" @@ -33,7 +30,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package /// AlertState represents state of the alert. Has to match 1:1 Prometheus AlertState: // @@ -123,7 +120,7 @@ func (m *RulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_RulesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -163,7 +160,7 @@ func (m *RulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RulesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -189,10 +186,10 @@ type isRulesResponse_Result interface { } type RulesResponse_Group struct { - Group *RuleGroup `protobuf:"bytes,1,opt,name=group,proto3,oneof" json:"group,omitempty"` + Group *RuleGroup `protobuf:"bytes,1,opt,name=group,proto3,oneof"` } type RulesResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } func (*RulesResponse_Group) isRulesResponse_Result() {} @@ -219,14 +216,76 @@ func (m *RulesResponse) GetWarning() string { return "" } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RulesResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*RulesResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _RulesResponse_OneofMarshaler, _RulesResponse_OneofUnmarshaler, _RulesResponse_OneofSizer, []interface{}{ (*RulesResponse_Group)(nil), (*RulesResponse_Warning)(nil), } } +func _RulesResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*RulesResponse) + // result + switch x := m.Result.(type) { + case *RulesResponse_Group: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Group); err != nil { + return err + } + case *RulesResponse_Warning: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeStringBytes(x.Warning) + case nil: + default: + return fmt.Errorf("RulesResponse.Result has unexpected type %T", x) + } + return nil +} + +func _RulesResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*RulesResponse) + switch tag { + case 1: // result.group + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RuleGroup) + err := b.DecodeMessage(msg) + m.Result = &RulesResponse_Group{msg} + return true, err + case 2: // result.warning + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Result = &RulesResponse_Warning{x} + return true, err + default: + return false, nil + } +} + +func _RulesResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*RulesResponse) + // result + switch x := m.Result.(type) { + case *RulesResponse_Group: + s := proto.Size(x.Group) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *RulesResponse_Warning: + n += 1 // tag and wire + n += proto.SizeVarint(uint64(len(x.Warning))) + n += len(x.Warning) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + /// RuleGroups is set of rule groups. /// This and below APIs are meant to be used for unmarshaling and marshsaling rules from/to Prometheus API. /// That's why json tag has to be customized and matching https://github.com/prometheus/prometheus/blob/c530b4b456cc5f9ec249f771dff187eb7715dc9b/web/api/v1/api.go#L955 @@ -251,7 +310,7 @@ func (m *RuleGroups) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RuleGroups.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -297,7 +356,7 @@ func (m *RuleGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RuleGroup.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -337,7 +396,7 @@ func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Rule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -363,10 +422,10 @@ type isRule_Result interface { } type Rule_Recording struct { - Recording *RecordingRule `protobuf:"bytes,1,opt,name=recording,proto3,oneof" json:"recording,omitempty"` + Recording *RecordingRule `protobuf:"bytes,1,opt,name=recording,proto3,oneof"` } type Rule_Alert struct { - Alert *Alert `protobuf:"bytes,2,opt,name=alert,proto3,oneof" json:"alert,omitempty"` + Alert *Alert `protobuf:"bytes,2,opt,name=alert,proto3,oneof"` } func (*Rule_Recording) isRule_Result() {} @@ -393,14 +452,80 @@ func (m *Rule) GetAlert() *Alert { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Rule) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*Rule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _Rule_OneofMarshaler, _Rule_OneofUnmarshaler, _Rule_OneofSizer, []interface{}{ (*Rule_Recording)(nil), (*Rule_Alert)(nil), } } +func _Rule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Rule) + // result + switch x := m.Result.(type) { + case *Rule_Recording: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Recording); err != nil { + return err + } + case *Rule_Alert: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Alert); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Rule.Result has unexpected type %T", x) + } + return nil +} + +func _Rule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*Rule) + switch tag { + case 1: // result.recording + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RecordingRule) + err := b.DecodeMessage(msg) + m.Result = &Rule_Recording{msg} + return true, err + case 2: // result.alert + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Alert) + err := b.DecodeMessage(msg) + m.Result = &Rule_Alert{msg} + return true, err + default: + return false, nil + } +} + +func _Rule_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Rule) + // result + switch x := m.Result.(type) { + case *Rule_Recording: + s := proto.Size(x.Recording) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Rule_Alert: + s := proto.Size(x.Alert) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + type AlertInstance struct { Labels PromLabels `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` Annotations PromLabels `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` @@ -425,7 +550,7 @@ func (m *AlertInstance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_AlertInstance.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -473,7 +598,7 @@ func (m *Alert) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Alert.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -516,7 +641,7 @@ func (m *RecordingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_RecordingRule.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -553,7 +678,7 @@ func (m *PromLabels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PromLabels.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -721,14 +846,6 @@ type RulesServer interface { Rules(*RulesRequest, Rules_RulesServer) error } -// UnimplementedRulesServer can be embedded to have forward compatible implementations. -type UnimplementedRulesServer struct { -} - -func (*UnimplementedRulesServer) Rules(req *RulesRequest, srv Rules_RulesServer) error { - return status.Errorf(codes.Unimplemented, "method Rules not implemented") -} - func RegisterRulesServer(s *grpc.Server, srv RulesServer) { s.RegisterService(&_Rules_serviceDesc, srv) } @@ -771,7 +888,7 @@ var _Rules_serviceDesc = grpc.ServiceDesc{ func (m *RulesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -779,32 +896,27 @@ func (m *RulesRequest) Marshal() (dAtA []byte, err error) { } func (m *RulesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } if m.Type != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Type)) - i-- dAtA[i] = 0x8 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Type)) + } + if m.PartialResponseStrategy != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) } - return len(dAtA) - i, nil + return i, nil } func (m *RulesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -812,66 +924,46 @@ func (m *RulesResponse) Marshal() (dAtA []byte, err error) { } func (m *RulesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } + nn1, err1 := m.Result.MarshalTo(dAtA[i:]) + if err1 != nil { + return 0, err1 } + i += nn1 } - return len(dAtA) - i, nil + return i, nil } func (m *RulesResponse_Group) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesResponse_Group) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + i := 0 if m.Group != nil { - { - size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Group.Size())) + n2, err2 := m.Group.MarshalTo(dAtA[i:]) + if err2 != nil { + return 0, err2 + } + i += n2 } - return len(dAtA) - i, nil + return i, nil } func (m *RulesResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RulesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- + i := 0 dAtA[i] = 0x12 - return len(dAtA) - i, nil + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) + i += copy(dAtA[i:], m.Warning) + return i, nil } func (m *RuleGroups) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -879,36 +971,29 @@ func (m *RuleGroups) Marshal() (dAtA []byte, err error) { } func (m *RuleGroups) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleGroups) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Groups) > 0 { - for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Groups { dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *RuleGroup) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -916,80 +1001,71 @@ func (m *RuleGroup) Marshal() (dAtA []byte, err error) { } func (m *RuleGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x40 - } - if m.DeprecatedPartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.DeprecatedPartialResponseStrategy)) - i-- - dAtA[i] = 0x38 + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err2 != nil { - return 0, err2 + if len(m.File) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.File))) + i += copy(dAtA[i:], m.File) } - i -= n2 - i = encodeVarintRpc(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x32 - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x29 + if len(m.Rules) > 0 { + for _, msg := range m.Rules { + dAtA[i] = 0x1a + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.Interval != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Interval)))) - i-- dAtA[i] = 0x21 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Interval)))) + i += 8 } - if len(m.Rules) > 0 { - for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + if m.EvaluationDurationSeconds != 0 { + dAtA[i] = 0x29 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i += 8 } - if len(m.File) > 0 { - i -= len(m.File) - copy(dAtA[i:], m.File) - i = encodeVarintRpc(dAtA, i, uint64(len(m.File))) - i-- - dAtA[i] = 0x12 + dAtA[i] = 0x32 + i++ + i = encodeVarintRpc(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation))) + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i:]) + if err3 != nil { + return 0, err3 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa + i += n3 + if m.DeprecatedPartialResponseStrategy != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.DeprecatedPartialResponseStrategy)) + } + if m.PartialResponseStrategy != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) } - return len(dAtA) - i, nil + return i, nil } func (m *Rule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -997,73 +1073,52 @@ func (m *Rule) Marshal() (dAtA []byte, err error) { } func (m *Rule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } + nn4, err4 := m.Result.MarshalTo(dAtA[i:]) + if err4 != nil { + return 0, err4 } + i += nn4 } - return len(dAtA) - i, nil + return i, nil } func (m *Rule_Recording) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule_Recording) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + i := 0 if m.Recording != nil { - { - size, err := m.Recording.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Recording.Size())) + n5, err5 := m.Recording.MarshalTo(dAtA[i:]) + if err5 != nil { + return 0, err5 + } + i += n5 } - return len(dAtA) - i, nil + return i, nil } func (m *Rule_Alert) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Rule_Alert) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + i := 0 if m.Alert != nil { - { - size, err := m.Alert.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Alert.Size())) + n6, err6 := m.Alert.MarshalTo(dAtA[i:]) + if err6 != nil { + return 0, err6 + } + i += n6 } - return len(dAtA) - i, nil + return i, nil } func (m *AlertInstance) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1071,69 +1126,59 @@ func (m *AlertInstance) Marshal() (dAtA []byte, err error) { } func (m *AlertInstance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AlertInstance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x30 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x2a + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Labels.Size())) + n7, err7 := m.Labels.MarshalTo(dAtA[i:]) + if err7 != nil { + return 0, err7 } - if m.ActiveAt != nil { - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.ActiveAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.ActiveAt):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintRpc(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x22 + i += n7 + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Annotations.Size())) + n8, err8 := m.Annotations.MarshalTo(dAtA[i:]) + if err8 != nil { + return 0, err8 } + i += n8 if m.State != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.State)) - i-- dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.State)) } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.ActiveAt != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRpc(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.ActiveAt))) + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.ActiveAt, dAtA[i:]) + if err9 != nil { + return 0, err9 } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + i += n9 } - i-- - dAtA[i] = 0x12 - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + if len(m.Value) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + if m.PartialResponseStrategy != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) + } + return i, nil } func (m *Alert) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1141,109 +1186,94 @@ func (m *Alert) Marshal() (dAtA []byte, err error) { } func (m *Alert) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Alert) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintRpc(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x5a - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x51 + if m.State != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.State)) } - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x4a + if len(m.Name) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - if len(m.Health) > 0 { - i -= len(m.Health) - copy(dAtA[i:], m.Health) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) - i-- - dAtA[i] = 0x42 + if len(m.Query) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) + i += copy(dAtA[i:], m.Query) } - if len(m.Alerts) > 0 { - for iNdEx := len(m.Alerts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Alerts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } + if m.DurationSeconds != 0 { + dAtA[i] = 0x21 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DurationSeconds)))) + i += 8 } - { - size, err := m.Annotations.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + dAtA[i] = 0x2a + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Labels.Size())) + n10, err10 := m.Labels.MarshalTo(dAtA[i:]) + if err10 != nil { + return 0, err10 } - i-- + i += n10 dAtA[i] = 0x32 - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Annotations.Size())) + n11, err11 := m.Annotations.MarshalTo(dAtA[i:]) + if err11 != nil { + return 0, err11 + } + i += n11 + if len(m.Alerts) > 0 { + for _, msg := range m.Alerts { + dAtA[i] = 0x3a + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x2a - if m.DurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DurationSeconds)))) - i-- - dAtA[i] = 0x21 + if len(m.Health) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) + i += copy(dAtA[i:], m.Health) } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x1a + if len(m.LastError) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) + i += copy(dAtA[i:], m.LastError) } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 + if m.EvaluationDurationSeconds != 0 { + dAtA[i] = 0x51 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i += 8 } - if m.State != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0x5a + i++ + i = encodeVarintRpc(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation))) + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i:]) + if err12 != nil { + return 0, err12 } - return len(dAtA) - i, nil + i += n12 + return i, nil } func (m *RecordingRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1251,74 +1281,63 @@ func (m *RecordingRule) Marshal() (dAtA []byte, err error) { } func (m *RecordingRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RecordingRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation):]) - if err11 != nil { - return 0, err11 + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - i -= n11 - i = encodeVarintRpc(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x3a - if m.EvaluationDurationSeconds != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) - i-- - dAtA[i] = 0x31 + if len(m.Query) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) + i += copy(dAtA[i:], m.Query) } - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Labels.Size())) + n13, err13 := m.Labels.MarshalTo(dAtA[i:]) + if err13 != nil { + return 0, err13 } + i += n13 if len(m.Health) > 0 { - i -= len(m.Health) - copy(dAtA[i:], m.Health) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) - i-- dAtA[i] = 0x22 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Health))) + i += copy(dAtA[i:], m.Health) } - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + if len(m.LastError) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.LastError))) + i += copy(dAtA[i:], m.LastError) } - i-- - dAtA[i] = 0x1a - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x12 + if m.EvaluationDurationSeconds != 0 { + dAtA[i] = 0x31 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.EvaluationDurationSeconds)))) + i += 8 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa + dAtA[i] = 0x3a + i++ + i = encodeVarintRpc(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.LastEvaluation))) + n14, err14 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastEvaluation, dAtA[i:]) + if err14 != nil { + return 0, err14 } - return len(dAtA) - i, nil + i += n14 + return i, nil } func (m *PromLabels) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1326,42 +1345,33 @@ func (m *PromLabels) Marshal() (dAtA []byte, err error) { } func (m *PromLabels) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PromLabels) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Labels { dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *RulesRequest) Size() (n int) { if m == nil { @@ -1621,7 +1631,14 @@ func (m *PromLabels) Size() (n int) { } func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozRpc(x uint64) (n int) { return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3219,7 +3236,6 @@ func (m *PromLabels) Unmarshal(dAtA []byte) error { func skipRpc(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 { @@ -3251,8 +3267,10 @@ func skipRpc(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3273,30 +3291,55 @@ func skipRpc(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRpc } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRpc + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipRpc(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRpc + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") ) diff --git a/pkg/store/hintspb/hints.pb.go b/pkg/store/hintspb/hints.pb.go index d46d89a8..75b2e526 100644 --- a/pkg/store/hintspb/hints.pb.go +++ b/pkg/store/hintspb/hints.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" io "io" math "math" - math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -23,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type SeriesRequestHints struct { /// block_matchers is a list of label matchers that are evaluated against each single block's @@ -46,7 +45,7 @@ func (m *SeriesRequestHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SeriesRequestHints.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -84,7 +83,7 @@ func (m *SeriesResponseHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SeriesResponseHints.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -121,7 +120,7 @@ func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Block.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -171,7 +170,7 @@ var fileDescriptor_b82aa23c4c11e83f = []byte{ func (m *SeriesRequestHints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -179,36 +178,29 @@ func (m *SeriesRequestHints) Marshal() (dAtA []byte, err error) { } func (m *SeriesRequestHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesRequestHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.BlockMatchers) > 0 { - for iNdEx := len(m.BlockMatchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BlockMatchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.BlockMatchers { dAtA[i] = 0xa + i++ + i = encodeVarintHints(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *SeriesResponseHints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -216,36 +208,29 @@ func (m *SeriesResponseHints) Marshal() (dAtA []byte, err error) { } func (m *SeriesResponseHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponseHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.QueriedBlocks) > 0 { - for iNdEx := len(m.QueriedBlocks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QueriedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintHints(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.QueriedBlocks { dAtA[i] = 0xa + i++ + i = encodeVarintHints(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *Block) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -253,35 +238,27 @@ func (m *Block) Marshal() (dAtA []byte, err error) { } func (m *Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintHints(dAtA, i, uint64(len(m.Id))) - i-- dAtA[i] = 0xa + i++ + i = encodeVarintHints(dAtA, i, uint64(len(m.Id))) + i += copy(dAtA[i:], m.Id) } - return len(dAtA) - i, nil + return i, nil } func encodeVarintHints(dAtA []byte, offset int, v uint64) int { - offset -= sovHints(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *SeriesRequestHints) Size() (n int) { if m == nil { @@ -327,7 +304,14 @@ func (m *Block) Size() (n int) { } func sovHints(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozHints(x uint64) (n int) { return sovHints(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -594,7 +578,6 @@ func (m *Block) Unmarshal(dAtA []byte) error { func skipHints(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 { @@ -626,8 +609,10 @@ func skipHints(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -648,30 +633,55 @@ func skipHints(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthHints } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthHints + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHints + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHints + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipHints(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthHints + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthHints - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthHints = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHints = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHints = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthHints = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHints = fmt.Errorf("proto: integer overflow") ) diff --git a/pkg/store/storepb/prompb/remote.pb.go b/pkg/store/storepb/prompb/remote.pb.go index fe35516a..21cbee61 100644 --- a/pkg/store/storepb/prompb/remote.pb.go +++ b/pkg/store/storepb/prompb/remote.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" io "io" math "math" - math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -22,7 +21,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type ReadRequest_ResponseType int32 @@ -79,7 +78,7 @@ func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -130,7 +129,7 @@ func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -183,7 +182,7 @@ func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -230,7 +229,7 @@ func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Query.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -296,7 +295,7 @@ func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -346,7 +345,7 @@ func (m *ChunkedReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ChunkedReadResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -430,7 +429,7 @@ var fileDescriptor_b3df75c58e6767bb = []byte{ func (m *WriteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -438,36 +437,29 @@ func (m *WriteRequest) Marshal() (dAtA []byte, err error) { } func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Timeseries { dAtA[i] = 0xa + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *ReadRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -475,15 +467,22 @@ func (m *ReadRequest) Marshal() (dAtA []byte, err error) { } func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l + if len(m.Queries) > 0 { + for _, msg := range m.Queries { + dAtA[i] = 0xa + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } if len(m.AcceptedResponseTypes) > 0 { dAtA2 := make([]byte, len(m.AcceptedResponseTypes)*10) var j1 int @@ -496,33 +495,18 @@ func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA2[j1] = uint8(num) j1++ } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintRemote(dAtA, i, uint64(j1)) - i-- dAtA[i] = 0x12 + i++ + i = encodeVarintRemote(dAtA, i, uint64(j1)) + i += copy(dAtA[i:], dAtA2[:j1]) } - if len(m.Queries) > 0 { - for iNdEx := len(m.Queries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Queries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + return i, nil } func (m *ReadResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -530,36 +514,29 @@ func (m *ReadResponse) Marshal() (dAtA []byte, err error) { } func (m *ReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Results { dAtA[i] = 0xa + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *Query) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -567,58 +544,49 @@ func (m *Query) Marshal() (dAtA []byte, err error) { } func (m *Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) + if m.StartTimestampMs != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintRemote(dAtA, i, uint64(m.StartTimestampMs)) + } + if m.EndTimestampMs != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRemote(dAtA, i, uint64(m.EndTimestampMs)) + } + if len(m.Matchers) > 0 { + for _, msg := range m.Matchers { + dAtA[i] = 0x1a + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) + i += n } - i-- - dAtA[i] = 0x22 } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a + if m.Hints != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintRemote(dAtA, i, uint64(m.Hints.Size())) + n3, err3 := m.Hints.MarshalTo(dAtA[i:]) + if err3 != nil { + return 0, err3 } + i += n3 } - if m.EndTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.EndTimestampMs)) - i-- - dAtA[i] = 0x10 - } - if m.StartTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.StartTimestampMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return i, nil } func (m *QueryResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -626,36 +594,29 @@ func (m *QueryResult) Marshal() (dAtA []byte, err error) { } func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Timeseries { dAtA[i] = 0xa + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *ChunkedReadResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -663,47 +624,38 @@ func (m *ChunkedReadResponse) Marshal() (dAtA []byte, err error) { } func (m *ChunkedReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.QueryIndex != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.QueryIndex)) - i-- - dAtA[i] = 0x10 - } if len(m.ChunkedSeries) > 0 { - for iNdEx := len(m.ChunkedSeries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChunkedSeries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.ChunkedSeries { dAtA[i] = 0xa + i++ + i = encodeVarintRemote(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + if m.QueryIndex != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRemote(dAtA, i, uint64(m.QueryIndex)) + } + return i, nil } func encodeVarintRemote(dAtA []byte, offset int, v uint64) int { - offset -= sovRemote(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *WriteRequest) Size() (n int) { if m == nil { @@ -816,7 +768,14 @@ func (m *ChunkedReadResponse) Size() (n int) { } func sovRemote(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozRemote(x uint64) (n int) { return sovRemote(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1508,7 +1467,6 @@ func (m *ChunkedReadResponse) Unmarshal(dAtA []byte) error { func skipRemote(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 { @@ -1540,8 +1498,10 @@ func skipRemote(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1562,30 +1522,55 @@ func skipRemote(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRemote } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRemote + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRemote + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRemote + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipRemote(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRemote + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthRemote - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthRemote = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRemote = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRemote = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthRemote = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRemote = fmt.Errorf("proto: integer overflow") ) diff --git a/pkg/store/storepb/prompb/types.pb.go b/pkg/store/storepb/prompb/types.pb.go index 40ac8393..6fc605fb 100644 --- a/pkg/store/storepb/prompb/types.pb.go +++ b/pkg/store/storepb/prompb/types.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" io "io" math "math" - math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -23,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type LabelMatcher_Type int32 @@ -101,7 +100,7 @@ func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Sample.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -154,7 +153,7 @@ func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_TimeSeries.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -206,7 +205,7 @@ func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Label.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -257,7 +256,7 @@ func (m *Labels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Labels.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -304,7 +303,7 @@ func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LabelMatcher.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -368,7 +367,7 @@ func (m *ReadHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ReadHints.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -459,7 +458,7 @@ func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -528,7 +527,7 @@ func (m *ChunkedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ChunkedSeries.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -619,7 +618,7 @@ var fileDescriptor_166e07899dab7c14 = []byte{ func (m *Sample) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -627,33 +626,28 @@ func (m *Sample) Marshal() (dAtA []byte, err error) { } func (m *Sample) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x10 - } if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- dAtA[i] = 0x9 + i++ + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i += 8 + } + if m.Timestamp != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) } - return len(dAtA) - i, nil + return i, nil } func (m *TimeSeries) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -661,50 +655,41 @@ func (m *TimeSeries) Marshal() (dAtA []byte, err error) { } func (m *TimeSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i += n } } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Samples) > 0 { + for _, msg := range m.Samples { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -712,36 +697,29 @@ func (m *Label) Marshal() (dAtA []byte, err error) { } func (m *Label) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - return len(dAtA) - i, nil + if len(m.Value) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + } + return i, nil } func (m *Labels) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -749,36 +727,29 @@ func (m *Labels) Marshal() (dAtA []byte, err error) { } func (m *Labels) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Labels) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Labels { dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -786,41 +757,34 @@ func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { } func (m *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a + if m.Type != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) } if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 + if len(m.Value) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) } - return len(dAtA) - i, nil + return i, nil } func (m *ReadHints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -828,68 +792,68 @@ func (m *ReadHints) Marshal() (dAtA []byte, err error) { } func (m *ReadHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.RangeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RangeMs)) - i-- - dAtA[i] = 0x38 + if m.StepMs != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.StepMs)) } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 + if len(m.Func) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Func))) + i += copy(dAtA[i:], m.Func) } - if len(m.Grouping) > 0 { - for iNdEx := len(m.Grouping) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Grouping[iNdEx]) - copy(dAtA[i:], m.Grouping[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Grouping[iNdEx]))) - i-- - dAtA[i] = 0x2a - } + if m.StartMs != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.StartMs)) } if m.EndMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.EndMs)) - i-- dAtA[i] = 0x20 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.EndMs)) } - if m.StartMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StartMs)) - i-- - dAtA[i] = 0x18 + if len(m.Grouping) > 0 { + for _, s := range m.Grouping { + dAtA[i] = 0x2a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } - if len(m.Func) > 0 { - i -= len(m.Func) - copy(dAtA[i:], m.Func) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Func))) - i-- - dAtA[i] = 0x12 + if m.By { + dAtA[i] = 0x30 + i++ + if m.By { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - if m.StepMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StepMs)) - i-- - dAtA[i] = 0x8 + if m.RangeMs != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.RangeMs)) } - return len(dAtA) - i, nil + return i, nil } func (m *Chunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -897,44 +861,38 @@ func (m *Chunk) Marshal() (dAtA []byte, err error) { } func (m *Chunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 + if m.MinTimeMs != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.MinTimeMs)) } if m.MaxTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTimeMs)) - i-- dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.MaxTimeMs)) } - if m.MinTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTimeMs)) - i-- - dAtA[i] = 0x8 + if m.Type != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) + } + if len(m.Data) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i += copy(dAtA[i:], m.Data) } - return len(dAtA) - i, nil + return i, nil } func (m *ChunkedSeries) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -942,56 +900,45 @@ func (m *ChunkedSeries) Marshal() (dAtA []byte, err error) { } func (m *ChunkedSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i += n } } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Chunks) > 0 { + for _, msg := range m.Chunks { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i += n } } - return len(dAtA) - i, nil + return i, nil } func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *Sample) Size() (n int) { if m == nil { @@ -1159,7 +1106,14 @@ func (m *ChunkedSeries) Size() (n int) { } func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2189,7 +2143,6 @@ func (m *ChunkedSeries) Unmarshal(dAtA []byte) error { func skipTypes(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 { @@ -2221,8 +2174,10 @@ func skipTypes(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2243,30 +2198,55 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipTypes(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) diff --git a/pkg/store/storepb/rpc.pb.go b/pkg/store/storepb/rpc.pb.go index bddab10d..889ecc2e 100644 --- a/pkg/store/storepb/rpc.pb.go +++ b/pkg/store/storepb/rpc.pb.go @@ -8,15 +8,12 @@ import ( fmt "fmt" io "io" math "math" - math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" ) // Reference imports to suppress errors if they are not otherwise used. @@ -28,7 +25,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type StoreType int32 @@ -125,7 +122,7 @@ func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -164,7 +161,7 @@ func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -200,7 +197,7 @@ func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -243,7 +240,7 @@ func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -280,7 +277,7 @@ func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LabelSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -331,7 +328,7 @@ func (m *SeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_SeriesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -372,7 +369,7 @@ func (m *SeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_SeriesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -398,13 +395,13 @@ type isSeriesResponse_Result interface { } type SeriesResponse_Series struct { - Series *Series `protobuf:"bytes,1,opt,name=series,proto3,oneof" json:"series,omitempty"` + Series *Series `protobuf:"bytes,1,opt,name=series,proto3,oneof"` } type SeriesResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` + Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof"` } type SeriesResponse_Hints struct { - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof" json:"hints,omitempty"` + Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof"` } func (*SeriesResponse_Series) isSeriesResponse_Result() {} @@ -439,15 +436,95 @@ func (m *SeriesResponse) GetHints() *types.Any { return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SeriesResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SeriesResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SeriesResponse_OneofMarshaler, _SeriesResponse_OneofUnmarshaler, _SeriesResponse_OneofSizer, []interface{}{ (*SeriesResponse_Series)(nil), (*SeriesResponse_Warning)(nil), (*SeriesResponse_Hints)(nil), } } +func _SeriesResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SeriesResponse) + // result + switch x := m.Result.(type) { + case *SeriesResponse_Series: + _ = b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Series); err != nil { + return err + } + case *SeriesResponse_Warning: + _ = b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeStringBytes(x.Warning) + case *SeriesResponse_Hints: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Hints); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SeriesResponse.Result has unexpected type %T", x) + } + return nil +} + +func _SeriesResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SeriesResponse) + switch tag { + case 1: // result.series + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Series) + err := b.DecodeMessage(msg) + m.Result = &SeriesResponse_Series{msg} + return true, err + case 2: // result.warning + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Result = &SeriesResponse_Warning{x} + return true, err + case 3: // result.hints + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(types.Any) + err := b.DecodeMessage(msg) + m.Result = &SeriesResponse_Hints{msg} + return true, err + default: + return false, nil + } +} + +func _SeriesResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SeriesResponse) + // result + switch x := m.Result.(type) { + case *SeriesResponse_Series: + s := proto.Size(x.Series) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SeriesResponse_Warning: + n += 1 // tag and wire + n += proto.SizeVarint(uint64(len(x.Warning))) + n += len(x.Warning) + case *SeriesResponse_Hints: + s := proto.Size(x.Hints) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + type LabelNamesRequest struct { PartialResponseDisabled bool `protobuf:"varint,1,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. @@ -468,7 +545,7 @@ func (m *LabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_LabelNamesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -506,7 +583,7 @@ func (m *LabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_LabelNamesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -546,7 +623,7 @@ func (m *LabelValuesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_LabelValuesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -584,7 +661,7 @@ func (m *LabelValuesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_LabelValuesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -807,23 +884,6 @@ type StoreServer interface { LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) } -// UnimplementedStoreServer can be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (*UnimplementedStoreServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} -func (*UnimplementedStoreServer) Series(req *SeriesRequest, srv Store_SeriesServer) error { - return status.Errorf(codes.Unimplemented, "method Series not implemented") -} -func (*UnimplementedStoreServer) LabelNames(ctx context.Context, req *LabelNamesRequest) (*LabelNamesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") -} -func (*UnimplementedStoreServer) LabelValues(ctx context.Context, req *LabelValuesRequest) (*LabelValuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") -} - func RegisterStoreServer(s *grpc.Server, srv StoreServer) { s.RegisterService(&_Store_serviceDesc, srv) } @@ -961,14 +1021,6 @@ type WriteableStoreServer interface { RemoteWrite(context.Context, *WriteRequest) (*WriteResponse, error) } -// UnimplementedWriteableStoreServer can be embedded to have forward compatible implementations. -type UnimplementedWriteableStoreServer struct { -} - -func (*UnimplementedWriteableStoreServer) RemoteWrite(ctx context.Context, req *WriteRequest) (*WriteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoteWrite not implemented") -} - func RegisterWriteableStoreServer(s *grpc.Server, srv WriteableStoreServer) { s.RegisterService(&_WriteableStore_serviceDesc, srv) } @@ -1007,7 +1059,7 @@ var _WriteableStore_serviceDesc = grpc.ServiceDesc{ func (m *WriteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1015,22 +1067,17 @@ func (m *WriteResponse) Marshal() (dAtA []byte, err error) { } func (m *WriteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - return len(dAtA) - i, nil + return i, nil } func (m *WriteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1038,48 +1085,40 @@ func (m *WriteRequest) Marshal() (dAtA []byte, err error) { } func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.Replica != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Replica)) - i-- - dAtA[i] = 0x18 + if len(m.Timeseries) > 0 { + for _, msg := range m.Timeseries { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } if len(m.Tenant) > 0 { - i -= len(m.Tenant) - copy(dAtA[i:], m.Tenant) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Tenant))) - i-- dAtA[i] = 0x12 + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Tenant))) + i += copy(dAtA[i:], m.Tenant) } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if m.Replica != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Replica)) } - return len(dAtA) - i, nil + return i, nil } func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1087,22 +1126,17 @@ func (m *InfoRequest) Marshal() (dAtA []byte, err error) { } func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - return len(dAtA) - i, nil + return i, nil } func (m *InfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1110,65 +1144,56 @@ func (m *InfoResponse) Marshal() (dAtA []byte, err error) { } func (m *InfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.LabelSets) > 0 { - for iNdEx := len(m.LabelSets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LabelSets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i += n } } - if m.StoreType != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.StoreType)) - i-- - dAtA[i] = 0x20 + if m.MinTime != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) } if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x10 + if m.StoreType != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.StoreType)) } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + if len(m.LabelSets) > 0 { + for _, msg := range m.LabelSets { + dAtA[i] = 0x2a + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *LabelSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1176,36 +1201,29 @@ func (m *LabelSet) Marshal() (dAtA []byte, err error) { } func (m *LabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- + for _, msg := range m.Labels { dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *SeriesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1213,106 +1231,96 @@ func (m *SeriesRequest) Marshal() (dAtA []byte, err error) { } func (m *SeriesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) + if m.MinTime != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) + } + if m.MaxTime != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) + } + if len(m.Matchers) > 0 { + for _, msg := range m.Matchers { + dAtA[i] = 0x1a + i++ + i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) + i += n } - i-- - dAtA[i] = 0x4a } - if m.SkipChunks { - i-- - if m.SkipChunks { + if m.MaxResolutionWindow != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.MaxResolutionWindow)) + } + if len(m.Aggregates) > 0 { + dAtA2 := make([]byte, len(m.Aggregates)*10) + var j1 int + for _, num := range m.Aggregates { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + dAtA[i] = 0x2a + i++ + i = encodeVarintRpc(dAtA, i, uint64(j1)) + i += copy(dAtA[i:], dAtA2[:j1]) + } + if m.PartialResponseDisabled { + dAtA[i] = 0x30 + i++ + if m.PartialResponseDisabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x40 + i++ } if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- dAtA[i] = 0x38 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { + if m.SkipChunks { + dAtA[i] = 0x40 + i++ + if m.SkipChunks { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x30 - } - if len(m.Aggregates) > 0 { - dAtA3 := make([]byte, len(m.Aggregates)*10) - var j2 int - for _, num := range m.Aggregates { - 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 = encodeVarintRpc(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x2a + i++ } - if m.MaxResolutionWindow != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxResolutionWindow)) - i-- - dAtA[i] = 0x20 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a + if m.Hints != nil { + dAtA[i] = 0x4a + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Hints.Size())) + n3, err3 := m.Hints.MarshalTo(dAtA[i:]) + if err3 != nil { + return 0, err3 } + i += n3 } - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil + return i, nil } func (m *SeriesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1320,87 +1328,60 @@ func (m *SeriesResponse) Marshal() (dAtA []byte, err error) { } func (m *SeriesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } + nn4, err4 := m.Result.MarshalTo(dAtA[i:]) + if err4 != nil { + return 0, err4 } + i += nn4 } - return len(dAtA) - i, nil + return i, nil } func (m *SeriesResponse_Series) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + i := 0 if m.Series != nil { - { - size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Series.Size())) + n5, err5 := m.Series.MarshalTo(dAtA[i:]) + if err5 != nil { + return 0, err5 + } + i += n5 } - return len(dAtA) - i, nil + return i, nil } func (m *SeriesResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- + i := 0 dAtA[i] = 0x12 - return len(dAtA) - i, nil + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) + i += copy(dAtA[i:], m.Warning) + return i, nil } func (m *SeriesResponse_Hints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Hints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + i := 0 if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0x1a + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.Hints.Size())) + n6, err6 := m.Hints.MarshalTo(dAtA[i:]) + if err6 != nil { + return 0, err6 + } + i += n6 } - return len(dAtA) - i, nil + return i, nil } func (m *LabelNamesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1408,37 +1389,32 @@ func (m *LabelNamesRequest) Marshal() (dAtA []byte, err error) { } func (m *LabelNamesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } if m.PartialResponseDisabled { - i-- + dAtA[i] = 0x8 + i++ if m.PartialResponseDisabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x8 + i++ } - return len(dAtA) - i, nil + if m.PartialResponseStrategy != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) + } + return i, nil } func (m *LabelNamesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1446,40 +1422,47 @@ func (m *LabelNamesResponse) Marshal() (dAtA []byte, err error) { } func (m *LabelNamesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- + for _, s := range m.Names { dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - return len(dAtA) - i, nil + return i, nil } func (m *LabelValuesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1487,44 +1470,38 @@ func (m *LabelValuesRequest) Marshal() (dAtA []byte, err error) { } func (m *LabelValuesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x18 + if len(m.Label) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRpc(dAtA, i, uint64(len(m.Label))) + i += copy(dAtA[i:], m.Label) } if m.PartialResponseDisabled { - i-- + dAtA[i] = 0x10 + i++ if m.PartialResponseDisabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x10 + i++ } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0xa + if m.PartialResponseStrategy != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) } - return len(dAtA) - i, nil + return i, nil } func (m *LabelValuesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -1532,46 +1509,51 @@ func (m *LabelValuesResponse) Marshal() (dAtA []byte, err error) { } func (m *LabelValuesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } 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 = encodeVarintRpc(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- + for _, s := range m.Values { dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) } } - return len(dAtA) - i, nil + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + return i, nil } func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *WriteResponse) Size() (n int) { if m == nil { @@ -1825,7 +1807,14 @@ func (m *LabelValuesResponse) Size() (n int) { } func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozRpc(x uint64) (n int) { return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3255,7 +3244,6 @@ func (m *LabelValuesResponse) Unmarshal(dAtA []byte) error { func skipRpc(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 { @@ -3287,8 +3275,10 @@ func skipRpc(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3309,30 +3299,55 @@ func skipRpc(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRpc } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRpc + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipRpc(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRpc + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") ) diff --git a/pkg/store/storepb/types.pb.go b/pkg/store/storepb/types.pb.go index aecd1019..bfadc2fe 100644 --- a/pkg/store/storepb/types.pb.go +++ b/pkg/store/storepb/types.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" io "io" math "math" - math_bits "math/bits" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -22,7 +21,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package /// PartialResponseStrategy controls partial response handling. type PartialResponseStrategy int32 @@ -130,7 +129,7 @@ func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Label.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -168,7 +167,7 @@ func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -206,7 +205,7 @@ func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Series.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -250,7 +249,7 @@ func (m *AggrChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AggrChunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -290,7 +289,7 @@ func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_LabelMatcher.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -360,7 +359,7 @@ var fileDescriptor_121fba57de02d8e0 = []byte{ func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -368,36 +367,29 @@ func (m *Label) Marshal() (dAtA []byte, err error) { } func (m *Label) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - return len(dAtA) - i, nil + if len(m.Value) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) + } + return i, nil } func (m *Chunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -405,34 +397,28 @@ func (m *Chunk) Marshal() (dAtA []byte, err error) { } func (m *Chunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) } - return len(dAtA) - i, nil + if len(m.Data) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) + i += copy(dAtA[i:], m.Data) + } + return i, nil } func (m *Series) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -440,50 +426,41 @@ func (m *Series) Marshal() (dAtA []byte, err error) { } func (m *Series) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Labels) > 0 { + for _, msg := range m.Labels { + dAtA[i] = 0xa + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i += n } } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if len(m.Chunks) > 0 { + for _, msg := range m.Chunks { + dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i += n } } - return len(dAtA) - i, nil + return i, nil } func (m *AggrChunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -491,104 +468,87 @@ func (m *AggrChunk) Marshal() (dAtA []byte, err error) { } func (m *AggrChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AggrChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.Counter != nil { - { - size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 + if m.MinTime != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.MinTime)) } - if m.Max != nil { - { - size, err := m.Max.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.MaxTime != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.MaxTime)) + } + if m.Raw != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Raw.Size())) + n1, err1 := m.Raw.MarshalTo(dAtA[i:]) + if err1 != nil { + return 0, err1 } - i-- - dAtA[i] = 0x3a + i += n1 } - if m.Min != nil { - { - size, err := m.Min.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.Count != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Count.Size())) + n2, err2 := m.Count.MarshalTo(dAtA[i:]) + if err2 != nil { + return 0, err2 } - i-- - dAtA[i] = 0x32 + i += n2 } if m.Sum != nil { - { - size, err := m.Sum.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- dAtA[i] = 0x2a - } - if m.Count != nil { - { - size, err := m.Count.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Sum.Size())) + n3, err3 := m.Sum.MarshalTo(dAtA[i:]) + if err3 != nil { + return 0, err3 } - i-- - dAtA[i] = 0x22 + i += n3 } - if m.Raw != nil { - { - size, err := m.Raw.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + if m.Min != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Min.Size())) + n4, err4 := m.Min.MarshalTo(dAtA[i:]) + if err4 != nil { + return 0, err4 } - i-- - dAtA[i] = 0x1a + i += n4 } - if m.MaxTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 + if m.Max != nil { + dAtA[i] = 0x3a + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Max.Size())) + n5, err5 := m.Max.MarshalTo(dAtA[i:]) + if err5 != nil { + return 0, err5 + } + i += n5 } - if m.MinTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 + if m.Counter != nil { + dAtA[i] = 0x42 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Counter.Size())) + n6, err6 := m.Counter.MarshalTo(dAtA[i:]) + if err6 != nil { + return 0, err6 + } + i += n6 } - return len(dAtA) - i, nil + return i, nil } func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -596,47 +556,38 @@ func (m *LabelMatcher) Marshal() (dAtA []byte, err error) { } func (m *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a + if m.Type != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Type)) } if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- dAtA[i] = 0x12 + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 + if len(m.Value) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i += copy(dAtA[i:], m.Value) } - return len(dAtA) - i, nil + return i, nil } func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *Label) Size() (n int) { if m == nil { @@ -752,7 +703,14 @@ func (m *LabelMatcher) Size() (n int) { } func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1547,7 +1505,6 @@ func (m *LabelMatcher) Unmarshal(dAtA []byte) error { func skipTypes(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 { @@ -1579,8 +1536,10 @@ func skipTypes(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1601,30 +1560,55 @@ func skipTypes(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTypes } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipTypes(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") )