From b954bc2abf662ec3c7a1a6f6c6180fa9b41a876b Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 14 Nov 2023 18:13:45 +0100 Subject: [PATCH 01/25] start defining query plan --- pkg/compactor/client/grpc/grpc.pb.go | 1548 ---- pkg/ingester/checkpoint.pb.go | 1434 ---- pkg/logqlmodel/stats/stats.pb.go | 3689 -------- .../frontend/v2/frontendv2pb/frontend.pb.go | 1014 --- pkg/push/push.pb.go | 1739 ---- pkg/querier/plan.go | 30 + pkg/querier/queryrange/queryrange.pb.go | 7466 ----------------- pkg/querier/queryrange/queryrange.proto | 3 + .../definitions/definitions.pb.go | 969 --- .../queryrangebase/queryrange.pb.go | 2594 ------ pkg/querier/stats/stats.pb.go | 501 -- pkg/ruler/base/ruler.pb.go | 2380 ------ pkg/ruler/rulespb/rules.pb.go | 1320 --- pkg/scheduler/schedulerpb/scheduler.pb.go | 2850 ------- pkg/storage/chunk/client/grpc/grpc.pb.go | 6484 -------------- .../series/index/caching_index_client.pb.go | 845 -- 16 files changed, 33 insertions(+), 34833 deletions(-) delete mode 100644 pkg/compactor/client/grpc/grpc.pb.go delete mode 100644 pkg/ingester/checkpoint.pb.go delete mode 100644 pkg/logqlmodel/stats/stats.pb.go delete mode 100644 pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go delete mode 100644 pkg/push/push.pb.go create mode 100644 pkg/querier/plan.go delete mode 100644 pkg/querier/queryrange/queryrange.pb.go delete mode 100644 pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go delete mode 100644 pkg/querier/queryrange/queryrangebase/queryrange.pb.go delete mode 100644 pkg/querier/stats/stats.pb.go delete mode 100644 pkg/ruler/base/ruler.pb.go delete mode 100644 pkg/ruler/rulespb/rules.pb.go delete mode 100644 pkg/scheduler/schedulerpb/scheduler.pb.go delete mode 100644 pkg/storage/chunk/client/grpc/grpc.pb.go delete mode 100644 pkg/storage/stores/series/index/caching_index_client.pb.go diff --git a/pkg/compactor/client/grpc/grpc.pb.go b/pkg/compactor/client/grpc/grpc.pb.go deleted file mode 100644 index a6a9aabdd15c6..0000000000000 --- a/pkg/compactor/client/grpc/grpc.pb.go +++ /dev/null @@ -1,1548 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/compactor/client/grpc/grpc.proto - -package grpc - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - 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" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GetDeleteRequestsRequest struct { -} - -func (m *GetDeleteRequestsRequest) Reset() { *m = GetDeleteRequestsRequest{} } -func (*GetDeleteRequestsRequest) ProtoMessage() {} -func (*GetDeleteRequestsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24a5f361c0f660df, []int{0} -} -func (m *GetDeleteRequestsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetDeleteRequestsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetDeleteRequestsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetDeleteRequestsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDeleteRequestsRequest.Merge(m, src) -} -func (m *GetDeleteRequestsRequest) XXX_Size() int { - return m.Size() -} -func (m *GetDeleteRequestsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDeleteRequestsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDeleteRequestsRequest proto.InternalMessageInfo - -type GetDeleteRequestsResponse struct { - DeleteRequests []*DeleteRequest `protobuf:"bytes,1,rep,name=deleteRequests,proto3" json:"deleteRequests,omitempty"` -} - -func (m *GetDeleteRequestsResponse) Reset() { *m = GetDeleteRequestsResponse{} } -func (*GetDeleteRequestsResponse) ProtoMessage() {} -func (*GetDeleteRequestsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24a5f361c0f660df, []int{1} -} -func (m *GetDeleteRequestsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetDeleteRequestsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetDeleteRequestsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetDeleteRequestsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDeleteRequestsResponse.Merge(m, src) -} -func (m *GetDeleteRequestsResponse) XXX_Size() int { - return m.Size() -} -func (m *GetDeleteRequestsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetDeleteRequestsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetDeleteRequestsResponse proto.InternalMessageInfo - -func (m *GetDeleteRequestsResponse) GetDeleteRequests() []*DeleteRequest { - if m != nil { - return m.DeleteRequests - } - return nil -} - -type DeleteRequest struct { - RequestID string `protobuf:"bytes,1,opt,name=requestID,proto3" json:"requestID,omitempty"` - StartTime int64 `protobuf:"varint,2,opt,name=startTime,proto3" json:"startTime,omitempty"` - EndTime int64 `protobuf:"varint,3,opt,name=endTime,proto3" json:"endTime,omitempty"` - Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` - Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` - CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"` -} - -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (*DeleteRequest) ProtoMessage() {} -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24a5f361c0f660df, []int{2} -} -func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRequest.Merge(m, src) -} -func (m *DeleteRequest) XXX_Size() int { - return m.Size() -} -func (m *DeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo - -func (m *DeleteRequest) GetRequestID() string { - if m != nil { - return m.RequestID - } - return "" -} - -func (m *DeleteRequest) GetStartTime() int64 { - if m != nil { - return m.StartTime - } - return 0 -} - -func (m *DeleteRequest) GetEndTime() int64 { - if m != nil { - return m.EndTime - } - return 0 -} - -func (m *DeleteRequest) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *DeleteRequest) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *DeleteRequest) GetCreatedAt() int64 { - if m != nil { - return m.CreatedAt - } - return 0 -} - -type GetCacheGenNumbersRequest struct { -} - -func (m *GetCacheGenNumbersRequest) Reset() { *m = GetCacheGenNumbersRequest{} } -func (*GetCacheGenNumbersRequest) ProtoMessage() {} -func (*GetCacheGenNumbersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24a5f361c0f660df, []int{3} -} -func (m *GetCacheGenNumbersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetCacheGenNumbersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetCacheGenNumbersRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetCacheGenNumbersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCacheGenNumbersRequest.Merge(m, src) -} -func (m *GetCacheGenNumbersRequest) XXX_Size() int { - return m.Size() -} -func (m *GetCacheGenNumbersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetCacheGenNumbersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCacheGenNumbersRequest proto.InternalMessageInfo - -type GetCacheGenNumbersResponse struct { - ResultsCacheGen string `protobuf:"bytes,1,opt,name=resultsCacheGen,proto3" json:"resultsCacheGen,omitempty"` -} - -func (m *GetCacheGenNumbersResponse) Reset() { *m = GetCacheGenNumbersResponse{} } -func (*GetCacheGenNumbersResponse) ProtoMessage() {} -func (*GetCacheGenNumbersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24a5f361c0f660df, []int{4} -} -func (m *GetCacheGenNumbersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetCacheGenNumbersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetCacheGenNumbersResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetCacheGenNumbersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCacheGenNumbersResponse.Merge(m, src) -} -func (m *GetCacheGenNumbersResponse) XXX_Size() int { - return m.Size() -} -func (m *GetCacheGenNumbersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetCacheGenNumbersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCacheGenNumbersResponse proto.InternalMessageInfo - -func (m *GetCacheGenNumbersResponse) GetResultsCacheGen() string { - if m != nil { - return m.ResultsCacheGen - } - return "" -} - -func init() { - proto.RegisterType((*GetDeleteRequestsRequest)(nil), "grpc.GetDeleteRequestsRequest") - proto.RegisterType((*GetDeleteRequestsResponse)(nil), "grpc.GetDeleteRequestsResponse") - proto.RegisterType((*DeleteRequest)(nil), "grpc.DeleteRequest") - proto.RegisterType((*GetCacheGenNumbersRequest)(nil), "grpc.GetCacheGenNumbersRequest") - proto.RegisterType((*GetCacheGenNumbersResponse)(nil), "grpc.GetCacheGenNumbersResponse") -} - -func init() { - proto.RegisterFile("pkg/compactor/client/grpc/grpc.proto", fileDescriptor_24a5f361c0f660df) -} - -var fileDescriptor_24a5f361c0f660df = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xbb, 0x4e, 0xe3, 0x40, - 0x14, 0xf5, 0x6c, 0x1e, 0xab, 0xcc, 0x6a, 0x77, 0xc5, 0x80, 0xd0, 0x60, 0xd0, 0xc5, 0xb2, 0x28, - 0x5c, 0x25, 0x52, 0xa0, 0xa3, 0x82, 0x44, 0x44, 0x34, 0x14, 0x56, 0x24, 0x68, 0x1d, 0xe7, 0x2a, - 0x44, 0x24, 0xb6, 0x33, 0x33, 0x2e, 0xe8, 0xf8, 0x04, 0x3e, 0x83, 0x96, 0x96, 0x2f, 0xa0, 0x4c, - 0x99, 0x92, 0x38, 0x0d, 0x65, 0x3e, 0x01, 0x65, 0xec, 0x24, 0xca, 0xab, 0xb1, 0xe7, 0x9e, 0x73, - 0xe6, 0x3e, 0xce, 0x1d, 0x7a, 0x16, 0x3d, 0x75, 0x2a, 0x7e, 0xd8, 0x8f, 0x3c, 0x5f, 0x85, 0xa2, - 0xe2, 0xf7, 0xba, 0x18, 0xa8, 0x4a, 0x47, 0x44, 0xbe, 0xfe, 0x94, 0x23, 0x11, 0xaa, 0x90, 0xe5, - 0x67, 0x67, 0xdb, 0xa4, 0xbc, 0x81, 0xaa, 0x8e, 0x3d, 0x54, 0xe8, 0xe2, 0x20, 0x46, 0xa9, 0x64, - 0xf6, 0xb7, 0x1f, 0xe8, 0xd1, 0x16, 0x4e, 0x46, 0x61, 0x20, 0x91, 0x5d, 0xd2, 0x7f, 0xed, 0x15, - 0x86, 0x13, 0x2b, 0xe7, 0xfc, 0xa9, 0xee, 0x97, 0x75, 0x8d, 0x95, 0x5b, 0xee, 0x9a, 0xd4, 0x7e, - 0x27, 0xf4, 0xef, 0x8a, 0x82, 0x9d, 0xd0, 0x92, 0x48, 0x8f, 0xb7, 0x75, 0x4e, 0x2c, 0xe2, 0x94, - 0xdc, 0x25, 0x30, 0x63, 0xa5, 0xf2, 0x84, 0x6a, 0x76, 0xfb, 0xc8, 0x7f, 0x59, 0xc4, 0xc9, 0xb9, - 0x4b, 0x80, 0x71, 0xfa, 0x1b, 0x83, 0xb6, 0xe6, 0x72, 0x9a, 0x9b, 0x87, 0xec, 0x80, 0x16, 0x06, - 0x31, 0x8a, 0x67, 0x9e, 0xd7, 0x19, 0xd3, 0x80, 0x1d, 0xd2, 0xa2, 0x54, 0x9e, 0x8a, 0x25, 0x2f, - 0x68, 0x38, 0x8b, 0x66, 0x55, 0x7c, 0x81, 0x9e, 0xc2, 0xf6, 0x95, 0xe2, 0xc5, 0xb4, 0xca, 0x02, - 0xb0, 0x8f, 0xb5, 0x1b, 0x35, 0xcf, 0x7f, 0xc4, 0x06, 0x06, 0x77, 0x71, 0xbf, 0x85, 0x62, 0x61, - 0xd5, 0x0d, 0x35, 0xb7, 0x91, 0x99, 0x57, 0x0e, 0xfd, 0x2f, 0x50, 0xc6, 0x3d, 0x25, 0xe7, 0x8a, - 0x6c, 0xc4, 0x75, 0xb8, 0xfa, 0x41, 0x68, 0xa9, 0x36, 0xdf, 0x1c, 0x6b, 0xd2, 0xbd, 0x8d, 0x05, - 0x30, 0x48, 0x0d, 0xde, 0xb5, 0x35, 0xf3, 0x74, 0x27, 0x9f, 0x75, 0x73, 0x4f, 0xd9, 0x66, 0xaf, - 0x6c, 0x79, 0x6d, 0xfb, 0x88, 0xa6, 0xb5, 0x5b, 0x90, 0x26, 0xbe, 0xbe, 0x18, 0x8e, 0xc1, 0x18, - 0x8d, 0xc1, 0x98, 0x8e, 0x81, 0xbc, 0x24, 0x40, 0xde, 0x12, 0x20, 0x9f, 0x09, 0x90, 0x61, 0x02, - 0xe4, 0x2b, 0x01, 0xf2, 0x9d, 0x80, 0x31, 0x4d, 0x80, 0xbc, 0x4e, 0xc0, 0x18, 0x4e, 0xc0, 0x18, - 0x4d, 0xc0, 0x68, 0x15, 0xf5, 0x73, 0x3c, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x80, 0xfa, 0x3c, - 0xc9, 0xb6, 0x02, 0x00, 0x00, -} - -func (this *GetDeleteRequestsRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetDeleteRequestsRequest) - if !ok { - that2, ok := that.(GetDeleteRequestsRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *GetDeleteRequestsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetDeleteRequestsResponse) - if !ok { - that2, ok := that.(GetDeleteRequestsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.DeleteRequests) != len(that1.DeleteRequests) { - return false - } - for i := range this.DeleteRequests { - if !this.DeleteRequests[i].Equal(that1.DeleteRequests[i]) { - return false - } - } - return true -} -func (this *DeleteRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DeleteRequest) - if !ok { - that2, ok := that.(DeleteRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.RequestID != that1.RequestID { - return false - } - if this.StartTime != that1.StartTime { - return false - } - if this.EndTime != that1.EndTime { - return false - } - if this.Query != that1.Query { - return false - } - if this.Status != that1.Status { - return false - } - if this.CreatedAt != that1.CreatedAt { - return false - } - return true -} -func (this *GetCacheGenNumbersRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetCacheGenNumbersRequest) - if !ok { - that2, ok := that.(GetCacheGenNumbersRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *GetCacheGenNumbersResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetCacheGenNumbersResponse) - if !ok { - that2, ok := that.(GetCacheGenNumbersResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ResultsCacheGen != that1.ResultsCacheGen { - return false - } - return true -} -func (this *GetDeleteRequestsRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&grpc.GetDeleteRequestsRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetDeleteRequestsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.GetDeleteRequestsResponse{") - if this.DeleteRequests != nil { - s = append(s, "DeleteRequests: "+fmt.Sprintf("%#v", this.DeleteRequests)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DeleteRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&grpc.DeleteRequest{") - s = append(s, "RequestID: "+fmt.Sprintf("%#v", this.RequestID)+",\n") - s = append(s, "StartTime: "+fmt.Sprintf("%#v", this.StartTime)+",\n") - s = append(s, "EndTime: "+fmt.Sprintf("%#v", this.EndTime)+",\n") - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "CreatedAt: "+fmt.Sprintf("%#v", this.CreatedAt)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetCacheGenNumbersRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&grpc.GetCacheGenNumbersRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetCacheGenNumbersResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.GetCacheGenNumbersResponse{") - s = append(s, "ResultsCacheGen: "+fmt.Sprintf("%#v", this.ResultsCacheGen)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringGrpc(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// CompactorClient is the client API for Compactor service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type CompactorClient interface { - GetDeleteRequests(ctx context.Context, in *GetDeleteRequestsRequest, opts ...grpc.CallOption) (*GetDeleteRequestsResponse, error) - GetCacheGenNumbers(ctx context.Context, in *GetCacheGenNumbersRequest, opts ...grpc.CallOption) (*GetCacheGenNumbersResponse, error) -} - -type compactorClient struct { - cc *grpc.ClientConn -} - -func NewCompactorClient(cc *grpc.ClientConn) CompactorClient { - return &compactorClient{cc} -} - -func (c *compactorClient) GetDeleteRequests(ctx context.Context, in *GetDeleteRequestsRequest, opts ...grpc.CallOption) (*GetDeleteRequestsResponse, error) { - out := new(GetDeleteRequestsResponse) - err := c.cc.Invoke(ctx, "/grpc.Compactor/GetDeleteRequests", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *compactorClient) GetCacheGenNumbers(ctx context.Context, in *GetCacheGenNumbersRequest, opts ...grpc.CallOption) (*GetCacheGenNumbersResponse, error) { - out := new(GetCacheGenNumbersResponse) - err := c.cc.Invoke(ctx, "/grpc.Compactor/GetCacheGenNumbers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CompactorServer is the server API for Compactor service. -type CompactorServer interface { - GetDeleteRequests(context.Context, *GetDeleteRequestsRequest) (*GetDeleteRequestsResponse, error) - GetCacheGenNumbers(context.Context, *GetCacheGenNumbersRequest) (*GetCacheGenNumbersResponse, error) -} - -// UnimplementedCompactorServer can be embedded to have forward compatible implementations. -type UnimplementedCompactorServer struct { -} - -func (*UnimplementedCompactorServer) GetDeleteRequests(ctx context.Context, req *GetDeleteRequestsRequest) (*GetDeleteRequestsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDeleteRequests not implemented") -} -func (*UnimplementedCompactorServer) GetCacheGenNumbers(ctx context.Context, req *GetCacheGenNumbersRequest) (*GetCacheGenNumbersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCacheGenNumbers not implemented") -} - -func RegisterCompactorServer(s *grpc.Server, srv CompactorServer) { - s.RegisterService(&_Compactor_serviceDesc, srv) -} - -func _Compactor_GetDeleteRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDeleteRequestsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CompactorServer).GetDeleteRequests(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.Compactor/GetDeleteRequests", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CompactorServer).GetDeleteRequests(ctx, req.(*GetDeleteRequestsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Compactor_GetCacheGenNumbers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCacheGenNumbersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CompactorServer).GetCacheGenNumbers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.Compactor/GetCacheGenNumbers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CompactorServer).GetCacheGenNumbers(ctx, req.(*GetCacheGenNumbersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Compactor_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.Compactor", - HandlerType: (*CompactorServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetDeleteRequests", - Handler: _Compactor_GetDeleteRequests_Handler, - }, - { - MethodName: "GetCacheGenNumbers", - Handler: _Compactor_GetCacheGenNumbers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/compactor/client/grpc/grpc.proto", -} - -func (m *GetDeleteRequestsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetDeleteRequestsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetDeleteRequestsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetDeleteRequestsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetDeleteRequestsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetDeleteRequestsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DeleteRequests) > 0 { - for iNdEx := len(m.DeleteRequests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DeleteRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.CreatedAt != 0 { - i = encodeVarintGrpc(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x30 - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x2a - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x22 - } - if m.EndTime != 0 { - i = encodeVarintGrpc(dAtA, i, uint64(m.EndTime)) - i-- - dAtA[i] = 0x18 - } - if m.StartTime != 0 { - i = encodeVarintGrpc(dAtA, i, uint64(m.StartTime)) - i-- - dAtA[i] = 0x10 - } - if len(m.RequestID) > 0 { - i -= len(m.RequestID) - copy(dAtA[i:], m.RequestID) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.RequestID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetCacheGenNumbersRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetCacheGenNumbersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetCacheGenNumbersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetCacheGenNumbersResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetCacheGenNumbersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetCacheGenNumbersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResultsCacheGen) > 0 { - i -= len(m.ResultsCacheGen) - copy(dAtA[i:], m.ResultsCacheGen) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.ResultsCacheGen))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGrpc(dAtA []byte, offset int, v uint64) int { - offset -= sovGrpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GetDeleteRequestsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetDeleteRequestsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.DeleteRequests) > 0 { - for _, e := range m.DeleteRequests { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *DeleteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RequestID) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - if m.StartTime != 0 { - n += 1 + sovGrpc(uint64(m.StartTime)) - } - if m.EndTime != 0 { - n += 1 + sovGrpc(uint64(m.EndTime)) - } - l = len(m.Query) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.Status) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - if m.CreatedAt != 0 { - n += 1 + sovGrpc(uint64(m.CreatedAt)) - } - return n -} - -func (m *GetCacheGenNumbersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetCacheGenNumbersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResultsCacheGen) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func sovGrpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGrpc(x uint64) (n int) { - return sovGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *GetDeleteRequestsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetDeleteRequestsRequest{`, - `}`, - }, "") - return s -} -func (this *GetDeleteRequestsResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForDeleteRequests := "[]*DeleteRequest{" - for _, f := range this.DeleteRequests { - repeatedStringForDeleteRequests += strings.Replace(f.String(), "DeleteRequest", "DeleteRequest", 1) + "," - } - repeatedStringForDeleteRequests += "}" - s := strings.Join([]string{`&GetDeleteRequestsResponse{`, - `DeleteRequests:` + repeatedStringForDeleteRequests + `,`, - `}`, - }, "") - return s -} -func (this *DeleteRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DeleteRequest{`, - `RequestID:` + fmt.Sprintf("%v", this.RequestID) + `,`, - `StartTime:` + fmt.Sprintf("%v", this.StartTime) + `,`, - `EndTime:` + fmt.Sprintf("%v", this.EndTime) + `,`, - `Query:` + fmt.Sprintf("%v", this.Query) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `}`, - }, "") - return s -} -func (this *GetCacheGenNumbersRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetCacheGenNumbersRequest{`, - `}`, - }, "") - return s -} -func (this *GetCacheGenNumbersResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GetCacheGenNumbersResponse{`, - `ResultsCacheGen:` + fmt.Sprintf("%v", this.ResultsCacheGen) + `,`, - `}`, - }, "") - return s -} -func valueToStringGrpc(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *GetDeleteRequestsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetDeleteRequestsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetDeleteRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetDeleteRequestsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetDeleteRequestsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetDeleteRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeleteRequests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DeleteRequests = append(m.DeleteRequests, &DeleteRequest{}) - if err := m.DeleteRequests[len(m.DeleteRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RequestID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - m.EndTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - m.CreatedAt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCacheGenNumbersRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCacheGenNumbersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCacheGenNumbersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCacheGenNumbersResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCacheGenNumbersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCacheGenNumbersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultsCacheGen", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultsCacheGen = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGrpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGrpc - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGrpc - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - 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 := skipGrpc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGrpc - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGrpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGrpc = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/ingester/checkpoint.pb.go b/pkg/ingester/checkpoint.pb.go deleted file mode 100644 index 4f66c217b5ef1..0000000000000 --- a/pkg/ingester/checkpoint.pb.go +++ /dev/null @@ -1,1434 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/ingester/checkpoint.proto - -package ingester - -import ( - bytes "bytes" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/grafana/loki/pkg/logproto" - github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Chunk is a {de,}serializable intermediate type for chunkDesc which allows -// efficient loading/unloading to disk during WAL checkpoint recovery. -type Chunk struct { - From time.Time `protobuf:"bytes,1,opt,name=from,proto3,stdtime" json:"from"` - To time.Time `protobuf:"bytes,2,opt,name=to,proto3,stdtime" json:"to"` - FlushedAt time.Time `protobuf:"bytes,3,opt,name=flushedAt,proto3,stdtime" json:"flushedAt"` - LastUpdated time.Time `protobuf:"bytes,4,opt,name=lastUpdated,proto3,stdtime" json:"lastUpdated"` - Closed bool `protobuf:"varint,5,opt,name=closed,proto3" json:"closed,omitempty"` - Synced bool `protobuf:"varint,6,opt,name=synced,proto3" json:"synced,omitempty"` - // data to be unmarshaled into a MemChunk - Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` - // data to be unmarshaled into a MemChunk's headBlock - Head []byte `protobuf:"bytes,8,opt,name=head,proto3" json:"head,omitempty"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_00f4b7152db9bdb5, []int{0} -} -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) -} -func (m *Chunk) XXX_Size() int { - return m.Size() -} -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) -} - -var xxx_messageInfo_Chunk proto.InternalMessageInfo - -func (m *Chunk) GetFrom() time.Time { - if m != nil { - return m.From - } - return time.Time{} -} - -func (m *Chunk) GetTo() time.Time { - if m != nil { - return m.To - } - return time.Time{} -} - -func (m *Chunk) GetFlushedAt() time.Time { - if m != nil { - return m.FlushedAt - } - return time.Time{} -} - -func (m *Chunk) GetLastUpdated() time.Time { - if m != nil { - return m.LastUpdated - } - return time.Time{} -} - -func (m *Chunk) GetClosed() bool { - if m != nil { - return m.Closed - } - return false -} - -func (m *Chunk) GetSynced() bool { - if m != nil { - return m.Synced - } - return false -} - -func (m *Chunk) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *Chunk) GetHead() []byte { - if m != nil { - return m.Head - } - return nil -} - -// Series is a {de,}serializable intermediate type for Series. -type Series struct { - UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` - // post mapped fingerprint is necessary because subsequent wal writes will reference it. - Fingerprint uint64 `protobuf:"varint,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` - Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` - // most recently pushed timestamp. - To time.Time `protobuf:"bytes,5,opt,name=to,proto3,stdtime" json:"to"` - // most recently pushed line. - LastLine string `protobuf:"bytes,6,opt,name=lastLine,proto3" json:"lastLine,omitempty"` - // highest counter value for pushes to this stream. - // Used to skip already applied entries during WAL replay. - EntryCt int64 `protobuf:"varint,7,opt,name=entryCt,proto3" json:"entryCt,omitempty"` - // highest timestamp pushed to this stream. - HighestTs time.Time `protobuf:"bytes,8,opt,name=highestTs,proto3,stdtime" json:"highestTs"` -} - -func (m *Series) Reset() { *m = Series{} } -func (*Series) ProtoMessage() {} -func (*Series) Descriptor() ([]byte, []int) { - return fileDescriptor_00f4b7152db9bdb5, []int{1} -} -func (m *Series) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Series.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Series) XXX_Merge(src proto.Message) { - xxx_messageInfo_Series.Merge(m, src) -} -func (m *Series) XXX_Size() int { - return m.Size() -} -func (m *Series) XXX_DiscardUnknown() { - xxx_messageInfo_Series.DiscardUnknown(m) -} - -var xxx_messageInfo_Series proto.InternalMessageInfo - -func (m *Series) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *Series) GetFingerprint() uint64 { - if m != nil { - return m.Fingerprint - } - return 0 -} - -func (m *Series) GetChunks() []Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -func (m *Series) GetTo() time.Time { - if m != nil { - return m.To - } - return time.Time{} -} - -func (m *Series) GetLastLine() string { - if m != nil { - return m.LastLine - } - return "" -} - -func (m *Series) GetEntryCt() int64 { - if m != nil { - return m.EntryCt - } - return 0 -} - -func (m *Series) GetHighestTs() time.Time { - if m != nil { - return m.HighestTs - } - return time.Time{} -} - -func init() { - proto.RegisterType((*Chunk)(nil), "loki_ingester.Chunk") - proto.RegisterType((*Series)(nil), "loki_ingester.Series") -} - -func init() { proto.RegisterFile("pkg/ingester/checkpoint.proto", fileDescriptor_00f4b7152db9bdb5) } - -var fileDescriptor_00f4b7152db9bdb5 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x31, 0x8f, 0xd3, 0x30, - 0x14, 0x8e, 0xdb, 0x5c, 0xae, 0x75, 0x61, 0xb1, 0x4e, 0xc8, 0x14, 0xe1, 0x56, 0x37, 0x75, 0x4a, - 0x44, 0x61, 0x80, 0x05, 0xe9, 0x7a, 0x08, 0x09, 0xa9, 0x03, 0x0a, 0xc7, 0xc2, 0x82, 0xdc, 0xc4, - 0x75, 0xa2, 0xa6, 0x71, 0x64, 0xbb, 0x43, 0x37, 0x7e, 0xc2, 0x0d, 0xfc, 0x08, 0x7e, 0xca, 0x8d, - 0x1d, 0x4f, 0x20, 0x1d, 0x34, 0x5d, 0x18, 0xef, 0x27, 0x20, 0x3b, 0x49, 0x29, 0x1b, 0xdd, 0xde, - 0xf7, 0x9e, 0xbf, 0xf7, 0xc9, 0xdf, 0xfb, 0xe0, 0xd3, 0x62, 0xc1, 0x83, 0x34, 0xe7, 0x4c, 0x69, - 0x26, 0x83, 0x28, 0x61, 0xd1, 0xa2, 0x10, 0x69, 0xae, 0xfd, 0x42, 0x0a, 0x2d, 0xd0, 0xc3, 0x4c, - 0x2c, 0xd2, 0xcf, 0xcd, 0xbc, 0x7f, 0xc6, 0x05, 0x17, 0x76, 0x12, 0x98, 0xaa, 0x7a, 0xd4, 0x1f, - 0x70, 0x21, 0x78, 0xc6, 0x02, 0x8b, 0x66, 0xab, 0x79, 0xa0, 0xd3, 0x25, 0x53, 0x9a, 0x2e, 0x8b, - 0xfa, 0xc1, 0x13, 0x23, 0x92, 0x09, 0x5e, 0x31, 0x9b, 0xa2, 0x1a, 0x9e, 0xff, 0x68, 0xc1, 0x93, - 0xcb, 0x64, 0x95, 0x2f, 0xd0, 0x4b, 0xe8, 0xce, 0xa5, 0x58, 0x62, 0x30, 0x04, 0xa3, 0xde, 0xb8, - 0xef, 0x57, 0x6b, 0xfd, 0x66, 0xad, 0x7f, 0xd5, 0xac, 0x9d, 0x74, 0x6e, 0xee, 0x06, 0xce, 0xf5, - 0xcf, 0x01, 0x08, 0x2d, 0x03, 0xbd, 0x80, 0x2d, 0x2d, 0x70, 0xeb, 0x08, 0x5e, 0x4b, 0x0b, 0x34, - 0x81, 0xdd, 0x79, 0xb6, 0x52, 0x09, 0x8b, 0x2f, 0x34, 0x6e, 0x1f, 0x41, 0xfe, 0x4b, 0x43, 0x6f, - 0x61, 0x2f, 0xa3, 0x4a, 0x7f, 0x2c, 0x62, 0xaa, 0x59, 0x8c, 0xdd, 0x23, 0xb6, 0x1c, 0x12, 0xd1, - 0x23, 0xe8, 0x45, 0x99, 0x50, 0x2c, 0xc6, 0x27, 0x43, 0x30, 0xea, 0x84, 0x35, 0x32, 0x7d, 0xb5, - 0xce, 0x23, 0x16, 0x63, 0xaf, 0xea, 0x57, 0x08, 0x21, 0xe8, 0xc6, 0x54, 0x53, 0x7c, 0x3a, 0x04, - 0xa3, 0x07, 0xa1, 0xad, 0x4d, 0x2f, 0x61, 0x34, 0xc6, 0x9d, 0xaa, 0x67, 0xea, 0xf3, 0xaf, 0x6d, - 0xe8, 0x7d, 0x60, 0x32, 0x65, 0xca, 0xac, 0x5a, 0x29, 0x26, 0xdf, 0xbd, 0xb1, 0x06, 0x77, 0xc3, - 0x1a, 0xa1, 0x21, 0xec, 0xcd, 0xcd, 0x85, 0x65, 0x21, 0xd3, 0x5c, 0x5b, 0x17, 0xdd, 0xf0, 0xb0, - 0x85, 0x32, 0xe8, 0x65, 0x74, 0xc6, 0x32, 0x85, 0xdb, 0xc3, 0xf6, 0xa8, 0x37, 0x7e, 0xec, 0xef, - 0x6f, 0x38, 0x65, 0x9c, 0x46, 0xeb, 0xa9, 0x99, 0xbe, 0xa7, 0xa9, 0x9c, 0xbc, 0x32, 0xdf, 0xfb, - 0x7e, 0x37, 0x78, 0xc6, 0x53, 0x9d, 0xac, 0x66, 0x7e, 0x24, 0x96, 0x01, 0x97, 0x74, 0x4e, 0x73, - 0x1a, 0x98, 0x2c, 0x05, 0x87, 0x51, 0xf0, 0x2d, 0xef, 0x22, 0xa6, 0x85, 0x66, 0x32, 0xac, 0x35, - 0xd0, 0x18, 0x7a, 0x91, 0xc9, 0x83, 0xc2, 0xae, 0x55, 0x3b, 0xf3, 0xff, 0x09, 0xa1, 0x6f, 0xc3, - 0x32, 0x71, 0x8d, 0x50, 0x58, 0xbf, 0xac, 0x03, 0x70, 0x72, 0x64, 0x00, 0xfa, 0xb0, 0x63, 0x6e, - 0x30, 0x4d, 0x73, 0x66, 0xed, 0xed, 0x86, 0x7b, 0x8c, 0x30, 0x3c, 0x65, 0xb9, 0x96, 0xeb, 0x4b, - 0x6d, 0x3d, 0x6e, 0x87, 0x0d, 0x34, 0xb1, 0x49, 0x52, 0x9e, 0x30, 0xa5, 0xaf, 0x94, 0xf5, 0xfa, - 0xbf, 0x63, 0xb3, 0xa7, 0x4d, 0x5e, 0x6f, 0xb6, 0xc4, 0xb9, 0xdd, 0x12, 0xe7, 0x7e, 0x4b, 0xc0, - 0x97, 0x92, 0x80, 0x6f, 0x25, 0x01, 0x37, 0x25, 0x01, 0x9b, 0x92, 0x80, 0x5f, 0x25, 0x01, 0xbf, - 0x4b, 0xe2, 0xdc, 0x97, 0x04, 0x5c, 0xef, 0x88, 0xb3, 0xd9, 0x11, 0xe7, 0x76, 0x47, 0x9c, 0x4f, - 0x9d, 0xc6, 0x83, 0x99, 0x67, 0x85, 0x9e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xda, 0xcc, 0xb5, - 0xf6, 0xbf, 0x03, 0x00, 0x00, -} - -func (this *Chunk) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Chunk) - if !ok { - that2, ok := that.(Chunk) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.From.Equal(that1.From) { - return false - } - if !this.To.Equal(that1.To) { - return false - } - if !this.FlushedAt.Equal(that1.FlushedAt) { - return false - } - if !this.LastUpdated.Equal(that1.LastUpdated) { - return false - } - if this.Closed != that1.Closed { - return false - } - if this.Synced != that1.Synced { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.Head, that1.Head) { - return false - } - return true -} -func (this *Series) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Series) - if !ok { - that2, ok := that.(Series) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.UserID != that1.UserID { - return false - } - if this.Fingerprint != that1.Fingerprint { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(&that1.Chunks[i]) { - return false - } - } - if !this.To.Equal(that1.To) { - return false - } - if this.LastLine != that1.LastLine { - return false - } - if this.EntryCt != that1.EntryCt { - return false - } - if !this.HighestTs.Equal(that1.HighestTs) { - return false - } - return true -} -func (this *Chunk) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&ingester.Chunk{") - s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") - s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") - s = append(s, "FlushedAt: "+fmt.Sprintf("%#v", this.FlushedAt)+",\n") - s = append(s, "LastUpdated: "+fmt.Sprintf("%#v", this.LastUpdated)+",\n") - s = append(s, "Closed: "+fmt.Sprintf("%#v", this.Closed)+",\n") - s = append(s, "Synced: "+fmt.Sprintf("%#v", this.Synced)+",\n") - s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") - s = append(s, "Head: "+fmt.Sprintf("%#v", this.Head)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Series) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&ingester.Series{") - s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") - s = append(s, "Fingerprint: "+fmt.Sprintf("%#v", this.Fingerprint)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Chunks != nil { - vs := make([]*Chunk, len(this.Chunks)) - for i := range vs { - vs[i] = &this.Chunks[i] - } - s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") - s = append(s, "LastLine: "+fmt.Sprintf("%#v", this.LastLine)+",\n") - s = append(s, "EntryCt: "+fmt.Sprintf("%#v", this.EntryCt)+",\n") - s = append(s, "HighestTs: "+fmt.Sprintf("%#v", this.HighestTs)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCheckpoint(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Chunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - if len(m.Head) > 0 { - i -= len(m.Head) - copy(dAtA[i:], m.Head) - i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Head))) - i-- - dAtA[i] = 0x42 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x3a - } - if m.Synced { - i-- - if m.Synced { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.Closed { - i-- - if m.Closed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintCheckpoint(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x22 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FlushedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintCheckpoint(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1a - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintCheckpoint(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x12 - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.From, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.From):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintCheckpoint(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Series) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.HighestTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintCheckpoint(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x42 - if m.EntryCt != 0 { - i = encodeVarintCheckpoint(dAtA, i, uint64(m.EntryCt)) - i-- - dAtA[i] = 0x38 - } - if len(m.LastLine) > 0 { - i -= len(m.LastLine) - copy(dAtA[i:], m.LastLine) - i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.LastLine))) - i-- - dAtA[i] = 0x32 - } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintCheckpoint(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x2a - 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 = encodeVarintCheckpoint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCheckpoint(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.Fingerprint != 0 { - i = encodeVarintCheckpoint(dAtA, i, uint64(m.Fingerprint)) - i-- - dAtA[i] = 0x10 - } - if len(m.UserID) > 0 { - i -= len(m.UserID) - copy(dAtA[i:], m.UserID) - i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.UserID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintCheckpoint(dAtA []byte, offset int, v uint64) int { - offset -= sovCheckpoint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.From) - n += 1 + l + sovCheckpoint(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) - n += 1 + l + sovCheckpoint(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt) - n += 1 + l + sovCheckpoint(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated) - n += 1 + l + sovCheckpoint(uint64(l)) - if m.Closed { - n += 2 - } - if m.Synced { - n += 2 - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovCheckpoint(uint64(l)) - } - l = len(m.Head) - if l > 0 { - n += 1 + l + sovCheckpoint(uint64(l)) - } - return n -} - -func (m *Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.UserID) - if l > 0 { - n += 1 + l + sovCheckpoint(uint64(l)) - } - if m.Fingerprint != 0 { - n += 1 + sovCheckpoint(uint64(m.Fingerprint)) - } - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovCheckpoint(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovCheckpoint(uint64(l)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) - n += 1 + l + sovCheckpoint(uint64(l)) - l = len(m.LastLine) - if l > 0 { - n += 1 + l + sovCheckpoint(uint64(l)) - } - if m.EntryCt != 0 { - n += 1 + sovCheckpoint(uint64(m.EntryCt)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs) - n += 1 + l + sovCheckpoint(uint64(l)) - return n -} - -func sovCheckpoint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCheckpoint(x uint64) (n int) { - return sovCheckpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Chunk) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Chunk{`, - `From:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.From), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `FlushedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FlushedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `LastUpdated:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdated), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Closed:` + fmt.Sprintf("%v", this.Closed) + `,`, - `Synced:` + fmt.Sprintf("%v", this.Synced) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Head:` + fmt.Sprintf("%v", this.Head) + `,`, - `}`, - }, "") - return s -} -func (this *Series) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]Chunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&Series{`, - `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, - `Fingerprint:` + fmt.Sprintf("%v", this.Fingerprint) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Chunks:` + repeatedStringForChunks + `,`, - `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `LastLine:` + fmt.Sprintf("%v", this.LastLine) + `,`, - `EntryCt:` + fmt.Sprintf("%v", this.EntryCt) + `,`, - `HighestTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.HighestTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringCheckpoint(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Chunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.From, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FlushedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FlushedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastUpdated, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Closed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Closed = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Synced", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Synced = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Head = append(m.Head[:0], dAtA[iNdEx:postIndex]...) - if m.Head == nil { - m.Head = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCheckpoint(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCheckpoint - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCheckpoint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Series) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Series: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) - } - m.Fingerprint = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Fingerprint |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastLine", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastLine = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EntryCt", wireType) - } - m.EntryCt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EntryCt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HighestTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCheckpoint - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCheckpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.HighestTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCheckpoint(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCheckpoint - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCheckpoint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCheckpoint(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCheckpoint - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCheckpoint - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCheckpoint - } - 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 := skipCheckpoint(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCheckpoint - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthCheckpoint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCheckpoint = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/logqlmodel/stats/stats.pb.go b/pkg/logqlmodel/stats/stats.pb.go deleted file mode 100644 index 91cbb1e31e787..0000000000000 --- a/pkg/logqlmodel/stats/stats.pb.go +++ /dev/null @@ -1,3689 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/logqlmodel/stats/stats.proto - -package stats - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Result contains LogQL query statistics. -type Result struct { - Summary Summary `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary"` - Querier Querier `protobuf:"bytes,2,opt,name=querier,proto3" json:"querier"` - Ingester Ingester `protobuf:"bytes,3,opt,name=ingester,proto3" json:"ingester"` - Caches Caches `protobuf:"bytes,4,opt,name=caches,proto3" json:"cache"` -} - -func (m *Result) Reset() { *m = Result{} } -func (*Result) ProtoMessage() {} -func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{0} -} -func (m *Result) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Result.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Result) XXX_Merge(src proto.Message) { - xxx_messageInfo_Result.Merge(m, src) -} -func (m *Result) XXX_Size() int { - return m.Size() -} -func (m *Result) XXX_DiscardUnknown() { - xxx_messageInfo_Result.DiscardUnknown(m) -} - -var xxx_messageInfo_Result proto.InternalMessageInfo - -func (m *Result) GetSummary() Summary { - if m != nil { - return m.Summary - } - return Summary{} -} - -func (m *Result) GetQuerier() Querier { - if m != nil { - return m.Querier - } - return Querier{} -} - -func (m *Result) GetIngester() Ingester { - if m != nil { - return m.Ingester - } - return Ingester{} -} - -func (m *Result) GetCaches() Caches { - if m != nil { - return m.Caches - } - return Caches{} -} - -type Caches struct { - Chunk Cache `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk"` - Index Cache `protobuf:"bytes,2,opt,name=index,proto3" json:"index"` - Result Cache `protobuf:"bytes,3,opt,name=result,proto3" json:"result"` - StatsResult Cache `protobuf:"bytes,4,opt,name=statsResult,proto3" json:"statsResult"` - VolumeResult Cache `protobuf:"bytes,5,opt,name=volumeResult,proto3" json:"volumeResult"` -} - -func (m *Caches) Reset() { *m = Caches{} } -func (*Caches) ProtoMessage() {} -func (*Caches) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{1} -} -func (m *Caches) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Caches) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Caches.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Caches) XXX_Merge(src proto.Message) { - xxx_messageInfo_Caches.Merge(m, src) -} -func (m *Caches) XXX_Size() int { - return m.Size() -} -func (m *Caches) XXX_DiscardUnknown() { - xxx_messageInfo_Caches.DiscardUnknown(m) -} - -var xxx_messageInfo_Caches proto.InternalMessageInfo - -func (m *Caches) GetChunk() Cache { - if m != nil { - return m.Chunk - } - return Cache{} -} - -func (m *Caches) GetIndex() Cache { - if m != nil { - return m.Index - } - return Cache{} -} - -func (m *Caches) GetResult() Cache { - if m != nil { - return m.Result - } - return Cache{} -} - -func (m *Caches) GetStatsResult() Cache { - if m != nil { - return m.StatsResult - } - return Cache{} -} - -func (m *Caches) GetVolumeResult() Cache { - if m != nil { - return m.VolumeResult - } - return Cache{} -} - -// Summary is the summary of a query statistics. -type Summary struct { - // Total bytes processed per second. - BytesProcessedPerSecond int64 `protobuf:"varint,1,opt,name=bytesProcessedPerSecond,proto3" json:"bytesProcessedPerSecond"` - // Total lines processed per second. - LinesProcessedPerSecond int64 `protobuf:"varint,2,opt,name=linesProcessedPerSecond,proto3" json:"linesProcessedPerSecond"` - // Total bytes processed. Includes structured metadata bytes. - TotalBytesProcessed int64 `protobuf:"varint,3,opt,name=totalBytesProcessed,proto3" json:"totalBytesProcessed"` - // Total lines processed. - TotalLinesProcessed int64 `protobuf:"varint,4,opt,name=totalLinesProcessed,proto3" json:"totalLinesProcessed"` - // Execution time in seconds. - // In addition to internal calculations this is also returned by the HTTP API. - // Grafana expects time values to be returned in seconds as float. - ExecTime float64 `protobuf:"fixed64,5,opt,name=execTime,proto3" json:"execTime"` - // Queue time in seconds. - // In addition to internal calculations this is also returned by the HTTP API. - // Grafana expects time values to be returned in seconds as float. - QueueTime float64 `protobuf:"fixed64,6,opt,name=queueTime,proto3" json:"queueTime"` - // Subqueries exists for backwards compatibility reasons and is deprecated. Do not use. - // Instead use splits and shards - Subqueries int64 `protobuf:"varint,7,opt,name=subqueries,proto3" json:"subqueries"` - // Total number of result entries returned - TotalEntriesReturned int64 `protobuf:"varint,8,opt,name=totalEntriesReturned,proto3" json:"totalEntriesReturned"` - // Total number of splits by time - Splits int64 `protobuf:"varint,9,opt,name=splits,proto3" json:"splits"` - // Total number of shards - Shards int64 `protobuf:"varint,10,opt,name=shards,proto3" json:"shards"` - // Total lines post query filtering - TotalPostFilterLines int64 `protobuf:"varint,11,opt,name=totalPostFilterLines,proto3" json:"totalPostFilterLines"` - // Total bytes processed of metadata. - TotalStructuredMetadataBytesProcessed int64 `protobuf:"varint,12,opt,name=totalStructuredMetadataBytesProcessed,proto3" json:"totalStructuredMetadataBytesProcessed"` -} - -func (m *Summary) Reset() { *m = Summary{} } -func (*Summary) ProtoMessage() {} -func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{2} -} -func (m *Summary) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Summary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Summary.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Summary) XXX_Merge(src proto.Message) { - xxx_messageInfo_Summary.Merge(m, src) -} -func (m *Summary) XXX_Size() int { - return m.Size() -} -func (m *Summary) XXX_DiscardUnknown() { - xxx_messageInfo_Summary.DiscardUnknown(m) -} - -var xxx_messageInfo_Summary proto.InternalMessageInfo - -func (m *Summary) GetBytesProcessedPerSecond() int64 { - if m != nil { - return m.BytesProcessedPerSecond - } - return 0 -} - -func (m *Summary) GetLinesProcessedPerSecond() int64 { - if m != nil { - return m.LinesProcessedPerSecond - } - return 0 -} - -func (m *Summary) GetTotalBytesProcessed() int64 { - if m != nil { - return m.TotalBytesProcessed - } - return 0 -} - -func (m *Summary) GetTotalLinesProcessed() int64 { - if m != nil { - return m.TotalLinesProcessed - } - return 0 -} - -func (m *Summary) GetExecTime() float64 { - if m != nil { - return m.ExecTime - } - return 0 -} - -func (m *Summary) GetQueueTime() float64 { - if m != nil { - return m.QueueTime - } - return 0 -} - -func (m *Summary) GetSubqueries() int64 { - if m != nil { - return m.Subqueries - } - return 0 -} - -func (m *Summary) GetTotalEntriesReturned() int64 { - if m != nil { - return m.TotalEntriesReturned - } - return 0 -} - -func (m *Summary) GetSplits() int64 { - if m != nil { - return m.Splits - } - return 0 -} - -func (m *Summary) GetShards() int64 { - if m != nil { - return m.Shards - } - return 0 -} - -func (m *Summary) GetTotalPostFilterLines() int64 { - if m != nil { - return m.TotalPostFilterLines - } - return 0 -} - -func (m *Summary) GetTotalStructuredMetadataBytesProcessed() int64 { - if m != nil { - return m.TotalStructuredMetadataBytesProcessed - } - return 0 -} - -type Querier struct { - Store Store `protobuf:"bytes,1,opt,name=store,proto3" json:"store"` -} - -func (m *Querier) Reset() { *m = Querier{} } -func (*Querier) ProtoMessage() {} -func (*Querier) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{3} -} -func (m *Querier) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Querier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Querier.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Querier) XXX_Merge(src proto.Message) { - xxx_messageInfo_Querier.Merge(m, src) -} -func (m *Querier) XXX_Size() int { - return m.Size() -} -func (m *Querier) XXX_DiscardUnknown() { - xxx_messageInfo_Querier.DiscardUnknown(m) -} - -var xxx_messageInfo_Querier proto.InternalMessageInfo - -func (m *Querier) GetStore() Store { - if m != nil { - return m.Store - } - return Store{} -} - -type Ingester struct { - // Total ingester reached for this query. - TotalReached int32 `protobuf:"varint,1,opt,name=totalReached,proto3" json:"totalReached"` - // Total of chunks matched by the query from ingesters - TotalChunksMatched int64 `protobuf:"varint,2,opt,name=totalChunksMatched,proto3" json:"totalChunksMatched"` - // Total of batches sent from ingesters. - TotalBatches int64 `protobuf:"varint,3,opt,name=totalBatches,proto3" json:"totalBatches"` - // Total lines sent by ingesters. - TotalLinesSent int64 `protobuf:"varint,4,opt,name=totalLinesSent,proto3" json:"totalLinesSent"` - Store Store `protobuf:"bytes,5,opt,name=store,proto3" json:"store"` -} - -func (m *Ingester) Reset() { *m = Ingester{} } -func (*Ingester) ProtoMessage() {} -func (*Ingester) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{4} -} -func (m *Ingester) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Ingester) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Ingester.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Ingester) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ingester.Merge(m, src) -} -func (m *Ingester) XXX_Size() int { - return m.Size() -} -func (m *Ingester) XXX_DiscardUnknown() { - xxx_messageInfo_Ingester.DiscardUnknown(m) -} - -var xxx_messageInfo_Ingester proto.InternalMessageInfo - -func (m *Ingester) GetTotalReached() int32 { - if m != nil { - return m.TotalReached - } - return 0 -} - -func (m *Ingester) GetTotalChunksMatched() int64 { - if m != nil { - return m.TotalChunksMatched - } - return 0 -} - -func (m *Ingester) GetTotalBatches() int64 { - if m != nil { - return m.TotalBatches - } - return 0 -} - -func (m *Ingester) GetTotalLinesSent() int64 { - if m != nil { - return m.TotalLinesSent - } - return 0 -} - -func (m *Ingester) GetStore() Store { - if m != nil { - return m.Store - } - return Store{} -} - -type Store struct { - // The total of chunk reference fetched from index. - TotalChunksRef int64 `protobuf:"varint,1,opt,name=totalChunksRef,proto3" json:"totalChunksRef"` - // Total number of chunks fetched. - TotalChunksDownloaded int64 `protobuf:"varint,2,opt,name=totalChunksDownloaded,proto3" json:"totalChunksDownloaded"` - // Time spent fetching chunks in nanoseconds. - ChunksDownloadTime int64 `protobuf:"varint,3,opt,name=chunksDownloadTime,proto3" json:"chunksDownloadTime"` - Chunk Chunk `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk"` - // Time spent fetching chunk refs from index. - ChunkRefsFetchTime int64 `protobuf:"varint,5,opt,name=chunkRefsFetchTime,proto3" json:"chunkRefsFetchTime"` -} - -func (m *Store) Reset() { *m = Store{} } -func (*Store) ProtoMessage() {} -func (*Store) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{5} -} -func (m *Store) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Store) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Store.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Store) XXX_Merge(src proto.Message) { - xxx_messageInfo_Store.Merge(m, src) -} -func (m *Store) XXX_Size() int { - return m.Size() -} -func (m *Store) XXX_DiscardUnknown() { - xxx_messageInfo_Store.DiscardUnknown(m) -} - -var xxx_messageInfo_Store proto.InternalMessageInfo - -func (m *Store) GetTotalChunksRef() int64 { - if m != nil { - return m.TotalChunksRef - } - return 0 -} - -func (m *Store) GetTotalChunksDownloaded() int64 { - if m != nil { - return m.TotalChunksDownloaded - } - return 0 -} - -func (m *Store) GetChunksDownloadTime() int64 { - if m != nil { - return m.ChunksDownloadTime - } - return 0 -} - -func (m *Store) GetChunk() Chunk { - if m != nil { - return m.Chunk - } - return Chunk{} -} - -func (m *Store) GetChunkRefsFetchTime() int64 { - if m != nil { - return m.ChunkRefsFetchTime - } - return 0 -} - -type Chunk struct { - // Total bytes processed but was already in memory (found in the headchunk). Includes structured metadata bytes. - HeadChunkBytes int64 `protobuf:"varint,4,opt,name=headChunkBytes,proto3" json:"headChunkBytes"` - // Total lines processed but was already in memory. (found in the headchunk) - HeadChunkLines int64 `protobuf:"varint,5,opt,name=headChunkLines,proto3" json:"headChunkLines"` - // Total bytes decompressed and processed from chunks. Includes structured metadata bytes. - DecompressedBytes int64 `protobuf:"varint,6,opt,name=decompressedBytes,proto3" json:"decompressedBytes"` - // Total lines decompressed and processed from chunks. - DecompressedLines int64 `protobuf:"varint,7,opt,name=decompressedLines,proto3" json:"decompressedLines"` - // Total bytes of compressed chunks (blocks) processed. - CompressedBytes int64 `protobuf:"varint,8,opt,name=compressedBytes,proto3" json:"compressedBytes"` - // Total duplicates found while processing. - TotalDuplicates int64 `protobuf:"varint,9,opt,name=totalDuplicates,proto3" json:"totalDuplicates"` - // Total lines post filtering - PostFilterLines int64 `protobuf:"varint,10,opt,name=postFilterLines,proto3" json:"postFilterLines"` - // Total bytes processed for metadata but was already in memory. (found in the headchunk) - HeadChunkStructuredMetadataBytes int64 `protobuf:"varint,11,opt,name=headChunkStructuredMetadataBytes,proto3" json:"headChunkStructuredMetadataBytes"` - // Total bytes of entries metadata decompressed and processed from chunks. - DecompressedStructuredMetadataBytes int64 `protobuf:"varint,12,opt,name=decompressedStructuredMetadataBytes,proto3" json:"decompressedStructuredMetadataBytes"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{6} -} -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) -} -func (m *Chunk) XXX_Size() int { - return m.Size() -} -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) -} - -var xxx_messageInfo_Chunk proto.InternalMessageInfo - -func (m *Chunk) GetHeadChunkBytes() int64 { - if m != nil { - return m.HeadChunkBytes - } - return 0 -} - -func (m *Chunk) GetHeadChunkLines() int64 { - if m != nil { - return m.HeadChunkLines - } - return 0 -} - -func (m *Chunk) GetDecompressedBytes() int64 { - if m != nil { - return m.DecompressedBytes - } - return 0 -} - -func (m *Chunk) GetDecompressedLines() int64 { - if m != nil { - return m.DecompressedLines - } - return 0 -} - -func (m *Chunk) GetCompressedBytes() int64 { - if m != nil { - return m.CompressedBytes - } - return 0 -} - -func (m *Chunk) GetTotalDuplicates() int64 { - if m != nil { - return m.TotalDuplicates - } - return 0 -} - -func (m *Chunk) GetPostFilterLines() int64 { - if m != nil { - return m.PostFilterLines - } - return 0 -} - -func (m *Chunk) GetHeadChunkStructuredMetadataBytes() int64 { - if m != nil { - return m.HeadChunkStructuredMetadataBytes - } - return 0 -} - -func (m *Chunk) GetDecompressedStructuredMetadataBytes() int64 { - if m != nil { - return m.DecompressedStructuredMetadataBytes - } - return 0 -} - -type Cache struct { - EntriesFound int32 `protobuf:"varint,1,opt,name=entriesFound,proto3" json:"entriesFound"` - EntriesRequested int32 `protobuf:"varint,2,opt,name=entriesRequested,proto3" json:"entriesRequested"` - EntriesStored int32 `protobuf:"varint,3,opt,name=entriesStored,proto3" json:"entriesStored"` - BytesReceived int64 `protobuf:"varint,4,opt,name=bytesReceived,proto3" json:"bytesReceived"` - BytesSent int64 `protobuf:"varint,5,opt,name=bytesSent,proto3" json:"bytesSent"` - Requests int32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests"` - DownloadTime int64 `protobuf:"varint,7,opt,name=downloadTime,proto3" json:"downloadTime"` -} - -func (m *Cache) Reset() { *m = Cache{} } -func (*Cache) ProtoMessage() {} -func (*Cache) Descriptor() ([]byte, []int) { - return fileDescriptor_6cdfe5d2aea33ebb, []int{7} -} -func (m *Cache) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Cache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Cache.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Cache) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cache.Merge(m, src) -} -func (m *Cache) XXX_Size() int { - return m.Size() -} -func (m *Cache) XXX_DiscardUnknown() { - xxx_messageInfo_Cache.DiscardUnknown(m) -} - -var xxx_messageInfo_Cache proto.InternalMessageInfo - -func (m *Cache) GetEntriesFound() int32 { - if m != nil { - return m.EntriesFound - } - return 0 -} - -func (m *Cache) GetEntriesRequested() int32 { - if m != nil { - return m.EntriesRequested - } - return 0 -} - -func (m *Cache) GetEntriesStored() int32 { - if m != nil { - return m.EntriesStored - } - return 0 -} - -func (m *Cache) GetBytesReceived() int64 { - if m != nil { - return m.BytesReceived - } - return 0 -} - -func (m *Cache) GetBytesSent() int64 { - if m != nil { - return m.BytesSent - } - return 0 -} - -func (m *Cache) GetRequests() int32 { - if m != nil { - return m.Requests - } - return 0 -} - -func (m *Cache) GetDownloadTime() int64 { - if m != nil { - return m.DownloadTime - } - return 0 -} - -func init() { - proto.RegisterType((*Result)(nil), "stats.Result") - proto.RegisterType((*Caches)(nil), "stats.Caches") - proto.RegisterType((*Summary)(nil), "stats.Summary") - proto.RegisterType((*Querier)(nil), "stats.Querier") - proto.RegisterType((*Ingester)(nil), "stats.Ingester") - proto.RegisterType((*Store)(nil), "stats.Store") - proto.RegisterType((*Chunk)(nil), "stats.Chunk") - proto.RegisterType((*Cache)(nil), "stats.Cache") -} - -func init() { proto.RegisterFile("pkg/logqlmodel/stats/stats.proto", fileDescriptor_6cdfe5d2aea33ebb) } - -var fileDescriptor_6cdfe5d2aea33ebb = []byte{ - // 1127 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0x4f, 0x52, 0x9c, 0x74, 0xa7, 0x7f, 0x77, 0xda, 0x65, 0x03, 0x48, 0x76, 0x15, 0x40, 0x2c, - 0x02, 0x35, 0xe2, 0x8f, 0x84, 0x40, 0xac, 0x84, 0xdc, 0xa5, 0x52, 0xa5, 0x5d, 0x51, 0x5e, 0xe1, - 0xc2, 0xcd, 0xb5, 0xa7, 0x89, 0x55, 0xc7, 0x4e, 0xed, 0xf1, 0xb2, 0x3d, 0xc1, 0x47, 0xe0, 0x63, - 0x70, 0xe1, 0x80, 0x38, 0xf1, 0x0d, 0xf6, 0xd8, 0x1b, 0x7b, 0xb2, 0x68, 0x7a, 0x41, 0x3e, 0xad, - 0xc4, 0x1d, 0xa1, 0x79, 0x33, 0xb1, 0x3d, 0x8e, 0xa3, 0xed, 0x25, 0x9e, 0xf7, 0x7b, 0xbf, 0xdf, - 0x7b, 0xe3, 0x99, 0x79, 0xcf, 0x13, 0xb2, 0x37, 0x3d, 0x1f, 0x0d, 0x83, 0x68, 0x74, 0x11, 0x4c, - 0x22, 0x8f, 0x05, 0xc3, 0x84, 0x3b, 0x3c, 0x91, 0xbf, 0xfb, 0xd3, 0x38, 0xe2, 0x11, 0x35, 0xd0, - 0x78, 0x73, 0x77, 0x14, 0x8d, 0x22, 0x44, 0x86, 0x62, 0x24, 0x9d, 0x83, 0x7f, 0xdb, 0xa4, 0x0b, - 0x2c, 0x49, 0x03, 0x4e, 0x3f, 0x27, 0xbd, 0x24, 0x9d, 0x4c, 0x9c, 0xf8, 0xb2, 0xdf, 0xde, 0x6b, - 0x3f, 0x58, 0xfb, 0x78, 0x73, 0x5f, 0x86, 0x39, 0x91, 0xa8, 0xbd, 0xf5, 0x3c, 0xb3, 0x5a, 0x79, - 0x66, 0xcd, 0x69, 0x30, 0x1f, 0x08, 0xe9, 0x45, 0xca, 0x62, 0x9f, 0xc5, 0xfd, 0x8e, 0x26, 0xfd, - 0x56, 0xa2, 0xa5, 0x54, 0xd1, 0x60, 0x3e, 0xa0, 0x0f, 0xc9, 0xaa, 0x1f, 0x8e, 0x58, 0xc2, 0x59, - 0xdc, 0x5f, 0x41, 0xed, 0x96, 0xd2, 0x1e, 0x29, 0xd8, 0xde, 0x56, 0xe2, 0x82, 0x08, 0xc5, 0x88, - 0x7e, 0x4a, 0xba, 0xae, 0xe3, 0x8e, 0x59, 0xd2, 0x7f, 0x0d, 0xc5, 0x1b, 0x4a, 0x7c, 0x80, 0xa0, - 0xbd, 0xa1, 0xa4, 0x06, 0x92, 0x40, 0x71, 0x07, 0xbf, 0x77, 0x48, 0x57, 0x32, 0xe8, 0x47, 0xc4, - 0x70, 0xc7, 0x69, 0x78, 0xae, 0xde, 0x79, 0xbd, 0xaa, 0xaf, 0xc8, 0x05, 0x05, 0xe4, 0x43, 0x48, - 0xfc, 0xd0, 0x63, 0xcf, 0xd4, 0xbb, 0x2e, 0x91, 0x20, 0x05, 0xe4, 0x43, 0x4c, 0x33, 0xc6, 0x55, - 0x56, 0xef, 0xa8, 0x6b, 0x36, 0x95, 0x46, 0x71, 0x40, 0x3d, 0xe9, 0x01, 0x59, 0x43, 0x9a, 0xdc, - 0x20, 0xf5, 0x86, 0xba, 0x74, 0x47, 0x49, 0xab, 0x44, 0xa8, 0x1a, 0xf4, 0x90, 0xac, 0x3f, 0x8d, - 0x82, 0x74, 0xc2, 0x54, 0x14, 0xa3, 0x21, 0xca, 0xae, 0x8a, 0xa2, 0x31, 0x41, 0xb3, 0x06, 0x7f, - 0x76, 0x49, 0x4f, 0x9d, 0x04, 0xfa, 0x3d, 0xb9, 0x7f, 0x7a, 0xc9, 0x59, 0x72, 0x1c, 0x47, 0x2e, - 0x4b, 0x12, 0xe6, 0x1d, 0xb3, 0xf8, 0x84, 0xb9, 0x51, 0xe8, 0xe1, 0x32, 0xae, 0xd8, 0x6f, 0xe5, - 0x99, 0xb5, 0x8c, 0x02, 0xcb, 0x1c, 0x22, 0x6c, 0xe0, 0x87, 0x8d, 0x61, 0x3b, 0x65, 0xd8, 0x25, - 0x14, 0x58, 0xe6, 0xa0, 0x47, 0x64, 0x87, 0x47, 0xdc, 0x09, 0x6c, 0x2d, 0x2d, 0xee, 0xc4, 0x8a, - 0x7d, 0x3f, 0xcf, 0xac, 0x26, 0x37, 0x34, 0x81, 0x45, 0xa8, 0xc7, 0x5a, 0x2a, 0xdc, 0x99, 0x6a, - 0x28, 0xdd, 0x0d, 0x4d, 0x20, 0x7d, 0x40, 0x56, 0xd9, 0x33, 0xe6, 0x7e, 0xe7, 0x4f, 0x18, 0xee, - 0x49, 0xdb, 0x5e, 0x17, 0x67, 0x7c, 0x8e, 0x41, 0x31, 0xa2, 0x1f, 0x90, 0x3b, 0x17, 0x29, 0x4b, - 0x19, 0x52, 0xbb, 0x48, 0xdd, 0xc8, 0x33, 0xab, 0x04, 0xa1, 0x1c, 0xd2, 0x7d, 0x42, 0x92, 0xf4, - 0x54, 0x56, 0x57, 0xd2, 0xef, 0xe1, 0xc4, 0x36, 0xf3, 0xcc, 0xaa, 0xa0, 0x50, 0x19, 0xd3, 0xc7, - 0x64, 0x17, 0x67, 0xf7, 0x75, 0xc8, 0xd1, 0xc7, 0x78, 0x1a, 0x87, 0xcc, 0xeb, 0xaf, 0xa2, 0xb2, - 0x9f, 0x67, 0x56, 0xa3, 0x1f, 0x1a, 0x51, 0x3a, 0x20, 0xdd, 0x64, 0x1a, 0xf8, 0x3c, 0xe9, 0xdf, - 0x41, 0x3d, 0x11, 0xa7, 0x5a, 0x22, 0xa0, 0x9e, 0xc8, 0x19, 0x3b, 0xb1, 0x97, 0xf4, 0x49, 0x85, - 0x83, 0x08, 0xa8, 0x67, 0x31, 0xab, 0xe3, 0x28, 0xe1, 0x87, 0x7e, 0xc0, 0x59, 0x8c, 0xab, 0xd7, - 0x5f, 0xab, 0xcd, 0xaa, 0xe6, 0x87, 0x46, 0x94, 0xfe, 0x44, 0xde, 0x45, 0xfc, 0x84, 0xc7, 0xa9, - 0xcb, 0xd3, 0x98, 0x79, 0x4f, 0x18, 0x77, 0x3c, 0x87, 0x3b, 0xb5, 0x23, 0xb1, 0x8e, 0xe1, 0xdf, - 0xcf, 0x33, 0xeb, 0x76, 0x02, 0xb8, 0x1d, 0x6d, 0xf0, 0x25, 0xe9, 0xa9, 0x4e, 0x28, 0x9a, 0x47, - 0xc2, 0xa3, 0x98, 0xd5, 0xfa, 0xcd, 0x89, 0xc0, 0xca, 0xe6, 0x81, 0x14, 0x90, 0x8f, 0xc1, 0x6f, - 0x1d, 0xb2, 0x7a, 0x54, 0x36, 0xbc, 0x75, 0xcc, 0x09, 0x4c, 0x54, 0xae, 0xac, 0x37, 0xc3, 0xde, - 0x16, 0xc5, 0x5b, 0xc5, 0x41, 0xb3, 0xe8, 0x21, 0xa1, 0x68, 0x1f, 0x88, 0x06, 0x96, 0x3c, 0x71, - 0x38, 0x6a, 0x65, 0x51, 0xbd, 0x9e, 0x67, 0x56, 0x83, 0x17, 0x1a, 0xb0, 0x22, 0xbb, 0x8d, 0x76, - 0xa2, 0x6a, 0xa8, 0xcc, 0xae, 0x70, 0xd0, 0x2c, 0xfa, 0x05, 0xd9, 0x2c, 0x2b, 0xe0, 0x84, 0x85, - 0x5c, 0x15, 0x0c, 0xcd, 0x33, 0xab, 0xe6, 0x81, 0x9a, 0x5d, 0xae, 0x97, 0x71, 0xeb, 0xf5, 0xfa, - 0xab, 0x43, 0x0c, 0xf4, 0x17, 0x89, 0xe5, 0x4b, 0x00, 0x3b, 0x53, 0xed, 0xa9, 0x4c, 0x5c, 0x78, - 0xa0, 0x66, 0xd3, 0x6f, 0xc8, 0xbd, 0x0a, 0xf2, 0x28, 0xfa, 0x31, 0x0c, 0x22, 0xc7, 0x2b, 0x56, - 0xed, 0x8d, 0x3c, 0xb3, 0x9a, 0x09, 0xd0, 0x0c, 0x8b, 0x3d, 0x70, 0x35, 0x0c, 0xeb, 0x79, 0xa5, - 0xdc, 0x83, 0x45, 0x2f, 0x34, 0x60, 0xe5, 0x17, 0xab, 0xf6, 0x3d, 0x10, 0xd8, 0x92, 0x2f, 0xd6, - 0x3c, 0x35, 0xb0, 0xb3, 0xe4, 0x90, 0x71, 0x77, 0x5c, 0x74, 0x9d, 0x6a, 0x6a, 0xcd, 0x0b, 0x0d, - 0xd8, 0xe0, 0x0f, 0x83, 0x18, 0x98, 0x47, 0xac, 0xec, 0x98, 0x39, 0x9e, 0x4c, 0x2a, 0x0e, 0x7b, - 0x75, 0x4b, 0x75, 0x0f, 0xd4, 0x6c, 0x4d, 0x2b, 0xcb, 0xda, 0x68, 0xd0, 0xca, 0x82, 0xae, 0xd9, - 0xf4, 0x80, 0xdc, 0xf5, 0x98, 0x1b, 0x4d, 0xa6, 0x31, 0x56, 0x96, 0x4c, 0xdd, 0x45, 0xf9, 0xbd, - 0x3c, 0xb3, 0x16, 0x9d, 0xb0, 0x08, 0xd5, 0x83, 0xc8, 0x39, 0xf4, 0x9a, 0x83, 0xc8, 0x69, 0x2c, - 0x42, 0xf4, 0x21, 0xd9, 0xaa, 0xcf, 0x43, 0xf6, 0xcc, 0x9d, 0x3c, 0xb3, 0xea, 0x2e, 0xa8, 0x03, - 0x42, 0x8e, 0xc7, 0xe4, 0x51, 0x3a, 0x0d, 0x7c, 0xd7, 0x11, 0xf2, 0x3b, 0xa5, 0xbc, 0xe6, 0x82, - 0x3a, 0x20, 0xe4, 0xd3, 0x5a, 0x6f, 0x24, 0xa5, 0xbc, 0xe6, 0x82, 0x3a, 0x40, 0xa7, 0x64, 0xaf, - 0x58, 0xd8, 0x25, 0xdd, 0x4b, 0xf5, 0xda, 0x77, 0xf2, 0xcc, 0x7a, 0x25, 0x17, 0x5e, 0xc9, 0xa0, - 0x97, 0xe4, 0xed, 0xea, 0x1a, 0x2e, 0x4b, 0x2a, 0x3b, 0xf0, 0x7b, 0x79, 0x66, 0xdd, 0x86, 0x0e, - 0xb7, 0x21, 0x0d, 0xfe, 0xeb, 0x10, 0x03, 0xef, 0x39, 0xa2, 0x7d, 0x31, 0xf9, 0xc5, 0x3a, 0x8c, - 0xd2, 0x50, 0x6b, 0x9e, 0x55, 0x1c, 0x34, 0x8b, 0x7e, 0x45, 0xb6, 0xd9, 0xfc, 0x3b, 0x77, 0x91, - 0x8a, 0x36, 0x2c, 0x9b, 0x80, 0x61, 0xef, 0xe6, 0x99, 0xb5, 0xe0, 0x83, 0x05, 0x84, 0x7e, 0x46, - 0x36, 0x14, 0x86, 0x7d, 0x49, 0xde, 0x3d, 0x0c, 0xfb, 0x6e, 0x9e, 0x59, 0xba, 0x03, 0x74, 0x53, - 0x08, 0xf1, 0xb2, 0x04, 0xcc, 0x65, 0xfe, 0xd3, 0xe2, 0xa6, 0x81, 0x42, 0xcd, 0x01, 0xba, 0x29, - 0xee, 0x0c, 0x08, 0x60, 0xb7, 0x95, 0xe5, 0x85, 0x77, 0x86, 0x02, 0x84, 0x72, 0x28, 0xae, 0x22, - 0xb1, 0x9c, 0xab, 0xac, 0x25, 0x43, 0x5e, 0x45, 0xe6, 0x18, 0x14, 0x23, 0xb1, 0x80, 0x5e, 0xb5, - 0x7b, 0xf5, 0xca, 0xfe, 0x5f, 0xc5, 0x41, 0xb3, 0xec, 0xd3, 0xab, 0x6b, 0xb3, 0xf5, 0xe2, 0xda, - 0x6c, 0xbd, 0xbc, 0x36, 0xdb, 0x3f, 0xcf, 0xcc, 0xf6, 0xaf, 0x33, 0xb3, 0xfd, 0x7c, 0x66, 0xb6, - 0xaf, 0x66, 0x66, 0xfb, 0xef, 0x99, 0xd9, 0xfe, 0x67, 0x66, 0xb6, 0x5e, 0xce, 0xcc, 0xf6, 0x2f, - 0x37, 0x66, 0xeb, 0xea, 0xc6, 0x6c, 0xbd, 0xb8, 0x31, 0x5b, 0x3f, 0x7c, 0x38, 0xf2, 0xf9, 0x38, - 0x3d, 0xdd, 0x77, 0xa3, 0xc9, 0x70, 0x14, 0x3b, 0x67, 0x4e, 0xe8, 0x0c, 0x83, 0xe8, 0xdc, 0x1f, - 0x36, 0xfd, 0xe3, 0x39, 0xed, 0xe2, 0xff, 0x99, 0x4f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x14, - 0xee, 0x83, 0x9b, 0x10, 0x0d, 0x00, 0x00, -} - -func (this *Result) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Result) - if !ok { - that2, ok := that.(Result) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Summary.Equal(&that1.Summary) { - return false - } - if !this.Querier.Equal(&that1.Querier) { - return false - } - if !this.Ingester.Equal(&that1.Ingester) { - return false - } - if !this.Caches.Equal(&that1.Caches) { - return false - } - return true -} -func (this *Caches) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Caches) - if !ok { - that2, ok := that.(Caches) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Chunk.Equal(&that1.Chunk) { - return false - } - if !this.Index.Equal(&that1.Index) { - return false - } - if !this.Result.Equal(&that1.Result) { - return false - } - if !this.StatsResult.Equal(&that1.StatsResult) { - return false - } - if !this.VolumeResult.Equal(&that1.VolumeResult) { - return false - } - return true -} -func (this *Summary) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Summary) - if !ok { - that2, ok := that.(Summary) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BytesProcessedPerSecond != that1.BytesProcessedPerSecond { - return false - } - if this.LinesProcessedPerSecond != that1.LinesProcessedPerSecond { - return false - } - if this.TotalBytesProcessed != that1.TotalBytesProcessed { - return false - } - if this.TotalLinesProcessed != that1.TotalLinesProcessed { - return false - } - if this.ExecTime != that1.ExecTime { - return false - } - if this.QueueTime != that1.QueueTime { - return false - } - if this.Subqueries != that1.Subqueries { - return false - } - if this.TotalEntriesReturned != that1.TotalEntriesReturned { - return false - } - if this.Splits != that1.Splits { - return false - } - if this.Shards != that1.Shards { - return false - } - if this.TotalPostFilterLines != that1.TotalPostFilterLines { - return false - } - if this.TotalStructuredMetadataBytesProcessed != that1.TotalStructuredMetadataBytesProcessed { - return false - } - return true -} -func (this *Querier) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Querier) - if !ok { - that2, ok := that.(Querier) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Store.Equal(&that1.Store) { - return false - } - return true -} -func (this *Ingester) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Ingester) - if !ok { - that2, ok := that.(Ingester) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TotalReached != that1.TotalReached { - return false - } - if this.TotalChunksMatched != that1.TotalChunksMatched { - return false - } - if this.TotalBatches != that1.TotalBatches { - return false - } - if this.TotalLinesSent != that1.TotalLinesSent { - return false - } - if !this.Store.Equal(&that1.Store) { - return false - } - return true -} -func (this *Store) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Store) - if !ok { - that2, ok := that.(Store) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TotalChunksRef != that1.TotalChunksRef { - return false - } - if this.TotalChunksDownloaded != that1.TotalChunksDownloaded { - return false - } - if this.ChunksDownloadTime != that1.ChunksDownloadTime { - return false - } - if !this.Chunk.Equal(&that1.Chunk) { - return false - } - if this.ChunkRefsFetchTime != that1.ChunkRefsFetchTime { - return false - } - return true -} -func (this *Chunk) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Chunk) - if !ok { - that2, ok := that.(Chunk) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.HeadChunkBytes != that1.HeadChunkBytes { - return false - } - if this.HeadChunkLines != that1.HeadChunkLines { - return false - } - if this.DecompressedBytes != that1.DecompressedBytes { - return false - } - if this.DecompressedLines != that1.DecompressedLines { - return false - } - if this.CompressedBytes != that1.CompressedBytes { - return false - } - if this.TotalDuplicates != that1.TotalDuplicates { - return false - } - if this.PostFilterLines != that1.PostFilterLines { - return false - } - if this.HeadChunkStructuredMetadataBytes != that1.HeadChunkStructuredMetadataBytes { - return false - } - if this.DecompressedStructuredMetadataBytes != that1.DecompressedStructuredMetadataBytes { - return false - } - return true -} -func (this *Cache) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Cache) - if !ok { - that2, ok := that.(Cache) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.EntriesFound != that1.EntriesFound { - return false - } - if this.EntriesRequested != that1.EntriesRequested { - return false - } - if this.EntriesStored != that1.EntriesStored { - return false - } - if this.BytesReceived != that1.BytesReceived { - return false - } - if this.BytesSent != that1.BytesSent { - return false - } - if this.Requests != that1.Requests { - return false - } - if this.DownloadTime != that1.DownloadTime { - return false - } - return true -} -func (this *Result) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&stats.Result{") - s = append(s, "Summary: "+strings.Replace(this.Summary.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Querier: "+strings.Replace(this.Querier.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Ingester: "+strings.Replace(this.Ingester.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Caches: "+strings.Replace(this.Caches.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Caches) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&stats.Caches{") - s = append(s, "Chunk: "+strings.Replace(this.Chunk.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Index: "+strings.Replace(this.Index.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Result: "+strings.Replace(this.Result.GoString(), `&`, ``, 1)+",\n") - s = append(s, "StatsResult: "+strings.Replace(this.StatsResult.GoString(), `&`, ``, 1)+",\n") - s = append(s, "VolumeResult: "+strings.Replace(this.VolumeResult.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Summary) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 16) - s = append(s, "&stats.Summary{") - s = append(s, "BytesProcessedPerSecond: "+fmt.Sprintf("%#v", this.BytesProcessedPerSecond)+",\n") - s = append(s, "LinesProcessedPerSecond: "+fmt.Sprintf("%#v", this.LinesProcessedPerSecond)+",\n") - s = append(s, "TotalBytesProcessed: "+fmt.Sprintf("%#v", this.TotalBytesProcessed)+",\n") - s = append(s, "TotalLinesProcessed: "+fmt.Sprintf("%#v", this.TotalLinesProcessed)+",\n") - s = append(s, "ExecTime: "+fmt.Sprintf("%#v", this.ExecTime)+",\n") - s = append(s, "QueueTime: "+fmt.Sprintf("%#v", this.QueueTime)+",\n") - s = append(s, "Subqueries: "+fmt.Sprintf("%#v", this.Subqueries)+",\n") - s = append(s, "TotalEntriesReturned: "+fmt.Sprintf("%#v", this.TotalEntriesReturned)+",\n") - s = append(s, "Splits: "+fmt.Sprintf("%#v", this.Splits)+",\n") - s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") - s = append(s, "TotalPostFilterLines: "+fmt.Sprintf("%#v", this.TotalPostFilterLines)+",\n") - s = append(s, "TotalStructuredMetadataBytesProcessed: "+fmt.Sprintf("%#v", this.TotalStructuredMetadataBytesProcessed)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Querier) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&stats.Querier{") - s = append(s, "Store: "+strings.Replace(this.Store.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Ingester) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&stats.Ingester{") - s = append(s, "TotalReached: "+fmt.Sprintf("%#v", this.TotalReached)+",\n") - s = append(s, "TotalChunksMatched: "+fmt.Sprintf("%#v", this.TotalChunksMatched)+",\n") - s = append(s, "TotalBatches: "+fmt.Sprintf("%#v", this.TotalBatches)+",\n") - s = append(s, "TotalLinesSent: "+fmt.Sprintf("%#v", this.TotalLinesSent)+",\n") - s = append(s, "Store: "+strings.Replace(this.Store.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Store) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&stats.Store{") - s = append(s, "TotalChunksRef: "+fmt.Sprintf("%#v", this.TotalChunksRef)+",\n") - s = append(s, "TotalChunksDownloaded: "+fmt.Sprintf("%#v", this.TotalChunksDownloaded)+",\n") - s = append(s, "ChunksDownloadTime: "+fmt.Sprintf("%#v", this.ChunksDownloadTime)+",\n") - s = append(s, "Chunk: "+strings.Replace(this.Chunk.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ChunkRefsFetchTime: "+fmt.Sprintf("%#v", this.ChunkRefsFetchTime)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Chunk) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&stats.Chunk{") - s = append(s, "HeadChunkBytes: "+fmt.Sprintf("%#v", this.HeadChunkBytes)+",\n") - s = append(s, "HeadChunkLines: "+fmt.Sprintf("%#v", this.HeadChunkLines)+",\n") - s = append(s, "DecompressedBytes: "+fmt.Sprintf("%#v", this.DecompressedBytes)+",\n") - s = append(s, "DecompressedLines: "+fmt.Sprintf("%#v", this.DecompressedLines)+",\n") - s = append(s, "CompressedBytes: "+fmt.Sprintf("%#v", this.CompressedBytes)+",\n") - s = append(s, "TotalDuplicates: "+fmt.Sprintf("%#v", this.TotalDuplicates)+",\n") - s = append(s, "PostFilterLines: "+fmt.Sprintf("%#v", this.PostFilterLines)+",\n") - s = append(s, "HeadChunkStructuredMetadataBytes: "+fmt.Sprintf("%#v", this.HeadChunkStructuredMetadataBytes)+",\n") - s = append(s, "DecompressedStructuredMetadataBytes: "+fmt.Sprintf("%#v", this.DecompressedStructuredMetadataBytes)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Cache) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&stats.Cache{") - s = append(s, "EntriesFound: "+fmt.Sprintf("%#v", this.EntriesFound)+",\n") - s = append(s, "EntriesRequested: "+fmt.Sprintf("%#v", this.EntriesRequested)+",\n") - s = append(s, "EntriesStored: "+fmt.Sprintf("%#v", this.EntriesStored)+",\n") - s = append(s, "BytesReceived: "+fmt.Sprintf("%#v", this.BytesReceived)+",\n") - s = append(s, "BytesSent: "+fmt.Sprintf("%#v", this.BytesSent)+",\n") - s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") - s = append(s, "DownloadTime: "+fmt.Sprintf("%#v", this.DownloadTime)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringStats(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Result) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Result) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Caches.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Ingester.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Querier.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Summary.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Caches) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Caches) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Caches) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.VolumeResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.StatsResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Index.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Chunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Summary) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Summary) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Summary) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalStructuredMetadataBytesProcessed != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalStructuredMetadataBytesProcessed)) - i-- - dAtA[i] = 0x60 - } - if m.TotalPostFilterLines != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalPostFilterLines)) - i-- - dAtA[i] = 0x58 - } - if m.Shards != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.Shards)) - i-- - dAtA[i] = 0x50 - } - if m.Splits != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.Splits)) - i-- - dAtA[i] = 0x48 - } - if m.TotalEntriesReturned != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalEntriesReturned)) - i-- - dAtA[i] = 0x40 - } - if m.Subqueries != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.Subqueries)) - i-- - dAtA[i] = 0x38 - } - if m.QueueTime != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.QueueTime)))) - i-- - dAtA[i] = 0x31 - } - if m.ExecTime != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ExecTime)))) - i-- - dAtA[i] = 0x29 - } - if m.TotalLinesProcessed != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalLinesProcessed)) - i-- - dAtA[i] = 0x20 - } - if m.TotalBytesProcessed != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalBytesProcessed)) - i-- - dAtA[i] = 0x18 - } - if m.LinesProcessedPerSecond != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.LinesProcessedPerSecond)) - i-- - dAtA[i] = 0x10 - } - if m.BytesProcessedPerSecond != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.BytesProcessedPerSecond)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Querier) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Querier) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Querier) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Ingester) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Ingester) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Ingester) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.TotalLinesSent != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalLinesSent)) - i-- - dAtA[i] = 0x20 - } - if m.TotalBatches != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalBatches)) - i-- - dAtA[i] = 0x18 - } - if m.TotalChunksMatched != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksMatched)) - i-- - dAtA[i] = 0x10 - } - if m.TotalReached != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalReached)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Store) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Store) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Store) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ChunkRefsFetchTime != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.ChunkRefsFetchTime)) - i-- - dAtA[i] = 0x28 - } - { - size, err := m.Chunk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStats(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.ChunksDownloadTime != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.ChunksDownloadTime)) - i-- - dAtA[i] = 0x18 - } - if m.TotalChunksDownloaded != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksDownloaded)) - i-- - dAtA[i] = 0x10 - } - if m.TotalChunksRef != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksRef)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Chunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - if m.DecompressedStructuredMetadataBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.DecompressedStructuredMetadataBytes)) - i-- - dAtA[i] = 0x60 - } - if m.HeadChunkStructuredMetadataBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkStructuredMetadataBytes)) - i-- - dAtA[i] = 0x58 - } - if m.PostFilterLines != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.PostFilterLines)) - i-- - dAtA[i] = 0x50 - } - if m.TotalDuplicates != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.TotalDuplicates)) - i-- - dAtA[i] = 0x48 - } - if m.CompressedBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.CompressedBytes)) - i-- - dAtA[i] = 0x40 - } - if m.DecompressedLines != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.DecompressedLines)) - i-- - dAtA[i] = 0x38 - } - if m.DecompressedBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.DecompressedBytes)) - i-- - dAtA[i] = 0x30 - } - if m.HeadChunkLines != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkLines)) - i-- - dAtA[i] = 0x28 - } - if m.HeadChunkBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkBytes)) - i-- - dAtA[i] = 0x20 - } - return len(dAtA) - i, nil -} - -func (m *Cache) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Cache) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Cache) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DownloadTime != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.DownloadTime)) - i-- - dAtA[i] = 0x38 - } - if m.Requests != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.Requests)) - i-- - dAtA[i] = 0x30 - } - if m.BytesSent != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.BytesSent)) - i-- - dAtA[i] = 0x28 - } - if m.BytesReceived != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.BytesReceived)) - i-- - dAtA[i] = 0x20 - } - if m.EntriesStored != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.EntriesStored)) - i-- - dAtA[i] = 0x18 - } - if m.EntriesRequested != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.EntriesRequested)) - i-- - dAtA[i] = 0x10 - } - if m.EntriesFound != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.EntriesFound)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintStats(dAtA []byte, offset int, v uint64) int { - offset -= sovStats(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Result) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Summary.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.Querier.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.Ingester.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.Caches.Size() - n += 1 + l + sovStats(uint64(l)) - return n -} - -func (m *Caches) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Chunk.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.Index.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.Result.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.StatsResult.Size() - n += 1 + l + sovStats(uint64(l)) - l = m.VolumeResult.Size() - n += 1 + l + sovStats(uint64(l)) - return n -} - -func (m *Summary) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BytesProcessedPerSecond != 0 { - n += 1 + sovStats(uint64(m.BytesProcessedPerSecond)) - } - if m.LinesProcessedPerSecond != 0 { - n += 1 + sovStats(uint64(m.LinesProcessedPerSecond)) - } - if m.TotalBytesProcessed != 0 { - n += 1 + sovStats(uint64(m.TotalBytesProcessed)) - } - if m.TotalLinesProcessed != 0 { - n += 1 + sovStats(uint64(m.TotalLinesProcessed)) - } - if m.ExecTime != 0 { - n += 9 - } - if m.QueueTime != 0 { - n += 9 - } - if m.Subqueries != 0 { - n += 1 + sovStats(uint64(m.Subqueries)) - } - if m.TotalEntriesReturned != 0 { - n += 1 + sovStats(uint64(m.TotalEntriesReturned)) - } - if m.Splits != 0 { - n += 1 + sovStats(uint64(m.Splits)) - } - if m.Shards != 0 { - n += 1 + sovStats(uint64(m.Shards)) - } - if m.TotalPostFilterLines != 0 { - n += 1 + sovStats(uint64(m.TotalPostFilterLines)) - } - if m.TotalStructuredMetadataBytesProcessed != 0 { - n += 1 + sovStats(uint64(m.TotalStructuredMetadataBytesProcessed)) - } - return n -} - -func (m *Querier) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Store.Size() - n += 1 + l + sovStats(uint64(l)) - return n -} - -func (m *Ingester) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TotalReached != 0 { - n += 1 + sovStats(uint64(m.TotalReached)) - } - if m.TotalChunksMatched != 0 { - n += 1 + sovStats(uint64(m.TotalChunksMatched)) - } - if m.TotalBatches != 0 { - n += 1 + sovStats(uint64(m.TotalBatches)) - } - if m.TotalLinesSent != 0 { - n += 1 + sovStats(uint64(m.TotalLinesSent)) - } - l = m.Store.Size() - n += 1 + l + sovStats(uint64(l)) - return n -} - -func (m *Store) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TotalChunksRef != 0 { - n += 1 + sovStats(uint64(m.TotalChunksRef)) - } - if m.TotalChunksDownloaded != 0 { - n += 1 + sovStats(uint64(m.TotalChunksDownloaded)) - } - if m.ChunksDownloadTime != 0 { - n += 1 + sovStats(uint64(m.ChunksDownloadTime)) - } - l = m.Chunk.Size() - n += 1 + l + sovStats(uint64(l)) - if m.ChunkRefsFetchTime != 0 { - n += 1 + sovStats(uint64(m.ChunkRefsFetchTime)) - } - return n -} - -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HeadChunkBytes != 0 { - n += 1 + sovStats(uint64(m.HeadChunkBytes)) - } - if m.HeadChunkLines != 0 { - n += 1 + sovStats(uint64(m.HeadChunkLines)) - } - if m.DecompressedBytes != 0 { - n += 1 + sovStats(uint64(m.DecompressedBytes)) - } - if m.DecompressedLines != 0 { - n += 1 + sovStats(uint64(m.DecompressedLines)) - } - if m.CompressedBytes != 0 { - n += 1 + sovStats(uint64(m.CompressedBytes)) - } - if m.TotalDuplicates != 0 { - n += 1 + sovStats(uint64(m.TotalDuplicates)) - } - if m.PostFilterLines != 0 { - n += 1 + sovStats(uint64(m.PostFilterLines)) - } - if m.HeadChunkStructuredMetadataBytes != 0 { - n += 1 + sovStats(uint64(m.HeadChunkStructuredMetadataBytes)) - } - if m.DecompressedStructuredMetadataBytes != 0 { - n += 1 + sovStats(uint64(m.DecompressedStructuredMetadataBytes)) - } - return n -} - -func (m *Cache) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EntriesFound != 0 { - n += 1 + sovStats(uint64(m.EntriesFound)) - } - if m.EntriesRequested != 0 { - n += 1 + sovStats(uint64(m.EntriesRequested)) - } - if m.EntriesStored != 0 { - n += 1 + sovStats(uint64(m.EntriesStored)) - } - if m.BytesReceived != 0 { - n += 1 + sovStats(uint64(m.BytesReceived)) - } - if m.BytesSent != 0 { - n += 1 + sovStats(uint64(m.BytesSent)) - } - if m.Requests != 0 { - n += 1 + sovStats(uint64(m.Requests)) - } - if m.DownloadTime != 0 { - n += 1 + sovStats(uint64(m.DownloadTime)) - } - return n -} - -func sovStats(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStats(x uint64) (n int) { - return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Result) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Result{`, - `Summary:` + strings.Replace(strings.Replace(this.Summary.String(), "Summary", "Summary", 1), `&`, ``, 1) + `,`, - `Querier:` + strings.Replace(strings.Replace(this.Querier.String(), "Querier", "Querier", 1), `&`, ``, 1) + `,`, - `Ingester:` + strings.Replace(strings.Replace(this.Ingester.String(), "Ingester", "Ingester", 1), `&`, ``, 1) + `,`, - `Caches:` + strings.Replace(strings.Replace(this.Caches.String(), "Caches", "Caches", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Caches) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Caches{`, - `Chunk:` + strings.Replace(strings.Replace(this.Chunk.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, - `Index:` + strings.Replace(strings.Replace(this.Index.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, - `Result:` + strings.Replace(strings.Replace(this.Result.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, - `StatsResult:` + strings.Replace(strings.Replace(this.StatsResult.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, - `VolumeResult:` + strings.Replace(strings.Replace(this.VolumeResult.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Summary) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Summary{`, - `BytesProcessedPerSecond:` + fmt.Sprintf("%v", this.BytesProcessedPerSecond) + `,`, - `LinesProcessedPerSecond:` + fmt.Sprintf("%v", this.LinesProcessedPerSecond) + `,`, - `TotalBytesProcessed:` + fmt.Sprintf("%v", this.TotalBytesProcessed) + `,`, - `TotalLinesProcessed:` + fmt.Sprintf("%v", this.TotalLinesProcessed) + `,`, - `ExecTime:` + fmt.Sprintf("%v", this.ExecTime) + `,`, - `QueueTime:` + fmt.Sprintf("%v", this.QueueTime) + `,`, - `Subqueries:` + fmt.Sprintf("%v", this.Subqueries) + `,`, - `TotalEntriesReturned:` + fmt.Sprintf("%v", this.TotalEntriesReturned) + `,`, - `Splits:` + fmt.Sprintf("%v", this.Splits) + `,`, - `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, - `TotalPostFilterLines:` + fmt.Sprintf("%v", this.TotalPostFilterLines) + `,`, - `TotalStructuredMetadataBytesProcessed:` + fmt.Sprintf("%v", this.TotalStructuredMetadataBytesProcessed) + `,`, - `}`, - }, "") - return s -} -func (this *Querier) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Querier{`, - `Store:` + strings.Replace(strings.Replace(this.Store.String(), "Store", "Store", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Ingester) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Ingester{`, - `TotalReached:` + fmt.Sprintf("%v", this.TotalReached) + `,`, - `TotalChunksMatched:` + fmt.Sprintf("%v", this.TotalChunksMatched) + `,`, - `TotalBatches:` + fmt.Sprintf("%v", this.TotalBatches) + `,`, - `TotalLinesSent:` + fmt.Sprintf("%v", this.TotalLinesSent) + `,`, - `Store:` + strings.Replace(strings.Replace(this.Store.String(), "Store", "Store", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *Store) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Store{`, - `TotalChunksRef:` + fmt.Sprintf("%v", this.TotalChunksRef) + `,`, - `TotalChunksDownloaded:` + fmt.Sprintf("%v", this.TotalChunksDownloaded) + `,`, - `ChunksDownloadTime:` + fmt.Sprintf("%v", this.ChunksDownloadTime) + `,`, - `Chunk:` + strings.Replace(strings.Replace(this.Chunk.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + `,`, - `ChunkRefsFetchTime:` + fmt.Sprintf("%v", this.ChunkRefsFetchTime) + `,`, - `}`, - }, "") - return s -} -func (this *Chunk) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Chunk{`, - `HeadChunkBytes:` + fmt.Sprintf("%v", this.HeadChunkBytes) + `,`, - `HeadChunkLines:` + fmt.Sprintf("%v", this.HeadChunkLines) + `,`, - `DecompressedBytes:` + fmt.Sprintf("%v", this.DecompressedBytes) + `,`, - `DecompressedLines:` + fmt.Sprintf("%v", this.DecompressedLines) + `,`, - `CompressedBytes:` + fmt.Sprintf("%v", this.CompressedBytes) + `,`, - `TotalDuplicates:` + fmt.Sprintf("%v", this.TotalDuplicates) + `,`, - `PostFilterLines:` + fmt.Sprintf("%v", this.PostFilterLines) + `,`, - `HeadChunkStructuredMetadataBytes:` + fmt.Sprintf("%v", this.HeadChunkStructuredMetadataBytes) + `,`, - `DecompressedStructuredMetadataBytes:` + fmt.Sprintf("%v", this.DecompressedStructuredMetadataBytes) + `,`, - `}`, - }, "") - return s -} -func (this *Cache) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Cache{`, - `EntriesFound:` + fmt.Sprintf("%v", this.EntriesFound) + `,`, - `EntriesRequested:` + fmt.Sprintf("%v", this.EntriesRequested) + `,`, - `EntriesStored:` + fmt.Sprintf("%v", this.EntriesStored) + `,`, - `BytesReceived:` + fmt.Sprintf("%v", this.BytesReceived) + `,`, - `BytesSent:` + fmt.Sprintf("%v", this.BytesSent) + `,`, - `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`, - `DownloadTime:` + fmt.Sprintf("%v", this.DownloadTime) + `,`, - `}`, - }, "") - return s -} -func valueToStringStats(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Result) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Result: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Summary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Querier", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Querier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ingester", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Ingester.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Caches", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Caches.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Caches) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Caches: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Caches: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Chunk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Index.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatsResult", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StatsResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeResult", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VolumeResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Summary) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Summary: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Summary: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BytesProcessedPerSecond", wireType) - } - m.BytesProcessedPerSecond = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BytesProcessedPerSecond |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LinesProcessedPerSecond", wireType) - } - m.LinesProcessedPerSecond = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LinesProcessedPerSecond |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesProcessed", wireType) - } - m.TotalBytesProcessed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalBytesProcessed |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalLinesProcessed", wireType) - } - m.TotalLinesProcessed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalLinesProcessed |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecTime", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.ExecTime = float64(math.Float64frombits(v)) - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field QueueTime", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.QueueTime = float64(math.Float64frombits(v)) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Subqueries", wireType) - } - m.Subqueries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Subqueries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalEntriesReturned", wireType) - } - m.TotalEntriesReturned = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalEntriesReturned |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Splits", wireType) - } - m.Splits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Splits |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - m.Shards = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Shards |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalPostFilterLines", wireType) - } - m.TotalPostFilterLines = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalPostFilterLines |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalStructuredMetadataBytesProcessed", wireType) - } - m.TotalStructuredMetadataBytesProcessed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalStructuredMetadataBytesProcessed |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Querier) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Querier: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Querier: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Ingester) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Ingester: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ingester: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalReached", wireType) - } - m.TotalReached = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalReached |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksMatched", wireType) - } - m.TotalChunksMatched = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalChunksMatched |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalBatches", wireType) - } - m.TotalBatches = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalBatches |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalLinesSent", wireType) - } - m.TotalLinesSent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalLinesSent |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Store) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Store: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Store: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksRef", wireType) - } - m.TotalChunksRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalChunksRef |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksDownloaded", wireType) - } - m.TotalChunksDownloaded = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalChunksDownloaded |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunksDownloadTime", wireType) - } - m.ChunksDownloadTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunksDownloadTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Chunk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkRefsFetchTime", wireType) - } - m.ChunkRefsFetchTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChunkRefsFetchTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Chunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkBytes", wireType) - } - m.HeadChunkBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HeadChunkBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkLines", wireType) - } - m.HeadChunkLines = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HeadChunkLines |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DecompressedBytes", wireType) - } - m.DecompressedBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DecompressedBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DecompressedLines", wireType) - } - m.DecompressedLines = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DecompressedLines |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompressedBytes", wireType) - } - m.CompressedBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompressedBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDuplicates", wireType) - } - m.TotalDuplicates = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalDuplicates |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PostFilterLines", wireType) - } - m.PostFilterLines = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PostFilterLines |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkStructuredMetadataBytes", wireType) - } - m.HeadChunkStructuredMetadataBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HeadChunkStructuredMetadataBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DecompressedStructuredMetadataBytes", wireType) - } - m.DecompressedStructuredMetadataBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DecompressedStructuredMetadataBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cache) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Cache: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cache: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EntriesFound", wireType) - } - m.EntriesFound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EntriesFound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EntriesRequested", wireType) - } - m.EntriesRequested = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EntriesRequested |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EntriesStored", wireType) - } - m.EntriesStored = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EntriesStored |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BytesReceived", wireType) - } - m.BytesReceived = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BytesReceived |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BytesSent", wireType) - } - m.BytesSent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BytesSent |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) - } - m.Requests = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Requests |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DownloadTime", wireType) - } - m.DownloadTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DownloadTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStats(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStats - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - 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 := skipStats(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go b/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go deleted file mode 100644 index 3773159c0cc37..0000000000000 --- a/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go +++ /dev/null @@ -1,1014 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto - -package frontendv2pb - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - httpgrpc "github.com/grafana/dskit/httpgrpc" - queryrange "github.com/grafana/loki/pkg/querier/queryrange" - stats "github.com/grafana/loki/pkg/querier/stats" - 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" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type QueryResultRequest struct { - QueryID uint64 `protobuf:"varint,1,opt,name=queryID,proto3" json:"queryID,omitempty"` - // Types that are valid to be assigned to Response: - // *QueryResultRequest_HttpResponse - // *QueryResultRequest_QueryResponse - Response isQueryResultRequest_Response `protobuf_oneof:"response"` - Stats *stats.Stats `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"` -} - -func (m *QueryResultRequest) Reset() { *m = QueryResultRequest{} } -func (*QueryResultRequest) ProtoMessage() {} -func (*QueryResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_85a7e5cdf8261f06, []int{0} -} -func (m *QueryResultRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResultRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryResultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResultRequest.Merge(m, src) -} -func (m *QueryResultRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryResultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResultRequest proto.InternalMessageInfo - -type isQueryResultRequest_Response interface { - isQueryResultRequest_Response() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryResultRequest_HttpResponse struct { - HttpResponse *httpgrpc.HTTPResponse `protobuf:"bytes,2,opt,name=httpResponse,proto3,oneof"` -} -type QueryResultRequest_QueryResponse struct { - QueryResponse *queryrange.QueryResponse `protobuf:"bytes,4,opt,name=queryResponse,proto3,oneof"` -} - -func (*QueryResultRequest_HttpResponse) isQueryResultRequest_Response() {} -func (*QueryResultRequest_QueryResponse) isQueryResultRequest_Response() {} - -func (m *QueryResultRequest) GetResponse() isQueryResultRequest_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *QueryResultRequest) GetQueryID() uint64 { - if m != nil { - return m.QueryID - } - return 0 -} - -// Deprecated: Do not use. -func (m *QueryResultRequest) GetHttpResponse() *httpgrpc.HTTPResponse { - if x, ok := m.GetResponse().(*QueryResultRequest_HttpResponse); ok { - return x.HttpResponse - } - return nil -} - -func (m *QueryResultRequest) GetQueryResponse() *queryrange.QueryResponse { - if x, ok := m.GetResponse().(*QueryResultRequest_QueryResponse); ok { - return x.QueryResponse - } - return nil -} - -func (m *QueryResultRequest) GetStats() *stats.Stats { - if m != nil { - return m.Stats - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryResultRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryResultRequest_HttpResponse)(nil), - (*QueryResultRequest_QueryResponse)(nil), - } -} - -type QueryResultResponse struct { -} - -func (m *QueryResultResponse) Reset() { *m = QueryResultResponse{} } -func (*QueryResultResponse) ProtoMessage() {} -func (*QueryResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_85a7e5cdf8261f06, []int{1} -} -func (m *QueryResultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResultResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResultResponse.Merge(m, src) -} -func (m *QueryResultResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResultResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryResultRequest)(nil), "frontendv2pb.QueryResultRequest") - proto.RegisterType((*QueryResultResponse)(nil), "frontendv2pb.QueryResultResponse") -} - -func init() { - proto.RegisterFile("pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto", fileDescriptor_85a7e5cdf8261f06) -} - -var fileDescriptor_85a7e5cdf8261f06 = []byte{ - // 379 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xbd, 0x4e, 0xc3, 0x30, - 0x18, 0xb4, 0x4b, 0xf9, 0x91, 0x5b, 0x16, 0xf3, 0xa3, 0x50, 0x09, 0xab, 0x74, 0xa1, 0x53, 0x82, - 0xc2, 0xc2, 0x08, 0x11, 0xaa, 0xca, 0x46, 0x43, 0x27, 0xb6, 0xb4, 0x75, 0xd3, 0xd0, 0x12, 0xa7, - 0x8e, 0x53, 0x89, 0x8d, 0x47, 0xe0, 0x31, 0x78, 0x14, 0xc6, 0x8e, 0x1d, 0x69, 0xb2, 0x30, 0xf6, - 0x11, 0x50, 0xe2, 0x34, 0x72, 0x84, 0xc4, 0xe2, 0x9c, 0x7d, 0x77, 0x5f, 0xee, 0xf3, 0x67, 0x74, - 0x13, 0x4c, 0x5d, 0x63, 0xc6, 0xa6, 0xde, 0x98, 0x33, 0x5f, 0x50, 0x7f, 0x64, 0x14, 0x60, 0x61, - 0x16, 0x78, 0x61, 0x06, 0x83, 0x62, 0xa3, 0x07, 0x9c, 0x09, 0x86, 0xeb, 0x2a, 0xd9, 0xb8, 0x72, - 0x3d, 0x31, 0x89, 0x06, 0xfa, 0x90, 0xbd, 0x1a, 0x2e, 0x77, 0xc6, 0x8e, 0xef, 0x18, 0xa3, 0x70, - 0xea, 0x09, 0x63, 0x22, 0x44, 0xe0, 0xf2, 0x60, 0x58, 0x00, 0xe9, 0x6f, 0x1c, 0xbb, 0xcc, 0x65, - 0x19, 0x34, 0x52, 0x94, 0x9f, 0x5e, 0xa6, 0x79, 0xe6, 0x11, 0xe5, 0x1e, 0xe5, 0xd9, 0xf7, 0x8d, - 0x3b, 0xbe, 0x4b, 0x15, 0x98, 0x0b, 0xcf, 0x55, 0x61, 0x28, 0x1c, 0x11, 0xca, 0x55, 0xd2, 0xad, - 0x04, 0x22, 0xdc, 0x4b, 0x3d, 0x36, 0x0d, 0xa3, 0x99, 0xb0, 0xe9, 0x3c, 0xa2, 0xa1, 0xc0, 0x1a, - 0xda, 0xcf, 0x2a, 0x3d, 0xdc, 0x6b, 0xb0, 0x09, 0xdb, 0x55, 0x7b, 0xbb, 0xc5, 0xb7, 0xa8, 0x9e, - 0x06, 0xb4, 0x69, 0x18, 0x30, 0x3f, 0xa4, 0x5a, 0xa5, 0x09, 0xdb, 0x35, 0xf3, 0x54, 0x2f, 0x52, - 0x77, 0xfb, 0xfd, 0xc7, 0x2d, 0x6b, 0x55, 0x34, 0xd8, 0x05, 0x76, 0xc9, 0x81, 0xef, 0xd0, 0xe1, - 0x3c, 0xff, 0xa3, 0x2c, 0x51, 0xcd, 0x4a, 0x9c, 0xe9, 0x4a, 0xf6, 0x9e, 0x2a, 0xe8, 0x02, 0xbb, - 0xec, 0xc0, 0x2d, 0xb4, 0x9b, 0x35, 0xa1, 0xed, 0x64, 0xd6, 0xba, 0x2e, 0x5b, 0x7a, 0x4a, 0x57, - 0x5b, 0x52, 0x16, 0x42, 0x07, 0x3c, 0xd7, 0xb7, 0x4e, 0xd0, 0x51, 0xa9, 0x49, 0x79, 0x6c, 0xbe, - 0x20, 0xdc, 0xc9, 0x87, 0xd3, 0x61, 0xbc, 0x27, 0x2f, 0x09, 0xf7, 0x51, 0x4d, 0x11, 0xe3, 0xa6, - 0xae, 0x0e, 0x50, 0xff, 0x7b, 0x59, 0x8d, 0x8b, 0x7f, 0x14, 0x79, 0x00, 0x60, 0x59, 0xcb, 0x35, - 0x01, 0xab, 0x35, 0x01, 0x9b, 0x35, 0x81, 0xef, 0x31, 0x81, 0x9f, 0x31, 0x81, 0x5f, 0x31, 0x81, - 0xcb, 0x98, 0xc0, 0xef, 0x98, 0xc0, 0x9f, 0x98, 0x80, 0x4d, 0x4c, 0xe0, 0x47, 0x42, 0xc0, 0x32, - 0x21, 0x60, 0x95, 0x10, 0xf0, 0x5c, 0x7a, 0x3c, 0x83, 0xbd, 0x6c, 0x66, 0xd7, 0xbf, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x8f, 0x20, 0x57, 0xb2, 0x8d, 0x02, 0x00, 0x00, -} - -func (this *QueryResultRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResultRequest) - if !ok { - that2, ok := that.(QueryResultRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.QueryID != that1.QueryID { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if this.Response == nil { - return false - } else if !this.Response.Equal(that1.Response) { - return false - } - if !this.Stats.Equal(that1.Stats) { - return false - } - return true -} -func (this *QueryResultRequest_HttpResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResultRequest_HttpResponse) - if !ok { - that2, ok := that.(QueryResultRequest_HttpResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.HttpResponse.Equal(that1.HttpResponse) { - return false - } - return true -} -func (this *QueryResultRequest_QueryResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResultRequest_QueryResponse) - if !ok { - that2, ok := that.(QueryResultRequest_QueryResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.QueryResponse.Equal(that1.QueryResponse) { - return false - } - return true -} -func (this *QueryResultResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResultResponse) - if !ok { - that2, ok := that.(QueryResultResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *QueryResultRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&frontendv2pb.QueryResultRequest{") - s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") - if this.Response != nil { - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - } - if this.Stats != nil { - s = append(s, "Stats: "+fmt.Sprintf("%#v", this.Stats)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryResultRequest_HttpResponse) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&frontendv2pb.QueryResultRequest_HttpResponse{` + - `HttpResponse:` + fmt.Sprintf("%#v", this.HttpResponse) + `}`}, ", ") - return s -} -func (this *QueryResultRequest_QueryResponse) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&frontendv2pb.QueryResultRequest_QueryResponse{` + - `QueryResponse:` + fmt.Sprintf("%#v", this.QueryResponse) + `}`}, ", ") - return s -} -func (this *QueryResultResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&frontendv2pb.QueryResultResponse{") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringFrontend(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// FrontendForQuerierClient is the client API for FrontendForQuerier service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type FrontendForQuerierClient interface { - QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) -} - -type frontendForQuerierClient struct { - cc *grpc.ClientConn -} - -func NewFrontendForQuerierClient(cc *grpc.ClientConn) FrontendForQuerierClient { - return &frontendForQuerierClient{cc} -} - -func (c *frontendForQuerierClient) QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) { - out := new(QueryResultResponse) - err := c.cc.Invoke(ctx, "/frontendv2pb.FrontendForQuerier/QueryResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// FrontendForQuerierServer is the server API for FrontendForQuerier service. -type FrontendForQuerierServer interface { - QueryResult(context.Context, *QueryResultRequest) (*QueryResultResponse, error) -} - -// UnimplementedFrontendForQuerierServer can be embedded to have forward compatible implementations. -type UnimplementedFrontendForQuerierServer struct { -} - -func (*UnimplementedFrontendForQuerierServer) QueryResult(ctx context.Context, req *QueryResultRequest) (*QueryResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryResult not implemented") -} - -func RegisterFrontendForQuerierServer(s *grpc.Server, srv FrontendForQuerierServer) { - s.RegisterService(&_FrontendForQuerier_serviceDesc, srv) -} - -func _FrontendForQuerier_QueryResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FrontendForQuerierServer).QueryResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/frontendv2pb.FrontendForQuerier/QueryResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FrontendForQuerierServer).QueryResult(ctx, req.(*QueryResultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _FrontendForQuerier_serviceDesc = grpc.ServiceDesc{ - ServiceName: "frontendv2pb.FrontendForQuerier", - HandlerType: (*FrontendForQuerierServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryResult", - Handler: _FrontendForQuerier_QueryResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto", -} - -func (m *QueryResultRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Stats != nil { - { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFrontend(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.QueryID != 0 { - i = encodeVarintFrontend(dAtA, i, uint64(m.QueryID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryResultRequest_HttpResponse) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResultRequest_HttpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.HttpResponse != nil { - { - size, err := m.HttpResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFrontend(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryResultRequest_QueryResponse) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResultRequest_QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.QueryResponse != nil { - { - size, err := m.QueryResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFrontend(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *QueryResultResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintFrontend(dAtA []byte, offset int, v uint64) int { - offset -= sovFrontend(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryResultRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QueryID != 0 { - n += 1 + sovFrontend(uint64(m.QueryID)) - } - if m.Response != nil { - n += m.Response.Size() - } - if m.Stats != nil { - l = m.Stats.Size() - n += 1 + l + sovFrontend(uint64(l)) - } - return n -} - -func (m *QueryResultRequest_HttpResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HttpResponse != nil { - l = m.HttpResponse.Size() - n += 1 + l + sovFrontend(uint64(l)) - } - return n -} -func (m *QueryResultRequest_QueryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QueryResponse != nil { - l = m.QueryResponse.Size() - n += 1 + l + sovFrontend(uint64(l)) - } - return n -} -func (m *QueryResultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovFrontend(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozFrontend(x uint64) (n int) { - return sovFrontend(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *QueryResultRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResultRequest{`, - `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "Stats", "stats.Stats", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResultRequest_HttpResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResultRequest_HttpResponse{`, - `HttpResponse:` + strings.Replace(fmt.Sprintf("%v", this.HttpResponse), "HTTPResponse", "httpgrpc.HTTPResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResultRequest_QueryResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResultRequest_QueryResponse{`, - `QueryResponse:` + strings.Replace(fmt.Sprintf("%v", this.QueryResponse), "QueryResponse", "queryrange.QueryResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResultResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResultResponse{`, - `}`, - }, "") - return s -} -func valueToStringFrontend(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *QueryResultRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryResultRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) - } - m.QueryID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFrontend - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFrontend - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &httpgrpc.HTTPResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResultRequest_HttpResponse{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFrontend - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFrontend - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Stats == nil { - m.Stats = &stats.Stats{} - } - if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFrontend - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFrontend - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &queryrange.QueryResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResultRequest_QueryResponse{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFrontend(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthFrontend - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthFrontend - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryResultResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFrontend - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipFrontend(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthFrontend - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthFrontend - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipFrontend(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFrontend - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFrontend - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFrontend - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthFrontend - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthFrontend - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowFrontend - } - 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 := skipFrontend(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthFrontend - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthFrontend = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFrontend = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/push/push.pb.go b/pkg/push/push.pb.go deleted file mode 100644 index 3b07d850ff162..0000000000000 --- a/pkg/push/push.pb.go +++ /dev/null @@ -1,1739 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/push/push.proto - -package push - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - 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" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PushRequest struct { - Streams []Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=Stream" json:"streams"` -} - -func (m *PushRequest) Reset() { *m = PushRequest{} } -func (*PushRequest) ProtoMessage() {} -func (*PushRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_35ec442956852c9e, []int{0} -} -func (m *PushRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PushRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PushRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushRequest.Merge(m, src) -} -func (m *PushRequest) XXX_Size() int { - return m.Size() -} -func (m *PushRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PushRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PushRequest proto.InternalMessageInfo - -type PushResponse struct { -} - -func (m *PushResponse) Reset() { *m = PushResponse{} } -func (*PushResponse) ProtoMessage() {} -func (*PushResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_35ec442956852c9e, []int{1} -} -func (m *PushResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PushResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PushResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PushResponse.Merge(m, src) -} -func (m *PushResponse) XXX_Size() int { - return m.Size() -} -func (m *PushResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PushResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PushResponse proto.InternalMessageInfo - -type StreamAdapter struct { - Labels string `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - Entries []EntryAdapter `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"` - // hash contains the original hash of the stream. - Hash uint64 `protobuf:"varint,3,opt,name=hash,proto3" json:"-"` -} - -func (m *StreamAdapter) Reset() { *m = StreamAdapter{} } -func (*StreamAdapter) ProtoMessage() {} -func (*StreamAdapter) Descriptor() ([]byte, []int) { - return fileDescriptor_35ec442956852c9e, []int{2} -} -func (m *StreamAdapter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamAdapter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamAdapter) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamAdapter.Merge(m, src) -} -func (m *StreamAdapter) XXX_Size() int { - return m.Size() -} -func (m *StreamAdapter) XXX_DiscardUnknown() { - xxx_messageInfo_StreamAdapter.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamAdapter proto.InternalMessageInfo - -func (m *StreamAdapter) GetLabels() string { - if m != nil { - return m.Labels - } - return "" -} - -func (m *StreamAdapter) GetEntries() []EntryAdapter { - if m != nil { - return m.Entries - } - return nil -} - -func (m *StreamAdapter) GetHash() uint64 { - if m != nil { - return m.Hash - } - return 0 -} - -type LabelPairAdapter struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelPairAdapter) Reset() { *m = LabelPairAdapter{} } -func (*LabelPairAdapter) ProtoMessage() {} -func (*LabelPairAdapter) Descriptor() ([]byte, []int) { - return fileDescriptor_35ec442956852c9e, []int{3} -} -func (m *LabelPairAdapter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelPairAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelPairAdapter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelPairAdapter) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelPairAdapter.Merge(m, src) -} -func (m *LabelPairAdapter) XXX_Size() int { - return m.Size() -} -func (m *LabelPairAdapter) XXX_DiscardUnknown() { - xxx_messageInfo_LabelPairAdapter.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelPairAdapter proto.InternalMessageInfo - -func (m *LabelPairAdapter) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *LabelPairAdapter) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -type EntryAdapter struct { - Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"ts"` - Line string `protobuf:"bytes,2,opt,name=line,proto3" json:"line"` - StructuredMetadata []LabelPairAdapter `protobuf:"bytes,3,rep,name=structuredMetadata,proto3" json:"structuredMetadata,omitempty"` - // This field shouldn't be used by clients to push data to Loki. - // It is only used by Loki to return parsed log lines in query responses. - // TODO: Remove this field from the write path Proto. - Parsed []LabelPairAdapter `protobuf:"bytes,4,rep,name=parsed,proto3" json:"parsed,omitempty"` -} - -func (m *EntryAdapter) Reset() { *m = EntryAdapter{} } -func (*EntryAdapter) ProtoMessage() {} -func (*EntryAdapter) Descriptor() ([]byte, []int) { - return fileDescriptor_35ec442956852c9e, []int{4} -} -func (m *EntryAdapter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EntryAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EntryAdapter.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EntryAdapter) XXX_Merge(src proto.Message) { - xxx_messageInfo_EntryAdapter.Merge(m, src) -} -func (m *EntryAdapter) XXX_Size() int { - return m.Size() -} -func (m *EntryAdapter) XXX_DiscardUnknown() { - xxx_messageInfo_EntryAdapter.DiscardUnknown(m) -} - -var xxx_messageInfo_EntryAdapter proto.InternalMessageInfo - -func (m *EntryAdapter) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *EntryAdapter) GetLine() string { - if m != nil { - return m.Line - } - return "" -} - -func (m *EntryAdapter) GetStructuredMetadata() []LabelPairAdapter { - if m != nil { - return m.StructuredMetadata - } - return nil -} - -func (m *EntryAdapter) GetParsed() []LabelPairAdapter { - if m != nil { - return m.Parsed - } - return nil -} - -func init() { - proto.RegisterType((*PushRequest)(nil), "logproto.PushRequest") - proto.RegisterType((*PushResponse)(nil), "logproto.PushResponse") - proto.RegisterType((*StreamAdapter)(nil), "logproto.StreamAdapter") - proto.RegisterType((*LabelPairAdapter)(nil), "logproto.LabelPairAdapter") - proto.RegisterType((*EntryAdapter)(nil), "logproto.EntryAdapter") -} - -func init() { proto.RegisterFile("pkg/push/push.proto", fileDescriptor_35ec442956852c9e) } - -var fileDescriptor_35ec442956852c9e = []byte{ - // 527 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xf5, 0x26, 0x6e, 0xda, 0x6e, 0x4a, 0xa9, 0x96, 0xb6, 0x18, 0xab, 0x5a, 0x47, 0x16, 0x87, - 0x1c, 0xc0, 0x96, 0xc2, 0x81, 0x0b, 0x97, 0x58, 0x42, 0xea, 0xa1, 0x48, 0x95, 0x41, 0x20, 0x71, - 0xdb, 0x34, 0x5b, 0xdb, 0xaa, 0xed, 0x35, 0xbb, 0x6b, 0xa4, 0xde, 0xf8, 0x84, 0xf2, 0x17, 0x7c, - 0x01, 0xdf, 0xd0, 0x63, 0x8e, 0x15, 0x07, 0x43, 0x9c, 0x0b, 0xca, 0xa9, 0x9f, 0x80, 0xbc, 0xb6, - 0x49, 0x28, 0x48, 0x5c, 0x36, 0x6f, 0x66, 0x67, 0xde, 0x7b, 0x99, 0x1d, 0xc3, 0x07, 0xd9, 0x45, - 0xe0, 0x66, 0xb9, 0x08, 0xd5, 0xe1, 0x64, 0x9c, 0x49, 0x86, 0xb6, 0x62, 0x16, 0x28, 0x64, 0xee, - 0x07, 0x2c, 0x60, 0x0a, 0xba, 0x15, 0xaa, 0xef, 0x4d, 0x2b, 0x60, 0x2c, 0x88, 0xa9, 0xab, 0xa2, - 0x49, 0x7e, 0xee, 0xca, 0x28, 0xa1, 0x42, 0x92, 0x24, 0xab, 0x0b, 0xec, 0x77, 0xb0, 0x7f, 0x9a, - 0x8b, 0xd0, 0xa7, 0x1f, 0x72, 0x2a, 0x24, 0x3a, 0x86, 0x9b, 0x42, 0x72, 0x4a, 0x12, 0x61, 0x80, - 0x41, 0x77, 0xd8, 0x1f, 0x3d, 0x74, 0x5a, 0x05, 0xe7, 0xb5, 0xba, 0x18, 0x4f, 0x49, 0x26, 0x29, - 0xf7, 0x0e, 0xbe, 0x15, 0x56, 0xaf, 0x4e, 0x2d, 0x0b, 0xab, 0xed, 0xf2, 0x5b, 0x60, 0xef, 0xc2, - 0x9d, 0x9a, 0x58, 0x64, 0x2c, 0x15, 0xd4, 0xfe, 0x0c, 0xe0, 0xbd, 0x3f, 0x18, 0x90, 0x0d, 0x7b, - 0x31, 0x99, 0xd0, 0xb8, 0x92, 0x02, 0xc3, 0x6d, 0x0f, 0x2e, 0x0b, 0xab, 0xc9, 0xf8, 0xcd, 0x2f, - 0x1a, 0xc3, 0x4d, 0x9a, 0x4a, 0x1e, 0x51, 0x61, 0x74, 0x94, 0x9f, 0xc3, 0x95, 0x9f, 0x97, 0xa9, - 0xe4, 0x97, 0xad, 0x9d, 0xfb, 0xd7, 0x85, 0xa5, 0x55, 0x46, 0x9a, 0x72, 0xbf, 0x05, 0xe8, 0x11, - 0xd4, 0x43, 0x22, 0x42, 0xa3, 0x3b, 0x00, 0x43, 0xdd, 0xdb, 0x58, 0x16, 0x16, 0x78, 0xea, 0xab, - 0x94, 0xfd, 0x02, 0xee, 0x9d, 0x54, 0x3a, 0xa7, 0x24, 0xe2, 0xad, 0x2b, 0x04, 0xf5, 0x94, 0x24, - 0xb4, 0xf6, 0xe4, 0x2b, 0x8c, 0xf6, 0xe1, 0xc6, 0x47, 0x12, 0xe7, 0xd4, 0xe8, 0xa8, 0x64, 0x1d, - 0xd8, 0x5f, 0x3b, 0x70, 0x67, 0xdd, 0x03, 0x3a, 0x86, 0xdb, 0xbf, 0xc7, 0xab, 0xfa, 0xfb, 0x23, - 0xd3, 0xa9, 0x1f, 0xc0, 0x69, 0x1f, 0xc0, 0x79, 0xd3, 0x56, 0x78, 0xbb, 0x8d, 0xe5, 0x8e, 0x14, - 0x57, 0xdf, 0x2d, 0xe0, 0xaf, 0x9a, 0xd1, 0x11, 0xd4, 0xe3, 0x28, 0x6d, 0xf4, 0xbc, 0xad, 0x65, - 0x61, 0xa9, 0xd8, 0x57, 0x27, 0xca, 0x20, 0x12, 0x92, 0xe7, 0x67, 0x32, 0xe7, 0x74, 0xfa, 0x8a, - 0x4a, 0x32, 0x25, 0x92, 0x18, 0x5d, 0x35, 0x1f, 0x73, 0x35, 0x9f, 0xbb, 0x7f, 0xcd, 0x7b, 0xdc, - 0x08, 0x1e, 0xfd, 0xdd, 0xfd, 0x84, 0x25, 0x91, 0xa4, 0x49, 0x26, 0x2f, 0xfd, 0x7f, 0x70, 0xa3, - 0x13, 0xd8, 0xcb, 0x08, 0x17, 0x74, 0x6a, 0xe8, 0xff, 0x55, 0x31, 0x1a, 0x95, 0xbd, 0xba, 0x63, - 0x8d, 0xb9, 0xe1, 0x18, 0x8d, 0x61, 0xaf, 0x5a, 0x0d, 0xca, 0xd1, 0x73, 0xa8, 0x57, 0x08, 0x1d, - 0xac, 0xf8, 0xd6, 0xb6, 0xd1, 0x3c, 0xbc, 0x9b, 0x6e, 0x76, 0x49, 0xf3, 0xde, 0xce, 0xe6, 0x58, - 0xbb, 0x99, 0x63, 0xed, 0x76, 0x8e, 0xc1, 0xa7, 0x12, 0x83, 0x2f, 0x25, 0x06, 0xd7, 0x25, 0x06, - 0xb3, 0x12, 0x83, 0x1f, 0x25, 0x06, 0x3f, 0x4b, 0xac, 0xdd, 0x96, 0x18, 0x5c, 0x2d, 0xb0, 0x36, - 0x5b, 0x60, 0xed, 0x66, 0x81, 0xb5, 0xf7, 0x83, 0x20, 0x92, 0x61, 0x3e, 0x71, 0xce, 0x58, 0xe2, - 0x06, 0x9c, 0x9c, 0x93, 0x94, 0xb8, 0x31, 0xbb, 0x88, 0xdc, 0xf6, 0xd3, 0x9a, 0xf4, 0x94, 0xda, - 0xb3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xaa, 0x57, 0xd3, 0x6d, 0x03, 0x00, 0x00, -} - -func (this *PushRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PushRequest) - if !ok { - that2, ok := that.(PushRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Streams) != len(that1.Streams) { - return false - } - for i := range this.Streams { - if !this.Streams[i].Equal(that1.Streams[i]) { - return false - } - } - return true -} -func (this *PushResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PushResponse) - if !ok { - that2, ok := that.(PushResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *StreamAdapter) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StreamAdapter) - if !ok { - that2, ok := that.(StreamAdapter) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Labels != that1.Labels { - return false - } - if len(this.Entries) != len(that1.Entries) { - return false - } - for i := range this.Entries { - if !this.Entries[i].Equal(&that1.Entries[i]) { - return false - } - } - if this.Hash != that1.Hash { - return false - } - return true -} -func (this *LabelPairAdapter) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LabelPairAdapter) - if !ok { - that2, ok := that.(LabelPairAdapter) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (this *EntryAdapter) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*EntryAdapter) - if !ok { - that2, ok := that.(EntryAdapter) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Timestamp.Equal(that1.Timestamp) { - return false - } - if this.Line != that1.Line { - return false - } - if len(this.StructuredMetadata) != len(that1.StructuredMetadata) { - return false - } - for i := range this.StructuredMetadata { - if !this.StructuredMetadata[i].Equal(&that1.StructuredMetadata[i]) { - return false - } - } - if len(this.Parsed) != len(that1.Parsed) { - return false - } - for i := range this.Parsed { - if !this.Parsed[i].Equal(&that1.Parsed[i]) { - return false - } - } - return true -} -func (this *PushRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&push.PushRequest{") - s = append(s, "Streams: "+fmt.Sprintf("%#v", this.Streams)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PushResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&push.PushResponse{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamAdapter) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&push.StreamAdapter{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Entries != nil { - vs := make([]*EntryAdapter, len(this.Entries)) - for i := range vs { - vs[i] = &this.Entries[i] - } - s = append(s, "Entries: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "Hash: "+fmt.Sprintf("%#v", this.Hash)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LabelPairAdapter) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&push.LabelPairAdapter{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EntryAdapter) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&push.EntryAdapter{") - s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") - s = append(s, "Line: "+fmt.Sprintf("%#v", this.Line)+",\n") - if this.StructuredMetadata != nil { - vs := make([]*LabelPairAdapter, len(this.StructuredMetadata)) - for i := range vs { - vs[i] = &this.StructuredMetadata[i] - } - s = append(s, "StructuredMetadata: "+fmt.Sprintf("%#v", vs)+",\n") - } - if this.Parsed != nil { - vs := make([]*LabelPairAdapter, len(this.Parsed)) - for i := range vs { - vs[i] = &this.Parsed[i] - } - s = append(s, "Parsed: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringPush(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// PusherClient is the client API for Pusher service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type PusherClient interface { - Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) -} - -type pusherClient struct { - cc *grpc.ClientConn -} - -func NewPusherClient(cc *grpc.ClientConn) PusherClient { - return &pusherClient{cc} -} - -func (c *pusherClient) Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) { - out := new(PushResponse) - err := c.cc.Invoke(ctx, "/logproto.Pusher/Push", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PusherServer is the server API for Pusher service. -type PusherServer interface { - Push(context.Context, *PushRequest) (*PushResponse, error) -} - -// UnimplementedPusherServer can be embedded to have forward compatible implementations. -type UnimplementedPusherServer struct { -} - -func (*UnimplementedPusherServer) Push(ctx context.Context, req *PushRequest) (*PushResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Push not implemented") -} - -func RegisterPusherServer(s *grpc.Server, srv PusherServer) { - s.RegisterService(&_Pusher_serviceDesc, srv) -} - -func _Pusher_Push_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PushRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PusherServer).Push(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/logproto.Pusher/Push", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PusherServer).Push(ctx, req.(*PushRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Pusher_serviceDesc = grpc.ServiceDesc{ - ServiceName: "logproto.Pusher", - HandlerType: (*PusherServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Push", - Handler: _Pusher_Push_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/push/push.proto", -} - -func (m *PushRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PushRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Streams) > 0 { - for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Streams[iNdEx].Size() - i -= size - if _, err := m.Streams[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintPush(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PushResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PushResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *StreamAdapter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StreamAdapter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StreamAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hash != 0 { - i = encodeVarintPush(dAtA, i, uint64(m.Hash)) - i-- - dAtA[i] = 0x18 - } - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPush(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - i -= len(m.Labels) - copy(dAtA[i:], m.Labels) - i = encodeVarintPush(dAtA, i, uint64(len(m.Labels))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LabelPairAdapter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelPairAdapter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelPairAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintPush(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 = encodeVarintPush(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EntryAdapter) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EntryAdapter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EntryAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Parsed) > 0 { - for iNdEx := len(m.Parsed) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Parsed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPush(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.StructuredMetadata) > 0 { - for iNdEx := len(m.StructuredMetadata) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StructuredMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPush(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Line) > 0 { - i -= len(m.Line) - copy(dAtA[i:], m.Line) - i = encodeVarintPush(dAtA, i, uint64(len(m.Line))) - i-- - dAtA[i] = 0x12 - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintPush(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintPush(dAtA []byte, offset int, v uint64) int { - offset -= sovPush(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PushRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Streams) > 0 { - for _, e := range m.Streams { - l = e.Size() - n += 1 + l + sovPush(uint64(l)) - } - } - return n -} - -func (m *PushResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *StreamAdapter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Labels) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovPush(uint64(l)) - } - } - if m.Hash != 0 { - n += 1 + sovPush(uint64(m.Hash)) - } - return n -} - -func (m *LabelPairAdapter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - return n -} - -func (m *EntryAdapter) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovPush(uint64(l)) - l = len(m.Line) - if l > 0 { - n += 1 + l + sovPush(uint64(l)) - } - if len(m.StructuredMetadata) > 0 { - for _, e := range m.StructuredMetadata { - l = e.Size() - n += 1 + l + sovPush(uint64(l)) - } - } - if len(m.Parsed) > 0 { - for _, e := range m.Parsed { - l = e.Size() - n += 1 + l + sovPush(uint64(l)) - } - } - return n -} - -func sovPush(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPush(x uint64) (n int) { - return sovPush(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PushRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PushRequest{`, - `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, - `}`, - }, "") - return s -} -func (this *PushResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PushResponse{`, - `}`, - }, "") - return s -} -func (this *StreamAdapter) String() string { - if this == nil { - return "nil" - } - repeatedStringForEntries := "[]EntryAdapter{" - for _, f := range this.Entries { - repeatedStringForEntries += strings.Replace(strings.Replace(f.String(), "EntryAdapter", "EntryAdapter", 1), `&`, ``, 1) + "," - } - repeatedStringForEntries += "}" - s := strings.Join([]string{`&StreamAdapter{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Entries:` + repeatedStringForEntries + `,`, - `Hash:` + fmt.Sprintf("%v", this.Hash) + `,`, - `}`, - }, "") - return s -} -func (this *LabelPairAdapter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LabelPairAdapter{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *EntryAdapter) String() string { - if this == nil { - return "nil" - } - repeatedStringForStructuredMetadata := "[]LabelPairAdapter{" - for _, f := range this.StructuredMetadata { - repeatedStringForStructuredMetadata += strings.Replace(strings.Replace(f.String(), "LabelPairAdapter", "LabelPairAdapter", 1), `&`, ``, 1) + "," - } - repeatedStringForStructuredMetadata += "}" - repeatedStringForParsed := "[]LabelPairAdapter{" - for _, f := range this.Parsed { - repeatedStringForParsed += strings.Replace(strings.Replace(f.String(), "LabelPairAdapter", "LabelPairAdapter", 1), `&`, ``, 1) + "," - } - repeatedStringForParsed += "}" - s := strings.Join([]string{`&EntryAdapter{`, - `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Line:` + fmt.Sprintf("%v", this.Line) + `,`, - `StructuredMetadata:` + repeatedStringForStructuredMetadata + `,`, - `Parsed:` + repeatedStringForParsed + `,`, - `}`, - }, "") - return s -} -func valueToStringPush(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *PushRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PushRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PushRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Streams = append(m.Streams, Stream{}) - if err := m.Streams[len(m.Streams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PushResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PushResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PushResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamAdapter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StreamAdapter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamAdapter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, EntryAdapter{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelPairAdapter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelPairAdapter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelPairAdapter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EntryAdapter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EntryAdapter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EntryAdapter: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Line = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructuredMetadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StructuredMetadata = append(m.StructuredMetadata, LabelPairAdapter{}) - if err := m.StructuredMetadata[len(m.StructuredMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parsed", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPush - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPush - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPush - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parsed = append(m.Parsed, LabelPairAdapter{}) - if err := m.Parsed[len(m.Parsed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPush(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthPush - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPush(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPush - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthPush - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPush - } - 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 := skipPush(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthPush - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthPush = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPush = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/querier/plan.go b/pkg/querier/plan.go new file mode 100644 index 0000000000000..a5f2c13eef760 --- /dev/null +++ b/pkg/querier/plan.go @@ -0,0 +1,30 @@ +package querier + +import ( + "bytes" + + "github.com/grafana/loki/pkg/logql/syntax" +) + +type QueryPlan struct { + AST syntax.Expr +} + +func (t QueryPlan) Marshal() ([]byte, error) { + var buf bytes.Buffer + err := syntax.EncodeJSON(t.AST, &buf) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func (t *QueryPlan) MarshalTo(data []byte) (n int, err error) { +} + +func (t *QueryPlan) Unmarshal(data []byte) error {} +func (t *QueryPlan) Size() int {} + +func (t QueryPlan) MarshalJSON() ([]byte, error) {} +func (t *QueryPlan) UnmarshalJSON(data []byte) error {} diff --git a/pkg/querier/queryrange/queryrange.pb.go b/pkg/querier/queryrange/queryrange.pb.go deleted file mode 100644 index f3955da153bf9..0000000000000 --- a/pkg/querier/queryrange/queryrange.pb.go +++ /dev/null @@ -1,7466 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/querier/queryrange/queryrange.proto - -package queryrange - -import ( - fmt "fmt" - rpc "github.com/gogo/googleapis/google/rpc" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" - logproto "github.com/grafana/loki/pkg/logproto" - stats "github.com/grafana/loki/pkg/logqlmodel/stats" - _ "github.com/grafana/loki/pkg/push" - github_com_grafana_loki_pkg_push "github.com/grafana/loki/pkg/push" - queryrangebase "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" - _ "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" - github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type LokiRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - Step int64 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` - Interval int64 `protobuf:"varint,9,opt,name=interval,proto3" json:"interval,omitempty"` - StartTs time.Time `protobuf:"bytes,4,opt,name=startTs,proto3,stdtime" json:"startTs"` - EndTs time.Time `protobuf:"bytes,5,opt,name=endTs,proto3,stdtime" json:"endTs"` - Direction logproto.Direction `protobuf:"varint,6,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` - Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` - Shards []string `protobuf:"bytes,8,rep,name=shards,proto3" json:"shards"` -} - -func (m *LokiRequest) Reset() { *m = LokiRequest{} } -func (*LokiRequest) ProtoMessage() {} -func (*LokiRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{0} -} -func (m *LokiRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiRequest.Merge(m, src) -} -func (m *LokiRequest) XXX_Size() int { - return m.Size() -} -func (m *LokiRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LokiRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiRequest proto.InternalMessageInfo - -func (m *LokiRequest) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *LokiRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *LokiRequest) GetStep() int64 { - if m != nil { - return m.Step - } - return 0 -} - -func (m *LokiRequest) GetInterval() int64 { - if m != nil { - return m.Interval - } - return 0 -} - -func (m *LokiRequest) GetStartTs() time.Time { - if m != nil { - return m.StartTs - } - return time.Time{} -} - -func (m *LokiRequest) GetEndTs() time.Time { - if m != nil { - return m.EndTs - } - return time.Time{} -} - -func (m *LokiRequest) GetDirection() logproto.Direction { - if m != nil { - return m.Direction - } - return logproto.FORWARD -} - -func (m *LokiRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *LokiRequest) GetShards() []string { - if m != nil { - return m.Shards - } - return nil -} - -type LokiInstantRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - TimeTs time.Time `protobuf:"bytes,3,opt,name=timeTs,proto3,stdtime" json:"timeTs"` - Direction logproto.Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` - Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` - Shards []string `protobuf:"bytes,6,rep,name=shards,proto3" json:"shards"` -} - -func (m *LokiInstantRequest) Reset() { *m = LokiInstantRequest{} } -func (*LokiInstantRequest) ProtoMessage() {} -func (*LokiInstantRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{1} -} -func (m *LokiInstantRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiInstantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiInstantRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiInstantRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiInstantRequest.Merge(m, src) -} -func (m *LokiInstantRequest) XXX_Size() int { - return m.Size() -} -func (m *LokiInstantRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LokiInstantRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiInstantRequest proto.InternalMessageInfo - -func (m *LokiInstantRequest) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *LokiInstantRequest) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *LokiInstantRequest) GetTimeTs() time.Time { - if m != nil { - return m.TimeTs - } - return time.Time{} -} - -func (m *LokiInstantRequest) GetDirection() logproto.Direction { - if m != nil { - return m.Direction - } - return logproto.FORWARD -} - -func (m *LokiInstantRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *LokiInstantRequest) GetShards() []string { - if m != nil { - return m.Shards - } - return nil -} - -type LokiResponse struct { - Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` - Data LokiData `protobuf:"bytes,2,opt,name=Data,proto3" json:"data,omitempty"` - ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` - Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` - Direction logproto.Direction `protobuf:"varint,5,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` - Limit uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"` - Version uint32 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"` - Statistics stats.Result `protobuf:"bytes,8,opt,name=statistics,proto3" json:"statistics"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,9,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` -} - -func (m *LokiResponse) Reset() { *m = LokiResponse{} } -func (*LokiResponse) ProtoMessage() {} -func (*LokiResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{2} -} -func (m *LokiResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiResponse.Merge(m, src) -} -func (m *LokiResponse) XXX_Size() int { - return m.Size() -} -func (m *LokiResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LokiResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiResponse proto.InternalMessageInfo - -func (m *LokiResponse) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *LokiResponse) GetData() LokiData { - if m != nil { - return m.Data - } - return LokiData{} -} - -func (m *LokiResponse) GetErrorType() string { - if m != nil { - return m.ErrorType - } - return "" -} - -func (m *LokiResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *LokiResponse) GetDirection() logproto.Direction { - if m != nil { - return m.Direction - } - return logproto.FORWARD -} - -func (m *LokiResponse) GetLimit() uint32 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *LokiResponse) GetVersion() uint32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *LokiResponse) GetStatistics() stats.Result { - if m != nil { - return m.Statistics - } - return stats.Result{} -} - -type LokiSeriesRequest struct { - Match []string `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"` - StartTs time.Time `protobuf:"bytes,2,opt,name=startTs,proto3,stdtime" json:"startTs"` - EndTs time.Time `protobuf:"bytes,3,opt,name=endTs,proto3,stdtime" json:"endTs"` - Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` - Shards []string `protobuf:"bytes,5,rep,name=shards,proto3" json:"shards"` -} - -func (m *LokiSeriesRequest) Reset() { *m = LokiSeriesRequest{} } -func (*LokiSeriesRequest) ProtoMessage() {} -func (*LokiSeriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{3} -} -func (m *LokiSeriesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiSeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiSeriesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiSeriesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiSeriesRequest.Merge(m, src) -} -func (m *LokiSeriesRequest) XXX_Size() int { - return m.Size() -} -func (m *LokiSeriesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LokiSeriesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiSeriesRequest proto.InternalMessageInfo - -func (m *LokiSeriesRequest) GetMatch() []string { - if m != nil { - return m.Match - } - return nil -} - -func (m *LokiSeriesRequest) GetStartTs() time.Time { - if m != nil { - return m.StartTs - } - return time.Time{} -} - -func (m *LokiSeriesRequest) GetEndTs() time.Time { - if m != nil { - return m.EndTs - } - return time.Time{} -} - -func (m *LokiSeriesRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *LokiSeriesRequest) GetShards() []string { - if m != nil { - return m.Shards - } - return nil -} - -type LokiSeriesResponse struct { - Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` - Data []logproto.SeriesIdentifier `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"` - Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,4,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` - Statistics stats.Result `protobuf:"bytes,5,opt,name=statistics,proto3" json:"statistics"` -} - -func (m *LokiSeriesResponse) Reset() { *m = LokiSeriesResponse{} } -func (*LokiSeriesResponse) ProtoMessage() {} -func (*LokiSeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{4} -} -func (m *LokiSeriesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiSeriesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiSeriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiSeriesResponse.Merge(m, src) -} -func (m *LokiSeriesResponse) XXX_Size() int { - return m.Size() -} -func (m *LokiSeriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LokiSeriesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiSeriesResponse proto.InternalMessageInfo - -func (m *LokiSeriesResponse) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *LokiSeriesResponse) GetData() []logproto.SeriesIdentifier { - if m != nil { - return m.Data - } - return nil -} - -func (m *LokiSeriesResponse) GetVersion() uint32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *LokiSeriesResponse) GetStatistics() stats.Result { - if m != nil { - return m.Statistics - } - return stats.Result{} -} - -type LokiLabelNamesResponse struct { - Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` - Data []string `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"` - Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,4,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` - Statistics stats.Result `protobuf:"bytes,5,opt,name=statistics,proto3" json:"statistics"` -} - -func (m *LokiLabelNamesResponse) Reset() { *m = LokiLabelNamesResponse{} } -func (*LokiLabelNamesResponse) ProtoMessage() {} -func (*LokiLabelNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{5} -} -func (m *LokiLabelNamesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiLabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiLabelNamesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiLabelNamesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiLabelNamesResponse.Merge(m, src) -} -func (m *LokiLabelNamesResponse) XXX_Size() int { - return m.Size() -} -func (m *LokiLabelNamesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LokiLabelNamesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiLabelNamesResponse proto.InternalMessageInfo - -func (m *LokiLabelNamesResponse) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *LokiLabelNamesResponse) GetData() []string { - if m != nil { - return m.Data - } - return nil -} - -func (m *LokiLabelNamesResponse) GetVersion() uint32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *LokiLabelNamesResponse) GetStatistics() stats.Result { - if m != nil { - return m.Statistics - } - return stats.Result{} -} - -type LokiData struct { - ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` - Result []github_com_grafana_loki_pkg_push.Stream `protobuf:"bytes,2,rep,name=Result,proto3,customtype=github.com/grafana/loki/pkg/push.Stream" json:"result"` -} - -func (m *LokiData) Reset() { *m = LokiData{} } -func (*LokiData) ProtoMessage() {} -func (*LokiData) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{6} -} -func (m *LokiData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiData) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiData.Merge(m, src) -} -func (m *LokiData) XXX_Size() int { - return m.Size() -} -func (m *LokiData) XXX_DiscardUnknown() { - xxx_messageInfo_LokiData.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiData proto.InternalMessageInfo - -func (m *LokiData) GetResultType() string { - if m != nil { - return m.ResultType - } - return "" -} - -// LokiPromResponse wraps a Prometheus response with statistics. -type LokiPromResponse struct { - Response *queryrangebase.PrometheusResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Statistics stats.Result `protobuf:"bytes,2,opt,name=statistics,proto3" json:"statistics"` -} - -func (m *LokiPromResponse) Reset() { *m = LokiPromResponse{} } -func (*LokiPromResponse) ProtoMessage() {} -func (*LokiPromResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{7} -} -func (m *LokiPromResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LokiPromResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LokiPromResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LokiPromResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LokiPromResponse.Merge(m, src) -} -func (m *LokiPromResponse) XXX_Size() int { - return m.Size() -} -func (m *LokiPromResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LokiPromResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LokiPromResponse proto.InternalMessageInfo - -func (m *LokiPromResponse) GetResponse() *queryrangebase.PrometheusResponse { - if m != nil { - return m.Response - } - return nil -} - -func (m *LokiPromResponse) GetStatistics() stats.Result { - if m != nil { - return m.Statistics - } - return stats.Result{} -} - -type IndexStatsResponse struct { - Response *github_com_grafana_loki_pkg_logproto.IndexStatsResponse `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.IndexStatsResponse" json:"response,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` -} - -func (m *IndexStatsResponse) Reset() { *m = IndexStatsResponse{} } -func (*IndexStatsResponse) ProtoMessage() {} -func (*IndexStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{8} -} -func (m *IndexStatsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexStatsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IndexStatsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexStatsResponse.Merge(m, src) -} -func (m *IndexStatsResponse) XXX_Size() int { - return m.Size() -} -func (m *IndexStatsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IndexStatsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexStatsResponse proto.InternalMessageInfo - -type VolumeResponse struct { - Response *github_com_grafana_loki_pkg_logproto.VolumeResponse `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.VolumeResponse" json:"response,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` -} - -func (m *VolumeResponse) Reset() { *m = VolumeResponse{} } -func (*VolumeResponse) ProtoMessage() {} -func (*VolumeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{9} -} -func (m *VolumeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VolumeResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VolumeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VolumeResponse.Merge(m, src) -} -func (m *VolumeResponse) XXX_Size() int { - return m.Size() -} -func (m *VolumeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VolumeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_VolumeResponse proto.InternalMessageInfo - -type TopKSketchesResponse struct { - Response *github_com_grafana_loki_pkg_logproto.TopKMatrix `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.TopKMatrix" json:"response,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` -} - -func (m *TopKSketchesResponse) Reset() { *m = TopKSketchesResponse{} } -func (*TopKSketchesResponse) ProtoMessage() {} -func (*TopKSketchesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{10} -} -func (m *TopKSketchesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TopKSketchesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TopKSketchesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TopKSketchesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TopKSketchesResponse.Merge(m, src) -} -func (m *TopKSketchesResponse) XXX_Size() int { - return m.Size() -} -func (m *TopKSketchesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TopKSketchesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TopKSketchesResponse proto.InternalMessageInfo - -type QuantileSketchResponse struct { - Response *github_com_grafana_loki_pkg_logproto.QuantileSketchMatrix `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.QuantileSketchMatrix" json:"response,omitempty"` - Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` -} - -func (m *QuantileSketchResponse) Reset() { *m = QuantileSketchResponse{} } -func (*QuantileSketchResponse) ProtoMessage() {} -func (*QuantileSketchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{11} -} -func (m *QuantileSketchResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuantileSketchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuantileSketchResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuantileSketchResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuantileSketchResponse.Merge(m, src) -} -func (m *QuantileSketchResponse) XXX_Size() int { - return m.Size() -} -func (m *QuantileSketchResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuantileSketchResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuantileSketchResponse proto.InternalMessageInfo - -type QueryResponse struct { - Status *rpc.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // Types that are valid to be assigned to Response: - // *QueryResponse_Series - // *QueryResponse_Labels - // *QueryResponse_Stats - // *QueryResponse_Prom - // *QueryResponse_Streams - // *QueryResponse_Volume - // *QueryResponse_TopkSketches - // *QueryResponse_QuantileSketches - Response isQueryResponse_Response `protobuf_oneof:"response"` -} - -func (m *QueryResponse) Reset() { *m = QueryResponse{} } -func (*QueryResponse) ProtoMessage() {} -func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{12} -} -func (m *QueryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResponse.Merge(m, src) -} -func (m *QueryResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResponse proto.InternalMessageInfo - -type isQueryResponse_Response interface { - isQueryResponse_Response() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryResponse_Series struct { - Series *LokiSeriesResponse `protobuf:"bytes,2,opt,name=series,proto3,oneof"` -} -type QueryResponse_Labels struct { - Labels *LokiLabelNamesResponse `protobuf:"bytes,3,opt,name=labels,proto3,oneof"` -} -type QueryResponse_Stats struct { - Stats *IndexStatsResponse `protobuf:"bytes,4,opt,name=stats,proto3,oneof"` -} -type QueryResponse_Prom struct { - Prom *LokiPromResponse `protobuf:"bytes,5,opt,name=prom,proto3,oneof"` -} -type QueryResponse_Streams struct { - Streams *LokiResponse `protobuf:"bytes,6,opt,name=streams,proto3,oneof"` -} -type QueryResponse_Volume struct { - Volume *VolumeResponse `protobuf:"bytes,7,opt,name=volume,proto3,oneof"` -} -type QueryResponse_TopkSketches struct { - TopkSketches *TopKSketchesResponse `protobuf:"bytes,8,opt,name=topkSketches,proto3,oneof"` -} -type QueryResponse_QuantileSketches struct { - QuantileSketches *QuantileSketchResponse `protobuf:"bytes,9,opt,name=quantileSketches,proto3,oneof"` -} - -func (*QueryResponse_Series) isQueryResponse_Response() {} -func (*QueryResponse_Labels) isQueryResponse_Response() {} -func (*QueryResponse_Stats) isQueryResponse_Response() {} -func (*QueryResponse_Prom) isQueryResponse_Response() {} -func (*QueryResponse_Streams) isQueryResponse_Response() {} -func (*QueryResponse_Volume) isQueryResponse_Response() {} -func (*QueryResponse_TopkSketches) isQueryResponse_Response() {} -func (*QueryResponse_QuantileSketches) isQueryResponse_Response() {} - -func (m *QueryResponse) GetResponse() isQueryResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *QueryResponse) GetStatus() *rpc.Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *QueryResponse) GetSeries() *LokiSeriesResponse { - if x, ok := m.GetResponse().(*QueryResponse_Series); ok { - return x.Series - } - return nil -} - -func (m *QueryResponse) GetLabels() *LokiLabelNamesResponse { - if x, ok := m.GetResponse().(*QueryResponse_Labels); ok { - return x.Labels - } - return nil -} - -func (m *QueryResponse) GetStats() *IndexStatsResponse { - if x, ok := m.GetResponse().(*QueryResponse_Stats); ok { - return x.Stats - } - return nil -} - -func (m *QueryResponse) GetProm() *LokiPromResponse { - if x, ok := m.GetResponse().(*QueryResponse_Prom); ok { - return x.Prom - } - return nil -} - -func (m *QueryResponse) GetStreams() *LokiResponse { - if x, ok := m.GetResponse().(*QueryResponse_Streams); ok { - return x.Streams - } - return nil -} - -func (m *QueryResponse) GetVolume() *VolumeResponse { - if x, ok := m.GetResponse().(*QueryResponse_Volume); ok { - return x.Volume - } - return nil -} - -func (m *QueryResponse) GetTopkSketches() *TopKSketchesResponse { - if x, ok := m.GetResponse().(*QueryResponse_TopkSketches); ok { - return x.TopkSketches - } - return nil -} - -func (m *QueryResponse) GetQuantileSketches() *QuantileSketchResponse { - if x, ok := m.GetResponse().(*QueryResponse_QuantileSketches); ok { - return x.QuantileSketches - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryResponse_Series)(nil), - (*QueryResponse_Labels)(nil), - (*QueryResponse_Stats)(nil), - (*QueryResponse_Prom)(nil), - (*QueryResponse_Streams)(nil), - (*QueryResponse_Volume)(nil), - (*QueryResponse_TopkSketches)(nil), - (*QueryResponse_QuantileSketches)(nil), - } -} - -type QueryRequest struct { - // Types that are valid to be assigned to Request: - // *QueryRequest_Series - // *QueryRequest_Labels - // *QueryRequest_Stats - // *QueryRequest_Instant - // *QueryRequest_Streams - // *QueryRequest_Volume - Request isQueryRequest_Request `protobuf_oneof:"request"` - Metadata map[string]string `protobuf:"bytes,7,rep,name=metadata,proto3" json:"metadata" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *QueryRequest) Reset() { *m = QueryRequest{} } -func (*QueryRequest) ProtoMessage() {} -func (*QueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_51b9d53b40d11902, []int{13} -} -func (m *QueryRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRequest.Merge(m, src) -} -func (m *QueryRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryRequest proto.InternalMessageInfo - -type isQueryRequest_Request interface { - isQueryRequest_Request() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type QueryRequest_Series struct { - Series *LokiSeriesRequest `protobuf:"bytes,1,opt,name=series,proto3,oneof"` -} -type QueryRequest_Labels struct { - Labels *logproto.LabelRequest `protobuf:"bytes,2,opt,name=labels,proto3,oneof"` -} -type QueryRequest_Stats struct { - Stats *logproto.IndexStatsRequest `protobuf:"bytes,3,opt,name=stats,proto3,oneof"` -} -type QueryRequest_Instant struct { - Instant *LokiInstantRequest `protobuf:"bytes,4,opt,name=instant,proto3,oneof"` -} -type QueryRequest_Streams struct { - Streams *LokiRequest `protobuf:"bytes,5,opt,name=streams,proto3,oneof"` -} -type QueryRequest_Volume struct { - Volume *logproto.VolumeRequest `protobuf:"bytes,6,opt,name=volume,proto3,oneof"` -} - -func (*QueryRequest_Series) isQueryRequest_Request() {} -func (*QueryRequest_Labels) isQueryRequest_Request() {} -func (*QueryRequest_Stats) isQueryRequest_Request() {} -func (*QueryRequest_Instant) isQueryRequest_Request() {} -func (*QueryRequest_Streams) isQueryRequest_Request() {} -func (*QueryRequest_Volume) isQueryRequest_Request() {} - -func (m *QueryRequest) GetRequest() isQueryRequest_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *QueryRequest) GetSeries() *LokiSeriesRequest { - if x, ok := m.GetRequest().(*QueryRequest_Series); ok { - return x.Series - } - return nil -} - -func (m *QueryRequest) GetLabels() *logproto.LabelRequest { - if x, ok := m.GetRequest().(*QueryRequest_Labels); ok { - return x.Labels - } - return nil -} - -func (m *QueryRequest) GetStats() *logproto.IndexStatsRequest { - if x, ok := m.GetRequest().(*QueryRequest_Stats); ok { - return x.Stats - } - return nil -} - -func (m *QueryRequest) GetInstant() *LokiInstantRequest { - if x, ok := m.GetRequest().(*QueryRequest_Instant); ok { - return x.Instant - } - return nil -} - -func (m *QueryRequest) GetStreams() *LokiRequest { - if x, ok := m.GetRequest().(*QueryRequest_Streams); ok { - return x.Streams - } - return nil -} - -func (m *QueryRequest) GetVolume() *logproto.VolumeRequest { - if x, ok := m.GetRequest().(*QueryRequest_Volume); ok { - return x.Volume - } - return nil -} - -func (m *QueryRequest) GetMetadata() map[string]string { - if m != nil { - return m.Metadata - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryRequest_Series)(nil), - (*QueryRequest_Labels)(nil), - (*QueryRequest_Stats)(nil), - (*QueryRequest_Instant)(nil), - (*QueryRequest_Streams)(nil), - (*QueryRequest_Volume)(nil), - } -} - -func init() { - proto.RegisterType((*LokiRequest)(nil), "queryrange.LokiRequest") - proto.RegisterType((*LokiInstantRequest)(nil), "queryrange.LokiInstantRequest") - proto.RegisterType((*LokiResponse)(nil), "queryrange.LokiResponse") - proto.RegisterType((*LokiSeriesRequest)(nil), "queryrange.LokiSeriesRequest") - proto.RegisterType((*LokiSeriesResponse)(nil), "queryrange.LokiSeriesResponse") - proto.RegisterType((*LokiLabelNamesResponse)(nil), "queryrange.LokiLabelNamesResponse") - proto.RegisterType((*LokiData)(nil), "queryrange.LokiData") - proto.RegisterType((*LokiPromResponse)(nil), "queryrange.LokiPromResponse") - proto.RegisterType((*IndexStatsResponse)(nil), "queryrange.IndexStatsResponse") - proto.RegisterType((*VolumeResponse)(nil), "queryrange.VolumeResponse") - proto.RegisterType((*TopKSketchesResponse)(nil), "queryrange.TopKSketchesResponse") - proto.RegisterType((*QuantileSketchResponse)(nil), "queryrange.QuantileSketchResponse") - proto.RegisterType((*QueryResponse)(nil), "queryrange.QueryResponse") - proto.RegisterType((*QueryRequest)(nil), "queryrange.QueryRequest") - proto.RegisterMapType((map[string]string)(nil), "queryrange.QueryRequest.MetadataEntry") -} - -func init() { - proto.RegisterFile("pkg/querier/queryrange/queryrange.proto", fileDescriptor_51b9d53b40d11902) -} - -var fileDescriptor_51b9d53b40d11902 = []byte{ - // 1458 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x1b, 0xf7, 0xfa, 0x33, 0x9e, 0x34, 0x79, 0xfb, 0x4e, 0xa2, 0x74, 0xdf, 0xb4, 0xef, 0xae, 0x65, - 0x89, 0xd6, 0x20, 0x58, 0x53, 0xa7, 0xf4, 0x13, 0x10, 0x5d, 0xda, 0xca, 0x15, 0x2d, 0x6a, 0x37, - 0x11, 0x07, 0x6e, 0x13, 0x7b, 0x62, 0x2f, 0xf6, 0x7a, 0x37, 0x3b, 0xe3, 0xa8, 0xb9, 0xf1, 0x07, - 0x80, 0xd4, 0xbf, 0x02, 0x21, 0x51, 0x21, 0x71, 0xe5, 0xc8, 0xa9, 0xc7, 0x1c, 0xab, 0x48, 0x18, - 0xea, 0x72, 0x80, 0x9c, 0xfa, 0x27, 0xa0, 0xf9, 0xd8, 0xf5, 0xac, 0xed, 0xb4, 0x76, 0xb9, 0xb4, - 0x12, 0x97, 0x64, 0x3e, 0x9e, 0xdf, 0xec, 0x3c, 0xbf, 0xe7, 0xf7, 0x3c, 0x33, 0x63, 0x70, 0x2e, - 0xe8, 0xb4, 0xaa, 0xbb, 0x7d, 0x1c, 0xba, 0x38, 0xe4, 0xff, 0xf7, 0x43, 0xd4, 0x6b, 0x61, 0xa5, - 0x69, 0x05, 0xa1, 0x4f, 0x7d, 0x08, 0x46, 0x23, 0xeb, 0xb5, 0x96, 0x4b, 0xdb, 0xfd, 0x6d, 0xab, - 0xe1, 0x7b, 0xd5, 0x96, 0xdf, 0xf2, 0xab, 0x2d, 0xdf, 0x6f, 0x75, 0x31, 0x0a, 0x5c, 0x22, 0x9b, - 0xd5, 0x30, 0x68, 0x54, 0x09, 0x45, 0xb4, 0x4f, 0x04, 0x7e, 0x7d, 0x95, 0x19, 0xf2, 0x26, 0x87, - 0xc8, 0x51, 0x53, 0x9a, 0xf3, 0xde, 0x76, 0x7f, 0xa7, 0x4a, 0x5d, 0x0f, 0x13, 0x8a, 0xbc, 0x40, - 0x1a, 0x9c, 0x66, 0xfb, 0xeb, 0xfa, 0x2d, 0x81, 0x8c, 0x1a, 0x72, 0xf2, 0x7f, 0x89, 0x49, 0xd2, - 0xc1, 0xb4, 0xd1, 0x96, 0x53, 0x25, 0x39, 0xb5, 0xdb, 0xf5, 0xfc, 0x26, 0xee, 0xf2, 0xbd, 0x10, - 0xf1, 0x57, 0x5a, 0xac, 0x30, 0x8b, 0xa0, 0x4f, 0xda, 0xfc, 0x8f, 0x1c, 0xfc, 0xf4, 0xa5, 0x74, - 0x6c, 0x23, 0x82, 0xab, 0x4d, 0xbc, 0xe3, 0xf6, 0x5c, 0xea, 0xfa, 0x3d, 0xa2, 0xb6, 0xe5, 0x22, - 0x17, 0x67, 0x5b, 0x64, 0x9c, 0xe2, 0xf2, 0x41, 0x1a, 0x2c, 0xde, 0xf1, 0x3b, 0xae, 0x83, 0x77, - 0xfb, 0x98, 0x50, 0xb8, 0x0a, 0x72, 0xdc, 0x46, 0xd7, 0x4a, 0x5a, 0xa5, 0xe8, 0x88, 0x0e, 0x1b, - 0xed, 0xba, 0x9e, 0x4b, 0xf5, 0x74, 0x49, 0xab, 0x2c, 0x39, 0xa2, 0x03, 0x21, 0xc8, 0x12, 0x8a, - 0x03, 0x3d, 0x53, 0xd2, 0x2a, 0x19, 0x87, 0xb7, 0xe1, 0x3a, 0x58, 0x70, 0x7b, 0x14, 0x87, 0x7b, - 0xa8, 0xab, 0x17, 0xf9, 0x78, 0xdc, 0x87, 0x1f, 0x83, 0x02, 0xa1, 0x28, 0xa4, 0x5b, 0x44, 0xcf, - 0x96, 0xb4, 0xca, 0x62, 0x6d, 0xdd, 0x12, 0xa1, 0xb0, 0xa2, 0x50, 0x58, 0x5b, 0x51, 0x28, 0xec, - 0x85, 0xc7, 0x03, 0x33, 0xf5, 0xf0, 0x37, 0x53, 0x73, 0x22, 0x10, 0xbc, 0x0a, 0x72, 0xb8, 0xd7, - 0xdc, 0x22, 0x7a, 0x6e, 0x0e, 0xb4, 0x80, 0xc0, 0xf3, 0xa0, 0xd8, 0x74, 0x43, 0xdc, 0x60, 0x9c, - 0xe9, 0xf9, 0x92, 0x56, 0x59, 0xae, 0xad, 0x58, 0x71, 0x68, 0x6f, 0x44, 0x53, 0xce, 0xc8, 0x8a, - 0xb9, 0x17, 0x20, 0xda, 0xd6, 0x0b, 0x9c, 0x09, 0xde, 0x86, 0x65, 0x90, 0x27, 0x6d, 0x14, 0x36, - 0x89, 0xbe, 0x50, 0xca, 0x54, 0x8a, 0x36, 0x38, 0x1a, 0x98, 0x72, 0xc4, 0x91, 0xff, 0xcb, 0x7f, - 0x69, 0x00, 0x32, 0x4a, 0x6f, 0xf7, 0x08, 0x45, 0x3d, 0xfa, 0x2a, 0xcc, 0x7e, 0x08, 0xf2, 0x4c, - 0x94, 0x5b, 0x84, 0x73, 0x3b, 0xab, 0xab, 0x12, 0x93, 0xf4, 0x35, 0x3b, 0x97, 0xaf, 0xb9, 0xa9, - 0xbe, 0xe6, 0x8f, 0xf5, 0xf5, 0x87, 0x2c, 0x38, 0x21, 0xe4, 0x43, 0x02, 0xbf, 0x47, 0x30, 0x03, - 0x6d, 0xf2, 0x14, 0x14, 0x6e, 0x4a, 0x10, 0x1f, 0x71, 0xe4, 0x0c, 0xfc, 0x04, 0x64, 0x6f, 0x20, - 0x8a, 0xb8, 0xcb, 0x8b, 0xb5, 0x55, 0x4b, 0x11, 0x25, 0x5b, 0x8b, 0xcd, 0xd9, 0x6b, 0xcc, 0xab, - 0xa3, 0x81, 0xb9, 0xdc, 0x44, 0x14, 0xbd, 0xeb, 0x7b, 0x2e, 0xc5, 0x5e, 0x40, 0xf7, 0x1d, 0x8e, - 0x84, 0x1f, 0x80, 0xe2, 0xcd, 0x30, 0xf4, 0xc3, 0xad, 0xfd, 0x00, 0x73, 0x8a, 0x8a, 0xf6, 0xa9, - 0xa3, 0x81, 0xb9, 0x82, 0xa3, 0x41, 0x05, 0x31, 0xb2, 0x84, 0x6f, 0x83, 0x1c, 0xef, 0x70, 0x52, - 0x8a, 0xf6, 0xca, 0xd1, 0xc0, 0xfc, 0x0f, 0x87, 0x28, 0xe6, 0xc2, 0x22, 0xc9, 0x61, 0x6e, 0x26, - 0x0e, 0xe3, 0x50, 0xe6, 0xd5, 0x50, 0xea, 0xa0, 0xb0, 0x87, 0x43, 0xc2, 0x96, 0x29, 0xf0, 0xf1, - 0xa8, 0x0b, 0xaf, 0x03, 0xc0, 0x88, 0x71, 0x09, 0x75, 0x1b, 0x4c, 0x4f, 0x8c, 0x8c, 0x25, 0x4b, - 0x94, 0x0b, 0x07, 0x93, 0x7e, 0x97, 0xda, 0x50, 0xb2, 0xa0, 0x18, 0x3a, 0x4a, 0x1b, 0x3e, 0xd2, - 0x40, 0xa1, 0x8e, 0x51, 0x13, 0x87, 0x44, 0x2f, 0x96, 0x32, 0x95, 0xc5, 0xda, 0x5b, 0x96, 0x5a, - 0x1b, 0xee, 0x85, 0xbe, 0x87, 0x69, 0x1b, 0xf7, 0x49, 0x14, 0x20, 0x61, 0x6d, 0x77, 0x0e, 0x07, - 0xe6, 0xb6, 0x5a, 0x51, 0x43, 0xb4, 0x83, 0x7a, 0xa8, 0xda, 0xf5, 0x3b, 0x6e, 0x75, 0xee, 0x7a, - 0x74, 0xec, 0x77, 0x8e, 0x06, 0xa6, 0xf6, 0x9e, 0x13, 0x6d, 0xb1, 0xfc, 0xab, 0x06, 0xfe, 0xcb, - 0x22, 0xbc, 0xc9, 0xd6, 0x26, 0x4a, 0x62, 0x78, 0x88, 0x36, 0xda, 0xba, 0xc6, 0x64, 0xe6, 0x88, - 0x8e, 0x5a, 0x2c, 0xd2, 0xff, 0xa8, 0x58, 0x64, 0xe6, 0x2f, 0x16, 0x51, 0x36, 0x64, 0xa7, 0x66, - 0x43, 0xee, 0xd8, 0x6c, 0xf8, 0x26, 0x23, 0x32, 0x3f, 0xf2, 0x6f, 0x8e, 0x9c, 0xb8, 0x15, 0xe7, - 0x44, 0x86, 0xef, 0x36, 0x96, 0x9a, 0x58, 0xeb, 0x76, 0x13, 0xf7, 0xa8, 0xbb, 0xe3, 0xe2, 0xf0, - 0x25, 0x99, 0xa1, 0xc8, 0x2d, 0x93, 0x94, 0x9b, 0xaa, 0x95, 0xec, 0x6b, 0xaf, 0x95, 0xb1, 0xec, - 0xc8, 0xbd, 0x42, 0x76, 0x94, 0x9f, 0xa7, 0xc1, 0x1a, 0x0b, 0xc7, 0x1d, 0xb4, 0x8d, 0xbb, 0x9f, - 0x23, 0x6f, 0xce, 0x90, 0x9c, 0x55, 0x42, 0x52, 0xb4, 0xe1, 0xbf, 0x94, 0xcf, 0x40, 0xf9, 0x77, - 0x1a, 0x58, 0x88, 0x6a, 0x38, 0xb4, 0x00, 0x10, 0x30, 0x5e, 0xa6, 0x05, 0xd1, 0xcb, 0x0c, 0x1c, - 0xc6, 0xa3, 0x8e, 0x62, 0x01, 0xbf, 0x02, 0x79, 0xd1, 0x93, 0x59, 0x70, 0x4a, 0xc9, 0x02, 0x1a, - 0x62, 0xe4, 0x5d, 0x6f, 0xa2, 0x80, 0xe2, 0xd0, 0xbe, 0xc2, 0x76, 0x71, 0x38, 0x30, 0xcf, 0xbd, - 0x88, 0x22, 0x7e, 0xc3, 0x12, 0x38, 0x16, 0x5c, 0xf1, 0x4d, 0x47, 0x7e, 0xa1, 0xfc, 0xad, 0x06, - 0x4e, 0xb2, 0x8d, 0x32, 0x6a, 0x62, 0x55, 0xdc, 0x00, 0x0b, 0xa1, 0x6c, 0xf3, 0xed, 0x2e, 0xd6, - 0xca, 0x56, 0x92, 0xd6, 0x29, 0x54, 0xda, 0xd9, 0xc7, 0x03, 0x53, 0x73, 0x62, 0x24, 0xdc, 0x48, - 0xd0, 0x98, 0x9e, 0x46, 0x23, 0x83, 0xa4, 0x12, 0xc4, 0xfd, 0x9c, 0x06, 0xf0, 0x76, 0xaf, 0x89, - 0x1f, 0x30, 0xf1, 0x8d, 0x74, 0xda, 0x9f, 0xd8, 0xd1, 0x99, 0x11, 0x29, 0x93, 0xf6, 0xf6, 0xb5, - 0xc3, 0x81, 0x79, 0xe9, 0x45, 0xac, 0xbc, 0x00, 0xac, 0xb8, 0xa0, 0x0a, 0x37, 0xfd, 0xfa, 0x9f, - 0x2b, 0x3f, 0xa6, 0xc1, 0xf2, 0x17, 0x7e, 0xb7, 0xef, 0xe1, 0x98, 0x38, 0x6f, 0x82, 0x38, 0x7d, - 0x44, 0x5c, 0xd2, 0xd6, 0xbe, 0x74, 0x38, 0x30, 0x37, 0x66, 0x22, 0x2d, 0x09, 0x7c, 0x73, 0x09, - 0x7b, 0x94, 0x06, 0xab, 0x5b, 0x7e, 0xf0, 0xd9, 0x26, 0x7f, 0xbe, 0x28, 0x75, 0x11, 0x4f, 0xd0, - 0xb6, 0x3a, 0xa2, 0x8d, 0x21, 0xee, 0x22, 0x1a, 0xba, 0x0f, 0xec, 0x8d, 0xc3, 0x81, 0x59, 0x9d, - 0x89, 0xb2, 0x11, 0xe8, 0xcd, 0xa5, 0xeb, 0x97, 0x34, 0x58, 0xbb, 0xdf, 0x47, 0x3d, 0xea, 0x76, - 0xb1, 0xa0, 0x2c, 0x26, 0x6c, 0x7f, 0x82, 0x30, 0x63, 0x44, 0x58, 0x12, 0x23, 0xa9, 0xfb, 0xe8, - 0x70, 0x60, 0x5e, 0x99, 0x89, 0xba, 0x69, 0xf0, 0x37, 0x97, 0xc4, 0x9f, 0xb2, 0x60, 0xe9, 0x3e, - 0x5b, 0x25, 0xe6, 0xee, 0x1d, 0x20, 0x8f, 0x5c, 0xc9, 0x1c, 0x8c, 0xee, 0x68, 0x61, 0xd0, 0xb0, - 0x36, 0xe5, 0x61, 0x2c, 0x2c, 0xe0, 0x65, 0x90, 0x27, 0xfc, 0x26, 0x24, 0x0b, 0xaa, 0x31, 0xfe, - 0x6a, 0x48, 0xde, 0xb9, 0xea, 0x29, 0x47, 0xda, 0xb3, 0xb7, 0x54, 0x97, 0x5d, 0x00, 0xa2, 0x9b, - 0x60, 0x79, 0x1c, 0x39, 0x79, 0x3d, 0x60, 0x68, 0x81, 0x81, 0x17, 0x41, 0x8e, 0x57, 0x6e, 0xf9, - 0x62, 0x4d, 0x7c, 0x76, 0xb2, 0x84, 0xd6, 0x53, 0x8e, 0x30, 0x87, 0x35, 0x90, 0x0d, 0x42, 0xdf, - 0x93, 0xa7, 0xe8, 0x99, 0xf1, 0x6f, 0xaa, 0xc7, 0x4e, 0x3d, 0xe5, 0x70, 0x5b, 0x78, 0x81, 0x5d, - 0x79, 0xd9, 0x79, 0x45, 0xf8, 0x13, 0x82, 0x95, 0xac, 0x31, 0x98, 0x02, 0x89, 0x4c, 0xe1, 0x05, - 0x90, 0xdf, 0xe3, 0x65, 0x89, 0xbf, 0x2f, 0xd8, 0xdd, 0x51, 0x01, 0x25, 0x0b, 0x16, 0xf3, 0x4b, - 0xd8, 0xc2, 0x5b, 0xe0, 0x04, 0xf5, 0x83, 0x4e, 0x54, 0x00, 0xe4, 0xf3, 0xa3, 0xa4, 0x62, 0xa7, - 0x15, 0x88, 0x7a, 0xca, 0x49, 0xe0, 0xe0, 0x3d, 0x70, 0x72, 0x37, 0x21, 0x53, 0x4c, 0xf8, 0xbb, - 0x7f, 0x8c, 0xe7, 0xe9, 0xd9, 0x53, 0x4f, 0x39, 0x13, 0x68, 0x1b, 0x8c, 0x32, 0xaa, 0xfc, 0x47, - 0x06, 0x9c, 0x90, 0x9a, 0x11, 0x6f, 0x85, 0x4b, 0xb1, 0x0c, 0x84, 0x64, 0xfe, 0x7f, 0x9c, 0x0c, - 0xb8, 0xb9, 0xa2, 0x82, 0xf7, 0x63, 0x15, 0x08, 0xfd, 0xac, 0x8d, 0xb2, 0x94, 0xc7, 0x5f, 0x41, - 0xc8, 0xc8, 0x6f, 0x44, 0x91, 0x17, 0xb2, 0x39, 0x3d, 0xfd, 0xdc, 0x8d, 0x50, 0x32, 0xec, 0x57, - 0x41, 0xc1, 0x15, 0xcf, 0xfe, 0x69, 0x82, 0x99, 0xfc, 0x55, 0x80, 0x05, 0x52, 0x02, 0xe0, 0xc6, - 0x28, 0xfc, 0x42, 0x35, 0xa7, 0x26, 0xc3, 0x1f, 0x83, 0xa2, 0xe8, 0x9f, 0x8f, 0xa3, 0x9f, 0x97, - 0x98, 0x89, 0xc3, 0x2a, 0x76, 0x4c, 0x86, 0xbe, 0x0e, 0x16, 0x3c, 0x4c, 0x11, 0xbb, 0xcb, 0xea, - 0x05, 0x5e, 0x37, 0xce, 0x26, 0x43, 0x35, 0xe2, 0xdb, 0xba, 0x2b, 0x0d, 0x6f, 0xf6, 0x68, 0xb8, - 0x2f, 0xaf, 0x2d, 0x31, 0x7a, 0xfd, 0x1a, 0x58, 0x4a, 0x18, 0xc0, 0x93, 0x20, 0xd3, 0xc1, 0xd1, - 0x2f, 0x1c, 0xac, 0xc9, 0x1e, 0x77, 0x7b, 0xa8, 0xdb, 0xc7, 0x9c, 0xf6, 0xa2, 0x23, 0x3a, 0x57, - 0xd3, 0x97, 0x35, 0xbb, 0x08, 0x0a, 0xa1, 0xf8, 0x8a, 0xdd, 0x3c, 0x78, 0x6a, 0xa4, 0x9e, 0x3c, - 0x35, 0x52, 0xcf, 0x9f, 0x1a, 0xda, 0xd7, 0x43, 0x43, 0xfb, 0x7e, 0x68, 0x68, 0x8f, 0x87, 0x86, - 0x76, 0x30, 0x34, 0xb4, 0xdf, 0x87, 0x86, 0xf6, 0xe7, 0xd0, 0x48, 0x3d, 0x1f, 0x1a, 0xda, 0xc3, - 0x67, 0x46, 0xea, 0xe0, 0x99, 0x91, 0x7a, 0xf2, 0xcc, 0x48, 0x7d, 0x69, 0xcd, 0x57, 0xc2, 0xb6, - 0xf3, 0x9c, 0x96, 0x8d, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x66, 0x27, 0xc9, 0x7f, 0x7f, 0x14, - 0x00, 0x00, -} - -func (this *LokiRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiRequest) - if !ok { - that2, ok := that.(LokiRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Query != that1.Query { - return false - } - if this.Limit != that1.Limit { - return false - } - if this.Step != that1.Step { - return false - } - if this.Interval != that1.Interval { - return false - } - if !this.StartTs.Equal(that1.StartTs) { - return false - } - if !this.EndTs.Equal(that1.EndTs) { - return false - } - if this.Direction != that1.Direction { - return false - } - if this.Path != that1.Path { - return false - } - if len(this.Shards) != len(that1.Shards) { - return false - } - for i := range this.Shards { - if this.Shards[i] != that1.Shards[i] { - return false - } - } - return true -} -func (this *LokiInstantRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiInstantRequest) - if !ok { - that2, ok := that.(LokiInstantRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Query != that1.Query { - return false - } - if this.Limit != that1.Limit { - return false - } - if !this.TimeTs.Equal(that1.TimeTs) { - return false - } - if this.Direction != that1.Direction { - return false - } - if this.Path != that1.Path { - return false - } - if len(this.Shards) != len(that1.Shards) { - return false - } - for i := range this.Shards { - if this.Shards[i] != that1.Shards[i] { - return false - } - } - return true -} -func (this *LokiResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiResponse) - if !ok { - that2, ok := that.(LokiResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if !this.Data.Equal(&that1.Data) { - return false - } - if this.ErrorType != that1.ErrorType { - return false - } - if this.Error != that1.Error { - return false - } - if this.Direction != that1.Direction { - return false - } - if this.Limit != that1.Limit { - return false - } - if this.Version != that1.Version { - return false - } - if !this.Statistics.Equal(&that1.Statistics) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *LokiSeriesRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiSeriesRequest) - if !ok { - that2, ok := that.(LokiSeriesRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Match) != len(that1.Match) { - return false - } - for i := range this.Match { - if this.Match[i] != that1.Match[i] { - return false - } - } - if !this.StartTs.Equal(that1.StartTs) { - return false - } - if !this.EndTs.Equal(that1.EndTs) { - return false - } - if this.Path != that1.Path { - return false - } - if len(this.Shards) != len(that1.Shards) { - return false - } - for i := range this.Shards { - if this.Shards[i] != that1.Shards[i] { - return false - } - } - return true -} -func (this *LokiSeriesResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiSeriesResponse) - if !ok { - that2, ok := that.(LokiSeriesResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if len(this.Data) != len(that1.Data) { - return false - } - for i := range this.Data { - if !this.Data[i].Equal(&that1.Data[i]) { - return false - } - } - if this.Version != that1.Version { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - if !this.Statistics.Equal(&that1.Statistics) { - return false - } - return true -} -func (this *LokiLabelNamesResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiLabelNamesResponse) - if !ok { - that2, ok := that.(LokiLabelNamesResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if len(this.Data) != len(that1.Data) { - return false - } - for i := range this.Data { - if this.Data[i] != that1.Data[i] { - return false - } - } - if this.Version != that1.Version { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - if !this.Statistics.Equal(&that1.Statistics) { - return false - } - return true -} -func (this *LokiData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiData) - if !ok { - that2, ok := that.(LokiData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ResultType != that1.ResultType { - return false - } - if len(this.Result) != len(that1.Result) { - return false - } - for i := range this.Result { - if !this.Result[i].Equal(that1.Result[i]) { - return false - } - } - return true -} -func (this *LokiPromResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LokiPromResponse) - if !ok { - that2, ok := that.(LokiPromResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Response.Equal(that1.Response) { - return false - } - if !this.Statistics.Equal(&that1.Statistics) { - return false - } - return true -} -func (this *IndexStatsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*IndexStatsResponse) - if !ok { - that2, ok := that.(IndexStatsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if !this.Response.Equal(*that1.Response) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *VolumeResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VolumeResponse) - if !ok { - that2, ok := that.(VolumeResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if !this.Response.Equal(*that1.Response) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *TopKSketchesResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TopKSketchesResponse) - if !ok { - that2, ok := that.(TopKSketchesResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if !this.Response.Equal(*that1.Response) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *QuantileSketchResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QuantileSketchResponse) - if !ok { - that2, ok := that.(QuantileSketchResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if !this.Response.Equal(*that1.Response) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *QueryResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse) - if !ok { - that2, ok := that.(QueryResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Status.Equal(that1.Status) { - return false - } - if that1.Response == nil { - if this.Response != nil { - return false - } - } else if this.Response == nil { - return false - } else if !this.Response.Equal(that1.Response) { - return false - } - return true -} -func (this *QueryResponse_Series) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Series) - if !ok { - that2, ok := that.(QueryResponse_Series) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Series.Equal(that1.Series) { - return false - } - return true -} -func (this *QueryResponse_Labels) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Labels) - if !ok { - that2, ok := that.(QueryResponse_Labels) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - return true -} -func (this *QueryResponse_Stats) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Stats) - if !ok { - that2, ok := that.(QueryResponse_Stats) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Stats.Equal(that1.Stats) { - return false - } - return true -} -func (this *QueryResponse_Prom) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Prom) - if !ok { - that2, ok := that.(QueryResponse_Prom) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Prom.Equal(that1.Prom) { - return false - } - return true -} -func (this *QueryResponse_Streams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Streams) - if !ok { - that2, ok := that.(QueryResponse_Streams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Streams.Equal(that1.Streams) { - return false - } - return true -} -func (this *QueryResponse_Volume) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_Volume) - if !ok { - that2, ok := that.(QueryResponse_Volume) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Volume.Equal(that1.Volume) { - return false - } - return true -} -func (this *QueryResponse_TopkSketches) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_TopkSketches) - if !ok { - that2, ok := that.(QueryResponse_TopkSketches) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.TopkSketches.Equal(that1.TopkSketches) { - return false - } - return true -} -func (this *QueryResponse_QuantileSketches) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryResponse_QuantileSketches) - if !ok { - that2, ok := that.(QueryResponse_QuantileSketches) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.QuantileSketches.Equal(that1.QuantileSketches) { - return false - } - return true -} -func (this *QueryRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest) - if !ok { - that2, ok := that.(QueryRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Request == nil { - if this.Request != nil { - return false - } - } else if this.Request == nil { - return false - } else if !this.Request.Equal(that1.Request) { - return false - } - if len(this.Metadata) != len(that1.Metadata) { - return false - } - for i := range this.Metadata { - if this.Metadata[i] != that1.Metadata[i] { - return false - } - } - return true -} -func (this *QueryRequest_Series) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Series) - if !ok { - that2, ok := that.(QueryRequest_Series) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Series.Equal(that1.Series) { - return false - } - return true -} -func (this *QueryRequest_Labels) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Labels) - if !ok { - that2, ok := that.(QueryRequest_Labels) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - return true -} -func (this *QueryRequest_Stats) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Stats) - if !ok { - that2, ok := that.(QueryRequest_Stats) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Stats.Equal(that1.Stats) { - return false - } - return true -} -func (this *QueryRequest_Instant) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Instant) - if !ok { - that2, ok := that.(QueryRequest_Instant) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Instant.Equal(that1.Instant) { - return false - } - return true -} -func (this *QueryRequest_Streams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Streams) - if !ok { - that2, ok := that.(QueryRequest_Streams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Streams.Equal(that1.Streams) { - return false - } - return true -} -func (this *QueryRequest_Volume) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest_Volume) - if !ok { - that2, ok := that.(QueryRequest_Volume) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Volume.Equal(that1.Volume) { - return false - } - return true -} -func (this *LokiRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&queryrange.LokiRequest{") - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") - s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") - s = append(s, "Step: "+fmt.Sprintf("%#v", this.Step)+",\n") - s = append(s, "Interval: "+fmt.Sprintf("%#v", this.Interval)+",\n") - s = append(s, "StartTs: "+fmt.Sprintf("%#v", this.StartTs)+",\n") - s = append(s, "EndTs: "+fmt.Sprintf("%#v", this.EndTs)+",\n") - s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiInstantRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&queryrange.LokiInstantRequest{") - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") - s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") - s = append(s, "TimeTs: "+fmt.Sprintf("%#v", this.TimeTs)+",\n") - s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&queryrange.LokiResponse{") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "Data: "+strings.Replace(this.Data.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ErrorType: "+fmt.Sprintf("%#v", this.ErrorType)+",\n") - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") - s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") - s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") - s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiSeriesRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&queryrange.LokiSeriesRequest{") - s = append(s, "Match: "+fmt.Sprintf("%#v", this.Match)+",\n") - s = append(s, "StartTs: "+fmt.Sprintf("%#v", this.StartTs)+",\n") - s = append(s, "EndTs: "+fmt.Sprintf("%#v", this.EndTs)+",\n") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiSeriesResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&queryrange.LokiSeriesResponse{") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - if this.Data != nil { - vs := make([]*logproto.SeriesIdentifier, len(this.Data)) - for i := range vs { - vs[i] = &this.Data[i] - } - s = append(s, "Data: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiLabelNamesResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&queryrange.LokiLabelNamesResponse{") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") - s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiData) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.LokiData{") - s = append(s, "ResultType: "+fmt.Sprintf("%#v", this.ResultType)+",\n") - s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LokiPromResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.LokiPromResponse{") - if this.Response != nil { - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - } - s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *IndexStatsResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.IndexStatsResponse{") - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *VolumeResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.VolumeResponse{") - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TopKSketchesResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.TopKSketchesResponse{") - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QuantileSketchResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrange.QuantileSketchResponse{") - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&queryrange.QueryResponse{") - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - } - if this.Response != nil { - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryResponse_Series) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Series{` + - `Series:` + fmt.Sprintf("%#v", this.Series) + `}`}, ", ") - return s -} -func (this *QueryResponse_Labels) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Labels{` + - `Labels:` + fmt.Sprintf("%#v", this.Labels) + `}`}, ", ") - return s -} -func (this *QueryResponse_Stats) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Stats{` + - `Stats:` + fmt.Sprintf("%#v", this.Stats) + `}`}, ", ") - return s -} -func (this *QueryResponse_Prom) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Prom{` + - `Prom:` + fmt.Sprintf("%#v", this.Prom) + `}`}, ", ") - return s -} -func (this *QueryResponse_Streams) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Streams{` + - `Streams:` + fmt.Sprintf("%#v", this.Streams) + `}`}, ", ") - return s -} -func (this *QueryResponse_Volume) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_Volume{` + - `Volume:` + fmt.Sprintf("%#v", this.Volume) + `}`}, ", ") - return s -} -func (this *QueryResponse_TopkSketches) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_TopkSketches{` + - `TopkSketches:` + fmt.Sprintf("%#v", this.TopkSketches) + `}`}, ", ") - return s -} -func (this *QueryResponse_QuantileSketches) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryResponse_QuantileSketches{` + - `QuantileSketches:` + fmt.Sprintf("%#v", this.QuantileSketches) + `}`}, ", ") - return s -} -func (this *QueryRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&queryrange.QueryRequest{") - if this.Request != nil { - s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") - } - keysForMetadata := make([]string, 0, len(this.Metadata)) - for k, _ := range this.Metadata { - keysForMetadata = append(keysForMetadata, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) - mapStringForMetadata := "map[string]string{" - for _, k := range keysForMetadata { - mapStringForMetadata += fmt.Sprintf("%#v: %#v,", k, this.Metadata[k]) - } - mapStringForMetadata += "}" - if this.Metadata != nil { - s = append(s, "Metadata: "+mapStringForMetadata+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryRequest_Series) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Series{` + - `Series:` + fmt.Sprintf("%#v", this.Series) + `}`}, ", ") - return s -} -func (this *QueryRequest_Labels) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Labels{` + - `Labels:` + fmt.Sprintf("%#v", this.Labels) + `}`}, ", ") - return s -} -func (this *QueryRequest_Stats) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Stats{` + - `Stats:` + fmt.Sprintf("%#v", this.Stats) + `}`}, ", ") - return s -} -func (this *QueryRequest_Instant) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Instant{` + - `Instant:` + fmt.Sprintf("%#v", this.Instant) + `}`}, ", ") - return s -} -func (this *QueryRequest_Streams) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Streams{` + - `Streams:` + fmt.Sprintf("%#v", this.Streams) + `}`}, ", ") - return s -} -func (this *QueryRequest_Volume) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&queryrange.QueryRequest_Volume{` + - `Volume:` + fmt.Sprintf("%#v", this.Volume) + `}`}, ", ") - return s -} -func valueToGoStringQueryrange(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *LokiRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Interval != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Interval)) - i-- - dAtA[i] = 0x48 - } - if len(m.Shards) > 0 { - for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Shards[iNdEx]) - copy(dAtA[i:], m.Shards[iNdEx]) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x3a - } - if m.Direction != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) - i-- - dAtA[i] = 0x30 - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintQueryrange(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x2a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintQueryrange(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x22 - if m.Step != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x18 - } - if m.Limit != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x10 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiInstantRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiInstantRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiInstantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Shards) > 0 { - for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Shards[iNdEx]) - copy(dAtA[i:], m.Shards[iNdEx]) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x2a - } - if m.Direction != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) - i-- - dAtA[i] = 0x20 - } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.TimeTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.TimeTs):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintQueryrange(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - if m.Limit != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x10 - } - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - { - size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if m.Version != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x38 - } - if m.Limit != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x30 - } - if m.Direction != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) - i-- - dAtA[i] = 0x28 - } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x22 - } - if len(m.ErrorType) > 0 { - i -= len(m.ErrorType) - copy(dAtA[i:], m.ErrorType) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ErrorType))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiSeriesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiSeriesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiSeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Shards) > 0 { - for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Shards[iNdEx]) - copy(dAtA[i:], m.Shards[iNdEx]) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x22 - } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintQueryrange(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1a - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintQueryrange(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x12 - if len(m.Match) > 0 { - for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Match[iNdEx]) - copy(dAtA[i:], m.Match[iNdEx]) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Match[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LokiSeriesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiSeriesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Version != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x18 - } - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiLabelNamesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiLabelNamesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiLabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Version != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x18 - } - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Data[iNdEx]) - copy(dAtA[i:], m.Data[iNdEx]) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Data[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Result) > 0 { - for iNdEx := len(m.Result) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Result[iNdEx].Size() - i -= size - if _, err := m.Result[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ResultType) > 0 { - i -= len(m.ResultType) - copy(dAtA[i:], m.ResultType) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ResultType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LokiPromResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LokiPromResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LokiPromResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Response != nil { - { - size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IndexStatsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexStatsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *VolumeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VolumeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TopKSketchesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TopKSketchesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TopKSketchesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuantileSketchResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuantileSketchResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuantileSketchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Headers[iNdEx].Size() - i -= size - if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Response != nil { - { - size := m.Response.Size() - i -= size - if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryResponse_Series) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Series != nil { - { - size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Labels) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Labels) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Labels != nil { - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Stats) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Stats != nil { - { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Prom) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Prom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Prom != nil { - { - size, err := m.Prom.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Streams) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Streams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Streams != nil { - { - size, err := m.Streams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_Volume) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_TopkSketches) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_TopkSketches) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.TopkSketches != nil { - { - size, err := m.TopkSketches.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *QueryResponse_QuantileSketches) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryResponse_QuantileSketches) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.QuantileSketches != nil { - { - size, err := m.QuantileSketches.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} -func (m *QueryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - for k := range m.Metadata { - v := m.Metadata[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintQueryrange(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQueryrange(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQueryrange(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x3a - } - } - if m.Request != nil { - { - size := m.Request.Size() - i -= size - if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *QueryRequest_Series) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Series != nil { - { - size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *QueryRequest_Labels) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Labels) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Labels != nil { - { - size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryRequest_Stats) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Stats != nil { - { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *QueryRequest_Instant) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Instant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Instant != nil { - { - size, err := m.Instant.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *QueryRequest_Streams) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Streams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Streams != nil { - { - size, err := m.Streams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *QueryRequest_Volume) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *QueryRequest_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Volume != nil { - { - size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func encodeVarintQueryrange(dAtA []byte, offset int, v uint64) int { - offset -= sovQueryrange(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LokiRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovQueryrange(uint64(m.Limit)) - } - if m.Step != 0 { - n += 1 + sovQueryrange(uint64(m.Step)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs) - n += 1 + l + sovQueryrange(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs) - n += 1 + l + sovQueryrange(uint64(l)) - if m.Direction != 0 { - n += 1 + sovQueryrange(uint64(m.Direction)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Shards) > 0 { - for _, s := range m.Shards { - l = len(s) - n += 1 + l + sovQueryrange(uint64(l)) - } - } - if m.Interval != 0 { - n += 1 + sovQueryrange(uint64(m.Interval)) - } - return n -} - -func (m *LokiInstantRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovQueryrange(uint64(m.Limit)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.TimeTs) - n += 1 + l + sovQueryrange(uint64(l)) - if m.Direction != 0 { - n += 1 + sovQueryrange(uint64(m.Direction)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Shards) > 0 { - for _, s := range m.Shards { - l = len(s) - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *LokiResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = m.Data.Size() - n += 1 + l + sovQueryrange(uint64(l)) - l = len(m.ErrorType) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if m.Direction != 0 { - n += 1 + sovQueryrange(uint64(m.Direction)) - } - if m.Limit != 0 { - n += 1 + sovQueryrange(uint64(m.Limit)) - } - if m.Version != 0 { - n += 1 + sovQueryrange(uint64(m.Version)) - } - l = m.Statistics.Size() - n += 1 + l + sovQueryrange(uint64(l)) - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *LokiSeriesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Match) > 0 { - for _, s := range m.Match { - l = len(s) - n += 1 + l + sovQueryrange(uint64(l)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs) - n += 1 + l + sovQueryrange(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs) - n += 1 + l + sovQueryrange(uint64(l)) - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Shards) > 0 { - for _, s := range m.Shards { - l = len(s) - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *LokiSeriesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - if m.Version != 0 { - n += 1 + sovQueryrange(uint64(m.Version)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - l = m.Statistics.Size() - n += 1 + l + sovQueryrange(uint64(l)) - return n -} - -func (m *LokiLabelNamesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Data) > 0 { - for _, s := range m.Data { - l = len(s) - n += 1 + l + sovQueryrange(uint64(l)) - } - } - if m.Version != 0 { - n += 1 + sovQueryrange(uint64(m.Version)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - l = m.Statistics.Size() - n += 1 + l + sovQueryrange(uint64(l)) - return n -} - -func (m *LokiData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResultType) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Result) > 0 { - for _, e := range m.Result { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *LokiPromResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - l = m.Statistics.Size() - n += 1 + l + sovQueryrange(uint64(l)) - return n -} - -func (m *IndexStatsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *VolumeResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *TopKSketchesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *QuantileSketchResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *QueryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - if m.Response != nil { - n += m.Response.Size() - } - return n -} - -func (m *QueryResponse_Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Series != nil { - l = m.Series.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_Labels) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_Stats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Stats != nil { - l = m.Stats.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_Prom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Prom != nil { - l = m.Prom.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_Streams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Streams != nil { - l = m.Streams.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_TopkSketches) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TopkSketches != nil { - l = m.TopkSketches.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryResponse_QuantileSketches) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QuantileSketches != nil { - l = m.QuantileSketches.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Request != nil { - n += m.Request.Size() - } - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovQueryrange(uint64(len(k))) + 1 + len(v) + sovQueryrange(uint64(len(v))) - n += mapEntrySize + 1 + sovQueryrange(uint64(mapEntrySize)) - } - } - return n -} - -func (m *QueryRequest_Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Series != nil { - l = m.Series.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest_Labels) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest_Stats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Stats != nil { - l = m.Stats.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest_Instant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Instant != nil { - l = m.Instant.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest_Streams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Streams != nil { - l = m.Streams.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} -func (m *QueryRequest_Volume) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} - -func sovQueryrange(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQueryrange(x uint64) (n int) { - return sovQueryrange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *LokiRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiRequest{`, - `Query:` + fmt.Sprintf("%v", this.Query) + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `Step:` + fmt.Sprintf("%v", this.Step) + `,`, - `StartTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `EndTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EndTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, - `Interval:` + fmt.Sprintf("%v", this.Interval) + `,`, - `}`, - }, "") - return s -} -func (this *LokiInstantRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiInstantRequest{`, - `Query:` + fmt.Sprintf("%v", this.Query) + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `TimeTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.TimeTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, - `}`, - }, "") - return s -} -func (this *LokiResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiResponse{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Data:` + strings.Replace(strings.Replace(this.Data.String(), "LokiData", "LokiData", 1), `&`, ``, 1) + `,`, - `ErrorType:` + fmt.Sprintf("%v", this.ErrorType) + `,`, - `Error:` + fmt.Sprintf("%v", this.Error) + `,`, - `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `}`, - }, "") - return s -} -func (this *LokiSeriesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiSeriesRequest{`, - `Match:` + fmt.Sprintf("%v", this.Match) + `,`, - `StartTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `EndTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EndTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, - `}`, - }, "") - return s -} -func (this *LokiSeriesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForData := "[]SeriesIdentifier{" - for _, f := range this.Data { - repeatedStringForData += fmt.Sprintf("%v", f) + "," - } - repeatedStringForData += "}" - s := strings.Join([]string{`&LokiSeriesResponse{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Data:` + repeatedStringForData + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *LokiLabelNamesResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiLabelNamesResponse{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *LokiData) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiData{`, - `ResultType:` + fmt.Sprintf("%v", this.ResultType) + `,`, - `Result:` + fmt.Sprintf("%v", this.Result) + `,`, - `}`, - }, "") - return s -} -func (this *LokiPromResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LokiPromResponse{`, - `Response:` + strings.Replace(fmt.Sprintf("%v", this.Response), "PrometheusResponse", "queryrangebase.PrometheusResponse", 1) + `,`, - `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *IndexStatsResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexStatsResponse{`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `}`, - }, "") - return s -} -func (this *VolumeResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VolumeResponse{`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `}`, - }, "") - return s -} -func (this *TopKSketchesResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TopKSketchesResponse{`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `}`, - }, "") - return s -} -func (this *QuantileSketchResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QuantileSketchResponse{`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1) + `,`, - `Response:` + fmt.Sprintf("%v", this.Response) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Series) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Series{`, - `Series:` + strings.Replace(fmt.Sprintf("%v", this.Series), "LokiSeriesResponse", "LokiSeriesResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Labels) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Labels{`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "LokiLabelNamesResponse", "LokiLabelNamesResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Stats) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Stats{`, - `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "IndexStatsResponse", "IndexStatsResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Prom) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Prom{`, - `Prom:` + strings.Replace(fmt.Sprintf("%v", this.Prom), "LokiPromResponse", "LokiPromResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Streams) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Streams{`, - `Streams:` + strings.Replace(fmt.Sprintf("%v", this.Streams), "LokiResponse", "LokiResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_Volume{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "VolumeResponse", "VolumeResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_TopkSketches) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_TopkSketches{`, - `TopkSketches:` + strings.Replace(fmt.Sprintf("%v", this.TopkSketches), "TopKSketchesResponse", "TopKSketchesResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryResponse_QuantileSketches) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryResponse_QuantileSketches{`, - `QuantileSketches:` + strings.Replace(fmt.Sprintf("%v", this.QuantileSketches), "QuantileSketchResponse", "QuantileSketchResponse", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest) String() string { - if this == nil { - return "nil" - } - keysForMetadata := make([]string, 0, len(this.Metadata)) - for k, _ := range this.Metadata { - keysForMetadata = append(keysForMetadata, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) - mapStringForMetadata := "map[string]string{" - for _, k := range keysForMetadata { - mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) - } - mapStringForMetadata += "}" - s := strings.Join([]string{`&QueryRequest{`, - `Request:` + fmt.Sprintf("%v", this.Request) + `,`, - `Metadata:` + mapStringForMetadata + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Series) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Series{`, - `Series:` + strings.Replace(fmt.Sprintf("%v", this.Series), "LokiSeriesRequest", "LokiSeriesRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Labels) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Labels{`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "LabelRequest", "logproto.LabelRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Stats) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Stats{`, - `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "IndexStatsRequest", "logproto.IndexStatsRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Instant) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Instant{`, - `Instant:` + strings.Replace(fmt.Sprintf("%v", this.Instant), "LokiInstantRequest", "LokiInstantRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Streams) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Streams{`, - `Streams:` + strings.Replace(fmt.Sprintf("%v", this.Streams), "LokiRequest", "LokiRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *QueryRequest_Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryRequest_Volume{`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "VolumeRequest", "logproto.VolumeRequest", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringQueryrange(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *LokiRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) - } - m.Direction = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Direction |= logproto.Direction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - m.Interval = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Interval |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiInstantRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiInstantRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiInstantRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.TimeTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) - } - m.Direction = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Direction |= logproto.Direction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) - } - m.Direction = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Direction |= logproto.Direction(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiSeriesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiSeriesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiSeriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Match = append(m.Match, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTs, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiSeriesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiSeriesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiSeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, logproto.SeriesIdentifier{}) - if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiLabelNamesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiLabelNamesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiLabelNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = append(m.Result, github_com_grafana_loki_pkg_push.Stream{}) - if err := m.Result[len(m.Result)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LokiPromResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LokiPromResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LokiPromResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &queryrangebase.PrometheusResponse{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexStatsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IndexStatsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &github_com_grafana_loki_pkg_logproto.IndexStatsResponse{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VolumeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VolumeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &github_com_grafana_loki_pkg_logproto.VolumeResponse{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TopKSketchesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TopKSketchesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TopKSketchesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &github_com_grafana_loki_pkg_logproto.TopKMatrix{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuantileSketchResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuantileSketchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuantileSketchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &github_com_grafana_loki_pkg_logproto.QuantileSketchMatrix{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &rpc.Status{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiSeriesResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Series{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiLabelNamesResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Labels{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &IndexStatsResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Stats{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prom", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiPromResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Prom{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Streams{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VolumeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_Volume{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TopkSketches", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TopKSketchesResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_TopkSketches{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuantileSketches", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &QuantileSketchResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &QueryResponse_QuantileSketches{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiSeriesRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Series{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &logproto.LabelRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Labels{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &logproto.IndexStatsRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Stats{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Instant", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiInstantRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Instant{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LokiRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Streams{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &logproto.VolumeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &QueryRequest_Volume{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQueryrange - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQueryrange - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthQueryrange - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthQueryrange - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQueryrange(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQueryrange - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthQueryrange - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - 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 := skipQueryrange(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthQueryrange - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/querier/queryrange/queryrange.proto b/pkg/querier/queryrange/queryrange.proto index d5e89eeee47a7..6de74cde1464d 100644 --- a/pkg/querier/queryrange/queryrange.proto +++ b/pkg/querier/queryrange/queryrange.proto @@ -33,6 +33,9 @@ message LokiRequest { logproto.Direction direction = 6; string path = 7; repeated string shards = 8 [(gogoproto.jsontag) = "shards"]; + optional plan.QueryPlan = 0 [ + (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" + ]; } message LokiInstantRequest { diff --git a/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go b/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go deleted file mode 100644 index f9ee4b21059bb..0000000000000 --- a/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go +++ /dev/null @@ -1,969 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/querier/queryrange/queryrangebase/definitions/definitions.proto - -package definitions - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Defined here to prevent circular imports between logproto & queryrangebase -type CachingOptions struct { - Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"` -} - -func (m *CachingOptions) Reset() { *m = CachingOptions{} } -func (*CachingOptions) ProtoMessage() {} -func (*CachingOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_d1a37772b6ae2c5c, []int{0} -} -func (m *CachingOptions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CachingOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CachingOptions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CachingOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_CachingOptions.Merge(m, src) -} -func (m *CachingOptions) XXX_Size() int { - return m.Size() -} -func (m *CachingOptions) XXX_DiscardUnknown() { - xxx_messageInfo_CachingOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_CachingOptions proto.InternalMessageInfo - -func (m *CachingOptions) GetDisabled() bool { - if m != nil { - return m.Disabled - } - return false -} - -type PrometheusRequestHeader struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` - Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` -} - -func (m *PrometheusRequestHeader) Reset() { *m = PrometheusRequestHeader{} } -func (*PrometheusRequestHeader) ProtoMessage() {} -func (*PrometheusRequestHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_d1a37772b6ae2c5c, []int{1} -} -func (m *PrometheusRequestHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrometheusRequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrometheusRequestHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrometheusRequestHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusRequestHeader.Merge(m, src) -} -func (m *PrometheusRequestHeader) XXX_Size() int { - return m.Size() -} -func (m *PrometheusRequestHeader) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusRequestHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_PrometheusRequestHeader proto.InternalMessageInfo - -func (m *PrometheusRequestHeader) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *PrometheusRequestHeader) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -type PrometheusResponseHeader struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` - Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` -} - -func (m *PrometheusResponseHeader) Reset() { *m = PrometheusResponseHeader{} } -func (*PrometheusResponseHeader) ProtoMessage() {} -func (*PrometheusResponseHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_d1a37772b6ae2c5c, []int{2} -} -func (m *PrometheusResponseHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrometheusResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrometheusResponseHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrometheusResponseHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusResponseHeader.Merge(m, src) -} -func (m *PrometheusResponseHeader) XXX_Size() int { - return m.Size() -} -func (m *PrometheusResponseHeader) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusResponseHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_PrometheusResponseHeader proto.InternalMessageInfo - -func (m *PrometheusResponseHeader) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *PrometheusResponseHeader) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -func init() { - proto.RegisterType((*CachingOptions)(nil), "definitions.CachingOptions") - proto.RegisterType((*PrometheusRequestHeader)(nil), "definitions.PrometheusRequestHeader") - proto.RegisterType((*PrometheusResponseHeader)(nil), "definitions.PrometheusResponseHeader") -} - -func init() { - proto.RegisterFile("pkg/querier/queryrange/queryrangebase/definitions/definitions.proto", fileDescriptor_d1a37772b6ae2c5c) -} - -var fileDescriptor_d1a37772b6ae2c5c = []byte{ - // 294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0x31, 0x4e, 0x33, 0x31, - 0x10, 0x85, 0xed, 0xff, 0x87, 0x28, 0x18, 0x89, 0x62, 0x85, 0x44, 0x88, 0xc4, 0x10, 0xa5, 0xa2, - 0x80, 0xb8, 0xe0, 0x06, 0x49, 0x03, 0x0d, 0xa0, 0x80, 0x28, 0xe8, 0xbc, 0xd9, 0x89, 0x63, 0x25, - 0xb1, 0x37, 0xf6, 0x6e, 0x41, 0x05, 0x47, 0xe0, 0x18, 0x1c, 0x85, 0x72, 0xcb, 0x54, 0x88, 0xf5, - 0x36, 0x88, 0x2a, 0x47, 0x40, 0x18, 0x04, 0xdb, 0x22, 0xaa, 0x79, 0xf3, 0xcd, 0x9b, 0x57, 0xcc, - 0xb0, 0x41, 0x3a, 0x95, 0x7c, 0x91, 0xa3, 0x55, 0x68, 0x43, 0xbd, 0xb5, 0x42, 0x4b, 0xac, 0xc9, - 0x58, 0x38, 0xe4, 0x09, 0x8e, 0x95, 0x56, 0x99, 0x32, 0xda, 0xd5, 0x75, 0x2f, 0xb5, 0x26, 0x33, - 0xd1, 0x66, 0x0d, 0xb5, 0xb7, 0xa5, 0x91, 0x26, 0x70, 0xfe, 0xa1, 0x3e, 0x2d, 0xdd, 0x43, 0xb6, - 0x35, 0x10, 0xa3, 0x89, 0xd2, 0xf2, 0x3c, 0x0d, 0xbe, 0xa8, 0xcd, 0x9a, 0x89, 0x72, 0x22, 0x9e, - 0x61, 0xd2, 0xa2, 0x1d, 0x7a, 0xd0, 0x1c, 0x7e, 0xf7, 0xdd, 0x4b, 0xb6, 0x73, 0x61, 0xcd, 0x1c, - 0xb3, 0x09, 0xe6, 0x6e, 0x88, 0x8b, 0x1c, 0x5d, 0x76, 0x82, 0x22, 0x41, 0x1b, 0xed, 0xb2, 0xb5, - 0x33, 0x31, 0xc7, 0xb0, 0xb2, 0xd1, 0x5f, 0x7f, 0x7b, 0xde, 0xa7, 0x47, 0xc3, 0x80, 0xa2, 0x3d, - 0xd6, 0xb8, 0x16, 0xb3, 0x1c, 0x5d, 0xeb, 0x5f, 0xe7, 0xff, 0xcf, 0xf0, 0x0b, 0x76, 0xaf, 0x58, - 0xab, 0x1e, 0xea, 0x52, 0xa3, 0x1d, 0xfe, 0x35, 0xb5, 0x7f, 0x57, 0x94, 0x40, 0x96, 0x25, 0x90, - 0x55, 0x09, 0xf4, 0xde, 0x03, 0x7d, 0xf4, 0x40, 0x9f, 0x3c, 0xd0, 0xc2, 0x03, 0x7d, 0xf1, 0x40, - 0x5f, 0x3d, 0x90, 0x95, 0x07, 0xfa, 0x50, 0x01, 0x29, 0x2a, 0x20, 0xcb, 0x0a, 0xc8, 0xcd, 0xa9, - 0x54, 0xd9, 0x24, 0x8f, 0x7b, 0x23, 0x33, 0xe7, 0xd2, 0x8a, 0xb1, 0xd0, 0x82, 0xcf, 0xcc, 0x54, - 0xf1, 0x5f, 0xbf, 0x23, 0x6e, 0x84, 0x03, 0x1f, 0xbf, 0x07, 0x00, 0x00, 0xff, 0xff, 0x09, 0x36, - 0xa9, 0xa5, 0xca, 0x01, 0x00, 0x00, -} - -func (this *CachingOptions) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CachingOptions) - if !ok { - that2, ok := that.(CachingOptions) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Disabled != that1.Disabled { - return false - } - return true -} -func (this *PrometheusRequestHeader) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PrometheusRequestHeader) - if !ok { - that2, ok := that.(PrometheusRequestHeader) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - return true -} -func (this *PrometheusResponseHeader) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PrometheusResponseHeader) - if !ok { - that2, ok := that.(PrometheusResponseHeader) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - return true -} -func (this *CachingOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&definitions.CachingOptions{") - s = append(s, "Disabled: "+fmt.Sprintf("%#v", this.Disabled)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PrometheusRequestHeader) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&definitions.PrometheusRequestHeader{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PrometheusResponseHeader) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&definitions.PrometheusResponseHeader{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDefinitions(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CachingOptions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CachingOptions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CachingOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Disabled { - i-- - if m.Disabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PrometheusRequestHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrometheusRequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrometheusResponseHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PrometheusResponseHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrometheusResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDefinitions(dAtA []byte, offset int, v uint64) int { - offset -= sovDefinitions(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CachingOptions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Disabled { - n += 2 - } - return n -} - -func (m *PrometheusRequestHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDefinitions(uint64(l)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovDefinitions(uint64(l)) - } - } - return n -} - -func (m *PrometheusResponseHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovDefinitions(uint64(l)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovDefinitions(uint64(l)) - } - } - return n -} - -func sovDefinitions(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDefinitions(x uint64) (n int) { - return sovDefinitions(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CachingOptions) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CachingOptions{`, - `Disabled:` + fmt.Sprintf("%v", this.Disabled) + `,`, - `}`, - }, "") - return s -} -func (this *PrometheusRequestHeader) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PrometheusRequestHeader{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Values:` + fmt.Sprintf("%v", this.Values) + `,`, - `}`, - }, "") - return s -} -func (this *PrometheusResponseHeader) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PrometheusResponseHeader{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Values:` + fmt.Sprintf("%v", this.Values) + `,`, - `}`, - }, "") - return s -} -func valueToStringDefinitions(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CachingOptions) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CachingOptions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CachingOptions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Disabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Disabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipDefinitions(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrometheusRequestHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PrometheusRequestHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusRequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDefinitions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDefinitions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDefinitions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDefinitions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDefinitions(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrometheusResponseHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PrometheusResponseHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDefinitions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDefinitions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDefinitions - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDefinitions - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDefinitions - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDefinitions(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthDefinitions - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDefinitions(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDefinitions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDefinitions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDefinitions - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDefinitions - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthDefinitions - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDefinitions - } - 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 := skipDefinitions(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthDefinitions - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthDefinitions = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDefinitions = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/querier/queryrange/queryrangebase/queryrange.pb.go b/pkg/querier/queryrange/queryrangebase/queryrange.pb.go deleted file mode 100644 index 121b3ffb15351..0000000000000 --- a/pkg/querier/queryrange/queryrangebase/queryrange.pb.go +++ /dev/null @@ -1,2594 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/querier/queryrange/queryrangebase/queryrange.proto - -package queryrangebase - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" - logproto "github.com/grafana/loki/pkg/logproto" - definitions "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PrometheusRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Start time.Time `protobuf:"bytes,2,opt,name=start,proto3,stdtime" json:"start"` - End time.Time `protobuf:"bytes,3,opt,name=end,proto3,stdtime" json:"end"` - Step int64 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"` - Timeout time.Duration `protobuf:"bytes,5,opt,name=timeout,proto3,stdduration" json:"timeout"` - Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` - CachingOptions definitions.CachingOptions `protobuf:"bytes,7,opt,name=cachingOptions,proto3" json:"cachingOptions"` - Headers []*definitions.PrometheusRequestHeader `protobuf:"bytes,8,rep,name=Headers,proto3" json:"-"` -} - -func (m *PrometheusRequest) Reset() { *m = PrometheusRequest{} } -func (*PrometheusRequest) ProtoMessage() {} -func (*PrometheusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{0} -} -func (m *PrometheusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrometheusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrometheusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrometheusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusRequest.Merge(m, src) -} -func (m *PrometheusRequest) XXX_Size() int { - return m.Size() -} -func (m *PrometheusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PrometheusRequest proto.InternalMessageInfo - -func (m *PrometheusRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *PrometheusRequest) GetStart() time.Time { - if m != nil { - return m.Start - } - return time.Time{} -} - -func (m *PrometheusRequest) GetEnd() time.Time { - if m != nil { - return m.End - } - return time.Time{} -} - -func (m *PrometheusRequest) GetStep() int64 { - if m != nil { - return m.Step - } - return 0 -} - -func (m *PrometheusRequest) GetTimeout() time.Duration { - if m != nil { - return m.Timeout - } - return 0 -} - -func (m *PrometheusRequest) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *PrometheusRequest) GetCachingOptions() definitions.CachingOptions { - if m != nil { - return m.CachingOptions - } - return definitions.CachingOptions{} -} - -func (m *PrometheusRequest) GetHeaders() []*definitions.PrometheusRequestHeader { - if m != nil { - return m.Headers - } - return nil -} - -type PrometheusResponse struct { - Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` - Data PrometheusData `protobuf:"bytes,2,opt,name=Data,proto3" json:"data,omitempty"` - ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` - Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` - Headers []*definitions.PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` -} - -func (m *PrometheusResponse) Reset() { *m = PrometheusResponse{} } -func (*PrometheusResponse) ProtoMessage() {} -func (*PrometheusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{1} -} -func (m *PrometheusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrometheusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrometheusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrometheusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusResponse.Merge(m, src) -} -func (m *PrometheusResponse) XXX_Size() int { - return m.Size() -} -func (m *PrometheusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PrometheusResponse proto.InternalMessageInfo - -func (m *PrometheusResponse) GetStatus() string { - if m != nil { - return m.Status - } - return "" -} - -func (m *PrometheusResponse) GetData() PrometheusData { - if m != nil { - return m.Data - } - return PrometheusData{} -} - -func (m *PrometheusResponse) GetErrorType() string { - if m != nil { - return m.ErrorType - } - return "" -} - -func (m *PrometheusResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *PrometheusResponse) GetHeaders() []*definitions.PrometheusResponseHeader { - if m != nil { - return m.Headers - } - return nil -} - -type PrometheusData struct { - ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` - Result []SampleStream `protobuf:"bytes,2,rep,name=Result,proto3" json:"result"` -} - -func (m *PrometheusData) Reset() { *m = PrometheusData{} } -func (*PrometheusData) ProtoMessage() {} -func (*PrometheusData) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{2} -} -func (m *PrometheusData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrometheusData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrometheusData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrometheusData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusData.Merge(m, src) -} -func (m *PrometheusData) XXX_Size() int { - return m.Size() -} -func (m *PrometheusData) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusData.DiscardUnknown(m) -} - -var xxx_messageInfo_PrometheusData proto.InternalMessageInfo - -func (m *PrometheusData) GetResultType() string { - if m != nil { - return m.ResultType - } - return "" -} - -func (m *PrometheusData) GetResult() []SampleStream { - if m != nil { - return m.Result - } - return nil -} - -type SampleStream struct { - Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"metric"` - Samples []logproto.LegacySample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` -} - -func (m *SampleStream) Reset() { *m = SampleStream{} } -func (*SampleStream) ProtoMessage() {} -func (*SampleStream) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{3} -} -func (m *SampleStream) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SampleStream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SampleStream.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SampleStream) XXX_Merge(src proto.Message) { - xxx_messageInfo_SampleStream.Merge(m, src) -} -func (m *SampleStream) XXX_Size() int { - return m.Size() -} -func (m *SampleStream) XXX_DiscardUnknown() { - xxx_messageInfo_SampleStream.DiscardUnknown(m) -} - -var xxx_messageInfo_SampleStream proto.InternalMessageInfo - -func (m *SampleStream) GetSamples() []logproto.LegacySample { - if m != nil { - return m.Samples - } - return nil -} - -type CachedResponse struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"` - // List of cached responses; non-overlapping and in order. - Extents []Extent `protobuf:"bytes,2,rep,name=extents,proto3" json:"extents"` -} - -func (m *CachedResponse) Reset() { *m = CachedResponse{} } -func (*CachedResponse) ProtoMessage() {} -func (*CachedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{4} -} -func (m *CachedResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CachedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CachedResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CachedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CachedResponse.Merge(m, src) -} -func (m *CachedResponse) XXX_Size() int { - return m.Size() -} -func (m *CachedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CachedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CachedResponse proto.InternalMessageInfo - -func (m *CachedResponse) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *CachedResponse) GetExtents() []Extent { - if m != nil { - return m.Extents - } - return nil -} - -type Extent struct { - Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` - End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` - TraceId string `protobuf:"bytes,4,opt,name=trace_id,json=traceId,proto3" json:"-"` - Response *types.Any `protobuf:"bytes,5,opt,name=response,proto3" json:"response"` -} - -func (m *Extent) Reset() { *m = Extent{} } -func (*Extent) ProtoMessage() {} -func (*Extent) Descriptor() ([]byte, []int) { - return fileDescriptor_4cc6a0c1d6b614c4, []int{5} -} -func (m *Extent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Extent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Extent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Extent) XXX_Merge(src proto.Message) { - xxx_messageInfo_Extent.Merge(m, src) -} -func (m *Extent) XXX_Size() int { - return m.Size() -} -func (m *Extent) XXX_DiscardUnknown() { - xxx_messageInfo_Extent.DiscardUnknown(m) -} - -var xxx_messageInfo_Extent proto.InternalMessageInfo - -func (m *Extent) GetStart() int64 { - if m != nil { - return m.Start - } - return 0 -} - -func (m *Extent) GetEnd() int64 { - if m != nil { - return m.End - } - return 0 -} - -func (m *Extent) GetTraceId() string { - if m != nil { - return m.TraceId - } - return "" -} - -func (m *Extent) GetResponse() *types.Any { - if m != nil { - return m.Response - } - return nil -} - -func init() { - proto.RegisterType((*PrometheusRequest)(nil), "queryrangebase.PrometheusRequest") - proto.RegisterType((*PrometheusResponse)(nil), "queryrangebase.PrometheusResponse") - proto.RegisterType((*PrometheusData)(nil), "queryrangebase.PrometheusData") - proto.RegisterType((*SampleStream)(nil), "queryrangebase.SampleStream") - proto.RegisterType((*CachedResponse)(nil), "queryrangebase.CachedResponse") - proto.RegisterType((*Extent)(nil), "queryrangebase.Extent") -} - -func init() { - proto.RegisterFile("pkg/querier/queryrange/queryrangebase/queryrange.proto", fileDescriptor_4cc6a0c1d6b614c4) -} - -var fileDescriptor_4cc6a0c1d6b614c4 = []byte{ - // 846 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xdc, 0x44, - 0x14, 0x5f, 0xc7, 0xfb, 0x77, 0x5a, 0x6d, 0x61, 0x1a, 0x15, 0x27, 0x45, 0xf6, 0x6a, 0x05, 0x52, - 0x90, 0xc0, 0x2b, 0x8a, 0xe8, 0x01, 0xa9, 0x88, 0x38, 0x09, 0xa2, 0x55, 0x25, 0x2a, 0xa7, 0x27, - 0x2e, 0x68, 0x76, 0xfd, 0xe2, 0x58, 0xf1, 0xbf, 0xce, 0x8c, 0x2b, 0xf6, 0xc6, 0x89, 0x73, 0x4f, - 0x88, 0x8f, 0xc0, 0x01, 0xf1, 0x39, 0x72, 0xcc, 0xb1, 0xe2, 0x60, 0xc8, 0xe6, 0x82, 0x7c, 0xea, - 0x47, 0x40, 0xf3, 0xc7, 0xbb, 0xde, 0x8d, 0x02, 0xf4, 0xb2, 0xfb, 0x66, 0xde, 0xef, 0xbd, 0xf7, - 0x7b, 0xbf, 0x79, 0x7e, 0xe8, 0x61, 0x7e, 0x16, 0x4e, 0x5e, 0x14, 0x40, 0x23, 0xa0, 0xf2, 0x7f, - 0x4e, 0x49, 0x1a, 0x42, 0xc3, 0x9c, 0x12, 0xd6, 0x3c, 0xba, 0x39, 0xcd, 0x78, 0x86, 0x87, 0xeb, - 0x80, 0xdd, 0xed, 0x30, 0x0b, 0x33, 0xe9, 0x9a, 0x08, 0x4b, 0xa1, 0x76, 0x77, 0xc2, 0x2c, 0x0b, - 0x63, 0x98, 0xc8, 0xd3, 0xb4, 0x38, 0x99, 0x90, 0x74, 0xae, 0x5d, 0xf6, 0xa6, 0x2b, 0x28, 0x28, - 0xe1, 0x51, 0x96, 0x6a, 0xbf, 0xb3, 0xe9, 0xe7, 0x51, 0x02, 0x8c, 0x93, 0x24, 0xd7, 0x80, 0xfb, - 0x82, 0x79, 0x9c, 0x85, 0xaa, 0x68, 0x6d, 0x68, 0xe7, 0xc1, 0xff, 0x6b, 0x2b, 0x80, 0x93, 0x28, - 0x8d, 0x44, 0x55, 0xd6, 0xb4, 0x55, 0x92, 0xf1, 0xcf, 0x26, 0x7a, 0xf7, 0x19, 0xcd, 0x12, 0xe0, - 0xa7, 0x50, 0x30, 0x1f, 0x5e, 0x14, 0xc0, 0x38, 0xc6, 0xa8, 0x9d, 0x13, 0x7e, 0x6a, 0x19, 0x23, - 0x63, 0x6f, 0xe0, 0x4b, 0x1b, 0x7f, 0x81, 0x3a, 0x8c, 0x13, 0xca, 0xad, 0xad, 0x91, 0xb1, 0x77, - 0xeb, 0xc1, 0xae, 0xab, 0xc8, 0xbb, 0x35, 0x79, 0xf7, 0x79, 0x4d, 0xde, 0xeb, 0x9f, 0x97, 0x4e, - 0xeb, 0xd5, 0x9f, 0x8e, 0xe1, 0xab, 0x10, 0xfc, 0x10, 0x99, 0x90, 0x06, 0x96, 0xf9, 0x16, 0x91, - 0x22, 0x40, 0xf0, 0x60, 0x1c, 0x72, 0xab, 0x3d, 0x32, 0xf6, 0x4c, 0x5f, 0xda, 0xf8, 0x11, 0xea, - 0x09, 0x99, 0xb2, 0x82, 0x5b, 0x1d, 0x99, 0x6f, 0xe7, 0x5a, 0xbe, 0x43, 0x2d, 0xb3, 0x4a, 0xf7, - 0x8b, 0x48, 0x57, 0xc7, 0xe0, 0x6d, 0xd4, 0x91, 0x02, 0x59, 0x5d, 0xd9, 0x9b, 0x3a, 0xe0, 0xc7, - 0x68, 0x38, 0x23, 0xb3, 0xd3, 0x28, 0x0d, 0xbf, 0xcd, 0xa5, 0x3c, 0x56, 0x4f, 0xe6, 0xbe, 0xef, - 0x36, 0x25, 0x3b, 0x58, 0x83, 0x78, 0x6d, 0x91, 0xdd, 0xdf, 0x08, 0xc4, 0x47, 0xa8, 0xf7, 0x0d, - 0x90, 0x00, 0x28, 0xb3, 0xfa, 0x23, 0x73, 0xef, 0xd6, 0x83, 0x0f, 0xd6, 0x72, 0x5c, 0x13, 0x5b, - 0x81, 0xbd, 0x4e, 0x55, 0x3a, 0xc6, 0x27, 0x7e, 0x1d, 0x3b, 0xfe, 0x7d, 0x0b, 0xe1, 0x26, 0x96, - 0xe5, 0x59, 0xca, 0x00, 0x8f, 0x51, 0xf7, 0x98, 0x13, 0x5e, 0x30, 0xf5, 0x36, 0x1e, 0xaa, 0x4a, - 0xa7, 0xcb, 0xe4, 0x8d, 0xaf, 0x3d, 0xf8, 0x09, 0x6a, 0x1f, 0x12, 0x4e, 0xf4, 0x43, 0xd9, 0xee, - 0xfa, 0x40, 0x34, 0x18, 0x08, 0x94, 0x77, 0x4f, 0x74, 0x51, 0x95, 0xce, 0x30, 0x20, 0x9c, 0x7c, - 0x9c, 0x25, 0x11, 0x87, 0x24, 0xe7, 0x73, 0x5f, 0xe6, 0xc0, 0x9f, 0xa3, 0xc1, 0x11, 0xa5, 0x19, - 0x7d, 0x3e, 0xcf, 0x41, 0xbe, 0xdf, 0xc0, 0x7b, 0xaf, 0x2a, 0x9d, 0xbb, 0x50, 0x5f, 0x36, 0x22, - 0x56, 0x48, 0xfc, 0x11, 0xea, 0xc8, 0x83, 0x7c, 0xb9, 0x81, 0x77, 0xb7, 0x2a, 0x9d, 0x3b, 0x32, - 0xa4, 0x01, 0x57, 0x08, 0xfc, 0xf5, 0x4a, 0xaf, 0x8e, 0xd4, 0xeb, 0xc3, 0x1b, 0xf5, 0x52, 0x1a, - 0xdc, 0x20, 0xd8, 0x4f, 0x06, 0x1a, 0xae, 0xb7, 0x86, 0x5d, 0x84, 0x7c, 0x60, 0x45, 0xcc, 0x25, - 0x7b, 0x25, 0xd8, 0xb0, 0x2a, 0x1d, 0x44, 0x97, 0xb7, 0x7e, 0x03, 0x81, 0x0f, 0x51, 0x57, 0x9d, - 0xac, 0x2d, 0xc9, 0xe4, 0xfd, 0x4d, 0xe9, 0x8e, 0x49, 0x92, 0xc7, 0x70, 0xcc, 0x29, 0x90, 0xc4, - 0x1b, 0x6a, 0xe1, 0xba, 0x2a, 0x9b, 0xaf, 0x63, 0xc7, 0xe7, 0x06, 0xba, 0xdd, 0x04, 0xe2, 0x97, - 0xa8, 0x1b, 0x93, 0x29, 0xc4, 0xe2, 0xcd, 0x4c, 0x39, 0xb0, 0xcb, 0x2f, 0xf9, 0x29, 0x84, 0x64, - 0x36, 0x7f, 0x2a, 0xbc, 0xcf, 0x48, 0x44, 0xbd, 0x03, 0x91, 0xf3, 0x8f, 0xd2, 0xf9, 0x34, 0x8c, - 0xf8, 0x69, 0x31, 0x75, 0x67, 0x59, 0x32, 0x09, 0x29, 0x39, 0x21, 0x29, 0x99, 0xc4, 0xd9, 0x59, - 0x34, 0x69, 0x2e, 0x04, 0x57, 0xc6, 0xed, 0x07, 0x24, 0xe7, 0x40, 0x05, 0x91, 0x04, 0x38, 0x8d, - 0x66, 0xbe, 0xae, 0x86, 0xbf, 0x42, 0x3d, 0x26, 0x79, 0x30, 0xdd, 0xcf, 0xbd, 0xcd, 0xc2, 0x8a, - 0xe6, 0xaa, 0x93, 0x97, 0x24, 0x2e, 0x80, 0xf9, 0x75, 0xd8, 0x38, 0x45, 0x43, 0x31, 0xf3, 0x10, - 0x2c, 0xe7, 0x6f, 0x07, 0x99, 0x67, 0x30, 0xd7, 0x5a, 0xf6, 0xaa, 0xd2, 0x11, 0x47, 0x5f, 0xfc, - 0xe0, 0x7d, 0xd4, 0x83, 0x1f, 0x38, 0xa4, 0x7c, 0x55, 0x6e, 0x43, 0xbe, 0x23, 0xe9, 0xf6, 0xee, - 0xe8, 0x72, 0x35, 0xdc, 0xaf, 0x8d, 0xf1, 0x6f, 0x06, 0xea, 0x2a, 0x10, 0x76, 0xea, 0x75, 0x23, - 0x4a, 0x99, 0xde, 0xa0, 0x2a, 0x1d, 0x75, 0x51, 0xef, 0x94, 0x1d, 0xb5, 0x53, 0xb6, 0xa4, 0x5b, - 0x32, 0x81, 0x34, 0x50, 0x6b, 0x63, 0x84, 0xfa, 0x9c, 0x92, 0x19, 0x7c, 0x1f, 0x05, 0x7a, 0x00, - 0xeb, 0x61, 0x91, 0xd7, 0x8f, 0x03, 0xfc, 0x25, 0xea, 0x53, 0xdd, 0x92, 0xde, 0x22, 0xdb, 0xd7, - 0xb6, 0xc8, 0x7e, 0x3a, 0xf7, 0x6e, 0x57, 0xa5, 0xb3, 0x44, 0xfa, 0x4b, 0xeb, 0x49, 0xbb, 0x6f, - 0xbe, 0xd3, 0xf6, 0xd8, 0xc5, 0xa5, 0xdd, 0x7a, 0x7d, 0x69, 0xb7, 0xde, 0x5c, 0xda, 0xc6, 0x8f, - 0x0b, 0xdb, 0xf8, 0x75, 0x61, 0x1b, 0xe7, 0x0b, 0xdb, 0xb8, 0x58, 0xd8, 0xc6, 0x5f, 0x0b, 0xdb, - 0xf8, 0x7b, 0x61, 0xb7, 0xde, 0x2c, 0x6c, 0xe3, 0xd5, 0x95, 0xdd, 0xba, 0xb8, 0xb2, 0x5b, 0xaf, - 0xaf, 0xec, 0xd6, 0x77, 0x8f, 0xfe, 0xed, 0x6d, 0xff, 0x73, 0x9f, 0x4f, 0xbb, 0x92, 0xe0, 0x67, - 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x63, 0x5c, 0x0b, 0x88, 0xd6, 0x06, 0x00, 0x00, -} - -func (this *PrometheusRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PrometheusRequest) - if !ok { - that2, ok := that.(PrometheusRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if !this.Start.Equal(that1.Start) { - return false - } - if !this.End.Equal(that1.End) { - return false - } - if this.Step != that1.Step { - return false - } - if this.Timeout != that1.Timeout { - return false - } - if this.Query != that1.Query { - return false - } - if !this.CachingOptions.Equal(&that1.CachingOptions) { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *PrometheusResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PrometheusResponse) - if !ok { - that2, ok := that.(PrometheusResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if !this.Data.Equal(&that1.Data) { - return false - } - if this.ErrorType != that1.ErrorType { - return false - } - if this.Error != that1.Error { - return false - } - if len(this.Headers) != len(that1.Headers) { - return false - } - for i := range this.Headers { - if !this.Headers[i].Equal(that1.Headers[i]) { - return false - } - } - return true -} -func (this *PrometheusData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PrometheusData) - if !ok { - that2, ok := that.(PrometheusData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ResultType != that1.ResultType { - return false - } - if len(this.Result) != len(that1.Result) { - return false - } - for i := range this.Result { - if !this.Result[i].Equal(&that1.Result[i]) { - return false - } - } - return true -} -func (this *SampleStream) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SampleStream) - if !ok { - that2, ok := that.(SampleStream) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Samples) != len(that1.Samples) { - return false - } - for i := range this.Samples { - if !this.Samples[i].Equal(&that1.Samples[i]) { - return false - } - } - return true -} -func (this *CachedResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CachedResponse) - if !ok { - that2, ok := that.(CachedResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Key != that1.Key { - return false - } - if len(this.Extents) != len(that1.Extents) { - return false - } - for i := range this.Extents { - if !this.Extents[i].Equal(&that1.Extents[i]) { - return false - } - } - return true -} -func (this *Extent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Extent) - if !ok { - that2, ok := that.(Extent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Start != that1.Start { - return false - } - if this.End != that1.End { - return false - } - if this.TraceId != that1.TraceId { - return false - } - if !this.Response.Equal(that1.Response) { - return false - } - return true -} -func (this *PrometheusRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&queryrangebase.PrometheusRequest{") - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") - s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") - s = append(s, "Step: "+fmt.Sprintf("%#v", this.Step)+",\n") - s = append(s, "Timeout: "+fmt.Sprintf("%#v", this.Timeout)+",\n") - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") - s = append(s, "CachingOptions: "+strings.Replace(this.CachingOptions.GoString(), `&`, ``, 1)+",\n") - if this.Headers != nil { - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PrometheusResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&queryrangebase.PrometheusResponse{") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "Data: "+strings.Replace(this.Data.GoString(), `&`, ``, 1)+",\n") - s = append(s, "ErrorType: "+fmt.Sprintf("%#v", this.ErrorType)+",\n") - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - if this.Headers != nil { - s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PrometheusData) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrangebase.PrometheusData{") - s = append(s, "ResultType: "+fmt.Sprintf("%#v", this.ResultType)+",\n") - if this.Result != nil { - vs := make([]*SampleStream, len(this.Result)) - for i := range vs { - vs[i] = &this.Result[i] - } - s = append(s, "Result: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SampleStream) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrangebase.SampleStream{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Samples != nil { - vs := make([]*logproto.LegacySample, len(this.Samples)) - for i := range vs { - vs[i] = &this.Samples[i] - } - s = append(s, "Samples: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CachedResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&queryrangebase.CachedResponse{") - s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") - if this.Extents != nil { - vs := make([]*Extent, len(this.Extents)) - for i := range vs { - vs[i] = &this.Extents[i] - } - s = append(s, "Extents: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Extent) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&queryrangebase.Extent{") - s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") - s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") - s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") - if this.Response != nil { - s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringQueryrange(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *PrometheusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PrometheusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrometheusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - { - size, err := m.CachingOptions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - if len(m.Query) > 0 { - i -= len(m.Query) - copy(dAtA[i:], m.Query) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) - i-- - dAtA[i] = 0x32 - } - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintQueryrange(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x2a - if m.Step != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x20 - } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintQueryrange(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintQueryrange(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrometheusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PrometheusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrometheusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x22 - } - if len(m.ErrorType) > 0 { - i -= len(m.ErrorType) - copy(dAtA[i:], m.ErrorType) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ErrorType))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrometheusData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PrometheusData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrometheusData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Result) > 0 { - for iNdEx := len(m.Result) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Result[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ResultType) > 0 { - i -= len(m.ResultType) - copy(dAtA[i:], m.ResultType) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ResultType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SampleStream) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SampleStream) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = 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 = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CachedResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CachedResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CachedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Extents) > 0 { - for iNdEx := len(m.Extents) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Extents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Extent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Extent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Extent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Response != nil { - { - size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQueryrange(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.TraceId) > 0 { - i -= len(m.TraceId) - copy(dAtA[i:], m.TraceId) - i = encodeVarintQueryrange(dAtA, i, uint64(len(m.TraceId))) - i-- - dAtA[i] = 0x22 - } - if m.End != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x10 - } - if m.Start != 0 { - i = encodeVarintQueryrange(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintQueryrange(dAtA []byte, offset int, v uint64) int { - offset -= sovQueryrange(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PrometheusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) - n += 1 + l + sovQueryrange(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) - n += 1 + l + sovQueryrange(uint64(l)) - if m.Step != 0 { - n += 1 + sovQueryrange(uint64(m.Step)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) - n += 1 + l + sovQueryrange(uint64(l)) - l = len(m.Query) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = m.CachingOptions.Size() - n += 1 + l + sovQueryrange(uint64(l)) - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *PrometheusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = m.Data.Size() - n += 1 + l + sovQueryrange(uint64(l)) - l = len(m.ErrorType) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *PrometheusData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ResultType) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Result) > 0 { - for _, e := range m.Result { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *SampleStream) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - if len(m.Samples) > 0 { - for _, e := range m.Samples { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *CachedResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if len(m.Extents) > 0 { - for _, e := range m.Extents { - l = e.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - } - return n -} - -func (m *Extent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Start != 0 { - n += 1 + sovQueryrange(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovQueryrange(uint64(m.End)) - } - l = len(m.TraceId) - if l > 0 { - n += 1 + l + sovQueryrange(uint64(l)) - } - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovQueryrange(uint64(l)) - } - return n -} - -func sovQueryrange(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQueryrange(x uint64) (n int) { - return sovQueryrange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PrometheusRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForHeaders := "[]*PrometheusRequestHeader{" - for _, f := range this.Headers { - repeatedStringForHeaders += strings.Replace(fmt.Sprintf("%v", f), "PrometheusRequestHeader", "definitions.PrometheusRequestHeader", 1) + "," - } - repeatedStringForHeaders += "}" - s := strings.Join([]string{`&PrometheusRequest{`, - `Path:` + fmt.Sprintf("%v", this.Path) + `,`, - `Start:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Start), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `End:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.End), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `Step:` + fmt.Sprintf("%v", this.Step) + `,`, - `Timeout:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timeout), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `Query:` + fmt.Sprintf("%v", this.Query) + `,`, - `CachingOptions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CachingOptions), "CachingOptions", "definitions.CachingOptions", 1), `&`, ``, 1) + `,`, - `Headers:` + repeatedStringForHeaders + `,`, - `}`, - }, "") - return s -} -func (this *PrometheusResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForHeaders := "[]*PrometheusResponseHeader{" - for _, f := range this.Headers { - repeatedStringForHeaders += strings.Replace(fmt.Sprintf("%v", f), "PrometheusResponseHeader", "definitions.PrometheusResponseHeader", 1) + "," - } - repeatedStringForHeaders += "}" - s := strings.Join([]string{`&PrometheusResponse{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Data:` + strings.Replace(strings.Replace(this.Data.String(), "PrometheusData", "PrometheusData", 1), `&`, ``, 1) + `,`, - `ErrorType:` + fmt.Sprintf("%v", this.ErrorType) + `,`, - `Error:` + fmt.Sprintf("%v", this.Error) + `,`, - `Headers:` + repeatedStringForHeaders + `,`, - `}`, - }, "") - return s -} -func (this *PrometheusData) String() string { - if this == nil { - return "nil" - } - repeatedStringForResult := "[]SampleStream{" - for _, f := range this.Result { - repeatedStringForResult += strings.Replace(strings.Replace(f.String(), "SampleStream", "SampleStream", 1), `&`, ``, 1) + "," - } - repeatedStringForResult += "}" - s := strings.Join([]string{`&PrometheusData{`, - `ResultType:` + fmt.Sprintf("%v", this.ResultType) + `,`, - `Result:` + repeatedStringForResult + `,`, - `}`, - }, "") - return s -} -func (this *SampleStream) String() string { - if this == nil { - return "nil" - } - repeatedStringForSamples := "[]LegacySample{" - for _, f := range this.Samples { - repeatedStringForSamples += fmt.Sprintf("%v", f) + "," - } - repeatedStringForSamples += "}" - s := strings.Join([]string{`&SampleStream{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Samples:` + repeatedStringForSamples + `,`, - `}`, - }, "") - return s -} -func (this *CachedResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForExtents := "[]Extent{" - for _, f := range this.Extents { - repeatedStringForExtents += strings.Replace(strings.Replace(f.String(), "Extent", "Extent", 1), `&`, ``, 1) + "," - } - repeatedStringForExtents += "}" - s := strings.Join([]string{`&CachedResponse{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Extents:` + repeatedStringForExtents + `,`, - `}`, - }, "") - return s -} -func (this *Extent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Extent{`, - `Start:` + fmt.Sprintf("%v", this.Start) + `,`, - `End:` + fmt.Sprintf("%v", this.End) + `,`, - `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, - `Response:` + strings.Replace(fmt.Sprintf("%v", this.Response), "Any", "types.Any", 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringQueryrange(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *PrometheusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PrometheusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CachingOptions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CachingOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, &definitions.PrometheusRequestHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrometheusResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PrometheusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ErrorType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Headers = append(m.Headers, &definitions.PrometheusResponseHeader{}) - if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrometheusData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PrometheusData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResultType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResultType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = append(m.Result, SampleStream{}) - if err := m.Result[len(m.Result)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SampleStream) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SampleStream: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SampleStream: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Samples = append(m.Samples, logproto.LegacySample{}) - if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CachedResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CachedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CachedResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extents", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extents = append(m.Extents, Extent{}) - if err := m.Extents[len(m.Extents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Extent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Extent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Extent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) - } - m.Start = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - m.End = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQueryrange - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQueryrange - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQueryrange - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &types.Any{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQueryrange(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthQueryrange - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQueryrange(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQueryrange - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthQueryrange - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQueryrange - } - 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 := skipQueryrange(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthQueryrange - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/querier/stats/stats.pb.go b/pkg/querier/stats/stats.pb.go deleted file mode 100644 index bb56bb26c49c0..0000000000000 --- a/pkg/querier/stats/stats.pb.go +++ /dev/null @@ -1,501 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/querier/stats/stats.proto - -package stats - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Stats struct { - // The sum of all wall time spent in the querier to execute the query. - WallTime time.Duration `protobuf:"bytes,1,opt,name=wall_time,json=wallTime,proto3,stdduration" json:"wall_time"` - // The number of series fetched for the query - FetchedSeriesCount uint64 `protobuf:"varint,2,opt,name=fetched_series_count,json=fetchedSeriesCount,proto3" json:"fetched_series_count,omitempty"` - // The number of bytes of the chunks fetched for the query - FetchedChunkBytes uint64 `protobuf:"varint,3,opt,name=fetched_chunk_bytes,json=fetchedChunkBytes,proto3" json:"fetched_chunk_bytes,omitempty"` -} - -func (m *Stats) Reset() { *m = Stats{} } -func (*Stats) ProtoMessage() {} -func (*Stats) Descriptor() ([]byte, []int) { - return fileDescriptor_8ca2404f80bab2e8, []int{0} -} -func (m *Stats) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Stats.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Stats) XXX_Merge(src proto.Message) { - xxx_messageInfo_Stats.Merge(m, src) -} -func (m *Stats) XXX_Size() int { - return m.Size() -} -func (m *Stats) XXX_DiscardUnknown() { - xxx_messageInfo_Stats.DiscardUnknown(m) -} - -var xxx_messageInfo_Stats proto.InternalMessageInfo - -func (m *Stats) GetWallTime() time.Duration { - if m != nil { - return m.WallTime - } - return 0 -} - -func (m *Stats) GetFetchedSeriesCount() uint64 { - if m != nil { - return m.FetchedSeriesCount - } - return 0 -} - -func (m *Stats) GetFetchedChunkBytes() uint64 { - if m != nil { - return m.FetchedChunkBytes - } - return 0 -} - -func init() { - proto.RegisterType((*Stats)(nil), "stats.Stats") -} - -func init() { proto.RegisterFile("pkg/querier/stats/stats.proto", fileDescriptor_8ca2404f80bab2e8) } - -var fileDescriptor_8ca2404f80bab2e8 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0xd0, 0xb1, 0x4e, 0x3a, 0x31, - 0x1c, 0xc0, 0xf1, 0xfe, 0xfe, 0x7f, 0x31, 0x78, 0x4e, 0x9e, 0x0c, 0x48, 0xe2, 0x0f, 0xe2, 0x84, - 0xcb, 0xd5, 0xe8, 0x0b, 0x18, 0xf0, 0x09, 0xc0, 0xc9, 0xe5, 0xd2, 0x3b, 0x4a, 0x69, 0x38, 0xae, - 0x78, 0xd7, 0xc6, 0xb8, 0xf9, 0x08, 0x8e, 0x3e, 0x82, 0x89, 0x2f, 0xc2, 0xc8, 0xc8, 0xa4, 0x52, - 0x16, 0x47, 0x1e, 0xc1, 0xb4, 0x07, 0x93, 0x4b, 0xd3, 0x5f, 0x3f, 0xf9, 0x26, 0x6d, 0x83, 0xf3, - 0xf9, 0x54, 0xd0, 0x47, 0xc3, 0x0b, 0xc9, 0x0b, 0x5a, 0x6a, 0xa6, 0xcb, 0x6a, 0x8d, 0xe6, 0x85, - 0xd2, 0x2a, 0xac, 0xf9, 0xa1, 0xd5, 0x10, 0x4a, 0x28, 0x7f, 0x42, 0xdd, 0xae, 0xc2, 0x16, 0x0a, - 0xa5, 0x44, 0xc6, 0xa9, 0x9f, 0x12, 0x33, 0xa6, 0x23, 0x53, 0x30, 0x2d, 0x55, 0x5e, 0xf9, 0xc5, - 0x07, 0x04, 0xb5, 0xa1, 0xeb, 0xc3, 0xdb, 0xe0, 0xe8, 0x89, 0x65, 0x59, 0xac, 0xe5, 0x8c, 0x37, - 0xa1, 0x03, 0xdd, 0xe3, 0xeb, 0xb3, 0xa8, 0xaa, 0xa3, 0x7d, 0x1d, 0xdd, 0xed, 0xea, 0x5e, 0x7d, - 0xf1, 0xd9, 0x26, 0x6f, 0x5f, 0x6d, 0x18, 0xd4, 0x5d, 0x75, 0x2f, 0x67, 0x3c, 0xbc, 0x0a, 0x1a, - 0x63, 0xae, 0xd3, 0x09, 0x1f, 0xc5, 0xa5, 0xbb, 0x6c, 0x19, 0xa7, 0xca, 0xe4, 0xba, 0xf9, 0xaf, - 0x03, 0xdd, 0x83, 0x41, 0xb8, 0xb3, 0xa1, 0xa7, 0xbe, 0x93, 0x30, 0x0a, 0x4e, 0xf7, 0x45, 0x3a, - 0x31, 0xf9, 0x34, 0x4e, 0x9e, 0x35, 0x2f, 0x9b, 0xff, 0x7d, 0x70, 0xb2, 0xa3, 0xbe, 0x93, 0x9e, - 0x83, 0x5e, 0xbc, 0x5c, 0x23, 0x59, 0xad, 0x91, 0x6c, 0xd7, 0x08, 0x2f, 0x16, 0xe1, 0xdd, 0x22, - 0x2c, 0x2c, 0xc2, 0xd2, 0x22, 0x7c, 0x5b, 0x84, 0x1f, 0x8b, 0x64, 0x6b, 0x11, 0x5e, 0x37, 0x48, - 0x96, 0x1b, 0x24, 0xab, 0x0d, 0x92, 0x87, 0x4b, 0x21, 0xf5, 0xc4, 0x24, 0x51, 0xaa, 0x66, 0x54, - 0x14, 0x6c, 0xcc, 0x72, 0x46, 0x33, 0x35, 0x95, 0xf4, 0xcf, 0xbf, 0x26, 0x87, 0xfe, 0xa5, 0x37, - 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe6, 0x22, 0x2b, 0x73, 0x01, 0x00, 0x00, -} - -func (this *Stats) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Stats) - if !ok { - that2, ok := that.(Stats) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.WallTime != that1.WallTime { - return false - } - if this.FetchedSeriesCount != that1.FetchedSeriesCount { - return false - } - if this.FetchedChunkBytes != that1.FetchedChunkBytes { - return false - } - return true -} -func (this *Stats) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&stats.Stats{") - s = append(s, "WallTime: "+fmt.Sprintf("%#v", this.WallTime)+",\n") - s = append(s, "FetchedSeriesCount: "+fmt.Sprintf("%#v", this.FetchedSeriesCount)+",\n") - s = append(s, "FetchedChunkBytes: "+fmt.Sprintf("%#v", this.FetchedChunkBytes)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringStats(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *Stats) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Stats) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FetchedChunkBytes != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.FetchedChunkBytes)) - i-- - dAtA[i] = 0x18 - } - if m.FetchedSeriesCount != 0 { - i = encodeVarintStats(dAtA, i, uint64(m.FetchedSeriesCount)) - i-- - dAtA[i] = 0x10 - } - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.WallTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.WallTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintStats(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintStats(dAtA []byte, offset int, v uint64) int { - offset -= sovStats(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Stats) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.WallTime) - n += 1 + l + sovStats(uint64(l)) - if m.FetchedSeriesCount != 0 { - n += 1 + sovStats(uint64(m.FetchedSeriesCount)) - } - if m.FetchedChunkBytes != 0 { - n += 1 + sovStats(uint64(m.FetchedChunkBytes)) - } - return n -} - -func sovStats(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStats(x uint64) (n int) { - return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Stats) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Stats{`, - `WallTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.WallTime), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `FetchedSeriesCount:` + fmt.Sprintf("%v", this.FetchedSeriesCount) + `,`, - `FetchedChunkBytes:` + fmt.Sprintf("%v", this.FetchedChunkBytes) + `,`, - `}`, - }, "") - return s -} -func valueToStringStats(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Stats) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Stats: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Stats: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WallTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStats - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStats - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.WallTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FetchedSeriesCount", wireType) - } - m.FetchedSeriesCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FetchedSeriesCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FetchedChunkBytes", wireType) - } - m.FetchedChunkBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStats - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FetchedChunkBytes |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStats(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStats(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStats - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - 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 := skipStats(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/ruler/base/ruler.pb.go b/pkg/ruler/base/ruler.pb.go deleted file mode 100644 index b53b55afc96ee..0000000000000 --- a/pkg/ruler/base/ruler.pb.go +++ /dev/null @@ -1,2380 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/ruler/base/ruler.proto - -package base - -import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/grafana/loki/pkg/logproto" - github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" - rulespb "github.com/grafana/loki/pkg/ruler/rulespb" - 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" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type RulesRequest struct { -} - -func (m *RulesRequest) Reset() { *m = RulesRequest{} } -func (*RulesRequest) ProtoMessage() {} -func (*RulesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ca810a0fd7057a73, []int{0} -} -func (m *RulesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RulesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RulesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RulesRequest.Merge(m, src) -} -func (m *RulesRequest) XXX_Size() int { - return m.Size() -} -func (m *RulesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RulesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RulesRequest proto.InternalMessageInfo - -type RulesResponse struct { - Groups []*GroupStateDesc `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` -} - -func (m *RulesResponse) Reset() { *m = RulesResponse{} } -func (*RulesResponse) ProtoMessage() {} -func (*RulesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ca810a0fd7057a73, []int{1} -} -func (m *RulesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RulesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RulesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RulesResponse.Merge(m, src) -} -func (m *RulesResponse) XXX_Size() int { - return m.Size() -} -func (m *RulesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RulesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RulesResponse proto.InternalMessageInfo - -func (m *RulesResponse) GetGroups() []*GroupStateDesc { - if m != nil { - return m.Groups - } - return nil -} - -// GroupStateDesc is a proto representation of a rule group -type GroupStateDesc struct { - Group *rulespb.RuleGroupDesc `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - ActiveRules []*RuleStateDesc `protobuf:"bytes,2,rep,name=active_rules,json=activeRules,proto3" json:"active_rules,omitempty"` - EvaluationTimestamp time.Time `protobuf:"bytes,3,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` - EvaluationDuration time.Duration `protobuf:"bytes,4,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` -} - -func (m *GroupStateDesc) Reset() { *m = GroupStateDesc{} } -func (*GroupStateDesc) ProtoMessage() {} -func (*GroupStateDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_ca810a0fd7057a73, []int{2} -} -func (m *GroupStateDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GroupStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GroupStateDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GroupStateDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupStateDesc.Merge(m, src) -} -func (m *GroupStateDesc) XXX_Size() int { - return m.Size() -} -func (m *GroupStateDesc) XXX_DiscardUnknown() { - xxx_messageInfo_GroupStateDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupStateDesc proto.InternalMessageInfo - -func (m *GroupStateDesc) GetGroup() *rulespb.RuleGroupDesc { - if m != nil { - return m.Group - } - return nil -} - -func (m *GroupStateDesc) GetActiveRules() []*RuleStateDesc { - if m != nil { - return m.ActiveRules - } - return nil -} - -func (m *GroupStateDesc) GetEvaluationTimestamp() time.Time { - if m != nil { - return m.EvaluationTimestamp - } - return time.Time{} -} - -func (m *GroupStateDesc) GetEvaluationDuration() time.Duration { - if m != nil { - return m.EvaluationDuration - } - return 0 -} - -// RuleStateDesc is a proto representation of a Prometheus Rule -type RuleStateDesc struct { - Rule *rulespb.RuleDesc `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` - State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - Health string `protobuf:"bytes,3,opt,name=health,proto3" json:"health,omitempty"` - LastError string `protobuf:"bytes,4,opt,name=lastError,proto3" json:"lastError,omitempty"` - Alerts []*AlertStateDesc `protobuf:"bytes,5,rep,name=alerts,proto3" json:"alerts,omitempty"` - EvaluationTimestamp time.Time `protobuf:"bytes,6,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` - EvaluationDuration time.Duration `protobuf:"bytes,7,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` -} - -func (m *RuleStateDesc) Reset() { *m = RuleStateDesc{} } -func (*RuleStateDesc) ProtoMessage() {} -func (*RuleStateDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_ca810a0fd7057a73, []int{3} -} -func (m *RuleStateDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuleStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuleStateDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RuleStateDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuleStateDesc.Merge(m, src) -} -func (m *RuleStateDesc) XXX_Size() int { - return m.Size() -} -func (m *RuleStateDesc) XXX_DiscardUnknown() { - xxx_messageInfo_RuleStateDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_RuleStateDesc proto.InternalMessageInfo - -func (m *RuleStateDesc) GetRule() *rulespb.RuleDesc { - if m != nil { - return m.Rule - } - return nil -} - -func (m *RuleStateDesc) GetState() string { - if m != nil { - return m.State - } - return "" -} - -func (m *RuleStateDesc) GetHealth() string { - if m != nil { - return m.Health - } - return "" -} - -func (m *RuleStateDesc) GetLastError() string { - if m != nil { - return m.LastError - } - return "" -} - -func (m *RuleStateDesc) GetAlerts() []*AlertStateDesc { - if m != nil { - return m.Alerts - } - return nil -} - -func (m *RuleStateDesc) GetEvaluationTimestamp() time.Time { - if m != nil { - return m.EvaluationTimestamp - } - return time.Time{} -} - -func (m *RuleStateDesc) GetEvaluationDuration() time.Duration { - if m != nil { - return m.EvaluationDuration - } - return 0 -} - -type AlertStateDesc struct { - State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"annotations"` - Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` - ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` - FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` - ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` - LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` - ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` -} - -func (m *AlertStateDesc) Reset() { *m = AlertStateDesc{} } -func (*AlertStateDesc) ProtoMessage() {} -func (*AlertStateDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_ca810a0fd7057a73, []int{4} -} -func (m *AlertStateDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AlertStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AlertStateDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AlertStateDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_AlertStateDesc.Merge(m, src) -} -func (m *AlertStateDesc) XXX_Size() int { - return m.Size() -} -func (m *AlertStateDesc) XXX_DiscardUnknown() { - xxx_messageInfo_AlertStateDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_AlertStateDesc proto.InternalMessageInfo - -func (m *AlertStateDesc) GetState() string { - if m != nil { - return m.State - } - return "" -} - -func (m *AlertStateDesc) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *AlertStateDesc) GetActiveAt() time.Time { - if m != nil { - return m.ActiveAt - } - return time.Time{} -} - -func (m *AlertStateDesc) GetFiredAt() time.Time { - if m != nil { - return m.FiredAt - } - return time.Time{} -} - -func (m *AlertStateDesc) GetResolvedAt() time.Time { - if m != nil { - return m.ResolvedAt - } - return time.Time{} -} - -func (m *AlertStateDesc) GetLastSentAt() time.Time { - if m != nil { - return m.LastSentAt - } - return time.Time{} -} - -func (m *AlertStateDesc) GetValidUntil() time.Time { - if m != nil { - return m.ValidUntil - } - return time.Time{} -} - -func init() { - proto.RegisterType((*RulesRequest)(nil), "base.RulesRequest") - proto.RegisterType((*RulesResponse)(nil), "base.RulesResponse") - proto.RegisterType((*GroupStateDesc)(nil), "base.GroupStateDesc") - proto.RegisterType((*RuleStateDesc)(nil), "base.RuleStateDesc") - proto.RegisterType((*AlertStateDesc)(nil), "base.AlertStateDesc") -} - -func init() { proto.RegisterFile("pkg/ruler/base/ruler.proto", fileDescriptor_ca810a0fd7057a73) } - -var fileDescriptor_ca810a0fd7057a73 = []byte{ - // 682 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x8e, 0xbb, 0xb6, 0x6b, 0xdd, 0x31, 0x24, 0x6f, 0x42, 0x59, 0x01, 0x77, 0x2a, 0x97, 0x09, - 0xa1, 0x44, 0x0c, 0x84, 0x84, 0x10, 0x42, 0x9d, 0x36, 0xb8, 0xec, 0x80, 0x32, 0xe0, 0x3a, 0xb9, - 0xad, 0x97, 0x45, 0xf3, 0xe2, 0x60, 0x3b, 0x95, 0xb8, 0xf1, 0x13, 0x76, 0xe4, 0xca, 0x8d, 0x9f, - 0xb2, 0xe3, 0x8e, 0x13, 0x48, 0x83, 0x65, 0x17, 0x8e, 0xfb, 0x01, 0x1c, 0x90, 0xed, 0x64, 0xc9, - 0x60, 0x1c, 0x2a, 0xb4, 0x4b, 0x6b, 0xbf, 0xf7, 0xbe, 0xef, 0x7b, 0xef, 0xb3, 0x1d, 0xd8, 0x4d, - 0xf6, 0x42, 0x5f, 0xa4, 0x8c, 0x0a, 0x7f, 0x48, 0x24, 0xb5, 0x4b, 0x2f, 0x11, 0x5c, 0x71, 0x54, - 0xd7, 0x91, 0xee, 0x62, 0xc8, 0x43, 0x6e, 0x02, 0xbe, 0x5e, 0xd9, 0x5c, 0x17, 0x87, 0x9c, 0x87, - 0x8c, 0xfa, 0x66, 0x37, 0x4c, 0x77, 0xfc, 0x71, 0x2a, 0x88, 0x8a, 0x78, 0x9c, 0xe7, 0x7b, 0x7f, - 0xe6, 0x55, 0xb4, 0x4f, 0xa5, 0x22, 0xfb, 0x49, 0x5e, 0x70, 0x5b, 0x0b, 0x33, 0x1e, 0x5a, 0xe6, - 0x62, 0x91, 0x27, 0xef, 0x96, 0x5d, 0xe9, 0x5f, 0x99, 0x0c, 0xed, 0xbf, 0x4d, 0xf7, 0xe7, 0xe1, - 0x5c, 0xa0, 0xb7, 0x01, 0x7d, 0x9f, 0x52, 0xa9, 0xfa, 0xcf, 0xe1, 0x8d, 0x7c, 0x2f, 0x13, 0x1e, - 0x4b, 0x8a, 0x1e, 0xc0, 0x66, 0x28, 0x78, 0x9a, 0x48, 0x17, 0x2c, 0xcf, 0xac, 0x74, 0x56, 0x17, - 0x3d, 0x3d, 0x8a, 0xf7, 0x4a, 0xc7, 0xb6, 0x14, 0x51, 0x74, 0x9d, 0xca, 0x51, 0x90, 0xd7, 0xf4, - 0x3f, 0xd7, 0xe0, 0xfc, 0xe5, 0x14, 0xba, 0x0f, 0x1b, 0x26, 0xe9, 0x82, 0x65, 0x60, 0xf0, 0x56, - 0x5e, 0xab, 0x98, 0x4a, 0x83, 0xb7, 0x25, 0xe8, 0x09, 0x9c, 0x23, 0x23, 0x15, 0x4d, 0xe8, 0xb6, - 0x29, 0x72, 0x6b, 0x46, 0x72, 0xc1, 0x4a, 0x6a, 0x44, 0xa9, 0xd8, 0xb1, 0x85, 0xa6, 0x59, 0xf4, - 0x0e, 0x2e, 0xd0, 0x09, 0x61, 0xa9, 0xb1, 0xed, 0x4d, 0x61, 0x8f, 0x3b, 0x63, 0x14, 0xbb, 0x9e, - 0x35, 0xd0, 0x2b, 0x0c, 0xf4, 0x2e, 0x2a, 0xd6, 0x5a, 0x87, 0x27, 0x3d, 0xe7, 0xe0, 0x7b, 0x0f, - 0x04, 0x57, 0x11, 0xa0, 0x2d, 0x88, 0xca, 0xf0, 0x7a, 0x7e, 0x2c, 0x6e, 0xdd, 0xd0, 0x2e, 0xfd, - 0x45, 0x5b, 0x14, 0x58, 0xd6, 0x4f, 0x9a, 0xf5, 0x0a, 0x78, 0xff, 0x5b, 0xcd, 0x7a, 0x5c, 0x5a, - 0x74, 0x0f, 0xd6, 0xf5, 0xbc, 0xb9, 0x43, 0x37, 0x2b, 0x0e, 0x99, 0x51, 0x4d, 0x12, 0x2d, 0xc2, - 0x86, 0xd4, 0x08, 0xb7, 0xb6, 0x0c, 0x56, 0xda, 0x81, 0xdd, 0xa0, 0x5b, 0xb0, 0xb9, 0x4b, 0x09, - 0x53, 0xbb, 0x66, 0xd8, 0x76, 0x90, 0xef, 0xd0, 0x1d, 0xd8, 0x66, 0x44, 0xaa, 0x0d, 0x21, 0xb8, - 0x30, 0x0d, 0xb7, 0x83, 0x32, 0xa0, 0x0f, 0x95, 0x30, 0x2a, 0x94, 0x74, 0x1b, 0xd5, 0x43, 0x1d, - 0xe8, 0x58, 0xe5, 0x50, 0x6d, 0xcd, 0xbf, 0xdc, 0x6d, 0x5e, 0x8f, 0xbb, 0xb3, 0xff, 0xe7, 0xee, - 0xaf, 0x3a, 0x9c, 0xbf, 0x3c, 0x47, 0xe9, 0x1c, 0xa8, 0x3a, 0xc7, 0x60, 0x93, 0x91, 0x21, 0x65, - 0xc5, 0x2d, 0x5b, 0xf2, 0x2e, 0x5e, 0xce, 0x26, 0x0d, 0xc9, 0xe8, 0xc3, 0xa6, 0xce, 0xbe, 0x26, - 0x91, 0x58, 0x7b, 0xaa, 0x15, 0xbf, 0x9e, 0xf4, 0x1e, 0x86, 0x91, 0xda, 0x4d, 0x87, 0xde, 0x88, - 0xef, 0xfb, 0xa1, 0x20, 0x3b, 0x24, 0x26, 0x3e, 0xe3, 0x7b, 0x91, 0x5f, 0x7d, 0x80, 0x9e, 0xc1, - 0x0d, 0xc6, 0x24, 0x51, 0x54, 0x04, 0xb9, 0x06, 0x9a, 0xc0, 0x0e, 0x89, 0x63, 0xae, 0x4c, 0x93, - 0xd2, 0x9d, 0xb9, 0x46, 0xc9, 0xaa, 0x90, 0x9e, 0x5d, 0x7b, 0x44, 0xcd, 0x1d, 0x00, 0x81, 0xdd, - 0xa0, 0x01, 0x6c, 0xe7, 0xef, 0x8c, 0x28, 0xb7, 0x31, 0xc5, 0x39, 0xb6, 0x2c, 0x6c, 0xa0, 0xd0, - 0x0b, 0xd8, 0xda, 0x89, 0x04, 0x1d, 0x6b, 0x86, 0x69, 0x6e, 0xc2, 0xac, 0x41, 0x0d, 0x14, 0xda, - 0x80, 0x1d, 0x41, 0x25, 0x67, 0x13, 0xcb, 0x31, 0x3b, 0x05, 0x07, 0x2c, 0x80, 0x03, 0x85, 0x5e, - 0xc2, 0x39, 0x7d, 0xaf, 0xb7, 0x25, 0x8d, 0x95, 0xe6, 0x69, 0x4d, 0xc3, 0xa3, 0x91, 0x5b, 0x34, - 0x56, 0xb6, 0x9d, 0x09, 0x61, 0xd1, 0x78, 0x3b, 0x8d, 0x55, 0xc4, 0xdc, 0xf6, 0x34, 0x34, 0x06, - 0xf8, 0x56, 0xe3, 0x56, 0x9f, 0xc1, 0x86, 0x7e, 0xb7, 0x02, 0xad, 0xda, 0x85, 0x44, 0xa8, 0xfc, - 0x7a, 0x15, 0x5f, 0xd9, 0xee, 0xc2, 0xa5, 0x98, 0xfd, 0xd2, 0xf6, 0x9d, 0xb5, 0xc7, 0x47, 0xa7, - 0xd8, 0x39, 0x3e, 0xc5, 0xce, 0xf9, 0x29, 0x06, 0x1f, 0x33, 0x0c, 0xbe, 0x64, 0x18, 0x1c, 0x66, - 0x18, 0x1c, 0x65, 0x18, 0xfc, 0xc8, 0x30, 0xf8, 0x99, 0x61, 0xe7, 0x3c, 0xc3, 0xe0, 0xe0, 0x0c, - 0x3b, 0x47, 0x67, 0xd8, 0x39, 0x3e, 0xc3, 0xce, 0xb0, 0x69, 0x9a, 0x7b, 0xf4, 0x3b, 0x00, 0x00, - 0xff, 0xff, 0x35, 0xb6, 0x62, 0xce, 0x80, 0x06, 0x00, 0x00, -} - -func (this *RulesRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RulesRequest) - if !ok { - that2, ok := that.(RulesRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *RulesResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RulesResponse) - if !ok { - that2, ok := that.(RulesResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Groups) != len(that1.Groups) { - return false - } - for i := range this.Groups { - if !this.Groups[i].Equal(that1.Groups[i]) { - return false - } - } - return true -} -func (this *GroupStateDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GroupStateDesc) - if !ok { - that2, ok := that.(GroupStateDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Group.Equal(that1.Group) { - return false - } - if len(this.ActiveRules) != len(that1.ActiveRules) { - return false - } - for i := range this.ActiveRules { - if !this.ActiveRules[i].Equal(that1.ActiveRules[i]) { - return false - } - } - if !this.EvaluationTimestamp.Equal(that1.EvaluationTimestamp) { - return false - } - if this.EvaluationDuration != that1.EvaluationDuration { - return false - } - return true -} -func (this *RuleStateDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RuleStateDesc) - if !ok { - that2, ok := that.(RuleStateDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Rule.Equal(that1.Rule) { - return false - } - if this.State != that1.State { - return false - } - if this.Health != that1.Health { - return false - } - if this.LastError != that1.LastError { - return false - } - if len(this.Alerts) != len(that1.Alerts) { - return false - } - for i := range this.Alerts { - if !this.Alerts[i].Equal(that1.Alerts[i]) { - return false - } - } - if !this.EvaluationTimestamp.Equal(that1.EvaluationTimestamp) { - return false - } - if this.EvaluationDuration != that1.EvaluationDuration { - return false - } - return true -} -func (this *AlertStateDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AlertStateDesc) - if !ok { - that2, ok := that.(AlertStateDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.State != that1.State { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Annotations) != len(that1.Annotations) { - return false - } - for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { - return false - } - } - if this.Value != that1.Value { - return false - } - if !this.ActiveAt.Equal(that1.ActiveAt) { - return false - } - if !this.FiredAt.Equal(that1.FiredAt) { - return false - } - if !this.ResolvedAt.Equal(that1.ResolvedAt) { - return false - } - if !this.LastSentAt.Equal(that1.LastSentAt) { - return false - } - if !this.ValidUntil.Equal(that1.ValidUntil) { - return false - } - return true -} -func (this *RulesRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&base.RulesRequest{") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RulesResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&base.RulesResponse{") - if this.Groups != nil { - s = append(s, "Groups: "+fmt.Sprintf("%#v", this.Groups)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GroupStateDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&base.GroupStateDesc{") - if this.Group != nil { - s = append(s, "Group: "+fmt.Sprintf("%#v", this.Group)+",\n") - } - if this.ActiveRules != nil { - s = append(s, "ActiveRules: "+fmt.Sprintf("%#v", this.ActiveRules)+",\n") - } - s = append(s, "EvaluationTimestamp: "+fmt.Sprintf("%#v", this.EvaluationTimestamp)+",\n") - s = append(s, "EvaluationDuration: "+fmt.Sprintf("%#v", this.EvaluationDuration)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RuleStateDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&base.RuleStateDesc{") - if this.Rule != nil { - s = append(s, "Rule: "+fmt.Sprintf("%#v", this.Rule)+",\n") - } - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "Health: "+fmt.Sprintf("%#v", this.Health)+",\n") - s = append(s, "LastError: "+fmt.Sprintf("%#v", this.LastError)+",\n") - if this.Alerts != nil { - s = append(s, "Alerts: "+fmt.Sprintf("%#v", this.Alerts)+",\n") - } - s = append(s, "EvaluationTimestamp: "+fmt.Sprintf("%#v", this.EvaluationTimestamp)+",\n") - s = append(s, "EvaluationDuration: "+fmt.Sprintf("%#v", this.EvaluationDuration)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AlertStateDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&base.AlertStateDesc{") - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "ActiveAt: "+fmt.Sprintf("%#v", this.ActiveAt)+",\n") - s = append(s, "FiredAt: "+fmt.Sprintf("%#v", this.FiredAt)+",\n") - s = append(s, "ResolvedAt: "+fmt.Sprintf("%#v", this.ResolvedAt)+",\n") - s = append(s, "LastSentAt: "+fmt.Sprintf("%#v", this.LastSentAt)+",\n") - s = append(s, "ValidUntil: "+fmt.Sprintf("%#v", this.ValidUntil)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringRuler(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// RulerClient is the client API for Ruler service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RulerClient interface { - Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (*RulesResponse, error) -} - -type rulerClient struct { - cc *grpc.ClientConn -} - -func NewRulerClient(cc *grpc.ClientConn) RulerClient { - return &rulerClient{cc} -} - -func (c *rulerClient) Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (*RulesResponse, error) { - out := new(RulesResponse) - err := c.cc.Invoke(ctx, "/base.Ruler/Rules", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RulerServer is the server API for Ruler service. -type RulerServer interface { - Rules(context.Context, *RulesRequest) (*RulesResponse, error) -} - -// UnimplementedRulerServer can be embedded to have forward compatible implementations. -type UnimplementedRulerServer struct { -} - -func (*UnimplementedRulerServer) Rules(ctx context.Context, req *RulesRequest) (*RulesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Rules not implemented") -} - -func RegisterRulerServer(s *grpc.Server, srv RulerServer) { - s.RegisterService(&_Ruler_serviceDesc, srv) -} - -func _Ruler_Rules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RulesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RulerServer).Rules(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/base.Ruler/Rules", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RulerServer).Rules(ctx, req.(*RulesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Ruler_serviceDesc = grpc.ServiceDesc{ - ServiceName: "base.Ruler", - HandlerType: (*RulerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Rules", - Handler: _Ruler_Rules_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "pkg/ruler/base/ruler.proto", -} - -func (m *RulesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *RulesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = 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 = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GroupStateDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GroupStateDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GroupStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.EvaluationDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintRuler(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x22 - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EvaluationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintRuler(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x1a - if len(m.ActiveRules) > 0 { - for iNdEx := len(m.ActiveRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ActiveRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Group != nil { - { - size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RuleStateDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuleStateDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.EvaluationDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintRuler(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x3a - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EvaluationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintRuler(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x32 - 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 = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.LastError) > 0 { - i -= len(m.LastError) - copy(dAtA[i:], m.LastError) - i = encodeVarintRuler(dAtA, i, uint64(len(m.LastError))) - i-- - dAtA[i] = 0x22 - } - if len(m.Health) > 0 { - i -= len(m.Health) - copy(dAtA[i:], m.Health) - i = encodeVarintRuler(dAtA, i, uint64(len(m.Health))) - i-- - dAtA[i] = 0x1a - } - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintRuler(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0x12 - } - if m.Rule != nil { - { - size, err := m.Rule.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AlertStateDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlertStateDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AlertStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ValidUntil, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ValidUntil):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintRuler(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x4a - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastSentAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSentAt):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintRuler(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x42 - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ResolvedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ResolvedAt):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintRuler(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x3a - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FiredAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FiredAt):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintRuler(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x32 - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ActiveAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ActiveAt):]) - if err11 != nil { - return 0, err11 - } - i -= n11 - i = encodeVarintRuler(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x2a - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x21 - } - if len(m.Annotations) > 0 { - for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Annotations[iNdEx].Size() - i -= size - if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRuler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.State) > 0 { - i -= len(m.State) - copy(dAtA[i:], m.State) - i = encodeVarintRuler(dAtA, i, uint64(len(m.State))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRuler(dAtA []byte, offset int, v uint64) int { - offset -= sovRuler(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RulesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RulesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Groups) > 0 { - for _, e := range m.Groups { - l = e.Size() - n += 1 + l + sovRuler(uint64(l)) - } - } - return n -} - -func (m *GroupStateDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Group != nil { - l = m.Group.Size() - n += 1 + l + sovRuler(uint64(l)) - } - if len(m.ActiveRules) > 0 { - for _, e := range m.ActiveRules { - l = e.Size() - n += 1 + l + sovRuler(uint64(l)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration) - n += 1 + l + sovRuler(uint64(l)) - return n -} - -func (m *RuleStateDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Rule != nil { - l = m.Rule.Size() - n += 1 + l + sovRuler(uint64(l)) - } - l = len(m.State) - if l > 0 { - n += 1 + l + sovRuler(uint64(l)) - } - l = len(m.Health) - if l > 0 { - n += 1 + l + sovRuler(uint64(l)) - } - l = len(m.LastError) - if l > 0 { - n += 1 + l + sovRuler(uint64(l)) - } - if len(m.Alerts) > 0 { - for _, e := range m.Alerts { - l = e.Size() - n += 1 + l + sovRuler(uint64(l)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration) - n += 1 + l + sovRuler(uint64(l)) - return n -} - -func (m *AlertStateDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.State) - if l > 0 { - n += 1 + l + sovRuler(uint64(l)) - } - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovRuler(uint64(l)) - } - } - if len(m.Annotations) > 0 { - for _, e := range m.Annotations { - l = e.Size() - n += 1 + l + sovRuler(uint64(l)) - } - } - if m.Value != 0 { - n += 9 - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ActiveAt) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FiredAt) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ResolvedAt) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSentAt) - n += 1 + l + sovRuler(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ValidUntil) - n += 1 + l + sovRuler(uint64(l)) - return n -} - -func sovRuler(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRuler(x uint64) (n int) { - return sovRuler(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *RulesRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RulesRequest{`, - `}`, - }, "") - return s -} -func (this *RulesResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForGroups := "[]*GroupStateDesc{" - for _, f := range this.Groups { - repeatedStringForGroups += strings.Replace(f.String(), "GroupStateDesc", "GroupStateDesc", 1) + "," - } - repeatedStringForGroups += "}" - s := strings.Join([]string{`&RulesResponse{`, - `Groups:` + repeatedStringForGroups + `,`, - `}`, - }, "") - return s -} -func (this *GroupStateDesc) String() string { - if this == nil { - return "nil" - } - repeatedStringForActiveRules := "[]*RuleStateDesc{" - for _, f := range this.ActiveRules { - repeatedStringForActiveRules += strings.Replace(f.String(), "RuleStateDesc", "RuleStateDesc", 1) + "," - } - repeatedStringForActiveRules += "}" - s := strings.Join([]string{`&GroupStateDesc{`, - `Group:` + strings.Replace(fmt.Sprintf("%v", this.Group), "RuleGroupDesc", "rulespb.RuleGroupDesc", 1) + `,`, - `ActiveRules:` + repeatedStringForActiveRules + `,`, - `EvaluationTimestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationTimestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `EvaluationDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationDuration), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *RuleStateDesc) String() string { - if this == nil { - return "nil" - } - repeatedStringForAlerts := "[]*AlertStateDesc{" - for _, f := range this.Alerts { - repeatedStringForAlerts += strings.Replace(f.String(), "AlertStateDesc", "AlertStateDesc", 1) + "," - } - repeatedStringForAlerts += "}" - s := strings.Join([]string{`&RuleStateDesc{`, - `Rule:` + strings.Replace(fmt.Sprintf("%v", this.Rule), "RuleDesc", "rulespb.RuleDesc", 1) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Health:` + fmt.Sprintf("%v", this.Health) + `,`, - `LastError:` + fmt.Sprintf("%v", this.LastError) + `,`, - `Alerts:` + repeatedStringForAlerts + `,`, - `EvaluationTimestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationTimestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `EvaluationDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationDuration), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *AlertStateDesc) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AlertStateDesc{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `ActiveAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActiveAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `FiredAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FiredAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `ResolvedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ResolvedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `LastSentAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastSentAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `ValidUntil:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidUntil), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringRuler(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *RulesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RulesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRuler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RulesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RulesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Groups = append(m.Groups, &GroupStateDesc{}) - if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GroupStateDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GroupStateDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GroupStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Group == nil { - m.Group = &rulespb.RuleGroupDesc{} - } - if err := m.Group.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveRules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActiveRules = append(m.ActiveRules, &RuleStateDesc{}) - if err := m.ActiveRules[len(m.ActiveRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EvaluationTimestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.EvaluationDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuleStateDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RuleStateDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuleStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Rule == nil { - m.Rule = &rulespb.RuleDesc{} - } - if err := m.Rule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Health = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastError = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alerts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alerts = append(m.Alerts, &AlertStateDesc{}) - if err := m.Alerts[len(m.Alerts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationTimestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EvaluationTimestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.EvaluationDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlertStateDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlertStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotations = append(m.Annotations, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActiveAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ActiveAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FiredAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FiredAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResolvedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ResolvedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastSentAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastSentAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidUntil", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRuler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ValidUntil, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRuler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRuler(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRuler - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthRuler - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuler - } - 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 := skipRuler(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthRuler - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRuler = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRuler = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/ruler/rulespb/rules.pb.go b/pkg/ruler/rulespb/rules.pb.go deleted file mode 100644 index ead0d482791be..0000000000000 --- a/pkg/ruler/rulespb/rules.pb.go +++ /dev/null @@ -1,1320 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/ruler/rulespb/rules.proto - -package rulespb - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/grafana/loki/pkg/logproto" - github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// RuleGroupDesc is a proto representation of a rule group. -type RuleGroupDesc struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Interval time.Duration `protobuf:"bytes,3,opt,name=interval,proto3,stdduration" json:"interval"` - Rules []*RuleDesc `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` - User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` - // The options field can be used to extend Ruler functionality without - // having to repeatedly redefine the proto description. It can also be leveraged - // to create custom `ManagerOpts` based on rule configs which can then be passed - // to the Prometheus Manager. - Options []*types.Any `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` - Limit int64 `protobuf:"varint,10,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (m *RuleGroupDesc) Reset() { *m = RuleGroupDesc{} } -func (*RuleGroupDesc) ProtoMessage() {} -func (*RuleGroupDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_dd3ef3757f506fba, []int{0} -} -func (m *RuleGroupDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuleGroupDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuleGroupDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RuleGroupDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuleGroupDesc.Merge(m, src) -} -func (m *RuleGroupDesc) XXX_Size() int { - return m.Size() -} -func (m *RuleGroupDesc) XXX_DiscardUnknown() { - xxx_messageInfo_RuleGroupDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_RuleGroupDesc proto.InternalMessageInfo - -func (m *RuleGroupDesc) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *RuleGroupDesc) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *RuleGroupDesc) GetInterval() time.Duration { - if m != nil { - return m.Interval - } - return 0 -} - -func (m *RuleGroupDesc) GetRules() []*RuleDesc { - if m != nil { - return m.Rules - } - return nil -} - -func (m *RuleGroupDesc) GetUser() string { - if m != nil { - return m.User - } - return "" -} - -func (m *RuleGroupDesc) GetOptions() []*types.Any { - if m != nil { - return m.Options - } - return nil -} - -func (m *RuleGroupDesc) GetLimit() int64 { - if m != nil { - return m.Limit - } - return 0 -} - -// RuleDesc is a proto representation of a Prometheus Rule -type RuleDesc struct { - Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` - Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` - Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` - For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` - Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"annotations"` -} - -func (m *RuleDesc) Reset() { *m = RuleDesc{} } -func (*RuleDesc) ProtoMessage() {} -func (*RuleDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_dd3ef3757f506fba, []int{1} -} -func (m *RuleDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RuleDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RuleDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RuleDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_RuleDesc.Merge(m, src) -} -func (m *RuleDesc) XXX_Size() int { - return m.Size() -} -func (m *RuleDesc) XXX_DiscardUnknown() { - xxx_messageInfo_RuleDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_RuleDesc proto.InternalMessageInfo - -func (m *RuleDesc) GetExpr() string { - if m != nil { - return m.Expr - } - return "" -} - -func (m *RuleDesc) GetRecord() string { - if m != nil { - return m.Record - } - return "" -} - -func (m *RuleDesc) GetAlert() string { - if m != nil { - return m.Alert - } - return "" -} - -func (m *RuleDesc) GetFor() time.Duration { - if m != nil { - return m.For - } - return 0 -} - -func init() { - proto.RegisterType((*RuleGroupDesc)(nil), "rules.RuleGroupDesc") - proto.RegisterType((*RuleDesc)(nil), "rules.RuleDesc") -} - -func init() { proto.RegisterFile("pkg/ruler/rulespb/rules.proto", fileDescriptor_dd3ef3757f506fba) } - -var fileDescriptor_dd3ef3757f506fba = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x41, 0x6f, 0xd3, 0x30, - 0x18, 0x8d, 0xdb, 0x34, 0x4b, 0x5c, 0x4d, 0x54, 0x56, 0x85, 0xd2, 0x01, 0x6e, 0x35, 0x09, 0xa9, - 0x5c, 0x12, 0x31, 0xc4, 0x81, 0x13, 0x5a, 0x35, 0x09, 0xa9, 0xda, 0x01, 0xe5, 0xc8, 0x05, 0x39, - 0xa9, 0x6b, 0xa2, 0xb9, 0x71, 0xe4, 0x24, 0x13, 0xbd, 0xf1, 0x13, 0xb8, 0x20, 0xf1, 0x13, 0xf8, - 0x29, 0x3b, 0xf6, 0x38, 0x71, 0x18, 0x34, 0xbd, 0x70, 0x63, 0x3f, 0x01, 0xd9, 0x4e, 0xc6, 0x00, - 0x09, 0x71, 0xe1, 0x12, 0x7f, 0xcf, 0xcf, 0x9f, 0xdf, 0xfb, 0x5e, 0x12, 0xf8, 0x20, 0x3f, 0x63, - 0xa1, 0xac, 0x38, 0x95, 0xfa, 0x59, 0xe4, 0xb1, 0x59, 0x83, 0x5c, 0x8a, 0x52, 0xa0, 0x9e, 0x06, - 0x07, 0x43, 0x26, 0x98, 0xd0, 0x3b, 0xa1, 0xaa, 0x0c, 0x79, 0x30, 0x62, 0x42, 0x30, 0x4e, 0x43, - 0x8d, 0xe2, 0x6a, 0x19, 0x92, 0x6c, 0xdd, 0x50, 0xf8, 0x77, 0x6a, 0x51, 0x49, 0x52, 0xa6, 0x22, - 0x6b, 0xf8, 0x7b, 0x4a, 0x96, 0x0b, 0x66, 0xee, 0x6c, 0x0b, 0x43, 0x1e, 0x7e, 0xe8, 0xc0, 0xfd, - 0xa8, 0xe2, 0xf4, 0x85, 0x14, 0x55, 0x7e, 0x42, 0x8b, 0x04, 0x21, 0x68, 0x67, 0x64, 0x45, 0x7d, - 0x30, 0x01, 0x53, 0x2f, 0xd2, 0x35, 0xba, 0x0f, 0x3d, 0xb5, 0x16, 0x39, 0x49, 0xa8, 0xdf, 0xd1, - 0xc4, 0xcf, 0x0d, 0xf4, 0x1c, 0xba, 0x69, 0x56, 0x52, 0x79, 0x4e, 0xb8, 0xdf, 0x9d, 0x80, 0x69, - 0xff, 0x68, 0x14, 0x18, 0x4f, 0x41, 0xeb, 0x29, 0x38, 0x69, 0x3c, 0xcd, 0xdc, 0x8b, 0xab, 0xb1, - 0xf5, 0xf1, 0xcb, 0x18, 0x44, 0x37, 0x4d, 0xe8, 0x21, 0x34, 0xb3, 0xfb, 0xf6, 0xa4, 0x3b, 0xed, - 0x1f, 0xdd, 0x09, 0x4c, 0x2c, 0xca, 0x97, 0xb2, 0x14, 0x19, 0x56, 0x39, 0xab, 0x0a, 0x2a, 0x7d, - 0xc7, 0x38, 0x53, 0x35, 0x0a, 0xe0, 0x9e, 0xc8, 0xd5, 0xc5, 0x85, 0xef, 0xe9, 0xe6, 0xe1, 0x1f, - 0xd2, 0xc7, 0xd9, 0x3a, 0x6a, 0x0f, 0xa1, 0x21, 0xec, 0xf1, 0x74, 0x95, 0x96, 0x3e, 0x9c, 0x80, - 0x69, 0x37, 0x32, 0x60, 0x6e, 0xbb, 0xbd, 0x81, 0x33, 0xb7, 0xdd, 0xbd, 0x81, 0x3b, 0xb7, 0x5d, - 0x77, 0xe0, 0x1d, 0x7e, 0xef, 0x40, 0xb7, 0xd5, 0x57, 0xc2, 0xf4, 0x6d, 0x2e, 0xdb, 0x48, 0x54, - 0x8d, 0xee, 0x42, 0x47, 0xd2, 0x44, 0xc8, 0x45, 0x93, 0x47, 0x83, 0x94, 0x00, 0xe1, 0x54, 0x96, - 0x3a, 0x09, 0x2f, 0x32, 0x00, 0x3d, 0x85, 0xdd, 0xa5, 0x90, 0xbe, 0xfd, 0xef, 0xe9, 0xa8, 0xf3, - 0x88, 0x43, 0x87, 0x93, 0x98, 0xf2, 0xc2, 0xef, 0xe9, 0xe1, 0x46, 0xc1, 0xcd, 0xeb, 0x3b, 0xa5, - 0x8c, 0x24, 0xeb, 0x53, 0xc5, 0xbe, 0x24, 0xa9, 0x9c, 0x3d, 0x53, 0x9d, 0x9f, 0xaf, 0xc6, 0x8f, - 0x59, 0x5a, 0xbe, 0xa9, 0xe2, 0x20, 0x11, 0xab, 0x90, 0x49, 0xb2, 0x24, 0x19, 0x09, 0xb9, 0x38, - 0x4b, 0xc3, 0xdb, 0x5f, 0x41, 0xa0, 0xfb, 0x8e, 0x17, 0x24, 0x2f, 0xa9, 0x8c, 0x1a, 0x0d, 0x74, - 0x0e, 0xfb, 0x24, 0xcb, 0x44, 0x49, 0x4c, 0x9e, 0xce, 0x7f, 0x94, 0xbc, 0x2d, 0xa4, 0x73, 0xdf, - 0x9f, 0xbd, 0xde, 0x6c, 0xb1, 0x75, 0xb9, 0xc5, 0xd6, 0xf5, 0x16, 0x83, 0x77, 0x35, 0x06, 0x9f, - 0x6a, 0x0c, 0x2e, 0x6a, 0x0c, 0x36, 0x35, 0x06, 0x5f, 0x6b, 0x0c, 0xbe, 0xd5, 0xd8, 0xba, 0xae, - 0x31, 0x78, 0xbf, 0xc3, 0xd6, 0x66, 0x87, 0xad, 0xcb, 0x1d, 0xb6, 0x5e, 0x3d, 0xfa, 0x9b, 0xf6, - 0x2f, 0xff, 0x5a, 0xec, 0x68, 0x1f, 0x4f, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6f, 0xf3, 0x96, - 0x82, 0x87, 0x03, 0x00, 0x00, -} - -func (this *RuleGroupDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RuleGroupDesc) - if !ok { - that2, ok := that.(RuleGroupDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Namespace != that1.Namespace { - return false - } - if this.Interval != that1.Interval { - return false - } - if len(this.Rules) != len(that1.Rules) { - return false - } - for i := range this.Rules { - if !this.Rules[i].Equal(that1.Rules[i]) { - return false - } - } - if this.User != that1.User { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if !this.Options[i].Equal(that1.Options[i]) { - return false - } - } - if this.Limit != that1.Limit { - return false - } - return true -} -func (this *RuleDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*RuleDesc) - if !ok { - that2, ok := that.(RuleDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Expr != that1.Expr { - return false - } - if this.Record != that1.Record { - return false - } - if this.Alert != that1.Alert { - return false - } - if this.For != that1.For { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Annotations) != len(that1.Annotations) { - return false - } - for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { - return false - } - } - return true -} -func (this *RuleGroupDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&rulespb.RuleGroupDesc{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Namespace: "+fmt.Sprintf("%#v", this.Namespace)+",\n") - s = append(s, "Interval: "+fmt.Sprintf("%#v", this.Interval)+",\n") - if this.Rules != nil { - s = append(s, "Rules: "+fmt.Sprintf("%#v", this.Rules)+",\n") - } - s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RuleDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&rulespb.RuleDesc{") - s = append(s, "Expr: "+fmt.Sprintf("%#v", this.Expr)+",\n") - s = append(s, "Record: "+fmt.Sprintf("%#v", this.Record)+",\n") - s = append(s, "Alert: "+fmt.Sprintf("%#v", this.Alert)+",\n") - s = append(s, "For: "+fmt.Sprintf("%#v", this.For)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringRules(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *RuleGroupDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuleGroupDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleGroupDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Limit != 0 { - i = encodeVarintRules(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x50 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRules(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintRules(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0x32 - } - 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 = encodeVarintRules(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintRules(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1a - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintRules(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRules(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RuleDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuleDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Annotations) > 0 { - for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Annotations[iNdEx].Size() - i -= size - if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRules(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintRules(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.For, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.For):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintRules(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x22 - if len(m.Alert) > 0 { - i -= len(m.Alert) - copy(dAtA[i:], m.Alert) - i = encodeVarintRules(dAtA, i, uint64(len(m.Alert))) - i-- - dAtA[i] = 0x1a - } - if len(m.Record) > 0 { - i -= len(m.Record) - copy(dAtA[i:], m.Record) - i = encodeVarintRules(dAtA, i, uint64(len(m.Record))) - i-- - dAtA[i] = 0x12 - } - if len(m.Expr) > 0 { - i -= len(m.Expr) - copy(dAtA[i:], m.Expr) - i = encodeVarintRules(dAtA, i, uint64(len(m.Expr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintRules(dAtA []byte, offset int, v uint64) int { - offset -= sovRules(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *RuleGroupDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) - n += 1 + l + sovRules(uint64(l)) - if len(m.Rules) > 0 { - for _, e := range m.Rules { - l = e.Size() - n += 1 + l + sovRules(uint64(l)) - } - } - l = len(m.User) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovRules(uint64(l)) - } - } - if m.Limit != 0 { - n += 1 + sovRules(uint64(m.Limit)) - } - return n -} - -func (m *RuleDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Expr) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - l = len(m.Record) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - l = len(m.Alert) - if l > 0 { - n += 1 + l + sovRules(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.For) - n += 1 + l + sovRules(uint64(l)) - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovRules(uint64(l)) - } - } - if len(m.Annotations) > 0 { - for _, e := range m.Annotations { - l = e.Size() - n += 1 + l + sovRules(uint64(l)) - } - } - return n -} - -func sovRules(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRules(x uint64) (n int) { - return sovRules(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *RuleGroupDesc) String() string { - if this == nil { - return "nil" - } - repeatedStringForRules := "[]*RuleDesc{" - for _, f := range this.Rules { - repeatedStringForRules += strings.Replace(f.String(), "RuleDesc", "RuleDesc", 1) + "," - } - repeatedStringForRules += "}" - repeatedStringForOptions := "[]*Any{" - for _, f := range this.Options { - repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," - } - repeatedStringForOptions += "}" - s := strings.Join([]string{`&RuleGroupDesc{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Interval:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Interval), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `Rules:` + repeatedStringForRules + `,`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Options:` + repeatedStringForOptions + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `}`, - }, "") - return s -} -func (this *RuleDesc) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuleDesc{`, - `Expr:` + fmt.Sprintf("%v", this.Expr) + `,`, - `Record:` + fmt.Sprintf("%v", this.Record) + `,`, - `Alert:` + fmt.Sprintf("%v", this.Alert) + `,`, - `For:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.For), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, - `}`, - }, "") - return s -} -func valueToStringRules(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *RuleGroupDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RuleGroupDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuleGroupDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rules = append(m.Rules, &RuleDesc{}) - if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &types.Any{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRules(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRules - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRules - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuleDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RuleDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuleDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Expr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Record = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alert", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alert = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field For", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.For, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRules - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRules - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRules - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotations = append(m.Annotations, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) - if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRules(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRules - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRules - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRules(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRules - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRules - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRules - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthRules - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthRules - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRules - } - 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 := skipRules(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthRules - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRules = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRules = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/scheduler/schedulerpb/scheduler.pb.go b/pkg/scheduler/schedulerpb/scheduler.pb.go deleted file mode 100644 index c2f95e59cdae4..0000000000000 --- a/pkg/scheduler/schedulerpb/scheduler.pb.go +++ /dev/null @@ -1,2850 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/scheduler/schedulerpb/scheduler.proto - -package schedulerpb - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - httpgrpc "github.com/grafana/dskit/httpgrpc" - queryrange "github.com/grafana/loki/pkg/querier/queryrange" - 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" - reflect "reflect" - strconv "strconv" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type FrontendToSchedulerType int32 - -const ( - INIT FrontendToSchedulerType = 0 - ENQUEUE FrontendToSchedulerType = 1 - CANCEL FrontendToSchedulerType = 2 -) - -var FrontendToSchedulerType_name = map[int32]string{ - 0: "INIT", - 1: "ENQUEUE", - 2: "CANCEL", -} - -var FrontendToSchedulerType_value = map[string]int32{ - "INIT": 0, - "ENQUEUE": 1, - "CANCEL": 2, -} - -func (FrontendToSchedulerType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{0} -} - -type SchedulerToFrontendStatus int32 - -const ( - OK SchedulerToFrontendStatus = 0 - TOO_MANY_REQUESTS_PER_TENANT SchedulerToFrontendStatus = 1 - ERROR SchedulerToFrontendStatus = 2 - SHUTTING_DOWN SchedulerToFrontendStatus = 3 -) - -var SchedulerToFrontendStatus_name = map[int32]string{ - 0: "OK", - 1: "TOO_MANY_REQUESTS_PER_TENANT", - 2: "ERROR", - 3: "SHUTTING_DOWN", -} - -var SchedulerToFrontendStatus_value = map[string]int32{ - "OK": 0, - "TOO_MANY_REQUESTS_PER_TENANT": 1, - "ERROR": 2, - "SHUTTING_DOWN": 3, -} - -func (SchedulerToFrontendStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{1} -} - -// Querier reports its own clientID when it connects, so that scheduler knows how many *different* queriers are connected. -// To signal that querier is ready to accept another request, querier sends empty message. -type QuerierToScheduler struct { - QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"` -} - -func (m *QuerierToScheduler) Reset() { *m = QuerierToScheduler{} } -func (*QuerierToScheduler) ProtoMessage() {} -func (*QuerierToScheduler) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{0} -} -func (m *QuerierToScheduler) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerierToScheduler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerierToScheduler.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QuerierToScheduler) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerierToScheduler.Merge(m, src) -} -func (m *QuerierToScheduler) XXX_Size() int { - return m.Size() -} -func (m *QuerierToScheduler) XXX_DiscardUnknown() { - xxx_messageInfo_QuerierToScheduler.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerierToScheduler proto.InternalMessageInfo - -func (m *QuerierToScheduler) GetQuerierID() string { - if m != nil { - return m.QuerierID - } - return "" -} - -type SchedulerToQuerier struct { - // Query ID as reported by frontend. When querier sends the response back to frontend (using frontendAddress), - // it identifies the query by using this ID. - QueryID uint64 `protobuf:"varint,1,opt,name=queryID,proto3" json:"queryID,omitempty"` - // Types that are valid to be assigned to Request: - // *SchedulerToQuerier_HttpRequest - // *SchedulerToQuerier_QueryRequest - Request isSchedulerToQuerier_Request `protobuf_oneof:"request"` - // Where should querier send HTTP Response to (using FrontendForQuerier interface). - FrontendAddress string `protobuf:"bytes,3,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"` - // User who initiated the request. Needed to send reply back to frontend. - UserID string `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"` - // Whether query statistics tracking should be enabled. The response will include - // statistics only when this option is enabled. - StatsEnabled bool `protobuf:"varint,5,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"` -} - -func (m *SchedulerToQuerier) Reset() { *m = SchedulerToQuerier{} } -func (*SchedulerToQuerier) ProtoMessage() {} -func (*SchedulerToQuerier) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{1} -} -func (m *SchedulerToQuerier) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SchedulerToQuerier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SchedulerToQuerier.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SchedulerToQuerier) XXX_Merge(src proto.Message) { - xxx_messageInfo_SchedulerToQuerier.Merge(m, src) -} -func (m *SchedulerToQuerier) XXX_Size() int { - return m.Size() -} -func (m *SchedulerToQuerier) XXX_DiscardUnknown() { - xxx_messageInfo_SchedulerToQuerier.DiscardUnknown(m) -} - -var xxx_messageInfo_SchedulerToQuerier proto.InternalMessageInfo - -type isSchedulerToQuerier_Request interface { - isSchedulerToQuerier_Request() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type SchedulerToQuerier_HttpRequest struct { - HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,2,opt,name=httpRequest,proto3,oneof"` -} -type SchedulerToQuerier_QueryRequest struct { - QueryRequest *queryrange.QueryRequest `protobuf:"bytes,8,opt,name=queryRequest,proto3,oneof"` -} - -func (*SchedulerToQuerier_HttpRequest) isSchedulerToQuerier_Request() {} -func (*SchedulerToQuerier_QueryRequest) isSchedulerToQuerier_Request() {} - -func (m *SchedulerToQuerier) GetRequest() isSchedulerToQuerier_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *SchedulerToQuerier) GetQueryID() uint64 { - if m != nil { - return m.QueryID - } - return 0 -} - -// Deprecated: Do not use. -func (m *SchedulerToQuerier) GetHttpRequest() *httpgrpc.HTTPRequest { - if x, ok := m.GetRequest().(*SchedulerToQuerier_HttpRequest); ok { - return x.HttpRequest - } - return nil -} - -func (m *SchedulerToQuerier) GetQueryRequest() *queryrange.QueryRequest { - if x, ok := m.GetRequest().(*SchedulerToQuerier_QueryRequest); ok { - return x.QueryRequest - } - return nil -} - -func (m *SchedulerToQuerier) GetFrontendAddress() string { - if m != nil { - return m.FrontendAddress - } - return "" -} - -func (m *SchedulerToQuerier) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *SchedulerToQuerier) GetStatsEnabled() bool { - if m != nil { - return m.StatsEnabled - } - return false -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SchedulerToQuerier) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SchedulerToQuerier_HttpRequest)(nil), - (*SchedulerToQuerier_QueryRequest)(nil), - } -} - -type FrontendToScheduler struct { - Type FrontendToSchedulerType `protobuf:"varint,1,opt,name=type,proto3,enum=schedulerpb.FrontendToSchedulerType" json:"type,omitempty"` - // Used by INIT message. Will be put into all requests passed to querier. - FrontendAddress string `protobuf:"bytes,2,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"` - // Used by ENQUEUE and CANCEL. - // Each frontend manages its own queryIDs. Different frontends may use same set of query IDs. - QueryID uint64 `protobuf:"varint,3,opt,name=queryID,proto3" json:"queryID,omitempty"` - // Following are used by ENQUEUE only. - UserID string `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"` - // Types that are valid to be assigned to Request: - // *FrontendToScheduler_HttpRequest - // *FrontendToScheduler_QueryRequest - Request isFrontendToScheduler_Request `protobuf_oneof:"request"` - StatsEnabled bool `protobuf:"varint,6,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"` - // Path to queue to which the request will be enqueued. - QueuePath []string `protobuf:"bytes,7,rep,name=queuePath,proto3" json:"queuePath,omitempty"` -} - -func (m *FrontendToScheduler) Reset() { *m = FrontendToScheduler{} } -func (*FrontendToScheduler) ProtoMessage() {} -func (*FrontendToScheduler) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{2} -} -func (m *FrontendToScheduler) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FrontendToScheduler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FrontendToScheduler.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FrontendToScheduler) XXX_Merge(src proto.Message) { - xxx_messageInfo_FrontendToScheduler.Merge(m, src) -} -func (m *FrontendToScheduler) XXX_Size() int { - return m.Size() -} -func (m *FrontendToScheduler) XXX_DiscardUnknown() { - xxx_messageInfo_FrontendToScheduler.DiscardUnknown(m) -} - -var xxx_messageInfo_FrontendToScheduler proto.InternalMessageInfo - -type isFrontendToScheduler_Request interface { - isFrontendToScheduler_Request() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int -} - -type FrontendToScheduler_HttpRequest struct { - HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,5,opt,name=httpRequest,proto3,oneof"` -} -type FrontendToScheduler_QueryRequest struct { - QueryRequest *queryrange.QueryRequest `protobuf:"bytes,8,opt,name=queryRequest,proto3,oneof"` -} - -func (*FrontendToScheduler_HttpRequest) isFrontendToScheduler_Request() {} -func (*FrontendToScheduler_QueryRequest) isFrontendToScheduler_Request() {} - -func (m *FrontendToScheduler) GetRequest() isFrontendToScheduler_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *FrontendToScheduler) GetType() FrontendToSchedulerType { - if m != nil { - return m.Type - } - return INIT -} - -func (m *FrontendToScheduler) GetFrontendAddress() string { - if m != nil { - return m.FrontendAddress - } - return "" -} - -func (m *FrontendToScheduler) GetQueryID() uint64 { - if m != nil { - return m.QueryID - } - return 0 -} - -func (m *FrontendToScheduler) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -// Deprecated: Do not use. -func (m *FrontendToScheduler) GetHttpRequest() *httpgrpc.HTTPRequest { - if x, ok := m.GetRequest().(*FrontendToScheduler_HttpRequest); ok { - return x.HttpRequest - } - return nil -} - -func (m *FrontendToScheduler) GetQueryRequest() *queryrange.QueryRequest { - if x, ok := m.GetRequest().(*FrontendToScheduler_QueryRequest); ok { - return x.QueryRequest - } - return nil -} - -func (m *FrontendToScheduler) GetStatsEnabled() bool { - if m != nil { - return m.StatsEnabled - } - return false -} - -func (m *FrontendToScheduler) GetQueuePath() []string { - if m != nil { - return m.QueuePath - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*FrontendToScheduler) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*FrontendToScheduler_HttpRequest)(nil), - (*FrontendToScheduler_QueryRequest)(nil), - } -} - -type SchedulerToFrontend struct { - Status SchedulerToFrontendStatus `protobuf:"varint,1,opt,name=status,proto3,enum=schedulerpb.SchedulerToFrontendStatus" json:"status,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *SchedulerToFrontend) Reset() { *m = SchedulerToFrontend{} } -func (*SchedulerToFrontend) ProtoMessage() {} -func (*SchedulerToFrontend) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{3} -} -func (m *SchedulerToFrontend) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SchedulerToFrontend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SchedulerToFrontend.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SchedulerToFrontend) XXX_Merge(src proto.Message) { - xxx_messageInfo_SchedulerToFrontend.Merge(m, src) -} -func (m *SchedulerToFrontend) XXX_Size() int { - return m.Size() -} -func (m *SchedulerToFrontend) XXX_DiscardUnknown() { - xxx_messageInfo_SchedulerToFrontend.DiscardUnknown(m) -} - -var xxx_messageInfo_SchedulerToFrontend proto.InternalMessageInfo - -func (m *SchedulerToFrontend) GetStatus() SchedulerToFrontendStatus { - if m != nil { - return m.Status - } - return OK -} - -func (m *SchedulerToFrontend) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type NotifyQuerierShutdownRequest struct { - QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"` -} - -func (m *NotifyQuerierShutdownRequest) Reset() { *m = NotifyQuerierShutdownRequest{} } -func (*NotifyQuerierShutdownRequest) ProtoMessage() {} -func (*NotifyQuerierShutdownRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{4} -} -func (m *NotifyQuerierShutdownRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NotifyQuerierShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NotifyQuerierShutdownRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NotifyQuerierShutdownRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotifyQuerierShutdownRequest.Merge(m, src) -} -func (m *NotifyQuerierShutdownRequest) XXX_Size() int { - return m.Size() -} -func (m *NotifyQuerierShutdownRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NotifyQuerierShutdownRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NotifyQuerierShutdownRequest proto.InternalMessageInfo - -func (m *NotifyQuerierShutdownRequest) GetQuerierID() string { - if m != nil { - return m.QuerierID - } - return "" -} - -type NotifyQuerierShutdownResponse struct { -} - -func (m *NotifyQuerierShutdownResponse) Reset() { *m = NotifyQuerierShutdownResponse{} } -func (*NotifyQuerierShutdownResponse) ProtoMessage() {} -func (*NotifyQuerierShutdownResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c3657184e8d38989, []int{5} -} -func (m *NotifyQuerierShutdownResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NotifyQuerierShutdownResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NotifyQuerierShutdownResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NotifyQuerierShutdownResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotifyQuerierShutdownResponse.Merge(m, src) -} -func (m *NotifyQuerierShutdownResponse) XXX_Size() int { - return m.Size() -} -func (m *NotifyQuerierShutdownResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NotifyQuerierShutdownResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NotifyQuerierShutdownResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("schedulerpb.FrontendToSchedulerType", FrontendToSchedulerType_name, FrontendToSchedulerType_value) - proto.RegisterEnum("schedulerpb.SchedulerToFrontendStatus", SchedulerToFrontendStatus_name, SchedulerToFrontendStatus_value) - proto.RegisterType((*QuerierToScheduler)(nil), "schedulerpb.QuerierToScheduler") - proto.RegisterType((*SchedulerToQuerier)(nil), "schedulerpb.SchedulerToQuerier") - proto.RegisterType((*FrontendToScheduler)(nil), "schedulerpb.FrontendToScheduler") - proto.RegisterType((*SchedulerToFrontend)(nil), "schedulerpb.SchedulerToFrontend") - proto.RegisterType((*NotifyQuerierShutdownRequest)(nil), "schedulerpb.NotifyQuerierShutdownRequest") - proto.RegisterType((*NotifyQuerierShutdownResponse)(nil), "schedulerpb.NotifyQuerierShutdownResponse") -} - -func init() { - proto.RegisterFile("pkg/scheduler/schedulerpb/scheduler.proto", fileDescriptor_c3657184e8d38989) -} - -var fileDescriptor_c3657184e8d38989 = []byte{ - // 714 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x3d, 0x53, 0xdb, 0x4a, - 0x14, 0xd5, 0xca, 0x5f, 0xf8, 0x9a, 0xf7, 0x9e, 0xdf, 0x02, 0xef, 0x29, 0x1e, 0x22, 0x3c, 0x9e, - 0x4c, 0x62, 0x28, 0x6c, 0xc6, 0x69, 0x52, 0x10, 0x66, 0x0c, 0x88, 0xd8, 0x13, 0x22, 0x63, 0x59, - 0x9e, 0x7c, 0x34, 0x1e, 0x7f, 0x2c, 0xb6, 0x07, 0xa2, 0x15, 0x2b, 0x69, 0x32, 0xee, 0xf2, 0x13, - 0xf2, 0x0b, 0x52, 0xe7, 0xa7, 0xa4, 0xa4, 0xa4, 0x48, 0x11, 0x44, 0x93, 0x92, 0x2e, 0x6d, 0xc6, - 0xd2, 0xca, 0xc8, 0x60, 0x43, 0xaa, 0x54, 0xbe, 0x7b, 0xf7, 0x9c, 0xab, 0x3d, 0xe7, 0xde, 0x5d, - 0xc3, 0xba, 0x79, 0xdc, 0x2f, 0x5a, 0xdd, 0x01, 0xe9, 0x39, 0x27, 0x84, 0x5d, 0x47, 0x66, 0xe7, - 0x3a, 0x2e, 0x98, 0x8c, 0xda, 0x14, 0xa7, 0x42, 0x9b, 0x99, 0xcd, 0xfe, 0xd0, 0x1e, 0x38, 0x9d, - 0x42, 0x97, 0xbe, 0x2f, 0xf6, 0x59, 0xfb, 0xa8, 0x6d, 0xb4, 0x8b, 0x3d, 0xeb, 0x78, 0x68, 0x17, - 0x07, 0xb6, 0x6d, 0xf6, 0x99, 0xd9, 0x9d, 0x04, 0x3e, 0x3d, 0xb3, 0xdc, 0xa7, 0x7d, 0xea, 0x85, - 0xc5, 0x71, 0xc4, 0xb3, 0x4f, 0xc6, 0xdf, 0x3f, 0x75, 0x08, 0x1b, 0x12, 0xe6, 0xfd, 0x8e, 0x58, - 0xdb, 0xe8, 0x93, 0x50, 0xe8, 0x03, 0x73, 0x25, 0xc0, 0x75, 0x1f, 0xa6, 0xd3, 0x46, 0x70, 0x10, - 0xbc, 0x0a, 0x49, 0x4e, 0xae, 0xee, 0x49, 0x28, 0x8b, 0xf2, 0x49, 0xed, 0x3a, 0x91, 0xfb, 0x2c, - 0x02, 0x9e, 0x60, 0x75, 0xca, 0xf9, 0x58, 0x82, 0x84, 0x57, 0x9e, 0x53, 0xa2, 0x5a, 0xb0, 0xc4, - 0xcf, 0x21, 0x35, 0x3e, 0xb5, 0x46, 0x4e, 0x1d, 0x62, 0xd9, 0x92, 0x98, 0x45, 0xf9, 0x54, 0x69, - 0xa5, 0x30, 0x51, 0x52, 0xd1, 0xf5, 0x43, 0xbe, 0xb9, 0x23, 0x4a, 0xa8, 0x22, 0x68, 0x61, 0x3c, - 0xde, 0x86, 0x45, 0xaf, 0x52, 0xc0, 0x5f, 0xf0, 0xf8, 0x52, 0x21, 0x24, 0xa6, 0x1e, 0xda, 0xaf, - 0x08, 0xda, 0x14, 0x1e, 0xe7, 0xe1, 0x9f, 0x23, 0x46, 0x0d, 0x9b, 0x18, 0xbd, 0x72, 0xaf, 0xc7, - 0x88, 0x65, 0x49, 0x11, 0x4f, 0xd3, 0xcd, 0x34, 0xfe, 0x0f, 0xe2, 0x8e, 0xe5, 0x89, 0x8e, 0x7a, - 0x00, 0xbe, 0xc2, 0x39, 0x58, 0xb4, 0xec, 0xb6, 0x6d, 0x29, 0x46, 0xbb, 0x73, 0x42, 0x7a, 0x52, - 0x2c, 0x8b, 0xf2, 0x0b, 0xda, 0x54, 0x6e, 0x27, 0x09, 0x09, 0xe6, 0x7f, 0x30, 0xf7, 0x53, 0x84, - 0xa5, 0x7d, 0x5e, 0x3a, 0x6c, 0xeb, 0x33, 0x88, 0xda, 0x23, 0x93, 0x78, 0xf6, 0xfc, 0x5d, 0x7a, - 0x54, 0x08, 0x75, 0xbe, 0x30, 0x03, 0xaf, 0x8f, 0x4c, 0xa2, 0x79, 0x8c, 0x59, 0x12, 0xc4, 0xd9, - 0x12, 0x42, 0x5d, 0x88, 0x4c, 0x77, 0x61, 0x9e, 0xb8, 0x1b, 0xdd, 0x89, 0xfd, 0xe1, 0xee, 0xdc, - 0xf4, 0x36, 0x7e, 0xdb, 0x5b, 0x3e, 0x8f, 0x0e, 0x39, 0x6c, 0xdb, 0x03, 0x29, 0x91, 0x8d, 0xf0, - 0x79, 0xf4, 0x13, 0x61, 0xe7, 0x8f, 0x61, 0x29, 0x34, 0x99, 0x81, 0xa7, 0x78, 0x1b, 0xe2, 0xe3, - 0x7a, 0x8e, 0xc5, 0xad, 0x7f, 0x3c, 0x65, 0xfd, 0x0c, 0x46, 0xc3, 0x43, 0x6b, 0x9c, 0x85, 0x97, - 0x21, 0x46, 0x18, 0xa3, 0x8c, 0x9b, 0xee, 0x2f, 0x72, 0x5b, 0xb0, 0xaa, 0x52, 0x7b, 0x78, 0x34, - 0xe2, 0x37, 0xa0, 0x31, 0x70, 0xec, 0x1e, 0xfd, 0x60, 0x04, 0xca, 0xee, 0xbe, 0x45, 0x6b, 0xf0, - 0x70, 0x0e, 0xdb, 0x32, 0xa9, 0x61, 0x91, 0x8d, 0x2d, 0xf8, 0x7f, 0xce, 0x50, 0xe0, 0x05, 0x88, - 0x56, 0xd5, 0xaa, 0x9e, 0x16, 0x70, 0x0a, 0x12, 0x8a, 0x5a, 0x6f, 0x2a, 0x4d, 0x25, 0x8d, 0x30, - 0x40, 0x7c, 0xb7, 0xac, 0xee, 0x2a, 0x07, 0x69, 0x71, 0xa3, 0x0b, 0x0f, 0xe6, 0xea, 0xc2, 0x71, - 0x10, 0x6b, 0x2f, 0xd3, 0x02, 0xce, 0xc2, 0xaa, 0x5e, 0xab, 0xb5, 0x5e, 0x95, 0xd5, 0xb7, 0x2d, - 0x4d, 0xa9, 0x37, 0x95, 0x86, 0xde, 0x68, 0x1d, 0x2a, 0x5a, 0x4b, 0x57, 0xd4, 0xb2, 0xaa, 0xa7, - 0x11, 0x4e, 0x42, 0x4c, 0xd1, 0xb4, 0x9a, 0x96, 0x16, 0xf1, 0xbf, 0xf0, 0x57, 0xa3, 0xd2, 0xd4, - 0xf5, 0xaa, 0xfa, 0xa2, 0xb5, 0x57, 0x7b, 0xad, 0xa6, 0x23, 0xa5, 0x6f, 0x28, 0xe4, 0xf7, 0x3e, - 0x65, 0xc1, 0x53, 0xd0, 0x84, 0x14, 0x0f, 0x0f, 0x28, 0x35, 0xf1, 0xda, 0x94, 0xdd, 0xb7, 0xdf, - 0x9b, 0xcc, 0xda, 0xbc, 0x7e, 0x70, 0x6c, 0x4e, 0xc8, 0xa3, 0x4d, 0x84, 0x0d, 0x58, 0x99, 0x69, - 0x19, 0x5e, 0x9f, 0xe2, 0xdf, 0xd5, 0x94, 0xcc, 0xc6, 0xef, 0x40, 0xfd, 0x0e, 0x94, 0x4c, 0x58, - 0x0e, 0xab, 0x9b, 0x8c, 0xd3, 0x1b, 0x58, 0x0c, 0x62, 0x4f, 0x5f, 0xf6, 0xbe, 0x9b, 0x9c, 0xc9, - 0xde, 0x37, 0x70, 0xbe, 0xc2, 0x9d, 0xf2, 0xd9, 0x85, 0x2c, 0x9c, 0x5f, 0xc8, 0xc2, 0xd5, 0x85, - 0x8c, 0x3e, 0xba, 0x32, 0xfa, 0xe2, 0xca, 0xe8, 0xab, 0x2b, 0xa3, 0x33, 0x57, 0x46, 0xdf, 0x5d, - 0x19, 0xfd, 0x70, 0x65, 0xe1, 0xca, 0x95, 0xd1, 0xa7, 0x4b, 0x59, 0x38, 0xbb, 0x94, 0x85, 0xf3, - 0x4b, 0x59, 0x78, 0x17, 0xfe, 0x0b, 0xe9, 0xc4, 0xbd, 0x87, 0xfd, 0xe9, 0xaf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x0a, 0x15, 0x06, 0xe2, 0x83, 0x06, 0x00, 0x00, -} - -func (x FrontendToSchedulerType) String() string { - s, ok := FrontendToSchedulerType_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x SchedulerToFrontendStatus) String() string { - s, ok := SchedulerToFrontendStatus_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *QuerierToScheduler) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QuerierToScheduler) - if !ok { - that2, ok := that.(QuerierToScheduler) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.QuerierID != that1.QuerierID { - return false - } - return true -} -func (this *SchedulerToQuerier) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SchedulerToQuerier) - if !ok { - that2, ok := that.(SchedulerToQuerier) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.QueryID != that1.QueryID { - return false - } - if that1.Request == nil { - if this.Request != nil { - return false - } - } else if this.Request == nil { - return false - } else if !this.Request.Equal(that1.Request) { - return false - } - if this.FrontendAddress != that1.FrontendAddress { - return false - } - if this.UserID != that1.UserID { - return false - } - if this.StatsEnabled != that1.StatsEnabled { - return false - } - return true -} -func (this *SchedulerToQuerier_HttpRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SchedulerToQuerier_HttpRequest) - if !ok { - that2, ok := that.(SchedulerToQuerier_HttpRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.HttpRequest.Equal(that1.HttpRequest) { - return false - } - return true -} -func (this *SchedulerToQuerier_QueryRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SchedulerToQuerier_QueryRequest) - if !ok { - that2, ok := that.(SchedulerToQuerier_QueryRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.QueryRequest.Equal(that1.QueryRequest) { - return false - } - return true -} -func (this *FrontendToScheduler) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FrontendToScheduler) - if !ok { - that2, ok := that.(FrontendToScheduler) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.FrontendAddress != that1.FrontendAddress { - return false - } - if this.QueryID != that1.QueryID { - return false - } - if this.UserID != that1.UserID { - return false - } - if that1.Request == nil { - if this.Request != nil { - return false - } - } else if this.Request == nil { - return false - } else if !this.Request.Equal(that1.Request) { - return false - } - if this.StatsEnabled != that1.StatsEnabled { - return false - } - if len(this.QueuePath) != len(that1.QueuePath) { - return false - } - for i := range this.QueuePath { - if this.QueuePath[i] != that1.QueuePath[i] { - return false - } - } - return true -} -func (this *FrontendToScheduler_HttpRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FrontendToScheduler_HttpRequest) - if !ok { - that2, ok := that.(FrontendToScheduler_HttpRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.HttpRequest.Equal(that1.HttpRequest) { - return false - } - return true -} -func (this *FrontendToScheduler_QueryRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FrontendToScheduler_QueryRequest) - if !ok { - that2, ok := that.(FrontendToScheduler_QueryRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.QueryRequest.Equal(that1.QueryRequest) { - return false - } - return true -} -func (this *SchedulerToFrontend) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SchedulerToFrontend) - if !ok { - that2, ok := that.(SchedulerToFrontend) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if this.Error != that1.Error { - return false - } - return true -} -func (this *NotifyQuerierShutdownRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*NotifyQuerierShutdownRequest) - if !ok { - that2, ok := that.(NotifyQuerierShutdownRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.QuerierID != that1.QuerierID { - return false - } - return true -} -func (this *NotifyQuerierShutdownResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*NotifyQuerierShutdownResponse) - if !ok { - that2, ok := that.(NotifyQuerierShutdownResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *QuerierToScheduler) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&schedulerpb.QuerierToScheduler{") - s = append(s, "QuerierID: "+fmt.Sprintf("%#v", this.QuerierID)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SchedulerToQuerier) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&schedulerpb.SchedulerToQuerier{") - s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") - if this.Request != nil { - s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") - } - s = append(s, "FrontendAddress: "+fmt.Sprintf("%#v", this.FrontendAddress)+",\n") - s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") - s = append(s, "StatsEnabled: "+fmt.Sprintf("%#v", this.StatsEnabled)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SchedulerToQuerier_HttpRequest) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&schedulerpb.SchedulerToQuerier_HttpRequest{` + - `HttpRequest:` + fmt.Sprintf("%#v", this.HttpRequest) + `}`}, ", ") - return s -} -func (this *SchedulerToQuerier_QueryRequest) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&schedulerpb.SchedulerToQuerier_QueryRequest{` + - `QueryRequest:` + fmt.Sprintf("%#v", this.QueryRequest) + `}`}, ", ") - return s -} -func (this *FrontendToScheduler) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&schedulerpb.FrontendToScheduler{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "FrontendAddress: "+fmt.Sprintf("%#v", this.FrontendAddress)+",\n") - s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") - s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") - if this.Request != nil { - s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") - } - s = append(s, "StatsEnabled: "+fmt.Sprintf("%#v", this.StatsEnabled)+",\n") - s = append(s, "QueuePath: "+fmt.Sprintf("%#v", this.QueuePath)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrontendToScheduler_HttpRequest) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&schedulerpb.FrontendToScheduler_HttpRequest{` + - `HttpRequest:` + fmt.Sprintf("%#v", this.HttpRequest) + `}`}, ", ") - return s -} -func (this *FrontendToScheduler_QueryRequest) GoString() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&schedulerpb.FrontendToScheduler_QueryRequest{` + - `QueryRequest:` + fmt.Sprintf("%#v", this.QueryRequest) + `}`}, ", ") - return s -} -func (this *SchedulerToFrontend) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&schedulerpb.SchedulerToFrontend{") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *NotifyQuerierShutdownRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&schedulerpb.NotifyQuerierShutdownRequest{") - s = append(s, "QuerierID: "+fmt.Sprintf("%#v", this.QuerierID)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *NotifyQuerierShutdownResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&schedulerpb.NotifyQuerierShutdownResponse{") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringScheduler(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// SchedulerForQuerierClient is the client API for SchedulerForQuerier service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SchedulerForQuerierClient interface { - // After calling this method, both Querier and Scheduler enter a loop, in which querier waits for - // "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request, - // querier signals that it is ready to accept another one by sending empty QuerierToScheduler message. - // - // Long-running loop is used to detect broken connection between scheduler and querier. This is important - // for scheduler to keep a list of connected queriers up-to-date. - QuerierLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForQuerier_QuerierLoopClient, error) - // The querier notifies the query-scheduler that it started a graceful shutdown. - NotifyQuerierShutdown(ctx context.Context, in *NotifyQuerierShutdownRequest, opts ...grpc.CallOption) (*NotifyQuerierShutdownResponse, error) -} - -type schedulerForQuerierClient struct { - cc *grpc.ClientConn -} - -func NewSchedulerForQuerierClient(cc *grpc.ClientConn) SchedulerForQuerierClient { - return &schedulerForQuerierClient{cc} -} - -func (c *schedulerForQuerierClient) QuerierLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForQuerier_QuerierLoopClient, error) { - stream, err := c.cc.NewStream(ctx, &_SchedulerForQuerier_serviceDesc.Streams[0], "/schedulerpb.SchedulerForQuerier/QuerierLoop", opts...) - if err != nil { - return nil, err - } - x := &schedulerForQuerierQuerierLoopClient{stream} - return x, nil -} - -type SchedulerForQuerier_QuerierLoopClient interface { - Send(*QuerierToScheduler) error - Recv() (*SchedulerToQuerier, error) - grpc.ClientStream -} - -type schedulerForQuerierQuerierLoopClient struct { - grpc.ClientStream -} - -func (x *schedulerForQuerierQuerierLoopClient) Send(m *QuerierToScheduler) error { - return x.ClientStream.SendMsg(m) -} - -func (x *schedulerForQuerierQuerierLoopClient) Recv() (*SchedulerToQuerier, error) { - m := new(SchedulerToQuerier) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *schedulerForQuerierClient) NotifyQuerierShutdown(ctx context.Context, in *NotifyQuerierShutdownRequest, opts ...grpc.CallOption) (*NotifyQuerierShutdownResponse, error) { - out := new(NotifyQuerierShutdownResponse) - err := c.cc.Invoke(ctx, "/schedulerpb.SchedulerForQuerier/NotifyQuerierShutdown", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SchedulerForQuerierServer is the server API for SchedulerForQuerier service. -type SchedulerForQuerierServer interface { - // After calling this method, both Querier and Scheduler enter a loop, in which querier waits for - // "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request, - // querier signals that it is ready to accept another one by sending empty QuerierToScheduler message. - // - // Long-running loop is used to detect broken connection between scheduler and querier. This is important - // for scheduler to keep a list of connected queriers up-to-date. - QuerierLoop(SchedulerForQuerier_QuerierLoopServer) error - // The querier notifies the query-scheduler that it started a graceful shutdown. - NotifyQuerierShutdown(context.Context, *NotifyQuerierShutdownRequest) (*NotifyQuerierShutdownResponse, error) -} - -// UnimplementedSchedulerForQuerierServer can be embedded to have forward compatible implementations. -type UnimplementedSchedulerForQuerierServer struct { -} - -func (*UnimplementedSchedulerForQuerierServer) QuerierLoop(srv SchedulerForQuerier_QuerierLoopServer) error { - return status.Errorf(codes.Unimplemented, "method QuerierLoop not implemented") -} -func (*UnimplementedSchedulerForQuerierServer) NotifyQuerierShutdown(ctx context.Context, req *NotifyQuerierShutdownRequest) (*NotifyQuerierShutdownResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NotifyQuerierShutdown not implemented") -} - -func RegisterSchedulerForQuerierServer(s *grpc.Server, srv SchedulerForQuerierServer) { - s.RegisterService(&_SchedulerForQuerier_serviceDesc, srv) -} - -func _SchedulerForQuerier_QuerierLoop_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(SchedulerForQuerierServer).QuerierLoop(&schedulerForQuerierQuerierLoopServer{stream}) -} - -type SchedulerForQuerier_QuerierLoopServer interface { - Send(*SchedulerToQuerier) error - Recv() (*QuerierToScheduler, error) - grpc.ServerStream -} - -type schedulerForQuerierQuerierLoopServer struct { - grpc.ServerStream -} - -func (x *schedulerForQuerierQuerierLoopServer) Send(m *SchedulerToQuerier) error { - return x.ServerStream.SendMsg(m) -} - -func (x *schedulerForQuerierQuerierLoopServer) Recv() (*QuerierToScheduler, error) { - m := new(QuerierToScheduler) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _SchedulerForQuerier_NotifyQuerierShutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NotifyQuerierShutdownRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SchedulerForQuerierServer).NotifyQuerierShutdown(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/schedulerpb.SchedulerForQuerier/NotifyQuerierShutdown", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SchedulerForQuerierServer).NotifyQuerierShutdown(ctx, req.(*NotifyQuerierShutdownRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _SchedulerForQuerier_serviceDesc = grpc.ServiceDesc{ - ServiceName: "schedulerpb.SchedulerForQuerier", - HandlerType: (*SchedulerForQuerierServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NotifyQuerierShutdown", - Handler: _SchedulerForQuerier_NotifyQuerierShutdown_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "QuerierLoop", - Handler: _SchedulerForQuerier_QuerierLoop_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "pkg/scheduler/schedulerpb/scheduler.proto", -} - -// SchedulerForFrontendClient is the client API for SchedulerForFrontend service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SchedulerForFrontendClient interface { - // After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and - // CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request. - // - // Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both - // parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending - // requests sent to this scheduler, while scheduler can cancel queued requests from given frontend. - FrontendLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForFrontend_FrontendLoopClient, error) -} - -type schedulerForFrontendClient struct { - cc *grpc.ClientConn -} - -func NewSchedulerForFrontendClient(cc *grpc.ClientConn) SchedulerForFrontendClient { - return &schedulerForFrontendClient{cc} -} - -func (c *schedulerForFrontendClient) FrontendLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForFrontend_FrontendLoopClient, error) { - stream, err := c.cc.NewStream(ctx, &_SchedulerForFrontend_serviceDesc.Streams[0], "/schedulerpb.SchedulerForFrontend/FrontendLoop", opts...) - if err != nil { - return nil, err - } - x := &schedulerForFrontendFrontendLoopClient{stream} - return x, nil -} - -type SchedulerForFrontend_FrontendLoopClient interface { - Send(*FrontendToScheduler) error - Recv() (*SchedulerToFrontend, error) - grpc.ClientStream -} - -type schedulerForFrontendFrontendLoopClient struct { - grpc.ClientStream -} - -func (x *schedulerForFrontendFrontendLoopClient) Send(m *FrontendToScheduler) error { - return x.ClientStream.SendMsg(m) -} - -func (x *schedulerForFrontendFrontendLoopClient) Recv() (*SchedulerToFrontend, error) { - m := new(SchedulerToFrontend) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SchedulerForFrontendServer is the server API for SchedulerForFrontend service. -type SchedulerForFrontendServer interface { - // After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and - // CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request. - // - // Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both - // parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending - // requests sent to this scheduler, while scheduler can cancel queued requests from given frontend. - FrontendLoop(SchedulerForFrontend_FrontendLoopServer) error -} - -// UnimplementedSchedulerForFrontendServer can be embedded to have forward compatible implementations. -type UnimplementedSchedulerForFrontendServer struct { -} - -func (*UnimplementedSchedulerForFrontendServer) FrontendLoop(srv SchedulerForFrontend_FrontendLoopServer) error { - return status.Errorf(codes.Unimplemented, "method FrontendLoop not implemented") -} - -func RegisterSchedulerForFrontendServer(s *grpc.Server, srv SchedulerForFrontendServer) { - s.RegisterService(&_SchedulerForFrontend_serviceDesc, srv) -} - -func _SchedulerForFrontend_FrontendLoop_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(SchedulerForFrontendServer).FrontendLoop(&schedulerForFrontendFrontendLoopServer{stream}) -} - -type SchedulerForFrontend_FrontendLoopServer interface { - Send(*SchedulerToFrontend) error - Recv() (*FrontendToScheduler, error) - grpc.ServerStream -} - -type schedulerForFrontendFrontendLoopServer struct { - grpc.ServerStream -} - -func (x *schedulerForFrontendFrontendLoopServer) Send(m *SchedulerToFrontend) error { - return x.ServerStream.SendMsg(m) -} - -func (x *schedulerForFrontendFrontendLoopServer) Recv() (*FrontendToScheduler, error) { - m := new(FrontendToScheduler) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _SchedulerForFrontend_serviceDesc = grpc.ServiceDesc{ - ServiceName: "schedulerpb.SchedulerForFrontend", - HandlerType: (*SchedulerForFrontendServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "FrontendLoop", - Handler: _SchedulerForFrontend_FrontendLoop_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "pkg/scheduler/schedulerpb/scheduler.proto", -} - -func (m *QuerierToScheduler) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QuerierToScheduler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerierToScheduler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QuerierID) > 0 { - i -= len(m.QuerierID) - copy(dAtA[i:], m.QuerierID) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.QuerierID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SchedulerToQuerier) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SchedulerToQuerier) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SchedulerToQuerier) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Request != nil { - { - size := m.Request.Size() - i -= size - if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.StatsEnabled { - i-- - if m.StatsEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.UserID) > 0 { - i -= len(m.UserID) - copy(dAtA[i:], m.UserID) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.UserID))) - i-- - dAtA[i] = 0x22 - } - if len(m.FrontendAddress) > 0 { - i -= len(m.FrontendAddress) - copy(dAtA[i:], m.FrontendAddress) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.FrontendAddress))) - i-- - dAtA[i] = 0x1a - } - if m.QueryID != 0 { - i = encodeVarintScheduler(dAtA, i, uint64(m.QueryID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SchedulerToQuerier_HttpRequest) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *SchedulerToQuerier_HttpRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.HttpRequest != nil { - { - size, err := m.HttpRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScheduler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *SchedulerToQuerier_QueryRequest) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *SchedulerToQuerier_QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.QueryRequest != nil { - { - size, err := m.QueryRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScheduler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *FrontendToScheduler) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FrontendToScheduler) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FrontendToScheduler) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Request != nil { - { - size := m.Request.Size() - i -= size - if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.QueuePath) > 0 { - for iNdEx := len(m.QueuePath) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.QueuePath[iNdEx]) - copy(dAtA[i:], m.QueuePath[iNdEx]) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.QueuePath[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if m.StatsEnabled { - i-- - if m.StatsEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.UserID) > 0 { - i -= len(m.UserID) - copy(dAtA[i:], m.UserID) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.UserID))) - i-- - dAtA[i] = 0x22 - } - if m.QueryID != 0 { - i = encodeVarintScheduler(dAtA, i, uint64(m.QueryID)) - i-- - dAtA[i] = 0x18 - } - if len(m.FrontendAddress) > 0 { - i -= len(m.FrontendAddress) - copy(dAtA[i:], m.FrontendAddress) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.FrontendAddress))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintScheduler(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FrontendToScheduler_HttpRequest) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *FrontendToScheduler_HttpRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.HttpRequest != nil { - { - size, err := m.HttpRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScheduler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *FrontendToScheduler_QueryRequest) MarshalTo(dAtA []byte) (int, error) { - return m.MarshalToSizedBuffer(dAtA[:m.Size()]) -} - -func (m *FrontendToScheduler_QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.QueryRequest != nil { - { - size, err := m.QueryRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintScheduler(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} -func (m *SchedulerToFrontend) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SchedulerToFrontend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SchedulerToFrontend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x12 - } - if m.Status != 0 { - i = encodeVarintScheduler(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NotifyQuerierShutdownRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NotifyQuerierShutdownRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NotifyQuerierShutdownRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QuerierID) > 0 { - i -= len(m.QuerierID) - copy(dAtA[i:], m.QuerierID) - i = encodeVarintScheduler(dAtA, i, uint64(len(m.QuerierID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *NotifyQuerierShutdownResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NotifyQuerierShutdownResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NotifyQuerierShutdownResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintScheduler(dAtA []byte, offset int, v uint64) int { - offset -= sovScheduler(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QuerierToScheduler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.QuerierID) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} - -func (m *SchedulerToQuerier) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QueryID != 0 { - n += 1 + sovScheduler(uint64(m.QueryID)) - } - if m.Request != nil { - n += m.Request.Size() - } - l = len(m.FrontendAddress) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - l = len(m.UserID) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - if m.StatsEnabled { - n += 2 - } - return n -} - -func (m *SchedulerToQuerier_HttpRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HttpRequest != nil { - l = m.HttpRequest.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} -func (m *SchedulerToQuerier_QueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QueryRequest != nil { - l = m.QueryRequest.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} -func (m *FrontendToScheduler) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovScheduler(uint64(m.Type)) - } - l = len(m.FrontendAddress) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - if m.QueryID != 0 { - n += 1 + sovScheduler(uint64(m.QueryID)) - } - l = len(m.UserID) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Request != nil { - n += m.Request.Size() - } - if m.StatsEnabled { - n += 2 - } - if len(m.QueuePath) > 0 { - for _, s := range m.QueuePath { - l = len(s) - n += 1 + l + sovScheduler(uint64(l)) - } - } - return n -} - -func (m *FrontendToScheduler_HttpRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HttpRequest != nil { - l = m.HttpRequest.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} -func (m *FrontendToScheduler_QueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.QueryRequest != nil { - l = m.QueryRequest.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} -func (m *SchedulerToFrontend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != 0 { - n += 1 + sovScheduler(uint64(m.Status)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} - -func (m *NotifyQuerierShutdownRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.QuerierID) - if l > 0 { - n += 1 + l + sovScheduler(uint64(l)) - } - return n -} - -func (m *NotifyQuerierShutdownResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovScheduler(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozScheduler(x uint64) (n int) { - return sovScheduler(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *QuerierToScheduler) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QuerierToScheduler{`, - `QuerierID:` + fmt.Sprintf("%v", this.QuerierID) + `,`, - `}`, - }, "") - return s -} -func (this *SchedulerToQuerier) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SchedulerToQuerier{`, - `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, - `Request:` + fmt.Sprintf("%v", this.Request) + `,`, - `FrontendAddress:` + fmt.Sprintf("%v", this.FrontendAddress) + `,`, - `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, - `StatsEnabled:` + fmt.Sprintf("%v", this.StatsEnabled) + `,`, - `}`, - }, "") - return s -} -func (this *SchedulerToQuerier_HttpRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SchedulerToQuerier_HttpRequest{`, - `HttpRequest:` + strings.Replace(fmt.Sprintf("%v", this.HttpRequest), "HTTPRequest", "httpgrpc.HTTPRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SchedulerToQuerier_QueryRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SchedulerToQuerier_QueryRequest{`, - `QueryRequest:` + strings.Replace(fmt.Sprintf("%v", this.QueryRequest), "QueryRequest", "queryrange.QueryRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *FrontendToScheduler) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrontendToScheduler{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `FrontendAddress:` + fmt.Sprintf("%v", this.FrontendAddress) + `,`, - `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, - `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, - `Request:` + fmt.Sprintf("%v", this.Request) + `,`, - `StatsEnabled:` + fmt.Sprintf("%v", this.StatsEnabled) + `,`, - `QueuePath:` + fmt.Sprintf("%v", this.QueuePath) + `,`, - `}`, - }, "") - return s -} -func (this *FrontendToScheduler_HttpRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrontendToScheduler_HttpRequest{`, - `HttpRequest:` + strings.Replace(fmt.Sprintf("%v", this.HttpRequest), "HTTPRequest", "httpgrpc.HTTPRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *FrontendToScheduler_QueryRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrontendToScheduler_QueryRequest{`, - `QueryRequest:` + strings.Replace(fmt.Sprintf("%v", this.QueryRequest), "QueryRequest", "queryrange.QueryRequest", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SchedulerToFrontend) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SchedulerToFrontend{`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Error:` + fmt.Sprintf("%v", this.Error) + `,`, - `}`, - }, "") - return s -} -func (this *NotifyQuerierShutdownRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NotifyQuerierShutdownRequest{`, - `QuerierID:` + fmt.Sprintf("%v", this.QuerierID) + `,`, - `}`, - }, "") - return s -} -func (this *NotifyQuerierShutdownResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NotifyQuerierShutdownResponse{`, - `}`, - }, "") - return s -} -func valueToStringScheduler(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *QuerierToScheduler) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QuerierToScheduler: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerierToScheduler: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuerierID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QuerierID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SchedulerToQuerier) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SchedulerToQuerier: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SchedulerToQuerier: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) - } - m.QueryID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &httpgrpc.HTTPRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &SchedulerToQuerier_HttpRequest{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrontendAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FrontendAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StatsEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StatsEnabled = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &queryrange.QueryRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &SchedulerToQuerier_QueryRequest{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FrontendToScheduler) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FrontendToScheduler: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FrontendToScheduler: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= FrontendToSchedulerType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrontendAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FrontendAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) - } - m.QueryID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HttpRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &httpgrpc.HTTPRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &FrontendToScheduler_HttpRequest{v} - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StatsEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.StatsEnabled = bool(v != 0) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueuePath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueuePath = append(m.QueuePath, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &queryrange.QueryRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &FrontendToScheduler_QueryRequest{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SchedulerToFrontend) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SchedulerToFrontend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SchedulerToFrontend: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= SchedulerToFrontendStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NotifyQuerierShutdownRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NotifyQuerierShutdownRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NotifyQuerierShutdownRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuerierID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthScheduler - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QuerierID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NotifyQuerierShutdownResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowScheduler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NotifyQuerierShutdownResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NotifyQuerierShutdownResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipScheduler(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipScheduler(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowScheduler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowScheduler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowScheduler - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthScheduler - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthScheduler - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowScheduler - } - 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 := skipScheduler(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthScheduler - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthScheduler = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowScheduler = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/storage/chunk/client/grpc/grpc.pb.go b/pkg/storage/chunk/client/grpc/grpc.pb.go deleted file mode 100644 index d76002adfc384..0000000000000 --- a/pkg/storage/chunk/client/grpc/grpc.pb.go +++ /dev/null @@ -1,6484 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/storage/chunk/client/grpc/grpc.proto - -package grpc - -import ( - bytes "bytes" - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - empty "github.com/golang/protobuf/ptypes/empty" - 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" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PutChunksRequest struct { - Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` -} - -func (m *PutChunksRequest) Reset() { *m = PutChunksRequest{} } -func (*PutChunksRequest) ProtoMessage() {} -func (*PutChunksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{0} -} -func (m *PutChunksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PutChunksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PutChunksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PutChunksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PutChunksRequest.Merge(m, src) -} -func (m *PutChunksRequest) XXX_Size() int { - return m.Size() -} -func (m *PutChunksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PutChunksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PutChunksRequest proto.InternalMessageInfo - -func (m *PutChunksRequest) GetChunks() []*Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -type GetChunksRequest struct { - Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` -} - -func (m *GetChunksRequest) Reset() { *m = GetChunksRequest{} } -func (*GetChunksRequest) ProtoMessage() {} -func (*GetChunksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{1} -} -func (m *GetChunksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetChunksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetChunksRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetChunksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetChunksRequest.Merge(m, src) -} -func (m *GetChunksRequest) XXX_Size() int { - return m.Size() -} -func (m *GetChunksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetChunksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetChunksRequest proto.InternalMessageInfo - -func (m *GetChunksRequest) GetChunks() []*Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -type GetChunksResponse struct { - Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` -} - -func (m *GetChunksResponse) Reset() { *m = GetChunksResponse{} } -func (*GetChunksResponse) ProtoMessage() {} -func (*GetChunksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{2} -} -func (m *GetChunksResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetChunksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetChunksResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetChunksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetChunksResponse.Merge(m, src) -} -func (m *GetChunksResponse) XXX_Size() int { - return m.Size() -} -func (m *GetChunksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetChunksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetChunksResponse proto.InternalMessageInfo - -func (m *GetChunksResponse) GetChunks() []*Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -type Chunk struct { - Encoded []byte `protobuf:"bytes,1,opt,name=encoded,proto3" json:"encoded,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - TableName string `protobuf:"bytes,3,opt,name=tableName,proto3" json:"tableName,omitempty"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{3} -} -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) -} -func (m *Chunk) XXX_Size() int { - return m.Size() -} -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) -} - -var xxx_messageInfo_Chunk proto.InternalMessageInfo - -func (m *Chunk) GetEncoded() []byte { - if m != nil { - return m.Encoded - } - return nil -} - -func (m *Chunk) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *Chunk) GetTableName() string { - if m != nil { - return m.TableName - } - return "" -} - -type ChunkID struct { - ChunkID string `protobuf:"bytes,1,opt,name=chunkID,proto3" json:"chunkID,omitempty"` -} - -func (m *ChunkID) Reset() { *m = ChunkID{} } -func (*ChunkID) ProtoMessage() {} -func (*ChunkID) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{4} -} -func (m *ChunkID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ChunkID) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkID.Merge(m, src) -} -func (m *ChunkID) XXX_Size() int { - return m.Size() -} -func (m *ChunkID) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkID.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkID proto.InternalMessageInfo - -func (m *ChunkID) GetChunkID() string { - if m != nil { - return m.ChunkID - } - return "" -} - -type DeleteTableRequest struct { - TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` -} - -func (m *DeleteTableRequest) Reset() { *m = DeleteTableRequest{} } -func (*DeleteTableRequest) ProtoMessage() {} -func (*DeleteTableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{5} -} -func (m *DeleteTableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteTableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DeleteTableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteTableRequest.Merge(m, src) -} -func (m *DeleteTableRequest) XXX_Size() int { - return m.Size() -} -func (m *DeleteTableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteTableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteTableRequest proto.InternalMessageInfo - -func (m *DeleteTableRequest) GetTableName() string { - if m != nil { - return m.TableName - } - return "" -} - -type DescribeTableRequest struct { - TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` -} - -func (m *DescribeTableRequest) Reset() { *m = DescribeTableRequest{} } -func (*DescribeTableRequest) ProtoMessage() {} -func (*DescribeTableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{6} -} -func (m *DescribeTableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DescribeTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DescribeTableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DescribeTableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeTableRequest.Merge(m, src) -} -func (m *DescribeTableRequest) XXX_Size() int { - return m.Size() -} -func (m *DescribeTableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeTableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeTableRequest proto.InternalMessageInfo - -func (m *DescribeTableRequest) GetTableName() string { - if m != nil { - return m.TableName - } - return "" -} - -type WriteBatch struct { - Writes []*IndexEntry `protobuf:"bytes,1,rep,name=writes,proto3" json:"writes,omitempty"` - Deletes []*IndexEntry `protobuf:"bytes,2,rep,name=deletes,proto3" json:"deletes,omitempty"` -} - -func (m *WriteBatch) Reset() { *m = WriteBatch{} } -func (*WriteBatch) ProtoMessage() {} -func (*WriteBatch) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{7} -} -func (m *WriteBatch) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteBatch.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WriteBatch) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteBatch.Merge(m, src) -} -func (m *WriteBatch) XXX_Size() int { - return m.Size() -} -func (m *WriteBatch) XXX_DiscardUnknown() { - xxx_messageInfo_WriteBatch.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteBatch proto.InternalMessageInfo - -func (m *WriteBatch) GetWrites() []*IndexEntry { - if m != nil { - return m.Writes - } - return nil -} - -func (m *WriteBatch) GetDeletes() []*IndexEntry { - if m != nil { - return m.Deletes - } - return nil -} - -type WriteIndexRequest struct { - Writes []*IndexEntry `protobuf:"bytes,1,rep,name=writes,proto3" json:"writes,omitempty"` -} - -func (m *WriteIndexRequest) Reset() { *m = WriteIndexRequest{} } -func (*WriteIndexRequest) ProtoMessage() {} -func (*WriteIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{8} -} -func (m *WriteIndexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteIndexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WriteIndexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteIndexRequest.Merge(m, src) -} -func (m *WriteIndexRequest) XXX_Size() int { - return m.Size() -} -func (m *WriteIndexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteIndexRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteIndexRequest proto.InternalMessageInfo - -func (m *WriteIndexRequest) GetWrites() []*IndexEntry { - if m != nil { - return m.Writes - } - return nil -} - -type DeleteIndexRequest struct { - Deletes []*IndexEntry `protobuf:"bytes,1,rep,name=deletes,proto3" json:"deletes,omitempty"` -} - -func (m *DeleteIndexRequest) Reset() { *m = DeleteIndexRequest{} } -func (*DeleteIndexRequest) ProtoMessage() {} -func (*DeleteIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{9} -} -func (m *DeleteIndexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DeleteIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DeleteIndexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DeleteIndexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteIndexRequest.Merge(m, src) -} -func (m *DeleteIndexRequest) XXX_Size() int { - return m.Size() -} -func (m *DeleteIndexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteIndexRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteIndexRequest proto.InternalMessageInfo - -func (m *DeleteIndexRequest) GetDeletes() []*IndexEntry { - if m != nil { - return m.Deletes - } - return nil -} - -type QueryIndexResponse struct { - Rows []*Row `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"` -} - -func (m *QueryIndexResponse) Reset() { *m = QueryIndexResponse{} } -func (*QueryIndexResponse) ProtoMessage() {} -func (*QueryIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{10} -} -func (m *QueryIndexResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIndexResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryIndexResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIndexResponse.Merge(m, src) -} -func (m *QueryIndexResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryIndexResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIndexResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIndexResponse proto.InternalMessageInfo - -func (m *QueryIndexResponse) GetRows() []*Row { - if m != nil { - return m.Rows - } - return nil -} - -type Row struct { - RangeValue []byte `protobuf:"bytes,1,opt,name=rangeValue,proto3" json:"rangeValue,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Row) Reset() { *m = Row{} } -func (*Row) ProtoMessage() {} -func (*Row) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{11} -} -func (m *Row) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Row) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Row.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Row) XXX_Merge(src proto.Message) { - xxx_messageInfo_Row.Merge(m, src) -} -func (m *Row) XXX_Size() int { - return m.Size() -} -func (m *Row) XXX_DiscardUnknown() { - xxx_messageInfo_Row.DiscardUnknown(m) -} - -var xxx_messageInfo_Row proto.InternalMessageInfo - -func (m *Row) GetRangeValue() []byte { - if m != nil { - return m.RangeValue - } - return nil -} - -func (m *Row) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type IndexEntry struct { - TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` - HashValue string `protobuf:"bytes,2,opt,name=hashValue,proto3" json:"hashValue,omitempty"` - RangeValue []byte `protobuf:"bytes,3,opt,name=rangeValue,proto3" json:"rangeValue,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *IndexEntry) Reset() { *m = IndexEntry{} } -func (*IndexEntry) ProtoMessage() {} -func (*IndexEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{12} -} -func (m *IndexEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IndexEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IndexEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IndexEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexEntry.Merge(m, src) -} -func (m *IndexEntry) XXX_Size() int { - return m.Size() -} -func (m *IndexEntry) XXX_DiscardUnknown() { - xxx_messageInfo_IndexEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexEntry proto.InternalMessageInfo - -func (m *IndexEntry) GetTableName() string { - if m != nil { - return m.TableName - } - return "" -} - -func (m *IndexEntry) GetHashValue() string { - if m != nil { - return m.HashValue - } - return "" -} - -func (m *IndexEntry) GetRangeValue() []byte { - if m != nil { - return m.RangeValue - } - return nil -} - -func (m *IndexEntry) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type QueryIndexRequest struct { - TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` - HashValue string `protobuf:"bytes,2,opt,name=hashValue,proto3" json:"hashValue,omitempty"` - RangeValuePrefix []byte `protobuf:"bytes,3,opt,name=rangeValuePrefix,proto3" json:"rangeValuePrefix,omitempty"` - RangeValueStart []byte `protobuf:"bytes,4,opt,name=rangeValueStart,proto3" json:"rangeValueStart,omitempty"` - ValueEqual []byte `protobuf:"bytes,5,opt,name=valueEqual,proto3" json:"valueEqual,omitempty"` - Immutable bool `protobuf:"varint,6,opt,name=immutable,proto3" json:"immutable,omitempty"` -} - -func (m *QueryIndexRequest) Reset() { *m = QueryIndexRequest{} } -func (*QueryIndexRequest) ProtoMessage() {} -func (*QueryIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{13} -} -func (m *QueryIndexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryIndexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryIndexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIndexRequest.Merge(m, src) -} -func (m *QueryIndexRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryIndexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIndexRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryIndexRequest proto.InternalMessageInfo - -func (m *QueryIndexRequest) GetTableName() string { - if m != nil { - return m.TableName - } - return "" -} - -func (m *QueryIndexRequest) GetHashValue() string { - if m != nil { - return m.HashValue - } - return "" -} - -func (m *QueryIndexRequest) GetRangeValuePrefix() []byte { - if m != nil { - return m.RangeValuePrefix - } - return nil -} - -func (m *QueryIndexRequest) GetRangeValueStart() []byte { - if m != nil { - return m.RangeValueStart - } - return nil -} - -func (m *QueryIndexRequest) GetValueEqual() []byte { - if m != nil { - return m.ValueEqual - } - return nil -} - -func (m *QueryIndexRequest) GetImmutable() bool { - if m != nil { - return m.Immutable - } - return false -} - -type UpdateTableRequest struct { - Current *TableDesc `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"` - Expected *TableDesc `protobuf:"bytes,2,opt,name=expected,proto3" json:"expected,omitempty"` -} - -func (m *UpdateTableRequest) Reset() { *m = UpdateTableRequest{} } -func (*UpdateTableRequest) ProtoMessage() {} -func (*UpdateTableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{14} -} -func (m *UpdateTableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UpdateTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UpdateTableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UpdateTableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateTableRequest.Merge(m, src) -} -func (m *UpdateTableRequest) XXX_Size() int { - return m.Size() -} -func (m *UpdateTableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateTableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateTableRequest proto.InternalMessageInfo - -func (m *UpdateTableRequest) GetCurrent() *TableDesc { - if m != nil { - return m.Current - } - return nil -} - -func (m *UpdateTableRequest) GetExpected() *TableDesc { - if m != nil { - return m.Expected - } - return nil -} - -type DescribeTableResponse struct { - Desc *TableDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` - IsActive bool `protobuf:"varint,2,opt,name=isActive,proto3" json:"isActive,omitempty"` -} - -func (m *DescribeTableResponse) Reset() { *m = DescribeTableResponse{} } -func (*DescribeTableResponse) ProtoMessage() {} -func (*DescribeTableResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{15} -} -func (m *DescribeTableResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DescribeTableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DescribeTableResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DescribeTableResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DescribeTableResponse.Merge(m, src) -} -func (m *DescribeTableResponse) XXX_Size() int { - return m.Size() -} -func (m *DescribeTableResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DescribeTableResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DescribeTableResponse proto.InternalMessageInfo - -func (m *DescribeTableResponse) GetDesc() *TableDesc { - if m != nil { - return m.Desc - } - return nil -} - -func (m *DescribeTableResponse) GetIsActive() bool { - if m != nil { - return m.IsActive - } - return false -} - -type CreateTableRequest struct { - Desc *TableDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` -} - -func (m *CreateTableRequest) Reset() { *m = CreateTableRequest{} } -func (*CreateTableRequest) ProtoMessage() {} -func (*CreateTableRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{16} -} -func (m *CreateTableRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CreateTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CreateTableRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CreateTableRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTableRequest.Merge(m, src) -} -func (m *CreateTableRequest) XXX_Size() int { - return m.Size() -} -func (m *CreateTableRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateTableRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateTableRequest proto.InternalMessageInfo - -func (m *CreateTableRequest) GetDesc() *TableDesc { - if m != nil { - return m.Desc - } - return nil -} - -type TableDesc struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - UseOnDemandIOMode bool `protobuf:"varint,2,opt,name=useOnDemandIOMode,proto3" json:"useOnDemandIOMode,omitempty"` - ProvisionedRead int64 `protobuf:"varint,3,opt,name=provisionedRead,proto3" json:"provisionedRead,omitempty"` - ProvisionedWrite int64 `protobuf:"varint,4,opt,name=provisionedWrite,proto3" json:"provisionedWrite,omitempty"` - Tags map[string]string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *TableDesc) Reset() { *m = TableDesc{} } -func (*TableDesc) ProtoMessage() {} -func (*TableDesc) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{17} -} -func (m *TableDesc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TableDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TableDesc.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TableDesc) XXX_Merge(src proto.Message) { - xxx_messageInfo_TableDesc.Merge(m, src) -} -func (m *TableDesc) XXX_Size() int { - return m.Size() -} -func (m *TableDesc) XXX_DiscardUnknown() { - xxx_messageInfo_TableDesc.DiscardUnknown(m) -} - -var xxx_messageInfo_TableDesc proto.InternalMessageInfo - -func (m *TableDesc) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TableDesc) GetUseOnDemandIOMode() bool { - if m != nil { - return m.UseOnDemandIOMode - } - return false -} - -func (m *TableDesc) GetProvisionedRead() int64 { - if m != nil { - return m.ProvisionedRead - } - return 0 -} - -func (m *TableDesc) GetProvisionedWrite() int64 { - if m != nil { - return m.ProvisionedWrite - } - return 0 -} - -func (m *TableDesc) GetTags() map[string]string { - if m != nil { - return m.Tags - } - return nil -} - -type ListTablesResponse struct { - TableNames []string `protobuf:"bytes,1,rep,name=tableNames,proto3" json:"tableNames,omitempty"` -} - -func (m *ListTablesResponse) Reset() { *m = ListTablesResponse{} } -func (*ListTablesResponse) ProtoMessage() {} -func (*ListTablesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{18} -} -func (m *ListTablesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListTablesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListTablesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ListTablesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTablesResponse.Merge(m, src) -} -func (m *ListTablesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListTablesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListTablesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListTablesResponse proto.InternalMessageInfo - -func (m *ListTablesResponse) GetTableNames() []string { - if m != nil { - return m.TableNames - } - return nil -} - -type Labels struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Labels) Reset() { *m = Labels{} } -func (*Labels) ProtoMessage() {} -func (*Labels) Descriptor() ([]byte, []int) { - return fileDescriptor_70cfe0ce419fcf8f, []int{19} -} -func (m *Labels) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Labels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Labels.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Labels) XXX_Merge(src proto.Message) { - xxx_messageInfo_Labels.Merge(m, src) -} -func (m *Labels) XXX_Size() int { - return m.Size() -} -func (m *Labels) XXX_DiscardUnknown() { - xxx_messageInfo_Labels.DiscardUnknown(m) -} - -var xxx_messageInfo_Labels proto.InternalMessageInfo - -func (m *Labels) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Labels) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -func init() { - proto.RegisterType((*PutChunksRequest)(nil), "grpc.PutChunksRequest") - proto.RegisterType((*GetChunksRequest)(nil), "grpc.GetChunksRequest") - proto.RegisterType((*GetChunksResponse)(nil), "grpc.GetChunksResponse") - proto.RegisterType((*Chunk)(nil), "grpc.Chunk") - proto.RegisterType((*ChunkID)(nil), "grpc.ChunkID") - proto.RegisterType((*DeleteTableRequest)(nil), "grpc.DeleteTableRequest") - proto.RegisterType((*DescribeTableRequest)(nil), "grpc.DescribeTableRequest") - proto.RegisterType((*WriteBatch)(nil), "grpc.WriteBatch") - proto.RegisterType((*WriteIndexRequest)(nil), "grpc.WriteIndexRequest") - proto.RegisterType((*DeleteIndexRequest)(nil), "grpc.DeleteIndexRequest") - proto.RegisterType((*QueryIndexResponse)(nil), "grpc.QueryIndexResponse") - proto.RegisterType((*Row)(nil), "grpc.Row") - proto.RegisterType((*IndexEntry)(nil), "grpc.IndexEntry") - proto.RegisterType((*QueryIndexRequest)(nil), "grpc.QueryIndexRequest") - proto.RegisterType((*UpdateTableRequest)(nil), "grpc.UpdateTableRequest") - proto.RegisterType((*DescribeTableResponse)(nil), "grpc.DescribeTableResponse") - proto.RegisterType((*CreateTableRequest)(nil), "grpc.CreateTableRequest") - proto.RegisterType((*TableDesc)(nil), "grpc.TableDesc") - proto.RegisterMapType((map[string]string)(nil), "grpc.TableDesc.TagsEntry") - proto.RegisterType((*ListTablesResponse)(nil), "grpc.ListTablesResponse") - proto.RegisterType((*Labels)(nil), "grpc.Labels") -} - -func init() { - proto.RegisterFile("pkg/storage/chunk/client/grpc/grpc.proto", fileDescriptor_70cfe0ce419fcf8f) -} - -var fileDescriptor_70cfe0ce419fcf8f = []byte{ - // 944 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x92, 0xdb, 0x44, - 0x10, 0xf6, 0xf8, 0x6f, 0x57, 0xed, 0xa4, 0xb2, 0x3b, 0x15, 0x12, 0xe1, 0x80, 0x6a, 0x4b, 0xb9, - 0x98, 0x00, 0x36, 0xe5, 0x2c, 0x95, 0x40, 0x2a, 0x84, 0x24, 0xde, 0x82, 0xad, 0x0a, 0x24, 0x11, - 0x21, 0x70, 0xa3, 0x64, 0xa9, 0xe3, 0x55, 0xad, 0x2d, 0x39, 0x9a, 0xd1, 0xfe, 0x5c, 0x28, 0xee, - 0x5c, 0x78, 0x0c, 0x1e, 0x85, 0xe3, 0x1e, 0x73, 0x64, 0xbd, 0x17, 0x8e, 0x79, 0x04, 0x6a, 0x46, - 0x1a, 0x49, 0x96, 0xac, 0xec, 0xc2, 0x45, 0xa5, 0xf9, 0xba, 0xfb, 0x9b, 0xaf, 0x67, 0xa6, 0xbb, - 0xa1, 0x37, 0xdf, 0x9f, 0x0c, 0x18, 0x0f, 0x42, 0x7b, 0x82, 0x03, 0x67, 0x2f, 0xf2, 0xf7, 0x07, - 0xce, 0xd4, 0x43, 0x9f, 0x0f, 0x26, 0xe1, 0xdc, 0x91, 0x9f, 0xfe, 0x3c, 0x0c, 0x78, 0x40, 0x9b, - 0xe2, 0xbf, 0x7b, 0x63, 0x12, 0x04, 0x93, 0x29, 0x0e, 0x24, 0x36, 0x8e, 0x5e, 0x0d, 0x70, 0x36, - 0xe7, 0xc7, 0xb1, 0x8b, 0x79, 0x07, 0x36, 0x9e, 0x45, 0xfc, 0xb1, 0x60, 0x61, 0x16, 0xbe, 0x8e, - 0x90, 0x71, 0x7a, 0x13, 0xda, 0x92, 0x96, 0xe9, 0x64, 0xab, 0xd1, 0xeb, 0x0c, 0x3b, 0x7d, 0xc9, - 0x29, 0x9d, 0xac, 0xc4, 0x24, 0x02, 0xbf, 0xc1, 0xff, 0x13, 0x78, 0x17, 0x36, 0x73, 0x81, 0x6c, - 0x1e, 0xf8, 0x0c, 0x2f, 0x16, 0xf9, 0x1c, 0x5a, 0x12, 0xa0, 0x3a, 0xac, 0xa1, 0xef, 0x04, 0x2e, - 0xba, 0x3a, 0xd9, 0x22, 0xbd, 0x4b, 0x96, 0x5a, 0xd2, 0x0d, 0x68, 0xec, 0xe3, 0xb1, 0x5e, 0xdf, - 0x22, 0x3d, 0xcd, 0x12, 0xbf, 0xf4, 0x03, 0xd0, 0xb8, 0x3d, 0x9e, 0xe2, 0xf7, 0xf6, 0x0c, 0xf5, - 0x86, 0xc4, 0x33, 0xc0, 0xbc, 0x09, 0x6b, 0x92, 0x72, 0x77, 0x24, 0x48, 0x9d, 0xf8, 0x57, 0x92, - 0x6a, 0x96, 0x5a, 0x9a, 0x43, 0xa0, 0x23, 0x9c, 0x22, 0xc7, 0x17, 0x22, 0x4e, 0x25, 0xbb, 0x44, - 0x4c, 0x8a, 0xc4, 0xdb, 0x70, 0x75, 0x84, 0xcc, 0x09, 0xbd, 0xf1, 0x7f, 0x89, 0x1a, 0x03, 0xfc, - 0x14, 0x7a, 0x1c, 0x1f, 0xd9, 0xdc, 0xd9, 0xa3, 0x3d, 0x68, 0x1f, 0x8a, 0x95, 0x3a, 0x94, 0x8d, - 0xf8, 0x50, 0x76, 0x7d, 0x17, 0x8f, 0x76, 0x7c, 0x1e, 0x1e, 0x5b, 0x89, 0x9d, 0xde, 0x82, 0x35, - 0x57, 0x2a, 0x64, 0x7a, 0xbd, 0xc2, 0x55, 0x39, 0x98, 0xf7, 0x61, 0x53, 0xee, 0x21, 0x6d, 0x4a, - 0xd6, 0x85, 0xb7, 0x32, 0xbf, 0x56, 0x87, 0xb1, 0x14, 0x9f, 0x13, 0x40, 0xce, 0x13, 0x70, 0x1b, - 0xe8, 0xf3, 0x08, 0xc3, 0xe3, 0x84, 0x20, 0x79, 0x01, 0x1f, 0x42, 0x33, 0x0c, 0x0e, 0x55, 0xb8, - 0x16, 0x87, 0x5b, 0xc1, 0xa1, 0x25, 0x61, 0xf3, 0x1e, 0x34, 0xac, 0xe0, 0x90, 0x1a, 0x00, 0xa1, - 0xed, 0x4f, 0xf0, 0xa5, 0x3d, 0x8d, 0x30, 0xb9, 0xfc, 0x1c, 0x42, 0xaf, 0x42, 0xeb, 0x40, 0x9a, - 0xea, 0xd2, 0x14, 0x2f, 0xcc, 0x5f, 0x01, 0x32, 0x21, 0xef, 0xbe, 0x02, 0x61, 0xdd, 0xb3, 0xd9, - 0xde, 0xcb, 0x94, 0x45, 0xb3, 0x32, 0xa0, 0xb0, 0x7f, 0xa3, 0x7a, 0xff, 0x66, 0x7e, 0xff, 0x33, - 0x02, 0x9b, 0xf9, 0x94, 0x2f, 0xf0, 0x14, 0xce, 0xd1, 0x71, 0x0b, 0x36, 0xb2, 0x5d, 0x9f, 0x85, - 0xf8, 0xca, 0x3b, 0x4a, 0xd4, 0x94, 0x70, 0xda, 0x83, 0x2b, 0x19, 0xf6, 0x03, 0xb7, 0x43, 0x9e, - 0xa8, 0x2b, 0xc2, 0x22, 0x3b, 0x29, 0x78, 0xe7, 0x75, 0x64, 0x4f, 0xf5, 0x56, 0x9c, 0x5d, 0x86, - 0x08, 0x4d, 0xde, 0x6c, 0x16, 0x49, 0x91, 0x7a, 0x7b, 0x8b, 0xf4, 0xd6, 0xad, 0x0c, 0x30, 0xa7, - 0x40, 0x7f, 0x9c, 0xbb, 0x76, 0xa1, 0x4c, 0x3e, 0x82, 0x35, 0x27, 0x0a, 0x43, 0xf4, 0xb9, 0xcc, - 0xb1, 0x33, 0xbc, 0x12, 0x5f, 0xad, 0x74, 0x12, 0x25, 0x62, 0x29, 0x3b, 0xfd, 0x18, 0xd6, 0xf1, - 0x68, 0x8e, 0x0e, 0x47, 0x57, 0x66, 0xbc, 0xc2, 0x37, 0x75, 0x30, 0x7f, 0x86, 0xf7, 0x0a, 0x05, - 0x96, 0xb6, 0x92, 0xa6, 0x8b, 0xcc, 0xa9, 0xda, 0x4d, 0x1a, 0x69, 0x17, 0xd6, 0x3d, 0xf6, 0xd0, - 0xe1, 0xde, 0x41, 0x7c, 0xb8, 0xeb, 0x56, 0xba, 0x36, 0xbf, 0x00, 0xfa, 0x38, 0xc4, 0x62, 0x1e, - 0x17, 0xa1, 0x35, 0x7f, 0xaf, 0x83, 0x96, 0x62, 0x94, 0x42, 0xd3, 0xcf, 0xee, 0x56, 0xfe, 0xd3, - 0x4f, 0x60, 0x33, 0x62, 0xf8, 0xd4, 0x1f, 0xe1, 0xcc, 0xf6, 0xdd, 0xdd, 0xa7, 0xdf, 0x05, 0xae, - 0x52, 0x50, 0x36, 0x88, 0xab, 0x9b, 0x87, 0xc1, 0x81, 0xc7, 0xbc, 0xc0, 0x47, 0xd7, 0x42, 0xdb, - 0x95, 0xb7, 0xdc, 0xb0, 0x8a, 0xb0, 0x78, 0x10, 0x39, 0x48, 0x16, 0xb8, 0xbc, 0xe5, 0x86, 0x55, - 0xc2, 0xe9, 0xa7, 0xd0, 0xe4, 0xf6, 0x84, 0xe9, 0x2d, 0x59, 0x6a, 0xef, 0x17, 0x52, 0xe9, 0xbf, - 0xb0, 0x27, 0x2c, 0x2e, 0x59, 0xe9, 0xd6, 0xbd, 0x23, 0x72, 0x4a, 0x20, 0xd5, 0x60, 0x49, 0xd6, - 0x60, 0x97, 0x4a, 0x4e, 0x4b, 0x9e, 0xfc, 0x97, 0xf5, 0xbb, 0xc4, 0xdc, 0x06, 0xfa, 0xc4, 0x63, - 0x5c, 0x32, 0x67, 0xad, 0xde, 0x00, 0x48, 0x5f, 0x79, 0x5c, 0xee, 0x9a, 0x95, 0x43, 0xcc, 0x21, - 0xb4, 0x9f, 0xd8, 0x63, 0x9c, 0xb2, 0x95, 0xe7, 0xb7, 0x72, 0xb7, 0xe1, 0x49, 0x0b, 0x40, 0x64, - 0xf1, 0x8b, 0x18, 0x8b, 0x48, 0xef, 0x27, 0x6d, 0x54, 0x96, 0x1b, 0xbd, 0x1e, 0x27, 0x58, 0x6a, - 0x7a, 0xdd, 0x6b, 0xfd, 0x78, 0x32, 0xf6, 0xd5, 0x64, 0xec, 0xef, 0x88, 0xc9, 0x48, 0x1f, 0x02, - 0x64, 0xd5, 0xaa, 0xc2, 0x4b, 0xf5, 0xdb, 0xd5, 0xcb, 0x86, 0x38, 0xc5, 0xcf, 0x08, 0x7d, 0x00, - 0x9d, 0x5c, 0x97, 0xa4, 0x89, 0x6b, 0xb9, 0x71, 0x56, 0x6a, 0xb8, 0x07, 0x5a, 0x3a, 0x97, 0xe9, - 0xb5, 0x38, 0xbc, 0x38, 0xa8, 0x2b, 0x83, 0xbf, 0x02, 0x2d, 0x1d, 0xb1, 0x2a, 0xb8, 0x38, 0xac, - 0xbb, 0xd7, 0x4b, 0x78, 0xaa, 0xfe, 0x73, 0xb8, 0x14, 0x4b, 0x4d, 0x28, 0x2e, 0xe7, 0xa6, 0xf1, - 0xee, 0xe8, 0x1d, 0xdb, 0x42, 0x76, 0xdf, 0xb4, 0xc2, 0x4b, 0x1d, 0xdb, 0x8a, 0x97, 0xf1, 0x00, - 0x3a, 0xb9, 0xc2, 0x53, 0x87, 0x56, 0xae, 0xc5, 0x4a, 0x01, 0xe9, 0xa9, 0x2f, 0x11, 0x94, 0x67, - 0x77, 0x25, 0xc1, 0xb7, 0x70, 0x79, 0xa9, 0xa9, 0xd0, 0xae, 0xa2, 0x28, 0x8f, 0xf2, 0xee, 0x8d, - 0x95, 0xb6, 0x2c, 0x97, 0x5c, 0x33, 0x54, 0x52, 0xca, 0xfd, 0xb1, 0x4a, 0xca, 0xa3, 0xed, 0x93, - 0x53, 0xa3, 0xf6, 0xe6, 0xd4, 0xa8, 0xbd, 0x3d, 0x35, 0xc8, 0x6f, 0x0b, 0x83, 0xfc, 0xb9, 0x30, - 0xc8, 0x5f, 0x0b, 0x83, 0x9c, 0x2c, 0x0c, 0xf2, 0xf7, 0xc2, 0x20, 0xff, 0x2c, 0x8c, 0xda, 0xdb, - 0x85, 0x41, 0xfe, 0x38, 0x33, 0x6a, 0x27, 0x67, 0x46, 0xed, 0xcd, 0x99, 0x51, 0x1b, 0xb7, 0x25, - 0xcb, 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xba, 0x8d, 0xe6, 0x24, 0x0a, 0x00, 0x00, -} - -func (this *PutChunksRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PutChunksRequest) - if !ok { - that2, ok := that.(PutChunksRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(that1.Chunks[i]) { - return false - } - } - return true -} -func (this *GetChunksRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetChunksRequest) - if !ok { - that2, ok := that.(GetChunksRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(that1.Chunks[i]) { - return false - } - } - return true -} -func (this *GetChunksResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GetChunksResponse) - if !ok { - that2, ok := that.(GetChunksResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(that1.Chunks[i]) { - return false - } - } - return true -} -func (this *Chunk) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Chunk) - if !ok { - that2, ok := that.(Chunk) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Encoded, that1.Encoded) { - return false - } - if this.Key != that1.Key { - return false - } - if this.TableName != that1.TableName { - return false - } - return true -} -func (this *ChunkID) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChunkID) - if !ok { - that2, ok := that.(ChunkID) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ChunkID != that1.ChunkID { - return false - } - return true -} -func (this *DeleteTableRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DeleteTableRequest) - if !ok { - that2, ok := that.(DeleteTableRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TableName != that1.TableName { - return false - } - return true -} -func (this *DescribeTableRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DescribeTableRequest) - if !ok { - that2, ok := that.(DescribeTableRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TableName != that1.TableName { - return false - } - return true -} -func (this *WriteBatch) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*WriteBatch) - if !ok { - that2, ok := that.(WriteBatch) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Writes) != len(that1.Writes) { - return false - } - for i := range this.Writes { - if !this.Writes[i].Equal(that1.Writes[i]) { - return false - } - } - if len(this.Deletes) != len(that1.Deletes) { - return false - } - for i := range this.Deletes { - if !this.Deletes[i].Equal(that1.Deletes[i]) { - return false - } - } - return true -} -func (this *WriteIndexRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*WriteIndexRequest) - if !ok { - that2, ok := that.(WriteIndexRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Writes) != len(that1.Writes) { - return false - } - for i := range this.Writes { - if !this.Writes[i].Equal(that1.Writes[i]) { - return false - } - } - return true -} -func (this *DeleteIndexRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DeleteIndexRequest) - if !ok { - that2, ok := that.(DeleteIndexRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Deletes) != len(that1.Deletes) { - return false - } - for i := range this.Deletes { - if !this.Deletes[i].Equal(that1.Deletes[i]) { - return false - } - } - return true -} -func (this *QueryIndexResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryIndexResponse) - if !ok { - that2, ok := that.(QueryIndexResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Rows) != len(that1.Rows) { - return false - } - for i := range this.Rows { - if !this.Rows[i].Equal(that1.Rows[i]) { - return false - } - } - return true -} -func (this *Row) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Row) - if !ok { - that2, ok := that.(Row) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.RangeValue, that1.RangeValue) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - return true -} -func (this *IndexEntry) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*IndexEntry) - if !ok { - that2, ok := that.(IndexEntry) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TableName != that1.TableName { - return false - } - if this.HashValue != that1.HashValue { - return false - } - if !bytes.Equal(this.RangeValue, that1.RangeValue) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - return true -} -func (this *QueryIndexRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryIndexRequest) - if !ok { - that2, ok := that.(QueryIndexRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TableName != that1.TableName { - return false - } - if this.HashValue != that1.HashValue { - return false - } - if !bytes.Equal(this.RangeValuePrefix, that1.RangeValuePrefix) { - return false - } - if !bytes.Equal(this.RangeValueStart, that1.RangeValueStart) { - return false - } - if !bytes.Equal(this.ValueEqual, that1.ValueEqual) { - return false - } - if this.Immutable != that1.Immutable { - return false - } - return true -} -func (this *UpdateTableRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*UpdateTableRequest) - if !ok { - that2, ok := that.(UpdateTableRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Current.Equal(that1.Current) { - return false - } - if !this.Expected.Equal(that1.Expected) { - return false - } - return true -} -func (this *DescribeTableResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DescribeTableResponse) - if !ok { - that2, ok := that.(DescribeTableResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Desc.Equal(that1.Desc) { - return false - } - if this.IsActive != that1.IsActive { - return false - } - return true -} -func (this *CreateTableRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CreateTableRequest) - if !ok { - that2, ok := that.(CreateTableRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Desc.Equal(that1.Desc) { - return false - } - return true -} -func (this *TableDesc) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TableDesc) - if !ok { - that2, ok := that.(TableDesc) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.UseOnDemandIOMode != that1.UseOnDemandIOMode { - return false - } - if this.ProvisionedRead != that1.ProvisionedRead { - return false - } - if this.ProvisionedWrite != that1.ProvisionedWrite { - return false - } - if len(this.Tags) != len(that1.Tags) { - return false - } - for i := range this.Tags { - if this.Tags[i] != that1.Tags[i] { - return false - } - } - return true -} -func (this *ListTablesResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ListTablesResponse) - if !ok { - that2, ok := that.(ListTablesResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.TableNames) != len(that1.TableNames) { - return false - } - for i := range this.TableNames { - if this.TableNames[i] != that1.TableNames[i] { - return false - } - } - return true -} -func (this *Labels) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Labels) - if !ok { - that2, ok := that.(Labels) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (this *PutChunksRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.PutChunksRequest{") - if this.Chunks != nil { - s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetChunksRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.GetChunksRequest{") - if this.Chunks != nil { - s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *GetChunksResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.GetChunksResponse{") - if this.Chunks != nil { - s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Chunk) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&grpc.Chunk{") - s = append(s, "Encoded: "+fmt.Sprintf("%#v", this.Encoded)+",\n") - s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") - s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ChunkID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.ChunkID{") - s = append(s, "ChunkID: "+fmt.Sprintf("%#v", this.ChunkID)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DeleteTableRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.DeleteTableRequest{") - s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescribeTableRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.DescribeTableRequest{") - s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WriteBatch) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&grpc.WriteBatch{") - if this.Writes != nil { - s = append(s, "Writes: "+fmt.Sprintf("%#v", this.Writes)+",\n") - } - if this.Deletes != nil { - s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WriteIndexRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.WriteIndexRequest{") - if this.Writes != nil { - s = append(s, "Writes: "+fmt.Sprintf("%#v", this.Writes)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DeleteIndexRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.DeleteIndexRequest{") - if this.Deletes != nil { - s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryIndexResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.QueryIndexResponse{") - if this.Rows != nil { - s = append(s, "Rows: "+fmt.Sprintf("%#v", this.Rows)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Row) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&grpc.Row{") - s = append(s, "RangeValue: "+fmt.Sprintf("%#v", this.RangeValue)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *IndexEntry) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&grpc.IndexEntry{") - s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") - s = append(s, "HashValue: "+fmt.Sprintf("%#v", this.HashValue)+",\n") - s = append(s, "RangeValue: "+fmt.Sprintf("%#v", this.RangeValue)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *QueryIndexRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&grpc.QueryIndexRequest{") - s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") - s = append(s, "HashValue: "+fmt.Sprintf("%#v", this.HashValue)+",\n") - s = append(s, "RangeValuePrefix: "+fmt.Sprintf("%#v", this.RangeValuePrefix)+",\n") - s = append(s, "RangeValueStart: "+fmt.Sprintf("%#v", this.RangeValueStart)+",\n") - s = append(s, "ValueEqual: "+fmt.Sprintf("%#v", this.ValueEqual)+",\n") - s = append(s, "Immutable: "+fmt.Sprintf("%#v", this.Immutable)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpdateTableRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&grpc.UpdateTableRequest{") - if this.Current != nil { - s = append(s, "Current: "+fmt.Sprintf("%#v", this.Current)+",\n") - } - if this.Expected != nil { - s = append(s, "Expected: "+fmt.Sprintf("%#v", this.Expected)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescribeTableResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&grpc.DescribeTableResponse{") - if this.Desc != nil { - s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") - } - s = append(s, "IsActive: "+fmt.Sprintf("%#v", this.IsActive)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CreateTableRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.CreateTableRequest{") - if this.Desc != nil { - s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TableDesc) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&grpc.TableDesc{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "UseOnDemandIOMode: "+fmt.Sprintf("%#v", this.UseOnDemandIOMode)+",\n") - s = append(s, "ProvisionedRead: "+fmt.Sprintf("%#v", this.ProvisionedRead)+",\n") - s = append(s, "ProvisionedWrite: "+fmt.Sprintf("%#v", this.ProvisionedWrite)+",\n") - keysForTags := make([]string, 0, len(this.Tags)) - for k, _ := range this.Tags { - keysForTags = append(keysForTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForTags) - mapStringForTags := "map[string]string{" - for _, k := range keysForTags { - mapStringForTags += fmt.Sprintf("%#v: %#v,", k, this.Tags[k]) - } - mapStringForTags += "}" - if this.Tags != nil { - s = append(s, "Tags: "+mapStringForTags+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ListTablesResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&grpc.ListTablesResponse{") - s = append(s, "TableNames: "+fmt.Sprintf("%#v", this.TableNames)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Labels) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&grpc.Labels{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringGrpc(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// GrpcStoreClient is the client API for GrpcStore service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GrpcStoreClient interface { - // / WriteIndex writes batch of indexes to the index tables. - WriteIndex(ctx context.Context, in *WriteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // / QueryIndex reads the indexes required for given query & sends back the batch of rows - // / in rpc streams - QueryIndex(ctx context.Context, in *QueryIndexRequest, opts ...grpc.CallOption) (GrpcStore_QueryIndexClient, error) - // / DeleteIndex deletes the batch of index entries from the index tables - DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // / PutChunks saves the batch of chunks into the chunk tables. - PutChunks(ctx context.Context, in *PutChunksRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // / GetChunks requests for batch of chunks and the batch of chunks are sent back in rpc streams - // / batching needs to be performed at server level as per requirement instead of sending single chunk per stream. - // / In GetChunks rpc request send buf as nil - GetChunks(ctx context.Context, in *GetChunksRequest, opts ...grpc.CallOption) (GrpcStore_GetChunksClient, error) - // / DeleteChunks deletes the chunks based on chunkID. - DeleteChunks(ctx context.Context, in *ChunkID, opts ...grpc.CallOption) (*empty.Empty, error) - // / Lists all the tables that exists in the database. - ListTables(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTablesResponse, error) - // / Creates a table with provided name & attributes. - CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // Deletes a table using table name provided. - DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) - // Describes a table information for the provided table. - DescribeTable(ctx context.Context, in *DescribeTableRequest, opts ...grpc.CallOption) (*DescribeTableResponse, error) - // Update a table with newly provided table information. - UpdateTable(ctx context.Context, in *UpdateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) -} - -type grpcStoreClient struct { - cc *grpc.ClientConn -} - -func NewGrpcStoreClient(cc *grpc.ClientConn) GrpcStoreClient { - return &grpcStoreClient{cc} -} - -func (c *grpcStoreClient) WriteIndex(ctx context.Context, in *WriteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/WriteIndex", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) QueryIndex(ctx context.Context, in *QueryIndexRequest, opts ...grpc.CallOption) (GrpcStore_QueryIndexClient, error) { - stream, err := c.cc.NewStream(ctx, &_GrpcStore_serviceDesc.Streams[0], "/grpc.grpc_store/QueryIndex", opts...) - if err != nil { - return nil, err - } - x := &grpcStoreQueryIndexClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type GrpcStore_QueryIndexClient interface { - Recv() (*QueryIndexResponse, error) - grpc.ClientStream -} - -type grpcStoreQueryIndexClient struct { - grpc.ClientStream -} - -func (x *grpcStoreQueryIndexClient) Recv() (*QueryIndexResponse, error) { - m := new(QueryIndexResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *grpcStoreClient) DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteIndex", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) PutChunks(ctx context.Context, in *PutChunksRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/PutChunks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) GetChunks(ctx context.Context, in *GetChunksRequest, opts ...grpc.CallOption) (GrpcStore_GetChunksClient, error) { - stream, err := c.cc.NewStream(ctx, &_GrpcStore_serviceDesc.Streams[1], "/grpc.grpc_store/GetChunks", opts...) - if err != nil { - return nil, err - } - x := &grpcStoreGetChunksClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type GrpcStore_GetChunksClient interface { - Recv() (*GetChunksResponse, error) - grpc.ClientStream -} - -type grpcStoreGetChunksClient struct { - grpc.ClientStream -} - -func (x *grpcStoreGetChunksClient) Recv() (*GetChunksResponse, error) { - m := new(GetChunksResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *grpcStoreClient) DeleteChunks(ctx context.Context, in *ChunkID, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteChunks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) ListTables(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTablesResponse, error) { - out := new(ListTablesResponse) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/ListTables", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/CreateTable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteTable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) DescribeTable(ctx context.Context, in *DescribeTableRequest, opts ...grpc.CallOption) (*DescribeTableResponse, error) { - out := new(DescribeTableResponse) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/DescribeTable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *grpcStoreClient) UpdateTable(ctx context.Context, in *UpdateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { - out := new(empty.Empty) - err := c.cc.Invoke(ctx, "/grpc.grpc_store/UpdateTable", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GrpcStoreServer is the server API for GrpcStore service. -type GrpcStoreServer interface { - // / WriteIndex writes batch of indexes to the index tables. - WriteIndex(context.Context, *WriteIndexRequest) (*empty.Empty, error) - // / QueryIndex reads the indexes required for given query & sends back the batch of rows - // / in rpc streams - QueryIndex(*QueryIndexRequest, GrpcStore_QueryIndexServer) error - // / DeleteIndex deletes the batch of index entries from the index tables - DeleteIndex(context.Context, *DeleteIndexRequest) (*empty.Empty, error) - // / PutChunks saves the batch of chunks into the chunk tables. - PutChunks(context.Context, *PutChunksRequest) (*empty.Empty, error) - // / GetChunks requests for batch of chunks and the batch of chunks are sent back in rpc streams - // / batching needs to be performed at server level as per requirement instead of sending single chunk per stream. - // / In GetChunks rpc request send buf as nil - GetChunks(*GetChunksRequest, GrpcStore_GetChunksServer) error - // / DeleteChunks deletes the chunks based on chunkID. - DeleteChunks(context.Context, *ChunkID) (*empty.Empty, error) - // / Lists all the tables that exists in the database. - ListTables(context.Context, *empty.Empty) (*ListTablesResponse, error) - // / Creates a table with provided name & attributes. - CreateTable(context.Context, *CreateTableRequest) (*empty.Empty, error) - // Deletes a table using table name provided. - DeleteTable(context.Context, *DeleteTableRequest) (*empty.Empty, error) - // Describes a table information for the provided table. - DescribeTable(context.Context, *DescribeTableRequest) (*DescribeTableResponse, error) - // Update a table with newly provided table information. - UpdateTable(context.Context, *UpdateTableRequest) (*empty.Empty, error) -} - -// UnimplementedGrpcStoreServer can be embedded to have forward compatible implementations. -type UnimplementedGrpcStoreServer struct { -} - -func (*UnimplementedGrpcStoreServer) WriteIndex(ctx context.Context, req *WriteIndexRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method WriteIndex not implemented") -} -func (*UnimplementedGrpcStoreServer) QueryIndex(req *QueryIndexRequest, srv GrpcStore_QueryIndexServer) error { - return status.Errorf(codes.Unimplemented, "method QueryIndex not implemented") -} -func (*UnimplementedGrpcStoreServer) DeleteIndex(ctx context.Context, req *DeleteIndexRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteIndex not implemented") -} -func (*UnimplementedGrpcStoreServer) PutChunks(ctx context.Context, req *PutChunksRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method PutChunks not implemented") -} -func (*UnimplementedGrpcStoreServer) GetChunks(req *GetChunksRequest, srv GrpcStore_GetChunksServer) error { - return status.Errorf(codes.Unimplemented, "method GetChunks not implemented") -} -func (*UnimplementedGrpcStoreServer) DeleteChunks(ctx context.Context, req *ChunkID) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteChunks not implemented") -} -func (*UnimplementedGrpcStoreServer) ListTables(ctx context.Context, req *empty.Empty) (*ListTablesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTables not implemented") -} -func (*UnimplementedGrpcStoreServer) CreateTable(ctx context.Context, req *CreateTableRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTable not implemented") -} -func (*UnimplementedGrpcStoreServer) DeleteTable(ctx context.Context, req *DeleteTableRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteTable not implemented") -} -func (*UnimplementedGrpcStoreServer) DescribeTable(ctx context.Context, req *DescribeTableRequest) (*DescribeTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DescribeTable not implemented") -} -func (*UnimplementedGrpcStoreServer) UpdateTable(ctx context.Context, req *UpdateTableRequest) (*empty.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTable not implemented") -} - -func RegisterGrpcStoreServer(s *grpc.Server, srv GrpcStoreServer) { - s.RegisterService(&_GrpcStore_serviceDesc, srv) -} - -func _GrpcStore_WriteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteIndexRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).WriteIndex(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/WriteIndex", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).WriteIndex(ctx, req.(*WriteIndexRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_QueryIndex_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(QueryIndexRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(GrpcStoreServer).QueryIndex(m, &grpcStoreQueryIndexServer{stream}) -} - -type GrpcStore_QueryIndexServer interface { - Send(*QueryIndexResponse) error - grpc.ServerStream -} - -type grpcStoreQueryIndexServer struct { - grpc.ServerStream -} - -func (x *grpcStoreQueryIndexServer) Send(m *QueryIndexResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _GrpcStore_DeleteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteIndexRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).DeleteIndex(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/DeleteIndex", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).DeleteIndex(ctx, req.(*DeleteIndexRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_PutChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PutChunksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).PutChunks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/PutChunks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).PutChunks(ctx, req.(*PutChunksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_GetChunks_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetChunksRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(GrpcStoreServer).GetChunks(m, &grpcStoreGetChunksServer{stream}) -} - -type GrpcStore_GetChunksServer interface { - Send(*GetChunksResponse) error - grpc.ServerStream -} - -type grpcStoreGetChunksServer struct { - grpc.ServerStream -} - -func (x *grpcStoreGetChunksServer) Send(m *GetChunksResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _GrpcStore_DeleteChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChunkID) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).DeleteChunks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/DeleteChunks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).DeleteChunks(ctx, req.(*ChunkID)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_ListTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).ListTables(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/ListTables", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).ListTables(ctx, req.(*empty.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_CreateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).CreateTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/CreateTable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).CreateTable(ctx, req.(*CreateTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_DeleteTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).DeleteTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/DeleteTable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).DeleteTable(ctx, req.(*DeleteTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_DescribeTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DescribeTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).DescribeTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/DescribeTable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).DescribeTable(ctx, req.(*DescribeTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GrpcStore_UpdateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GrpcStoreServer).UpdateTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.grpc_store/UpdateTable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GrpcStoreServer).UpdateTable(ctx, req.(*UpdateTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _GrpcStore_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.grpc_store", - HandlerType: (*GrpcStoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "WriteIndex", - Handler: _GrpcStore_WriteIndex_Handler, - }, - { - MethodName: "DeleteIndex", - Handler: _GrpcStore_DeleteIndex_Handler, - }, - { - MethodName: "PutChunks", - Handler: _GrpcStore_PutChunks_Handler, - }, - { - MethodName: "DeleteChunks", - Handler: _GrpcStore_DeleteChunks_Handler, - }, - { - MethodName: "ListTables", - Handler: _GrpcStore_ListTables_Handler, - }, - { - MethodName: "CreateTable", - Handler: _GrpcStore_CreateTable_Handler, - }, - { - MethodName: "DeleteTable", - Handler: _GrpcStore_DeleteTable_Handler, - }, - { - MethodName: "DescribeTable", - Handler: _GrpcStore_DescribeTable_Handler, - }, - { - MethodName: "UpdateTable", - Handler: _GrpcStore_UpdateTable_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "QueryIndex", - Handler: _GrpcStore_QueryIndex_Handler, - ServerStreams: true, - }, - { - StreamName: "GetChunks", - Handler: _GrpcStore_GetChunks_Handler, - ServerStreams: true, - }, - }, - Metadata: "pkg/storage/chunk/client/grpc/grpc.proto", -} - -func (m *PutChunksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PutChunksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PutChunksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetChunksRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetChunksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetChunksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetChunksResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetChunksResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetChunksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Chunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Encoded) > 0 { - i -= len(m.Encoded) - copy(dAtA[i:], m.Encoded) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Encoded))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChunkID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChunkID) > 0 { - i -= len(m.ChunkID) - copy(dAtA[i:], m.ChunkID) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.ChunkID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DeleteTableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteTableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DescribeTableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DescribeTableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DescribeTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WriteBatch) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteBatch) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Deletes) > 0 { - for iNdEx := len(m.Deletes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deletes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Writes) > 0 { - for iNdEx := len(m.Writes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Writes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *WriteIndexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WriteIndexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Writes) > 0 { - for iNdEx := len(m.Writes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Writes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DeleteIndexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteIndexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DeleteIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Deletes) > 0 { - for iNdEx := len(m.Deletes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deletes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryIndexResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryIndexResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Rows) > 0 { - for iNdEx := len(m.Rows) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rows[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Row) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Row) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Row) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.RangeValue) > 0 { - i -= len(m.RangeValue) - copy(dAtA[i:], m.RangeValue) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValue))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IndexEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IndexEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IndexEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x22 - } - if len(m.RangeValue) > 0 { - i -= len(m.RangeValue) - copy(dAtA[i:], m.RangeValue) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValue))) - i-- - dAtA[i] = 0x1a - } - if len(m.HashValue) > 0 { - i -= len(m.HashValue) - copy(dAtA[i:], m.HashValue) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.HashValue))) - i-- - dAtA[i] = 0x12 - } - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryIndexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryIndexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Immutable { - i-- - if m.Immutable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.ValueEqual) > 0 { - i -= len(m.ValueEqual) - copy(dAtA[i:], m.ValueEqual) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.ValueEqual))) - i-- - dAtA[i] = 0x2a - } - if len(m.RangeValueStart) > 0 { - i -= len(m.RangeValueStart) - copy(dAtA[i:], m.RangeValueStart) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValueStart))) - i-- - dAtA[i] = 0x22 - } - if len(m.RangeValuePrefix) > 0 { - i -= len(m.RangeValuePrefix) - copy(dAtA[i:], m.RangeValuePrefix) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValuePrefix))) - i-- - dAtA[i] = 0x1a - } - if len(m.HashValue) > 0 { - i -= len(m.HashValue) - copy(dAtA[i:], m.HashValue) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.HashValue))) - i-- - dAtA[i] = 0x12 - } - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UpdateTableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UpdateTableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expected != nil { - { - size, err := m.Expected.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Current != nil { - { - size, err := m.Current.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DescribeTableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DescribeTableResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DescribeTableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsActive { - i-- - if m.IsActive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Desc != nil { - { - size, err := m.Desc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CreateTableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CreateTableRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CreateTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Desc != nil { - { - size, err := m.Desc.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGrpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TableDesc) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TableDesc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TableDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintGrpc(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintGrpc(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintGrpc(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if m.ProvisionedWrite != 0 { - i = encodeVarintGrpc(dAtA, i, uint64(m.ProvisionedWrite)) - i-- - dAtA[i] = 0x20 - } - if m.ProvisionedRead != 0 { - i = encodeVarintGrpc(dAtA, i, uint64(m.ProvisionedRead)) - i-- - dAtA[i] = 0x18 - } - if m.UseOnDemandIOMode { - i-- - if m.UseOnDemandIOMode { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListTablesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ListTablesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListTablesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TableNames) > 0 { - for iNdEx := len(m.TableNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.TableNames[iNdEx]) - copy(dAtA[i:], m.TableNames[iNdEx]) - i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Labels) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *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) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintGrpc(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 = encodeVarintGrpc(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGrpc(dAtA []byte, offset int, v uint64) int { - offset -= sovGrpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PutChunksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *GetChunksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *GetChunksResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Encoded) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.TableName) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *ChunkID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChunkID) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *DeleteTableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TableName) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *DescribeTableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TableName) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *WriteBatch) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Writes) > 0 { - for _, e := range m.Writes { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - if len(m.Deletes) > 0 { - for _, e := range m.Deletes { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *WriteIndexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Writes) > 0 { - for _, e := range m.Writes { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *DeleteIndexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Deletes) > 0 { - for _, e := range m.Deletes { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *QueryIndexResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rows) > 0 { - for _, e := range m.Rows { - l = e.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *Row) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RangeValue) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *IndexEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TableName) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.HashValue) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.RangeValue) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *QueryIndexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TableName) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.HashValue) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.RangeValuePrefix) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.RangeValueStart) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.ValueEqual) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - if m.Immutable { - n += 2 - } - return n -} - -func (m *UpdateTableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Current != nil { - l = m.Current.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - if m.Expected != nil { - l = m.Expected.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *DescribeTableResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Desc != nil { - l = m.Desc.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - if m.IsActive { - n += 2 - } - return n -} - -func (m *CreateTableRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Desc != nil { - l = m.Desc.Size() - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func (m *TableDesc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - if m.UseOnDemandIOMode { - n += 2 - } - if m.ProvisionedRead != 0 { - n += 1 + sovGrpc(uint64(m.ProvisionedRead)) - } - if m.ProvisionedWrite != 0 { - n += 1 + sovGrpc(uint64(m.ProvisionedWrite)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovGrpc(uint64(len(k))) + 1 + len(v) + sovGrpc(uint64(len(v))) - n += mapEntrySize + 1 + sovGrpc(uint64(mapEntrySize)) - } - } - return n -} - -func (m *ListTablesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TableNames) > 0 { - for _, s := range m.TableNames { - l = len(s) - n += 1 + l + sovGrpc(uint64(l)) - } - } - return n -} - -func (m *Labels) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovGrpc(uint64(l)) - } - return n -} - -func sovGrpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGrpc(x uint64) (n int) { - return sovGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *PutChunksRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]*Chunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&PutChunksRequest{`, - `Chunks:` + repeatedStringForChunks + `,`, - `}`, - }, "") - return s -} -func (this *GetChunksRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]*Chunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&GetChunksRequest{`, - `Chunks:` + repeatedStringForChunks + `,`, - `}`, - }, "") - return s -} -func (this *GetChunksResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]*Chunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&GetChunksResponse{`, - `Chunks:` + repeatedStringForChunks + `,`, - `}`, - }, "") - return s -} -func (this *Chunk) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Chunk{`, - `Encoded:` + fmt.Sprintf("%v", this.Encoded) + `,`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, - `}`, - }, "") - return s -} -func (this *ChunkID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ChunkID{`, - `ChunkID:` + fmt.Sprintf("%v", this.ChunkID) + `,`, - `}`, - }, "") - return s -} -func (this *DeleteTableRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DeleteTableRequest{`, - `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, - `}`, - }, "") - return s -} -func (this *DescribeTableRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DescribeTableRequest{`, - `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, - `}`, - }, "") - return s -} -func (this *WriteBatch) String() string { - if this == nil { - return "nil" - } - repeatedStringForWrites := "[]*IndexEntry{" - for _, f := range this.Writes { - repeatedStringForWrites += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," - } - repeatedStringForWrites += "}" - repeatedStringForDeletes := "[]*IndexEntry{" - for _, f := range this.Deletes { - repeatedStringForDeletes += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," - } - repeatedStringForDeletes += "}" - s := strings.Join([]string{`&WriteBatch{`, - `Writes:` + repeatedStringForWrites + `,`, - `Deletes:` + repeatedStringForDeletes + `,`, - `}`, - }, "") - return s -} -func (this *WriteIndexRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForWrites := "[]*IndexEntry{" - for _, f := range this.Writes { - repeatedStringForWrites += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," - } - repeatedStringForWrites += "}" - s := strings.Join([]string{`&WriteIndexRequest{`, - `Writes:` + repeatedStringForWrites + `,`, - `}`, - }, "") - return s -} -func (this *DeleteIndexRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForDeletes := "[]*IndexEntry{" - for _, f := range this.Deletes { - repeatedStringForDeletes += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," - } - repeatedStringForDeletes += "}" - s := strings.Join([]string{`&DeleteIndexRequest{`, - `Deletes:` + repeatedStringForDeletes + `,`, - `}`, - }, "") - return s -} -func (this *QueryIndexResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForRows := "[]*Row{" - for _, f := range this.Rows { - repeatedStringForRows += strings.Replace(f.String(), "Row", "Row", 1) + "," - } - repeatedStringForRows += "}" - s := strings.Join([]string{`&QueryIndexResponse{`, - `Rows:` + repeatedStringForRows + `,`, - `}`, - }, "") - return s -} -func (this *Row) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Row{`, - `RangeValue:` + fmt.Sprintf("%v", this.RangeValue) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *IndexEntry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&IndexEntry{`, - `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, - `HashValue:` + fmt.Sprintf("%v", this.HashValue) + `,`, - `RangeValue:` + fmt.Sprintf("%v", this.RangeValue) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *QueryIndexRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueryIndexRequest{`, - `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, - `HashValue:` + fmt.Sprintf("%v", this.HashValue) + `,`, - `RangeValuePrefix:` + fmt.Sprintf("%v", this.RangeValuePrefix) + `,`, - `RangeValueStart:` + fmt.Sprintf("%v", this.RangeValueStart) + `,`, - `ValueEqual:` + fmt.Sprintf("%v", this.ValueEqual) + `,`, - `Immutable:` + fmt.Sprintf("%v", this.Immutable) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateTableRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateTableRequest{`, - `Current:` + strings.Replace(this.Current.String(), "TableDesc", "TableDesc", 1) + `,`, - `Expected:` + strings.Replace(this.Expected.String(), "TableDesc", "TableDesc", 1) + `,`, - `}`, - }, "") - return s -} -func (this *DescribeTableResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DescribeTableResponse{`, - `Desc:` + strings.Replace(this.Desc.String(), "TableDesc", "TableDesc", 1) + `,`, - `IsActive:` + fmt.Sprintf("%v", this.IsActive) + `,`, - `}`, - }, "") - return s -} -func (this *CreateTableRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CreateTableRequest{`, - `Desc:` + strings.Replace(this.Desc.String(), "TableDesc", "TableDesc", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TableDesc) String() string { - if this == nil { - return "nil" - } - keysForTags := make([]string, 0, len(this.Tags)) - for k, _ := range this.Tags { - keysForTags = append(keysForTags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForTags) - mapStringForTags := "map[string]string{" - for _, k := range keysForTags { - mapStringForTags += fmt.Sprintf("%v: %v,", k, this.Tags[k]) - } - mapStringForTags += "}" - s := strings.Join([]string{`&TableDesc{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `UseOnDemandIOMode:` + fmt.Sprintf("%v", this.UseOnDemandIOMode) + `,`, - `ProvisionedRead:` + fmt.Sprintf("%v", this.ProvisionedRead) + `,`, - `ProvisionedWrite:` + fmt.Sprintf("%v", this.ProvisionedWrite) + `,`, - `Tags:` + mapStringForTags + `,`, - `}`, - }, "") - return s -} -func (this *ListTablesResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ListTablesResponse{`, - `TableNames:` + fmt.Sprintf("%v", this.TableNames) + `,`, - `}`, - }, "") - return s -} -func (this *Labels) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Labels{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func valueToStringGrpc(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *PutChunksRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PutChunksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PutChunksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, &Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetChunksRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetChunksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetChunksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, &Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetChunksResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetChunksResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetChunksResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, &Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Chunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoded", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Encoded = append(m.Encoded[:0], dAtA[iNdEx:postIndex]...) - if m.Encoded == nil { - m.Encoded = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteTableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteTableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DescribeTableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DescribeTableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DescribeTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WriteBatch) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteBatch: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteBatch: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Writes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Writes = append(m.Writes, &IndexEntry{}) - if err := m.Writes[len(m.Writes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deletes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deletes = append(m.Deletes, &IndexEntry{}) - if err := m.Deletes[len(m.Deletes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WriteIndexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WriteIndexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Writes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Writes = append(m.Writes, &IndexEntry{}) - if err := m.Writes[len(m.Writes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteIndexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteIndexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deletes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deletes = append(m.Deletes, &IndexEntry{}) - if err := m.Deletes[len(m.Deletes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryIndexResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryIndexResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rows", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rows = append(m.Rows, &Row{}) - if err := m.Rows[len(m.Rows)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Row) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Row: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Row: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeValue", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeValue = append(m.RangeValue[:0], dAtA[iNdEx:postIndex]...) - if m.RangeValue == nil { - m.RangeValue = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IndexEntry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IndexEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IndexEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HashValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeValue", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeValue = append(m.RangeValue[:0], dAtA[iNdEx:postIndex]...) - if m.RangeValue == nil { - m.RangeValue = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryIndexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryIndexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HashValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HashValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeValuePrefix", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeValuePrefix = append(m.RangeValuePrefix[:0], dAtA[iNdEx:postIndex]...) - if m.RangeValuePrefix == nil { - m.RangeValuePrefix = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeValueStart", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeValueStart = append(m.RangeValueStart[:0], dAtA[iNdEx:postIndex]...) - if m.RangeValueStart == nil { - m.RangeValueStart = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValueEqual", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValueEqual = append(m.ValueEqual[:0], dAtA[iNdEx:postIndex]...) - if m.ValueEqual == nil { - m.ValueEqual = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Immutable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Immutable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UpdateTableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UpdateTableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UpdateTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Current == nil { - m.Current = &TableDesc{} - } - if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expected", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expected == nil { - m.Expected = &TableDesc{} - } - if err := m.Expected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DescribeTableResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DescribeTableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DescribeTableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Desc == nil { - m.Desc = &TableDesc{} - } - if err := m.Desc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsActive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsActive = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CreateTableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CreateTableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CreateTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Desc == nil { - m.Desc = &TableDesc{} - } - if err := m.Desc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TableDesc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TableDesc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TableDesc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UseOnDemandIOMode", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UseOnDemandIOMode = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProvisionedRead", wireType) - } - m.ProvisionedRead = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProvisionedRead |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProvisionedWrite", wireType) - } - m.ProvisionedWrite = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProvisionedWrite |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGrpc - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGrpc - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthGrpc - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthGrpc - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListTablesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ListTablesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListTablesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TableNames = append(m.TableNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Labels) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Labels: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Labels: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGrpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGrpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGrpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGrpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGrpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGrpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGrpc - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGrpc - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGrpc - } - 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 := skipGrpc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGrpc - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGrpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGrpc = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/storage/stores/series/index/caching_index_client.pb.go b/pkg/storage/stores/series/index/caching_index_client.pb.go deleted file mode 100644 index c441cdb6442a1..0000000000000 --- a/pkg/storage/stores/series/index/caching_index_client.pb.go +++ /dev/null @@ -1,845 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/storage/stores/series/index/caching_index_client.proto - -package index - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type CacheEntry struct { - Column Bytes `protobuf:"bytes,1,opt,name=Column,proto3,customtype=Bytes" json:"Column"` - Value Bytes `protobuf:"bytes,2,opt,name=Value,proto3,customtype=Bytes" json:"Value"` -} - -func (m *CacheEntry) Reset() { *m = CacheEntry{} } -func (*CacheEntry) ProtoMessage() {} -func (*CacheEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_1a3c8533c7598e01, []int{0} -} -func (m *CacheEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CacheEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CacheEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CacheEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheEntry.Merge(m, src) -} -func (m *CacheEntry) XXX_Size() int { - return m.Size() -} -func (m *CacheEntry) XXX_DiscardUnknown() { - xxx_messageInfo_CacheEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_CacheEntry proto.InternalMessageInfo - -type ReadBatch struct { - Entries []CacheEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // The time at which the key expires. - Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` - // The number of entries; used for cardinality limiting. - // entries will be empty when this is set. - Cardinality int32 `protobuf:"varint,4,opt,name=cardinality,proto3" json:"cardinality,omitempty"` -} - -func (m *ReadBatch) Reset() { *m = ReadBatch{} } -func (*ReadBatch) ProtoMessage() {} -func (*ReadBatch) Descriptor() ([]byte, []int) { - return fileDescriptor_1a3c8533c7598e01, []int{1} -} -func (m *ReadBatch) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadBatch.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ReadBatch) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadBatch.Merge(m, src) -} -func (m *ReadBatch) XXX_Size() int { - return m.Size() -} -func (m *ReadBatch) XXX_DiscardUnknown() { - xxx_messageInfo_ReadBatch.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadBatch proto.InternalMessageInfo - -func (m *ReadBatch) GetEntries() []CacheEntry { - if m != nil { - return m.Entries - } - return nil -} - -func (m *ReadBatch) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ReadBatch) GetExpiry() int64 { - if m != nil { - return m.Expiry - } - return 0 -} - -func (m *ReadBatch) GetCardinality() int32 { - if m != nil { - return m.Cardinality - } - return 0 -} - -func init() { - proto.RegisterType((*CacheEntry)(nil), "index.CacheEntry") - proto.RegisterType((*ReadBatch)(nil), "index.ReadBatch") -} - -func init() { - proto.RegisterFile("pkg/storage/stores/series/index/caching_index_client.proto", fileDescriptor_1a3c8533c7598e01) -} - -var fileDescriptor_1a3c8533c7598e01 = []byte{ - // 314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x50, 0x3f, 0x4b, 0xfb, 0x40, - 0x18, 0xbe, 0xfb, 0xa5, 0xe9, 0x8f, 0x5e, 0x15, 0xf4, 0x10, 0x09, 0x0e, 0x6f, 0x43, 0x45, 0xc8, - 0xd4, 0xe0, 0x9f, 0xc9, 0x31, 0xc5, 0x2f, 0x90, 0x41, 0xdc, 0xca, 0x99, 0xbe, 0xa4, 0x47, 0xe3, - 0xa5, 0x24, 0x57, 0x68, 0x36, 0x67, 0x27, 0x3f, 0x86, 0x1f, 0xa5, 0x63, 0xc7, 0xe2, 0x50, 0xec, - 0x75, 0x71, 0xec, 0x47, 0x90, 0x5c, 0x2b, 0x3a, 0x38, 0xdd, 0xf3, 0x8f, 0x7b, 0x1e, 0x5e, 0x76, - 0x3b, 0x19, 0xa7, 0x61, 0xa9, 0xf3, 0x42, 0xa4, 0x68, 0x5f, 0x2c, 0xc3, 0x12, 0x0b, 0x89, 0x65, - 0x28, 0xd5, 0x10, 0x67, 0x61, 0x22, 0x92, 0x91, 0x54, 0xe9, 0xc0, 0xb2, 0x41, 0x92, 0x49, 0x54, - 0xba, 0x37, 0x29, 0x72, 0x9d, 0x73, 0xd7, 0x6a, 0x67, 0x27, 0x69, 0x9e, 0xe6, 0x56, 0x09, 0x6b, - 0xb4, 0x33, 0xbb, 0x0f, 0x8c, 0xf5, 0x45, 0x32, 0xc2, 0x3b, 0xa5, 0x8b, 0x8a, 0x5f, 0xb0, 0x66, - 0x3f, 0xcf, 0xa6, 0x4f, 0xca, 0xa3, 0x3e, 0x0d, 0x0e, 0xa2, 0xc3, 0xf9, 0xaa, 0x43, 0xde, 0x57, - 0x1d, 0x37, 0xaa, 0x34, 0x96, 0xf1, 0xde, 0xe4, 0xe7, 0xcc, 0xbd, 0x17, 0xd9, 0x14, 0xbd, 0x7f, - 0x7f, 0xa5, 0x76, 0x5e, 0xf7, 0x85, 0xb2, 0x56, 0x8c, 0x62, 0x18, 0x09, 0x9d, 0x8c, 0xf8, 0x25, - 0xfb, 0x8f, 0x4a, 0xd7, 0x83, 0x3d, 0xea, 0x3b, 0x41, 0xfb, 0xea, 0xb8, 0x67, 0x67, 0xf5, 0x7e, - 0xda, 0xa3, 0x46, 0xfd, 0x4f, 0xfc, 0x9d, 0xe3, 0x47, 0xcc, 0x19, 0x63, 0x65, 0x3b, 0x5a, 0x71, - 0x0d, 0xf9, 0x29, 0x6b, 0xe2, 0x6c, 0x22, 0x8b, 0xca, 0x73, 0x7c, 0x1a, 0x38, 0xf1, 0x9e, 0x71, - 0x9f, 0xb5, 0x13, 0x51, 0x0c, 0xa5, 0x12, 0x99, 0xd4, 0x95, 0xd7, 0xf0, 0x69, 0xe0, 0xc6, 0xbf, - 0xa5, 0xe8, 0x66, 0xb1, 0x06, 0xb2, 0x5c, 0x03, 0xd9, 0xae, 0x81, 0x3e, 0x1b, 0xa0, 0x6f, 0x06, - 0xe8, 0xdc, 0x00, 0x5d, 0x18, 0xa0, 0x1f, 0x06, 0xe8, 0xa7, 0x01, 0xb2, 0x35, 0x40, 0x5f, 0x37, - 0x40, 0x16, 0x1b, 0x20, 0xcb, 0x0d, 0x90, 0xc7, 0xa6, 0xbd, 0xd1, 0xf5, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xad, 0xdc, 0x48, 0x36, 0x7e, 0x01, 0x00, 0x00, -} - -func (this *CacheEntry) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CacheEntry) - if !ok { - that2, ok := that.(CacheEntry) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Column.Equal(that1.Column) { - return false - } - if !this.Value.Equal(that1.Value) { - return false - } - return true -} -func (this *ReadBatch) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ReadBatch) - if !ok { - that2, ok := that.(ReadBatch) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Entries) != len(that1.Entries) { - return false - } - for i := range this.Entries { - if !this.Entries[i].Equal(&that1.Entries[i]) { - return false - } - } - if this.Key != that1.Key { - return false - } - if this.Expiry != that1.Expiry { - return false - } - if this.Cardinality != that1.Cardinality { - return false - } - return true -} -func (this *CacheEntry) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&index.CacheEntry{") - s = append(s, "Column: "+fmt.Sprintf("%#v", this.Column)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReadBatch) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&index.ReadBatch{") - if this.Entries != nil { - vs := make([]*CacheEntry, len(this.Entries)) - for i := range vs { - vs[i] = &this.Entries[i] - } - s = append(s, "Entries: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") - s = append(s, "Expiry: "+fmt.Sprintf("%#v", this.Expiry)+",\n") - s = append(s, "Cardinality: "+fmt.Sprintf("%#v", this.Cardinality)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringCachingIndexClient(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func (m *CacheEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CacheEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CacheEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Column.Size() - i -= size - if _, err := m.Column.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ReadBatch) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ReadBatch) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Cardinality != 0 { - i = encodeVarintCachingIndexClient(dAtA, i, uint64(m.Cardinality)) - i-- - dAtA[i] = 0x20 - } - if m.Expiry != 0 { - i = encodeVarintCachingIndexClient(dAtA, i, uint64(m.Expiry)) - i-- - dAtA[i] = 0x18 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintCachingIndexClient(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintCachingIndexClient(dAtA []byte, offset int, v uint64) int { - offset -= sovCachingIndexClient(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CacheEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Column.Size() - n += 1 + l + sovCachingIndexClient(uint64(l)) - l = m.Value.Size() - n += 1 + l + sovCachingIndexClient(uint64(l)) - return n -} - -func (m *ReadBatch) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovCachingIndexClient(uint64(l)) - } - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovCachingIndexClient(uint64(l)) - } - if m.Expiry != 0 { - n += 1 + sovCachingIndexClient(uint64(m.Expiry)) - } - if m.Cardinality != 0 { - n += 1 + sovCachingIndexClient(uint64(m.Cardinality)) - } - return n -} - -func sovCachingIndexClient(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCachingIndexClient(x uint64) (n int) { - return sovCachingIndexClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CacheEntry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CacheEntry{`, - `Column:` + fmt.Sprintf("%v", this.Column) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *ReadBatch) String() string { - if this == nil { - return "nil" - } - repeatedStringForEntries := "[]CacheEntry{" - for _, f := range this.Entries { - repeatedStringForEntries += strings.Replace(strings.Replace(f.String(), "CacheEntry", "CacheEntry", 1), `&`, ``, 1) + "," - } - repeatedStringForEntries += "}" - s := strings.Join([]string{`&ReadBatch{`, - `Entries:` + repeatedStringForEntries + `,`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Expiry:` + fmt.Sprintf("%v", this.Expiry) + `,`, - `Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`, - `}`, - }, "") - return s -} -func valueToStringCachingIndexClient(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *CacheEntry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CacheEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CacheEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Column", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCachingIndexClient - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCachingIndexClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Column.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCachingIndexClient - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCachingIndexClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCachingIndexClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCachingIndexClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCachingIndexClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadBatch) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadBatch: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadBatch: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCachingIndexClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCachingIndexClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entries = append(m.Entries, CacheEntry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCachingIndexClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCachingIndexClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) - } - m.Expiry = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Expiry |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cardinality", wireType) - } - m.Cardinality = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Cardinality |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCachingIndexClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthCachingIndexClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthCachingIndexClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCachingIndexClient(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachingIndexClient - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthCachingIndexClient - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCachingIndexClient - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCachingIndexClient - } - 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 := skipCachingIndexClient(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCachingIndexClient - } - } - 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) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthCachingIndexClient = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCachingIndexClient = fmt.Errorf("proto: integer overflow") -) From 32a43746504222490f615c884ac2a2292ba4e4c8 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 12:00:53 +0100 Subject: [PATCH 02/25] Pass parsed query --- pkg/compactor/client/grpc/grpc.pb.go | 1548 ++++ pkg/ingester/checkpoint.pb.go | 1434 ++++ pkg/logcli/client/file.go | 8 +- pkg/logcli/query/query.go | 8 +- pkg/logproto/indexgateway.pb.go | 50 +- pkg/logproto/indexgateway.proto | 1 - pkg/logproto/sketch.pb.go | 78 +- pkg/logproto/sketch.proto | 1 - pkg/logql/downstream.go | 4 +- pkg/logql/engine.go | 21 +- pkg/logqlmodel/stats/stats.pb.go | 3689 ++++++++ .../frontend/v2/frontendv2pb/frontend.pb.go | 1014 +++ pkg/push/push.pb.go | 1739 ++++ pkg/querier/http.go | 6 +- pkg/querier/plan.go | 30 - pkg/querier/plan/plan.go | 61 + pkg/querier/queryrange/queryrange.pb.go | 7529 +++++++++++++++++ pkg/querier/queryrange/queryrange.proto | 5 +- .../definitions/definitions.pb.go | 969 +++ .../queryrangebase/queryrange.pb.go | 2594 ++++++ pkg/querier/stats/stats.pb.go | 501 ++ pkg/ruler/base/ruler.pb.go | 2380 ++++++ pkg/ruler/rulespb/rules.pb.go | 1320 +++ pkg/scheduler/schedulerpb/scheduler.pb.go | 2850 +++++++ pkg/storage/chunk/client/grpc/grpc.pb.go | 6484 ++++++++++++++ .../series/index/caching_index_client.pb.go | 845 ++ 26 files changed, 35048 insertions(+), 121 deletions(-) create mode 100644 pkg/compactor/client/grpc/grpc.pb.go create mode 100644 pkg/ingester/checkpoint.pb.go create mode 100644 pkg/logqlmodel/stats/stats.pb.go create mode 100644 pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go create mode 100644 pkg/push/push.pb.go delete mode 100644 pkg/querier/plan.go create mode 100644 pkg/querier/plan/plan.go create mode 100644 pkg/querier/queryrange/queryrange.pb.go create mode 100644 pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go create mode 100644 pkg/querier/queryrange/queryrangebase/queryrange.pb.go create mode 100644 pkg/querier/stats/stats.pb.go create mode 100644 pkg/ruler/base/ruler.pb.go create mode 100644 pkg/ruler/rulespb/rules.pb.go create mode 100644 pkg/scheduler/schedulerpb/scheduler.pb.go create mode 100644 pkg/storage/chunk/client/grpc/grpc.pb.go create mode 100644 pkg/storage/stores/series/index/caching_index_client.pb.go diff --git a/pkg/compactor/client/grpc/grpc.pb.go b/pkg/compactor/client/grpc/grpc.pb.go new file mode 100644 index 0000000000000..a6a9aabdd15c6 --- /dev/null +++ b/pkg/compactor/client/grpc/grpc.pb.go @@ -0,0 +1,1548 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/compactor/client/grpc/grpc.proto + +package grpc + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + 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" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GetDeleteRequestsRequest struct { +} + +func (m *GetDeleteRequestsRequest) Reset() { *m = GetDeleteRequestsRequest{} } +func (*GetDeleteRequestsRequest) ProtoMessage() {} +func (*GetDeleteRequestsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_24a5f361c0f660df, []int{0} +} +func (m *GetDeleteRequestsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetDeleteRequestsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetDeleteRequestsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetDeleteRequestsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDeleteRequestsRequest.Merge(m, src) +} +func (m *GetDeleteRequestsRequest) XXX_Size() int { + return m.Size() +} +func (m *GetDeleteRequestsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDeleteRequestsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDeleteRequestsRequest proto.InternalMessageInfo + +type GetDeleteRequestsResponse struct { + DeleteRequests []*DeleteRequest `protobuf:"bytes,1,rep,name=deleteRequests,proto3" json:"deleteRequests,omitempty"` +} + +func (m *GetDeleteRequestsResponse) Reset() { *m = GetDeleteRequestsResponse{} } +func (*GetDeleteRequestsResponse) ProtoMessage() {} +func (*GetDeleteRequestsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_24a5f361c0f660df, []int{1} +} +func (m *GetDeleteRequestsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetDeleteRequestsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetDeleteRequestsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetDeleteRequestsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDeleteRequestsResponse.Merge(m, src) +} +func (m *GetDeleteRequestsResponse) XXX_Size() int { + return m.Size() +} +func (m *GetDeleteRequestsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetDeleteRequestsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDeleteRequestsResponse proto.InternalMessageInfo + +func (m *GetDeleteRequestsResponse) GetDeleteRequests() []*DeleteRequest { + if m != nil { + return m.DeleteRequests + } + return nil +} + +type DeleteRequest struct { + RequestID string `protobuf:"bytes,1,opt,name=requestID,proto3" json:"requestID,omitempty"` + StartTime int64 `protobuf:"varint,2,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime int64 `protobuf:"varint,3,opt,name=endTime,proto3" json:"endTime,omitempty"` + Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"` +} + +func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } +func (*DeleteRequest) ProtoMessage() {} +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_24a5f361c0f660df, []int{2} +} +func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteRequest.Merge(m, src) +} +func (m *DeleteRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo + +func (m *DeleteRequest) GetRequestID() string { + if m != nil { + return m.RequestID + } + return "" +} + +func (m *DeleteRequest) GetStartTime() int64 { + if m != nil { + return m.StartTime + } + return 0 +} + +func (m *DeleteRequest) GetEndTime() int64 { + if m != nil { + return m.EndTime + } + return 0 +} + +func (m *DeleteRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *DeleteRequest) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *DeleteRequest) GetCreatedAt() int64 { + if m != nil { + return m.CreatedAt + } + return 0 +} + +type GetCacheGenNumbersRequest struct { +} + +func (m *GetCacheGenNumbersRequest) Reset() { *m = GetCacheGenNumbersRequest{} } +func (*GetCacheGenNumbersRequest) ProtoMessage() {} +func (*GetCacheGenNumbersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_24a5f361c0f660df, []int{3} +} +func (m *GetCacheGenNumbersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCacheGenNumbersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCacheGenNumbersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetCacheGenNumbersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCacheGenNumbersRequest.Merge(m, src) +} +func (m *GetCacheGenNumbersRequest) XXX_Size() int { + return m.Size() +} +func (m *GetCacheGenNumbersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCacheGenNumbersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCacheGenNumbersRequest proto.InternalMessageInfo + +type GetCacheGenNumbersResponse struct { + ResultsCacheGen string `protobuf:"bytes,1,opt,name=resultsCacheGen,proto3" json:"resultsCacheGen,omitempty"` +} + +func (m *GetCacheGenNumbersResponse) Reset() { *m = GetCacheGenNumbersResponse{} } +func (*GetCacheGenNumbersResponse) ProtoMessage() {} +func (*GetCacheGenNumbersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_24a5f361c0f660df, []int{4} +} +func (m *GetCacheGenNumbersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCacheGenNumbersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCacheGenNumbersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetCacheGenNumbersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCacheGenNumbersResponse.Merge(m, src) +} +func (m *GetCacheGenNumbersResponse) XXX_Size() int { + return m.Size() +} +func (m *GetCacheGenNumbersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetCacheGenNumbersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCacheGenNumbersResponse proto.InternalMessageInfo + +func (m *GetCacheGenNumbersResponse) GetResultsCacheGen() string { + if m != nil { + return m.ResultsCacheGen + } + return "" +} + +func init() { + proto.RegisterType((*GetDeleteRequestsRequest)(nil), "grpc.GetDeleteRequestsRequest") + proto.RegisterType((*GetDeleteRequestsResponse)(nil), "grpc.GetDeleteRequestsResponse") + proto.RegisterType((*DeleteRequest)(nil), "grpc.DeleteRequest") + proto.RegisterType((*GetCacheGenNumbersRequest)(nil), "grpc.GetCacheGenNumbersRequest") + proto.RegisterType((*GetCacheGenNumbersResponse)(nil), "grpc.GetCacheGenNumbersResponse") +} + +func init() { + proto.RegisterFile("pkg/compactor/client/grpc/grpc.proto", fileDescriptor_24a5f361c0f660df) +} + +var fileDescriptor_24a5f361c0f660df = []byte{ + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xbb, 0x4e, 0xe3, 0x40, + 0x14, 0xf5, 0x6c, 0x1e, 0xab, 0xcc, 0x6a, 0x77, 0xc5, 0x80, 0xd0, 0x60, 0xd0, 0xc5, 0xb2, 0x28, + 0x5c, 0x25, 0x52, 0xa0, 0xa3, 0x82, 0x44, 0x44, 0x34, 0x14, 0x56, 0x24, 0x68, 0x1d, 0xe7, 0x2a, + 0x44, 0x24, 0xb6, 0x33, 0x33, 0x2e, 0xe8, 0xf8, 0x04, 0x3e, 0x83, 0x96, 0x96, 0x2f, 0xa0, 0x4c, + 0x99, 0x92, 0x38, 0x0d, 0x65, 0x3e, 0x01, 0x65, 0xec, 0x24, 0xca, 0xab, 0xb1, 0xe7, 0x9e, 0x73, + 0xe6, 0x3e, 0xce, 0x1d, 0x7a, 0x16, 0x3d, 0x75, 0x2a, 0x7e, 0xd8, 0x8f, 0x3c, 0x5f, 0x85, 0xa2, + 0xe2, 0xf7, 0xba, 0x18, 0xa8, 0x4a, 0x47, 0x44, 0xbe, 0xfe, 0x94, 0x23, 0x11, 0xaa, 0x90, 0xe5, + 0x67, 0x67, 0xdb, 0xa4, 0xbc, 0x81, 0xaa, 0x8e, 0x3d, 0x54, 0xe8, 0xe2, 0x20, 0x46, 0xa9, 0x64, + 0xf6, 0xb7, 0x1f, 0xe8, 0xd1, 0x16, 0x4e, 0x46, 0x61, 0x20, 0x91, 0x5d, 0xd2, 0x7f, 0xed, 0x15, + 0x86, 0x13, 0x2b, 0xe7, 0xfc, 0xa9, 0xee, 0x97, 0x75, 0x8d, 0x95, 0x5b, 0xee, 0x9a, 0xd4, 0x7e, + 0x27, 0xf4, 0xef, 0x8a, 0x82, 0x9d, 0xd0, 0x92, 0x48, 0x8f, 0xb7, 0x75, 0x4e, 0x2c, 0xe2, 0x94, + 0xdc, 0x25, 0x30, 0x63, 0xa5, 0xf2, 0x84, 0x6a, 0x76, 0xfb, 0xc8, 0x7f, 0x59, 0xc4, 0xc9, 0xb9, + 0x4b, 0x80, 0x71, 0xfa, 0x1b, 0x83, 0xb6, 0xe6, 0x72, 0x9a, 0x9b, 0x87, 0xec, 0x80, 0x16, 0x06, + 0x31, 0x8a, 0x67, 0x9e, 0xd7, 0x19, 0xd3, 0x80, 0x1d, 0xd2, 0xa2, 0x54, 0x9e, 0x8a, 0x25, 0x2f, + 0x68, 0x38, 0x8b, 0x66, 0x55, 0x7c, 0x81, 0x9e, 0xc2, 0xf6, 0x95, 0xe2, 0xc5, 0xb4, 0xca, 0x02, + 0xb0, 0x8f, 0xb5, 0x1b, 0x35, 0xcf, 0x7f, 0xc4, 0x06, 0x06, 0x77, 0x71, 0xbf, 0x85, 0x62, 0x61, + 0xd5, 0x0d, 0x35, 0xb7, 0x91, 0x99, 0x57, 0x0e, 0xfd, 0x2f, 0x50, 0xc6, 0x3d, 0x25, 0xe7, 0x8a, + 0x6c, 0xc4, 0x75, 0xb8, 0xfa, 0x41, 0x68, 0xa9, 0x36, 0xdf, 0x1c, 0x6b, 0xd2, 0xbd, 0x8d, 0x05, + 0x30, 0x48, 0x0d, 0xde, 0xb5, 0x35, 0xf3, 0x74, 0x27, 0x9f, 0x75, 0x73, 0x4f, 0xd9, 0x66, 0xaf, + 0x6c, 0x79, 0x6d, 0xfb, 0x88, 0xa6, 0xb5, 0x5b, 0x90, 0x26, 0xbe, 0xbe, 0x18, 0x8e, 0xc1, 0x18, + 0x8d, 0xc1, 0x98, 0x8e, 0x81, 0xbc, 0x24, 0x40, 0xde, 0x12, 0x20, 0x9f, 0x09, 0x90, 0x61, 0x02, + 0xe4, 0x2b, 0x01, 0xf2, 0x9d, 0x80, 0x31, 0x4d, 0x80, 0xbc, 0x4e, 0xc0, 0x18, 0x4e, 0xc0, 0x18, + 0x4d, 0xc0, 0x68, 0x15, 0xf5, 0x73, 0x3c, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x80, 0xfa, 0x3c, + 0xc9, 0xb6, 0x02, 0x00, 0x00, +} + +func (this *GetDeleteRequestsRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetDeleteRequestsRequest) + if !ok { + that2, ok := that.(GetDeleteRequestsRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *GetDeleteRequestsResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetDeleteRequestsResponse) + if !ok { + that2, ok := that.(GetDeleteRequestsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.DeleteRequests) != len(that1.DeleteRequests) { + return false + } + for i := range this.DeleteRequests { + if !this.DeleteRequests[i].Equal(that1.DeleteRequests[i]) { + return false + } + } + return true +} +func (this *DeleteRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DeleteRequest) + if !ok { + that2, ok := that.(DeleteRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.RequestID != that1.RequestID { + return false + } + if this.StartTime != that1.StartTime { + return false + } + if this.EndTime != that1.EndTime { + return false + } + if this.Query != that1.Query { + return false + } + if this.Status != that1.Status { + return false + } + if this.CreatedAt != that1.CreatedAt { + return false + } + return true +} +func (this *GetCacheGenNumbersRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetCacheGenNumbersRequest) + if !ok { + that2, ok := that.(GetCacheGenNumbersRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *GetCacheGenNumbersResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetCacheGenNumbersResponse) + if !ok { + that2, ok := that.(GetCacheGenNumbersResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ResultsCacheGen != that1.ResultsCacheGen { + return false + } + return true +} +func (this *GetDeleteRequestsRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&grpc.GetDeleteRequestsRequest{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetDeleteRequestsResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.GetDeleteRequestsResponse{") + if this.DeleteRequests != nil { + s = append(s, "DeleteRequests: "+fmt.Sprintf("%#v", this.DeleteRequests)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DeleteRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 10) + s = append(s, "&grpc.DeleteRequest{") + s = append(s, "RequestID: "+fmt.Sprintf("%#v", this.RequestID)+",\n") + s = append(s, "StartTime: "+fmt.Sprintf("%#v", this.StartTime)+",\n") + s = append(s, "EndTime: "+fmt.Sprintf("%#v", this.EndTime)+",\n") + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + s = append(s, "CreatedAt: "+fmt.Sprintf("%#v", this.CreatedAt)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetCacheGenNumbersRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&grpc.GetCacheGenNumbersRequest{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetCacheGenNumbersResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.GetCacheGenNumbersResponse{") + s = append(s, "ResultsCacheGen: "+fmt.Sprintf("%#v", this.ResultsCacheGen)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringGrpc(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// CompactorClient is the client API for Compactor service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type CompactorClient interface { + GetDeleteRequests(ctx context.Context, in *GetDeleteRequestsRequest, opts ...grpc.CallOption) (*GetDeleteRequestsResponse, error) + GetCacheGenNumbers(ctx context.Context, in *GetCacheGenNumbersRequest, opts ...grpc.CallOption) (*GetCacheGenNumbersResponse, error) +} + +type compactorClient struct { + cc *grpc.ClientConn +} + +func NewCompactorClient(cc *grpc.ClientConn) CompactorClient { + return &compactorClient{cc} +} + +func (c *compactorClient) GetDeleteRequests(ctx context.Context, in *GetDeleteRequestsRequest, opts ...grpc.CallOption) (*GetDeleteRequestsResponse, error) { + out := new(GetDeleteRequestsResponse) + err := c.cc.Invoke(ctx, "/grpc.Compactor/GetDeleteRequests", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *compactorClient) GetCacheGenNumbers(ctx context.Context, in *GetCacheGenNumbersRequest, opts ...grpc.CallOption) (*GetCacheGenNumbersResponse, error) { + out := new(GetCacheGenNumbersResponse) + err := c.cc.Invoke(ctx, "/grpc.Compactor/GetCacheGenNumbers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CompactorServer is the server API for Compactor service. +type CompactorServer interface { + GetDeleteRequests(context.Context, *GetDeleteRequestsRequest) (*GetDeleteRequestsResponse, error) + GetCacheGenNumbers(context.Context, *GetCacheGenNumbersRequest) (*GetCacheGenNumbersResponse, error) +} + +// UnimplementedCompactorServer can be embedded to have forward compatible implementations. +type UnimplementedCompactorServer struct { +} + +func (*UnimplementedCompactorServer) GetDeleteRequests(ctx context.Context, req *GetDeleteRequestsRequest) (*GetDeleteRequestsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeleteRequests not implemented") +} +func (*UnimplementedCompactorServer) GetCacheGenNumbers(ctx context.Context, req *GetCacheGenNumbersRequest) (*GetCacheGenNumbersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCacheGenNumbers not implemented") +} + +func RegisterCompactorServer(s *grpc.Server, srv CompactorServer) { + s.RegisterService(&_Compactor_serviceDesc, srv) +} + +func _Compactor_GetDeleteRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDeleteRequestsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompactorServer).GetDeleteRequests(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.Compactor/GetDeleteRequests", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompactorServer).GetDeleteRequests(ctx, req.(*GetDeleteRequestsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Compactor_GetCacheGenNumbers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCacheGenNumbersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CompactorServer).GetCacheGenNumbers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.Compactor/GetCacheGenNumbers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CompactorServer).GetCacheGenNumbers(ctx, req.(*GetCacheGenNumbersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Compactor_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.Compactor", + HandlerType: (*CompactorServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDeleteRequests", + Handler: _Compactor_GetDeleteRequests_Handler, + }, + { + MethodName: "GetCacheGenNumbers", + Handler: _Compactor_GetCacheGenNumbers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/compactor/client/grpc/grpc.proto", +} + +func (m *GetDeleteRequestsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetDeleteRequestsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDeleteRequestsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetDeleteRequestsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetDeleteRequestsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDeleteRequestsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DeleteRequests) > 0 { + for iNdEx := len(m.DeleteRequests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DeleteRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DeleteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreatedAt != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x30 + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x2a + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x22 + } + if m.EndTime != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.EndTime)) + i-- + dAtA[i] = 0x18 + } + if m.StartTime != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x10 + } + if len(m.RequestID) > 0 { + i -= len(m.RequestID) + copy(dAtA[i:], m.RequestID) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.RequestID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetCacheGenNumbersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCacheGenNumbersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCacheGenNumbersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetCacheGenNumbersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCacheGenNumbersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCacheGenNumbersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResultsCacheGen) > 0 { + i -= len(m.ResultsCacheGen) + copy(dAtA[i:], m.ResultsCacheGen) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.ResultsCacheGen))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGrpc(dAtA []byte, offset int, v uint64) int { + offset -= sovGrpc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GetDeleteRequestsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetDeleteRequestsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DeleteRequests) > 0 { + for _, e := range m.DeleteRequests { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *DeleteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestID) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + if m.StartTime != 0 { + n += 1 + sovGrpc(uint64(m.StartTime)) + } + if m.EndTime != 0 { + n += 1 + sovGrpc(uint64(m.EndTime)) + } + l = len(m.Query) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.Status) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + if m.CreatedAt != 0 { + n += 1 + sovGrpc(uint64(m.CreatedAt)) + } + return n +} + +func (m *GetCacheGenNumbersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetCacheGenNumbersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ResultsCacheGen) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func sovGrpc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGrpc(x uint64) (n int) { + return sovGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *GetDeleteRequestsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetDeleteRequestsRequest{`, + `}`, + }, "") + return s +} +func (this *GetDeleteRequestsResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForDeleteRequests := "[]*DeleteRequest{" + for _, f := range this.DeleteRequests { + repeatedStringForDeleteRequests += strings.Replace(f.String(), "DeleteRequest", "DeleteRequest", 1) + "," + } + repeatedStringForDeleteRequests += "}" + s := strings.Join([]string{`&GetDeleteRequestsResponse{`, + `DeleteRequests:` + repeatedStringForDeleteRequests + `,`, + `}`, + }, "") + return s +} +func (this *DeleteRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteRequest{`, + `RequestID:` + fmt.Sprintf("%v", this.RequestID) + `,`, + `StartTime:` + fmt.Sprintf("%v", this.StartTime) + `,`, + `EndTime:` + fmt.Sprintf("%v", this.EndTime) + `,`, + `Query:` + fmt.Sprintf("%v", this.Query) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, + `}`, + }, "") + return s +} +func (this *GetCacheGenNumbersRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetCacheGenNumbersRequest{`, + `}`, + }, "") + return s +} +func (this *GetCacheGenNumbersResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GetCacheGenNumbersResponse{`, + `ResultsCacheGen:` + fmt.Sprintf("%v", this.ResultsCacheGen) + `,`, + `}`, + }, "") + return s +} +func valueToStringGrpc(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *GetDeleteRequestsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetDeleteRequestsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetDeleteRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetDeleteRequestsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetDeleteRequestsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetDeleteRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteRequests", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeleteRequests = append(m.DeleteRequests, &DeleteRequest{}) + if err := m.DeleteRequests[len(m.DeleteRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + m.EndTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + m.CreatedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCacheGenNumbersRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCacheGenNumbersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCacheGenNumbersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCacheGenNumbersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCacheGenNumbersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCacheGenNumbersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResultsCacheGen", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResultsCacheGen = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGrpc(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGrpc + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGrpc + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + 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 := skipGrpc(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGrpc + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGrpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGrpc = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/ingester/checkpoint.pb.go b/pkg/ingester/checkpoint.pb.go new file mode 100644 index 0000000000000..4f66c217b5ef1 --- /dev/null +++ b/pkg/ingester/checkpoint.pb.go @@ -0,0 +1,1434 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/ingester/checkpoint.proto + +package ingester + +import ( + bytes "bytes" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/grafana/loki/pkg/logproto" + github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Chunk is a {de,}serializable intermediate type for chunkDesc which allows +// efficient loading/unloading to disk during WAL checkpoint recovery. +type Chunk struct { + From time.Time `protobuf:"bytes,1,opt,name=from,proto3,stdtime" json:"from"` + To time.Time `protobuf:"bytes,2,opt,name=to,proto3,stdtime" json:"to"` + FlushedAt time.Time `protobuf:"bytes,3,opt,name=flushedAt,proto3,stdtime" json:"flushedAt"` + LastUpdated time.Time `protobuf:"bytes,4,opt,name=lastUpdated,proto3,stdtime" json:"lastUpdated"` + Closed bool `protobuf:"varint,5,opt,name=closed,proto3" json:"closed,omitempty"` + Synced bool `protobuf:"varint,6,opt,name=synced,proto3" json:"synced,omitempty"` + // data to be unmarshaled into a MemChunk + Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + // data to be unmarshaled into a MemChunk's headBlock + Head []byte `protobuf:"bytes,8,opt,name=head,proto3" json:"head,omitempty"` +} + +func (m *Chunk) Reset() { *m = Chunk{} } +func (*Chunk) ProtoMessage() {} +func (*Chunk) Descriptor() ([]byte, []int) { + return fileDescriptor_00f4b7152db9bdb5, []int{0} +} +func (m *Chunk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Chunk) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chunk.Merge(m, src) +} +func (m *Chunk) XXX_Size() int { + return m.Size() +} +func (m *Chunk) XXX_DiscardUnknown() { + xxx_messageInfo_Chunk.DiscardUnknown(m) +} + +var xxx_messageInfo_Chunk proto.InternalMessageInfo + +func (m *Chunk) GetFrom() time.Time { + if m != nil { + return m.From + } + return time.Time{} +} + +func (m *Chunk) GetTo() time.Time { + if m != nil { + return m.To + } + return time.Time{} +} + +func (m *Chunk) GetFlushedAt() time.Time { + if m != nil { + return m.FlushedAt + } + return time.Time{} +} + +func (m *Chunk) GetLastUpdated() time.Time { + if m != nil { + return m.LastUpdated + } + return time.Time{} +} + +func (m *Chunk) GetClosed() bool { + if m != nil { + return m.Closed + } + return false +} + +func (m *Chunk) GetSynced() bool { + if m != nil { + return m.Synced + } + return false +} + +func (m *Chunk) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *Chunk) GetHead() []byte { + if m != nil { + return m.Head + } + return nil +} + +// Series is a {de,}serializable intermediate type for Series. +type Series struct { + UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` + // post mapped fingerprint is necessary because subsequent wal writes will reference it. + Fingerprint uint64 `protobuf:"varint,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` + Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` + Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` + // most recently pushed timestamp. + To time.Time `protobuf:"bytes,5,opt,name=to,proto3,stdtime" json:"to"` + // most recently pushed line. + LastLine string `protobuf:"bytes,6,opt,name=lastLine,proto3" json:"lastLine,omitempty"` + // highest counter value for pushes to this stream. + // Used to skip already applied entries during WAL replay. + EntryCt int64 `protobuf:"varint,7,opt,name=entryCt,proto3" json:"entryCt,omitempty"` + // highest timestamp pushed to this stream. + HighestTs time.Time `protobuf:"bytes,8,opt,name=highestTs,proto3,stdtime" json:"highestTs"` +} + +func (m *Series) Reset() { *m = Series{} } +func (*Series) ProtoMessage() {} +func (*Series) Descriptor() ([]byte, []int) { + return fileDescriptor_00f4b7152db9bdb5, []int{1} +} +func (m *Series) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Series.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Series) XXX_Merge(src proto.Message) { + xxx_messageInfo_Series.Merge(m, src) +} +func (m *Series) XXX_Size() int { + return m.Size() +} +func (m *Series) XXX_DiscardUnknown() { + xxx_messageInfo_Series.DiscardUnknown(m) +} + +var xxx_messageInfo_Series proto.InternalMessageInfo + +func (m *Series) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Series) GetFingerprint() uint64 { + if m != nil { + return m.Fingerprint + } + return 0 +} + +func (m *Series) GetChunks() []Chunk { + if m != nil { + return m.Chunks + } + return nil +} + +func (m *Series) GetTo() time.Time { + if m != nil { + return m.To + } + return time.Time{} +} + +func (m *Series) GetLastLine() string { + if m != nil { + return m.LastLine + } + return "" +} + +func (m *Series) GetEntryCt() int64 { + if m != nil { + return m.EntryCt + } + return 0 +} + +func (m *Series) GetHighestTs() time.Time { + if m != nil { + return m.HighestTs + } + return time.Time{} +} + +func init() { + proto.RegisterType((*Chunk)(nil), "loki_ingester.Chunk") + proto.RegisterType((*Series)(nil), "loki_ingester.Series") +} + +func init() { proto.RegisterFile("pkg/ingester/checkpoint.proto", fileDescriptor_00f4b7152db9bdb5) } + +var fileDescriptor_00f4b7152db9bdb5 = []byte{ + // 517 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x31, 0x8f, 0xd3, 0x30, + 0x14, 0x8e, 0xdb, 0x5c, 0xae, 0x75, 0x61, 0xb1, 0x4e, 0xc8, 0x14, 0xe1, 0x56, 0x37, 0x75, 0x4a, + 0x44, 0x61, 0x80, 0x05, 0xe9, 0x7a, 0x08, 0x09, 0xa9, 0x03, 0x0a, 0xc7, 0xc2, 0x82, 0xdc, 0xc4, + 0x75, 0xa2, 0xa6, 0x71, 0x64, 0xbb, 0x43, 0x37, 0x7e, 0xc2, 0x0d, 0xfc, 0x08, 0x7e, 0xca, 0x8d, + 0x1d, 0x4f, 0x20, 0x1d, 0x34, 0x5d, 0x18, 0xef, 0x27, 0x20, 0x3b, 0x49, 0x29, 0x1b, 0xdd, 0xde, + 0xf7, 0x9e, 0xbf, 0xf7, 0xc9, 0xdf, 0xfb, 0xe0, 0xd3, 0x62, 0xc1, 0x83, 0x34, 0xe7, 0x4c, 0x69, + 0x26, 0x83, 0x28, 0x61, 0xd1, 0xa2, 0x10, 0x69, 0xae, 0xfd, 0x42, 0x0a, 0x2d, 0xd0, 0xc3, 0x4c, + 0x2c, 0xd2, 0xcf, 0xcd, 0xbc, 0x7f, 0xc6, 0x05, 0x17, 0x76, 0x12, 0x98, 0xaa, 0x7a, 0xd4, 0x1f, + 0x70, 0x21, 0x78, 0xc6, 0x02, 0x8b, 0x66, 0xab, 0x79, 0xa0, 0xd3, 0x25, 0x53, 0x9a, 0x2e, 0x8b, + 0xfa, 0xc1, 0x13, 0x23, 0x92, 0x09, 0x5e, 0x31, 0x9b, 0xa2, 0x1a, 0x9e, 0xff, 0x68, 0xc1, 0x93, + 0xcb, 0x64, 0x95, 0x2f, 0xd0, 0x4b, 0xe8, 0xce, 0xa5, 0x58, 0x62, 0x30, 0x04, 0xa3, 0xde, 0xb8, + 0xef, 0x57, 0x6b, 0xfd, 0x66, 0xad, 0x7f, 0xd5, 0xac, 0x9d, 0x74, 0x6e, 0xee, 0x06, 0xce, 0xf5, + 0xcf, 0x01, 0x08, 0x2d, 0x03, 0xbd, 0x80, 0x2d, 0x2d, 0x70, 0xeb, 0x08, 0x5e, 0x4b, 0x0b, 0x34, + 0x81, 0xdd, 0x79, 0xb6, 0x52, 0x09, 0x8b, 0x2f, 0x34, 0x6e, 0x1f, 0x41, 0xfe, 0x4b, 0x43, 0x6f, + 0x61, 0x2f, 0xa3, 0x4a, 0x7f, 0x2c, 0x62, 0xaa, 0x59, 0x8c, 0xdd, 0x23, 0xb6, 0x1c, 0x12, 0xd1, + 0x23, 0xe8, 0x45, 0x99, 0x50, 0x2c, 0xc6, 0x27, 0x43, 0x30, 0xea, 0x84, 0x35, 0x32, 0x7d, 0xb5, + 0xce, 0x23, 0x16, 0x63, 0xaf, 0xea, 0x57, 0x08, 0x21, 0xe8, 0xc6, 0x54, 0x53, 0x7c, 0x3a, 0x04, + 0xa3, 0x07, 0xa1, 0xad, 0x4d, 0x2f, 0x61, 0x34, 0xc6, 0x9d, 0xaa, 0x67, 0xea, 0xf3, 0xaf, 0x6d, + 0xe8, 0x7d, 0x60, 0x32, 0x65, 0xca, 0xac, 0x5a, 0x29, 0x26, 0xdf, 0xbd, 0xb1, 0x06, 0x77, 0xc3, + 0x1a, 0xa1, 0x21, 0xec, 0xcd, 0xcd, 0x85, 0x65, 0x21, 0xd3, 0x5c, 0x5b, 0x17, 0xdd, 0xf0, 0xb0, + 0x85, 0x32, 0xe8, 0x65, 0x74, 0xc6, 0x32, 0x85, 0xdb, 0xc3, 0xf6, 0xa8, 0x37, 0x7e, 0xec, 0xef, + 0x6f, 0x38, 0x65, 0x9c, 0x46, 0xeb, 0xa9, 0x99, 0xbe, 0xa7, 0xa9, 0x9c, 0xbc, 0x32, 0xdf, 0xfb, + 0x7e, 0x37, 0x78, 0xc6, 0x53, 0x9d, 0xac, 0x66, 0x7e, 0x24, 0x96, 0x01, 0x97, 0x74, 0x4e, 0x73, + 0x1a, 0x98, 0x2c, 0x05, 0x87, 0x51, 0xf0, 0x2d, 0xef, 0x22, 0xa6, 0x85, 0x66, 0x32, 0xac, 0x35, + 0xd0, 0x18, 0x7a, 0x91, 0xc9, 0x83, 0xc2, 0xae, 0x55, 0x3b, 0xf3, 0xff, 0x09, 0xa1, 0x6f, 0xc3, + 0x32, 0x71, 0x8d, 0x50, 0x58, 0xbf, 0xac, 0x03, 0x70, 0x72, 0x64, 0x00, 0xfa, 0xb0, 0x63, 0x6e, + 0x30, 0x4d, 0x73, 0x66, 0xed, 0xed, 0x86, 0x7b, 0x8c, 0x30, 0x3c, 0x65, 0xb9, 0x96, 0xeb, 0x4b, + 0x6d, 0x3d, 0x6e, 0x87, 0x0d, 0x34, 0xb1, 0x49, 0x52, 0x9e, 0x30, 0xa5, 0xaf, 0x94, 0xf5, 0xfa, + 0xbf, 0x63, 0xb3, 0xa7, 0x4d, 0x5e, 0x6f, 0xb6, 0xc4, 0xb9, 0xdd, 0x12, 0xe7, 0x7e, 0x4b, 0xc0, + 0x97, 0x92, 0x80, 0x6f, 0x25, 0x01, 0x37, 0x25, 0x01, 0x9b, 0x92, 0x80, 0x5f, 0x25, 0x01, 0xbf, + 0x4b, 0xe2, 0xdc, 0x97, 0x04, 0x5c, 0xef, 0x88, 0xb3, 0xd9, 0x11, 0xe7, 0x76, 0x47, 0x9c, 0x4f, + 0x9d, 0xc6, 0x83, 0x99, 0x67, 0x85, 0x9e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xda, 0xcc, 0xb5, + 0xf6, 0xbf, 0x03, 0x00, 0x00, +} + +func (this *Chunk) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Chunk) + if !ok { + that2, ok := that.(Chunk) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.From.Equal(that1.From) { + return false + } + if !this.To.Equal(that1.To) { + return false + } + if !this.FlushedAt.Equal(that1.FlushedAt) { + return false + } + if !this.LastUpdated.Equal(that1.LastUpdated) { + return false + } + if this.Closed != that1.Closed { + return false + } + if this.Synced != that1.Synced { + return false + } + if !bytes.Equal(this.Data, that1.Data) { + return false + } + if !bytes.Equal(this.Head, that1.Head) { + return false + } + return true +} +func (this *Series) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Series) + if !ok { + that2, ok := that.(Series) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.UserID != that1.UserID { + return false + } + if this.Fingerprint != that1.Fingerprint { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if len(this.Chunks) != len(that1.Chunks) { + return false + } + for i := range this.Chunks { + if !this.Chunks[i].Equal(&that1.Chunks[i]) { + return false + } + } + if !this.To.Equal(that1.To) { + return false + } + if this.LastLine != that1.LastLine { + return false + } + if this.EntryCt != that1.EntryCt { + return false + } + if !this.HighestTs.Equal(that1.HighestTs) { + return false + } + return true +} +func (this *Chunk) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 12) + s = append(s, "&ingester.Chunk{") + s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") + s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") + s = append(s, "FlushedAt: "+fmt.Sprintf("%#v", this.FlushedAt)+",\n") + s = append(s, "LastUpdated: "+fmt.Sprintf("%#v", this.LastUpdated)+",\n") + s = append(s, "Closed: "+fmt.Sprintf("%#v", this.Closed)+",\n") + s = append(s, "Synced: "+fmt.Sprintf("%#v", this.Synced)+",\n") + s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "Head: "+fmt.Sprintf("%#v", this.Head)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Series) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 12) + s = append(s, "&ingester.Series{") + s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") + s = append(s, "Fingerprint: "+fmt.Sprintf("%#v", this.Fingerprint)+",\n") + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Chunks != nil { + vs := make([]*Chunk, len(this.Chunks)) + for i := range vs { + vs[i] = &this.Chunks[i] + } + s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") + s = append(s, "LastLine: "+fmt.Sprintf("%#v", this.LastLine)+",\n") + s = append(s, "EntryCt: "+fmt.Sprintf("%#v", this.EntryCt)+",\n") + s = append(s, "HighestTs: "+fmt.Sprintf("%#v", this.HighestTs)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringCheckpoint(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Chunk) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + if len(m.Head) > 0 { + i -= len(m.Head) + copy(dAtA[i:], m.Head) + i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Head))) + i-- + dAtA[i] = 0x42 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x3a + } + if m.Synced { + i-- + if m.Synced { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Closed { + i-- + if m.Closed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintCheckpoint(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x22 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FlushedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintCheckpoint(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintCheckpoint(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x12 + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.From, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.From):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintCheckpoint(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Series) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.HighestTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintCheckpoint(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + if m.EntryCt != 0 { + i = encodeVarintCheckpoint(dAtA, i, uint64(m.EntryCt)) + i-- + dAtA[i] = 0x38 + } + if len(m.LastLine) > 0 { + i -= len(m.LastLine) + copy(dAtA[i:], m.LastLine) + i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.LastLine))) + i-- + dAtA[i] = 0x32 + } + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintCheckpoint(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x2a + 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 = encodeVarintCheckpoint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCheckpoint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Fingerprint != 0 { + i = encodeVarintCheckpoint(dAtA, i, uint64(m.Fingerprint)) + i-- + dAtA[i] = 0x10 + } + if len(m.UserID) > 0 { + i -= len(m.UserID) + copy(dAtA[i:], m.UserID) + i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.UserID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCheckpoint(dAtA []byte, offset int, v uint64) int { + offset -= sovCheckpoint(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Chunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.From) + n += 1 + l + sovCheckpoint(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) + n += 1 + l + sovCheckpoint(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt) + n += 1 + l + sovCheckpoint(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated) + n += 1 + l + sovCheckpoint(uint64(l)) + if m.Closed { + n += 2 + } + if m.Synced { + n += 2 + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovCheckpoint(uint64(l)) + } + l = len(m.Head) + if l > 0 { + n += 1 + l + sovCheckpoint(uint64(l)) + } + return n +} + +func (m *Series) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.UserID) + if l > 0 { + n += 1 + l + sovCheckpoint(uint64(l)) + } + if m.Fingerprint != 0 { + n += 1 + sovCheckpoint(uint64(m.Fingerprint)) + } + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovCheckpoint(uint64(l)) + } + } + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.Size() + n += 1 + l + sovCheckpoint(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) + n += 1 + l + sovCheckpoint(uint64(l)) + l = len(m.LastLine) + if l > 0 { + n += 1 + l + sovCheckpoint(uint64(l)) + } + if m.EntryCt != 0 { + n += 1 + sovCheckpoint(uint64(m.EntryCt)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs) + n += 1 + l + sovCheckpoint(uint64(l)) + return n +} + +func sovCheckpoint(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCheckpoint(x uint64) (n int) { + return sovCheckpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Chunk) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Chunk{`, + `From:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.From), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `FlushedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FlushedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `LastUpdated:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdated), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Closed:` + fmt.Sprintf("%v", this.Closed) + `,`, + `Synced:` + fmt.Sprintf("%v", this.Synced) + `,`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `Head:` + fmt.Sprintf("%v", this.Head) + `,`, + `}`, + }, "") + return s +} +func (this *Series) String() string { + if this == nil { + return "nil" + } + repeatedStringForChunks := "[]Chunk{" + for _, f := range this.Chunks { + repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + "," + } + repeatedStringForChunks += "}" + s := strings.Join([]string{`&Series{`, + `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, + `Fingerprint:` + fmt.Sprintf("%v", this.Fingerprint) + `,`, + `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Chunks:` + repeatedStringForChunks + `,`, + `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `LastLine:` + fmt.Sprintf("%v", this.LastLine) + `,`, + `EntryCt:` + fmt.Sprintf("%v", this.EntryCt) + `,`, + `HighestTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.HighestTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringCheckpoint(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Chunk) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.From, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FlushedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FlushedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastUpdated, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Closed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Closed = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Synced", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Synced = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Head = append(m.Head[:0], dAtA[iNdEx:postIndex]...) + if m.Head == nil { + m.Head = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCheckpoint(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCheckpoint + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCheckpoint + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Series) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Series: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) + } + m.Fingerprint = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Fingerprint |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, Chunk{}) + if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastLine", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastLine = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EntryCt", wireType) + } + m.EntryCt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EntryCt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HighestTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCheckpoint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCheckpoint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.HighestTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCheckpoint(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCheckpoint + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCheckpoint + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCheckpoint(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCheckpoint + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCheckpoint + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthCheckpoint + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCheckpoint + } + 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 := skipCheckpoint(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthCheckpoint + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthCheckpoint = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCheckpoint = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index 45681c36c2c8f..c94fc4e3e7e61 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -17,6 +17,7 @@ import ( "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" logqllog "github.com/grafana/loki/pkg/logql/log" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/util/log" "github.com/grafana/loki/pkg/util/marshal" "github.com/grafana/loki/pkg/util/validation" @@ -117,7 +118,12 @@ func (f *FileClient) QueryRange(queryStr string, limit int, start, end time.Time nil, ) - query := f.engine.Query(params) + parsed, err := syntax.ParseExpr(queryStr) + if err != nil { + return nil, err + } + + query := f.engine.Query(params, parsed) result, err := query.Exec(ctx) if err != nil { diff --git a/pkg/logcli/query/query.go b/pkg/logcli/query/query.go index 6a71f0979abcf..5b8ceb8c3081d 100644 --- a/pkg/logcli/query/query.go +++ b/pkg/logcli/query/query.go @@ -22,6 +22,7 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/loki" "github.com/grafana/loki/pkg/storage" chunk "github.com/grafana/loki/pkg/storage/chunk/client" @@ -447,6 +448,11 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string return err } + parsed, err := syntax.ParseExpr(q.QueryString) + if err != nil { + return err + } + eng := logql.NewEngine(conf.Querier.Engine, querier, limits, util_log.Logger) var query logql.Query @@ -460,7 +466,7 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string q.resultsDirection(), uint32(q.Limit), nil, - )) + ), parsed) } else { query = eng.Query(logql.NewLiteralParams( q.QueryString, diff --git a/pkg/logproto/indexgateway.pb.go b/pkg/logproto/indexgateway.pb.go index e8b569ea07323..86b2665e86b17 100644 --- a/pkg/logproto/indexgateway.pb.go +++ b/pkg/logproto/indexgateway.pb.go @@ -6,7 +6,6 @@ package logproto import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -28,31 +27,30 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("pkg/logproto/indexgateway.proto", fileDescriptor_d27585148d0a52c8) } var fileDescriptor_d27585148d0a52c8 = []byte{ - // 372 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4a, 0xfb, 0x30, - 0x1c, 0xc7, 0x1b, 0xf8, 0xf3, 0x47, 0xa3, 0x78, 0x08, 0xc2, 0x46, 0xa7, 0x11, 0xc4, 0x83, 0x5e, - 0x56, 0xd1, 0x17, 0x10, 0x85, 0x95, 0xc1, 0x14, 0x9c, 0xb0, 0xc3, 0x0e, 0x62, 0x3a, 0x7f, 0xeb, - 0xca, 0xba, 0xa6, 0xb6, 0x29, 0xba, 0x9b, 0x8f, 0xe0, 0x63, 0xf8, 0x10, 0x3e, 0x80, 0xc7, 0x1d, - 0x77, 0x74, 0xdd, 0xc5, 0xe3, 0x1e, 0x41, 0x9a, 0xd0, 0x2d, 0x9b, 0x1d, 0x78, 0x6a, 0xfa, 0xf9, - 0x7e, 0xf3, 0xf9, 0xd1, 0xa4, 0xf8, 0x20, 0xec, 0xbb, 0x96, 0xcf, 0xdd, 0x30, 0xe2, 0x82, 0x5b, - 0x5e, 0xf0, 0x08, 0x2f, 0x2e, 0x13, 0xf0, 0xcc, 0x86, 0x55, 0x89, 0xc8, 0x8e, 0xce, 0x42, 0xc7, - 0xdc, 0x75, 0xb9, 0xcb, 0x55, 0x3b, 0x5b, 0xa9, 0x96, 0x59, 0x59, 0xd2, 0xe4, 0x0b, 0x15, 0x9e, - 0x7d, 0xfc, 0xc3, 0xdb, 0xf5, 0xcc, 0x62, 0x2b, 0x0b, 0xa9, 0x63, 0x7c, 0x9b, 0x40, 0x34, 0x94, - 0x90, 0x54, 0xaa, 0xf3, 0xfe, 0x82, 0x36, 0xe1, 0x29, 0x81, 0x58, 0x98, 0x7b, 0xc5, 0x61, 0x1c, - 0xf2, 0x20, 0x86, 0x53, 0x44, 0x1a, 0x78, 0xcb, 0x06, 0x71, 0xd5, 0x4b, 0x82, 0x7e, 0x13, 0xba, - 0x44, 0xab, 0x6b, 0x38, 0x97, 0xed, 0xaf, 0x49, 0x95, 0xed, 0xd0, 0x20, 0x35, 0xbc, 0x69, 0x83, - 0xb8, 0x83, 0xc8, 0x83, 0x98, 0x98, 0x4b, 0x6d, 0x05, 0x73, 0x53, 0xa5, 0x30, 0x9b, 0x7b, 0xee, - 0x71, 0xa9, 0xc1, 0x1c, 0xf0, 0x6f, 0xd8, 0x00, 0xe2, 0x1a, 0x8f, 0xae, 0x41, 0x44, 0x5e, 0x27, - 0x7b, 0x23, 0xc7, 0x8b, 0x9d, 0x6b, 0x2a, 0xf9, 0x8c, 0xd2, 0x4a, 0x53, 0xf3, 0x3f, 0xe0, 0xb2, - 0x44, 0x2d, 0xe6, 0x27, 0xab, 0x03, 0x4e, 0x56, 0xb6, 0x15, 0x74, 0xfe, 0x30, 0xc1, 0xc6, 0x1b, - 0xd9, 0x87, 0x09, 0x26, 0x62, 0xfd, 0x82, 0xe4, 0xf1, 0x4b, 0x5a, 0x70, 0x41, 0x7a, 0x38, 0x17, - 0x5d, 0xc8, 0x23, 0x6d, 0x71, 0x3f, 0x19, 0x00, 0xd1, 0x06, 0x2a, 0x92, 0x5b, 0xca, 0xbf, 0x83, - 0xdc, 0x70, 0xd9, 0x1e, 0x4d, 0xa8, 0x31, 0x9e, 0x50, 0x63, 0x36, 0xa1, 0xe8, 0x35, 0xa5, 0xe8, - 0x3d, 0xa5, 0xe8, 0x33, 0xa5, 0x68, 0x94, 0x52, 0xf4, 0x95, 0x52, 0xf4, 0x9d, 0x52, 0x63, 0x96, - 0x52, 0xf4, 0x36, 0xa5, 0xc6, 0x68, 0x4a, 0x8d, 0xf1, 0x94, 0x1a, 0xed, 0x23, 0xd7, 0x13, 0xbd, - 0xc4, 0xa9, 0x76, 0xf8, 0xc0, 0x72, 0x23, 0xd6, 0x65, 0x01, 0xb3, 0x7c, 0xde, 0xf7, 0x2c, 0xfd, - 0x4f, 0x75, 0xfe, 0xcb, 0xc7, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0xe4, 0x24, 0x34, - 0x07, 0x03, 0x00, 0x00, + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0x4e, 0xc2, 0x40, + 0x18, 0xc7, 0xef, 0x12, 0x63, 0xf4, 0x34, 0x0e, 0xb7, 0x40, 0x40, 0xcf, 0xc4, 0x38, 0xe8, 0x42, + 0x8d, 0xbe, 0x80, 0xd1, 0x84, 0x86, 0x04, 0x4d, 0xc4, 0x84, 0x81, 0xc1, 0x78, 0xc5, 0x8f, 0xd2, + 0x50, 0x7a, 0xb5, 0xbd, 0x46, 0xd9, 0x7c, 0x04, 0x1f, 0xc3, 0x87, 0xf0, 0x01, 0x1c, 0x19, 0x19, + 0xe5, 0x58, 0x1c, 0x79, 0x04, 0xc3, 0x35, 0x85, 0x03, 0x4b, 0xe2, 0x04, 0xfd, 0xfd, 0x7f, 0xdf, + 0xff, 0x4b, 0xef, 0x4a, 0x0e, 0xc3, 0x9e, 0x6b, 0xf9, 0xc2, 0x0d, 0x23, 0x21, 0x85, 0xe5, 0x05, + 0x4f, 0xf0, 0xea, 0x72, 0x09, 0x2f, 0x7c, 0x50, 0xd1, 0x88, 0xee, 0x99, 0x2c, 0x74, 0x4a, 0xe5, + 0xa5, 0x81, 0xec, 0x4f, 0x2a, 0x9f, 0x7f, 0x6e, 0x90, 0xdd, 0xda, 0xcc, 0xb7, 0x53, 0x9f, 0xd6, + 0x08, 0xb9, 0x4b, 0x20, 0x1a, 0x68, 0x48, 0xcb, 0x95, 0xb9, 0xbf, 0xa0, 0x0d, 0x78, 0x4e, 0x20, + 0x96, 0xa5, 0xfd, 0xfc, 0x30, 0x0e, 0x45, 0x10, 0xc3, 0x19, 0xa6, 0x75, 0xb2, 0x63, 0x83, 0xbc, + 0xee, 0x26, 0x41, 0xaf, 0x01, 0x1d, 0x6a, 0xe8, 0x06, 0xce, 0xca, 0x0e, 0xd6, 0xa4, 0x69, 0xdb, + 0x11, 0xa2, 0x55, 0xb2, 0x6d, 0x83, 0xbc, 0x87, 0xc8, 0x83, 0x98, 0x96, 0x96, 0xec, 0x14, 0x66, + 0x4d, 0xe5, 0xdc, 0x6c, 0xde, 0xf3, 0x40, 0x0a, 0x75, 0xee, 0x80, 0x7f, 0xcb, 0xfb, 0x10, 0x57, + 0x45, 0x74, 0x03, 0x32, 0xf2, 0xda, 0xb3, 0x27, 0x7a, 0xb2, 0x98, 0x5c, 0xa3, 0x64, 0x3b, 0x0a, + 0x2b, 0xa6, 0xd1, 0xff, 0x48, 0x8a, 0x1a, 0x35, 0xb9, 0x9f, 0xac, 0x2e, 0x38, 0x5d, 0x19, 0xcb, + 0x71, 0xfe, 0xb1, 0xc1, 0x26, 0x5b, 0xb3, 0x17, 0x93, 0x5c, 0xc6, 0xe6, 0x05, 0xe9, 0xe3, 0xd7, + 0x34, 0xe7, 0x82, 0xcc, 0x70, 0x5e, 0x74, 0xa9, 0x8f, 0xb4, 0x29, 0xfc, 0xa4, 0x0f, 0xd4, 0x58, + 0x98, 0x92, 0xac, 0xa5, 0xf8, 0x37, 0xc8, 0x1a, 0xae, 0x5a, 0xc3, 0x31, 0x43, 0xa3, 0x31, 0x43, + 0xd3, 0x31, 0xc3, 0x6f, 0x8a, 0xe1, 0x0f, 0xc5, 0xf0, 0x97, 0x62, 0x78, 0xa8, 0x18, 0xfe, 0x56, + 0x0c, 0xff, 0x28, 0x86, 0xa6, 0x8a, 0xe1, 0xf7, 0x09, 0x43, 0xc3, 0x09, 0x43, 0xa3, 0x09, 0x43, + 0xad, 0x63, 0xd7, 0x93, 0xdd, 0xc4, 0xa9, 0xb4, 0x45, 0xdf, 0x72, 0x23, 0xde, 0xe1, 0x01, 0xb7, + 0x7c, 0xd1, 0xf3, 0x2c, 0xf3, 0x4b, 0x75, 0x36, 0xf5, 0xcf, 0xc5, 0x6f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x7a, 0x1a, 0x28, 0xb4, 0xf1, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/pkg/logproto/indexgateway.proto b/pkg/logproto/indexgateway.proto index 9271ee9b2b5f4..af34e03a279cb 100644 --- a/pkg/logproto/indexgateway.proto +++ b/pkg/logproto/indexgateway.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package indexgatewaypb; -import "gogoproto/gogo.proto"; import "pkg/logproto/logproto.proto"; option go_package = "github.com/grafana/loki/pkg/logproto"; diff --git a/pkg/logproto/sketch.pb.go b/pkg/logproto/sketch.pb.go index 4a56552d984e8..c555d64d55970 100644 --- a/pkg/logproto/sketch.pb.go +++ b/pkg/logproto/sketch.pb.go @@ -7,7 +7,6 @@ import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -657,47 +656,46 @@ func init() { func init() { proto.RegisterFile("pkg/logproto/sketch.proto", fileDescriptor_7f9fd40e59b87ff3) } var fileDescriptor_7f9fd40e59b87ff3 = []byte{ - // 632 bytes of a gzipped FileDescriptorProto + // 623 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x4f, 0xd4, 0x4e, - 0x14, 0xef, 0xfc, 0x77, 0xff, 0xcb, 0xf2, 0x16, 0x88, 0x8e, 0xc4, 0xac, 0xc5, 0x4c, 0xd6, 0xc6, + 0x14, 0xef, 0xfc, 0x77, 0xff, 0xcb, 0xf2, 0x16, 0x88, 0x8e, 0xc4, 0xd4, 0xc5, 0x4c, 0xd6, 0xc6, 0x28, 0xd1, 0xb8, 0x9b, 0x40, 0x42, 0x38, 0x83, 0x07, 0x12, 0x45, 0x71, 0x20, 0xc6, 0x70, 0x31, - 0xa5, 0x1d, 0xba, 0x93, 0x6d, 0x3b, 0x4d, 0x67, 0x16, 0xf0, 0xe6, 0x27, 0x30, 0xc6, 0x4f, 0xe1, - 0xd5, 0x8f, 0xe0, 0xcd, 0x23, 0x47, 0x8e, 0x52, 0x2e, 0x1e, 0xf9, 0x08, 0x66, 0x66, 0xda, 0x85, - 0x2e, 0x31, 0x7a, 0xda, 0xf7, 0x7e, 0xef, 0xf7, 0x7e, 0xf3, 0x9b, 0x79, 0x7d, 0x0b, 0xf7, 0xb2, - 0x51, 0x34, 0x88, 0x45, 0x94, 0xe5, 0x42, 0x89, 0x81, 0x1c, 0x31, 0x15, 0x0c, 0xfb, 0x26, 0xc1, - 0xed, 0x0a, 0x76, 0x17, 0x23, 0x11, 0x09, 0xcb, 0xd0, 0x91, 0xad, 0xbb, 0x4b, 0xb5, 0xd6, 0x2a, - 0xb0, 0x45, 0xef, 0x15, 0x2c, 0xbe, 0x19, 0xfb, 0xa9, 0xe2, 0x31, 0xdb, 0x35, 0xa2, 0xdb, 0xbe, - 0xca, 0xf9, 0x09, 0x5e, 0x83, 0xd6, 0x91, 0x1f, 0x8f, 0x99, 0xec, 0xa2, 0x5e, 0x63, 0xb9, 0xb3, - 0x42, 0xfa, 0x93, 0xc6, 0x3a, 0xff, 0x2d, 0x0b, 0x94, 0xc8, 0x69, 0xc9, 0xf6, 0x76, 0xa6, 0xf5, - 0x6c, 0x1d, 0xaf, 0xc3, 0x8c, 0xf4, 0x93, 0x2c, 0xfe, 0xbb, 0xe0, 0xae, 0xa1, 0xd1, 0x8a, 0xee, - 0x7d, 0x42, 0xd3, 0x92, 0x96, 0x81, 0x1f, 0x01, 0x3a, 0xec, 0xa2, 0x1e, 0x5a, 0xee, 0xac, 0x74, - 0xff, 0x24, 0x46, 0xd1, 0x21, 0x7e, 0x00, 0x73, 0x8a, 0x27, 0x4c, 0x2a, 0x3f, 0xc9, 0xde, 0x27, - 0xb2, 0xfb, 0x5f, 0x0f, 0x2d, 0x37, 0x68, 0x67, 0x82, 0x6d, 0x4b, 0xfc, 0x14, 0x5a, 0x09, 0x53, - 0x39, 0x0f, 0xba, 0x0d, 0x63, 0xee, 0xce, 0x95, 0xde, 0x4b, 0xff, 0x80, 0xc5, 0x3b, 0x3e, 0xcf, - 0x69, 0x49, 0xf1, 0x22, 0x58, 0xa8, 0x1f, 0x82, 0x9f, 0xc1, 0x8c, 0x0a, 0x79, 0xc4, 0xa4, 0x2a, - 0xfd, 0xdc, 0xbe, 0xea, 0xdf, 0x7b, 0x6e, 0x0a, 0x5b, 0x0e, 0xad, 0x38, 0xf8, 0x3e, 0xb4, 0xc3, - 0xd0, 0x8e, 0xd0, 0x98, 0x99, 0xdb, 0x72, 0xe8, 0x04, 0xd9, 0x68, 0x43, 0xcb, 0x46, 0xde, 0x77, - 0x04, 0x33, 0x65, 0x3b, 0xbe, 0x05, 0x8d, 0x84, 0xa7, 0x46, 0x1e, 0x51, 0x1d, 0x1a, 0xc4, 0x3f, - 0x31, 0x02, 0x1a, 0xf1, 0x4f, 0x70, 0x0f, 0x3a, 0x81, 0x48, 0xb2, 0x9c, 0x49, 0xc9, 0x45, 0xda, - 0x6d, 0x98, 0xca, 0x75, 0x08, 0xaf, 0xc3, 0x6c, 0x96, 0x8b, 0x80, 0x49, 0xc9, 0xc2, 0x6e, 0xd3, - 0x5c, 0xd5, 0xbd, 0x61, 0xb5, 0xbf, 0xc9, 0x52, 0x95, 0x0b, 0x1e, 0xd2, 0x2b, 0xb2, 0xbb, 0x06, - 0xed, 0x0a, 0xc6, 0x18, 0x9a, 0x09, 0xf3, 0x2b, 0x33, 0x26, 0xc6, 0x77, 0xa1, 0x75, 0xcc, 0x78, - 0x34, 0x54, 0xa5, 0xa1, 0x32, 0xf3, 0xde, 0xc1, 0xc2, 0xa6, 0x18, 0xa7, 0x6a, 0x9b, 0xa7, 0xe5, - 0x63, 0x2d, 0xc2, 0xff, 0x21, 0xcb, 0xd4, 0xd0, 0xb4, 0xcf, 0x53, 0x9b, 0x68, 0xf4, 0x98, 0x87, - 0xca, 0x3e, 0xc8, 0x3c, 0xb5, 0x09, 0x76, 0xa1, 0x1d, 0xe8, 0x6e, 0x96, 0x4b, 0x33, 0x99, 0x79, - 0x3a, 0xc9, 0xbd, 0x6f, 0x08, 0x9a, 0x7b, 0x22, 0x7b, 0x81, 0x9f, 0x40, 0x23, 0x48, 0xe4, 0xcd, - 0x2f, 0xa1, 0x7e, 0x2e, 0xd5, 0x24, 0xfc, 0x18, 0x9a, 0x31, 0x97, 0xda, 0xe4, 0xd4, 0x98, 0xb5, - 0x52, 0xdf, 0x8c, 0xd9, 0x10, 0xf4, 0x5b, 0x0e, 0x3f, 0x64, 0x2c, 0x8f, 0x45, 0x14, 0x8b, 0xc8, - 0xbc, 0xe5, 0x1c, 0xbd, 0x0e, 0xb9, 0x2b, 0xd0, 0xd4, 0x7c, 0xed, 0x9c, 0x1d, 0xb1, 0xd4, 0x8e, - 0x7e, 0x96, 0xda, 0x44, 0xa3, 0xc6, 0x69, 0x75, 0x1f, 0x93, 0x78, 0x5f, 0x10, 0x80, 0x3e, 0xa9, - 0x5c, 0xb2, 0xd5, 0xa9, 0x25, 0x5b, 0xaa, 0xfb, 0xb1, 0xac, 0x7e, 0x7d, 0xc3, 0xdc, 0xd7, 0xd0, - 0x2a, 0x77, 0xca, 0x83, 0xa6, 0x12, 0xd9, 0xa8, 0xbc, 0xf9, 0x42, 0xbd, 0x99, 0x9a, 0xda, 0x3f, - 0x7c, 0xfc, 0x1b, 0xfb, 0xa7, 0xe7, 0xc4, 0x39, 0x3b, 0x27, 0xce, 0xe5, 0x39, 0x41, 0x1f, 0x0b, - 0x82, 0xbe, 0x16, 0x04, 0xfd, 0x28, 0x08, 0x3a, 0x2d, 0x08, 0xfa, 0x59, 0x10, 0xf4, 0xab, 0x20, - 0xce, 0x65, 0x41, 0xd0, 0xe7, 0x0b, 0xe2, 0x9c, 0x5e, 0x10, 0xe7, 0xec, 0x82, 0x38, 0xfb, 0x0f, - 0x23, 0xae, 0x86, 0xe3, 0x83, 0x7e, 0x20, 0x92, 0x41, 0x94, 0xfb, 0x87, 0x7e, 0xea, 0x0f, 0x62, - 0x31, 0xe2, 0x83, 0xeb, 0xff, 0x36, 0x07, 0x2d, 0xf3, 0xb3, 0xfa, 0x3b, 0x00, 0x00, 0xff, 0xff, - 0xa9, 0x7c, 0xb5, 0x30, 0xbf, 0x04, 0x00, 0x00, + 0x43, 0x3b, 0x74, 0x27, 0xdb, 0x76, 0x9a, 0xce, 0x2c, 0xe0, 0xcd, 0x4f, 0x60, 0x8c, 0x9f, 0xc2, + 0xab, 0x1f, 0xc1, 0x9b, 0x47, 0x8e, 0x1c, 0xa5, 0x5c, 0x3c, 0xf2, 0x11, 0xcc, 0x4c, 0xdb, 0x85, + 0x2e, 0x31, 0x7a, 0xda, 0x79, 0xbf, 0xf7, 0x7b, 0xbf, 0xf9, 0xcd, 0x7b, 0x7d, 0x0b, 0xf7, 0xd2, + 0x51, 0x38, 0x88, 0x64, 0x98, 0x66, 0x52, 0xcb, 0x81, 0x1a, 0x71, 0xed, 0x0f, 0xfb, 0x36, 0xc0, + 0xed, 0x0a, 0xee, 0x2e, 0xd5, 0x48, 0xd5, 0xa1, 0xa0, 0x79, 0xaf, 0x60, 0xf1, 0xcd, 0x98, 0x25, + 0x5a, 0x44, 0x7c, 0xd7, 0x96, 0x6f, 0x33, 0x9d, 0x89, 0x13, 0xbc, 0x06, 0xad, 0x23, 0x16, 0x8d, + 0xb9, 0x72, 0x51, 0xaf, 0xb1, 0xdc, 0x59, 0x21, 0xfd, 0x49, 0x61, 0x9d, 0xff, 0x96, 0xfb, 0x5a, + 0x66, 0xb4, 0x64, 0x7b, 0x3b, 0xd3, 0x7a, 0x45, 0x1e, 0xaf, 0xc3, 0x8c, 0x62, 0x71, 0x1a, 0xfd, + 0x5d, 0x70, 0xd7, 0xd2, 0x68, 0x45, 0xf7, 0x3e, 0xa1, 0x69, 0xc9, 0x82, 0x81, 0x1f, 0x01, 0x3a, + 0x74, 0x51, 0x0f, 0x2d, 0x77, 0x56, 0xdc, 0x3f, 0x89, 0x51, 0x74, 0x88, 0x1f, 0xc0, 0x9c, 0x16, + 0x31, 0x57, 0x9a, 0xc5, 0xe9, 0xfb, 0x58, 0xb9, 0xff, 0xf5, 0xd0, 0x72, 0x83, 0x76, 0x26, 0xd8, + 0xb6, 0xc2, 0x4f, 0xa1, 0x15, 0x73, 0x9d, 0x09, 0xdf, 0x6d, 0x58, 0x73, 0x77, 0xae, 0xf4, 0x5e, + 0xb2, 0x03, 0x1e, 0xed, 0x30, 0x91, 0xd1, 0x92, 0xe2, 0x85, 0xb0, 0x50, 0xbf, 0x04, 0x3f, 0x83, + 0x19, 0x1d, 0x88, 0x90, 0x2b, 0x5d, 0xfa, 0xb9, 0x7d, 0x55, 0xbf, 0xf7, 0xdc, 0x26, 0xb6, 0x1c, + 0x5a, 0x71, 0xf0, 0x7d, 0x68, 0x07, 0x41, 0x31, 0x2c, 0x6b, 0x66, 0x6e, 0xcb, 0xa1, 0x13, 0x64, + 0xa3, 0x0d, 0xad, 0xe2, 0xe4, 0x7d, 0x47, 0x30, 0x53, 0x96, 0xe3, 0x5b, 0xd0, 0x88, 0x45, 0x62, + 0xe5, 0x11, 0x35, 0x47, 0x8b, 0xb0, 0x13, 0x2b, 0x60, 0x10, 0x76, 0x82, 0x7b, 0xd0, 0xf1, 0x65, + 0x9c, 0x66, 0x5c, 0x29, 0x21, 0x13, 0xb7, 0x61, 0x33, 0xd7, 0x21, 0xbc, 0x0e, 0xb3, 0x69, 0x26, + 0x7d, 0xae, 0x14, 0x0f, 0xdc, 0xa6, 0x7d, 0x6a, 0xf7, 0x86, 0xd5, 0xfe, 0x26, 0x4f, 0x74, 0x26, + 0x45, 0x40, 0xaf, 0xc8, 0xdd, 0x35, 0x68, 0x57, 0x30, 0xc6, 0xd0, 0x8c, 0x39, 0xab, 0xcc, 0xd8, + 0x33, 0xbe, 0x0b, 0xad, 0x63, 0x2e, 0xc2, 0xa1, 0x2e, 0x0d, 0x95, 0x91, 0xf7, 0x0e, 0x16, 0x36, + 0xe5, 0x38, 0xd1, 0xdb, 0x22, 0x29, 0x9b, 0xb5, 0x08, 0xff, 0x07, 0x3c, 0xd5, 0x43, 0x5b, 0x3e, + 0x4f, 0x8b, 0xc0, 0xa0, 0xc7, 0x22, 0xd0, 0x45, 0x43, 0xe6, 0x69, 0x11, 0xe0, 0x2e, 0xb4, 0x7d, + 0x53, 0xcd, 0x33, 0x65, 0x27, 0x33, 0x4f, 0x27, 0xb1, 0xf7, 0x0d, 0x41, 0x73, 0x4f, 0xa6, 0x2f, + 0xf0, 0x13, 0x68, 0xf8, 0xb1, 0xba, 0xf9, 0x25, 0xd4, 0xef, 0xa5, 0x86, 0x84, 0x1f, 0x43, 0x33, + 0x12, 0xca, 0x98, 0x9c, 0x1a, 0xb3, 0x51, 0xea, 0xdb, 0x31, 0x5b, 0x82, 0xe9, 0xe5, 0xf0, 0x43, + 0xca, 0xb3, 0x48, 0x86, 0x91, 0x0c, 0x6d, 0x2f, 0xe7, 0xe8, 0x75, 0xa8, 0xbb, 0x02, 0x4d, 0xc3, + 0x37, 0xce, 0xf9, 0x11, 0x4f, 0x8a, 0xd1, 0xcf, 0xd2, 0x22, 0x30, 0xa8, 0x75, 0x5a, 0xbd, 0xc7, + 0x06, 0xde, 0x17, 0x04, 0x60, 0x6e, 0x2a, 0x97, 0x6c, 0x75, 0x6a, 0xc9, 0x96, 0xea, 0x7e, 0x0a, + 0x56, 0xbf, 0xbe, 0x61, 0xdd, 0xd7, 0xd0, 0x2a, 0x77, 0xca, 0x83, 0xa6, 0x96, 0xe9, 0xa8, 0x7c, + 0xf9, 0x42, 0xbd, 0x98, 0xda, 0xdc, 0x3f, 0x7c, 0xfc, 0x1b, 0xfb, 0xa7, 0xe7, 0xc4, 0x39, 0x3b, + 0x27, 0xce, 0xe5, 0x39, 0x41, 0x1f, 0x73, 0x82, 0xbe, 0xe6, 0x04, 0xfd, 0xc8, 0x09, 0x3a, 0xcd, + 0x09, 0xfa, 0x99, 0x13, 0xf4, 0x2b, 0x27, 0xce, 0x65, 0x4e, 0xd0, 0xe7, 0x0b, 0xe2, 0x9c, 0x5e, + 0x10, 0xe7, 0xec, 0x82, 0x38, 0xfb, 0x0f, 0x43, 0xa1, 0x87, 0xe3, 0x83, 0xbe, 0x2f, 0xe3, 0x41, + 0x98, 0xb1, 0x43, 0x96, 0xb0, 0x41, 0x24, 0x47, 0x62, 0x70, 0xfd, 0xdf, 0xe6, 0xa0, 0x65, 0x7f, + 0x56, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x24, 0x9c, 0x74, 0xb7, 0xa9, 0x04, 0x00, 0x00, } func (this *QuantileSketchMatrix) Equal(that interface{}) bool { diff --git a/pkg/logproto/sketch.proto b/pkg/logproto/sketch.proto index e84deaf20d4c8..d8ffeb0110340 100644 --- a/pkg/logproto/sketch.proto +++ b/pkg/logproto/sketch.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package logproto; -import "gogoproto/gogo.proto"; import "pkg/logproto/logproto.proto"; option go_package = "github.com/grafana/loki/pkg/logproto"; diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index 3944b4fc492a7..26b4249806d72 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -67,9 +67,7 @@ func (ng *DownstreamEngine) Query(ctx context.Context, p Params, mapped syntax.E logger: ng.logger, params: p, evaluator: NewDownstreamEvaluator(ng.downstreamable.Downstreamer(ctx)), - parse: func(_ context.Context, _ string) (syntax.Expr, error) { - return mapped, nil - }, + queryExpr: mapped, limits: ng.limits, } } diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 1b85ea05ea760..2379acdb1a4a5 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -158,14 +158,12 @@ func NewEngine(opts EngineOpts, q Querier, l Limits, logger log.Logger) *Engine } // Query creates a new LogQL query. Instant/Range type is derived from the parameters. -func (ng *Engine) Query(params Params) Query { +func (ng *Engine) Query(params Params, parsedQuery syntax.Expr) Query { return &query{ - logger: ng.logger, - params: params, - evaluator: ng.evaluatorFactory, - parse: func(_ context.Context, query string) (syntax.Expr, error) { - return syntax.ParseExpr(query) - }, + logger: ng.logger, + params: params, + evaluator: ng.evaluatorFactory, + queryExpr: parsedQuery, record: true, logExecQuery: ng.opts.LogExecutingQuery, limits: ng.limits, @@ -181,7 +179,7 @@ type Query interface { type query struct { logger log.Logger params Params - parse func(context.Context, string) (syntax.Expr, error) + queryExpr syntax.Expr limits Limits evaluator EvaluatorFactory record bool @@ -263,16 +261,11 @@ func (q *query) Eval(ctx context.Context) (promql_parser.Value, error) { ctx, cancel := context.WithTimeout(ctx, queryTimeout) defer cancel() - expr, err := q.parse(ctx, q.params.Query()) - if err != nil { - return nil, err - } - if q.checkBlocked(ctx, tenants) { return nil, logqlmodel.ErrBlocked } - switch e := expr.(type) { + switch e := q.queryExpr.(type) { case syntax.SampleExpr: value, err := q.evalSample(ctx, e) return value, err diff --git a/pkg/logqlmodel/stats/stats.pb.go b/pkg/logqlmodel/stats/stats.pb.go new file mode 100644 index 0000000000000..91cbb1e31e787 --- /dev/null +++ b/pkg/logqlmodel/stats/stats.pb.go @@ -0,0 +1,3689 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/logqlmodel/stats/stats.proto + +package stats + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Result contains LogQL query statistics. +type Result struct { + Summary Summary `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary"` + Querier Querier `protobuf:"bytes,2,opt,name=querier,proto3" json:"querier"` + Ingester Ingester `protobuf:"bytes,3,opt,name=ingester,proto3" json:"ingester"` + Caches Caches `protobuf:"bytes,4,opt,name=caches,proto3" json:"cache"` +} + +func (m *Result) Reset() { *m = Result{} } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{0} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +func (m *Result) GetSummary() Summary { + if m != nil { + return m.Summary + } + return Summary{} +} + +func (m *Result) GetQuerier() Querier { + if m != nil { + return m.Querier + } + return Querier{} +} + +func (m *Result) GetIngester() Ingester { + if m != nil { + return m.Ingester + } + return Ingester{} +} + +func (m *Result) GetCaches() Caches { + if m != nil { + return m.Caches + } + return Caches{} +} + +type Caches struct { + Chunk Cache `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk"` + Index Cache `protobuf:"bytes,2,opt,name=index,proto3" json:"index"` + Result Cache `protobuf:"bytes,3,opt,name=result,proto3" json:"result"` + StatsResult Cache `protobuf:"bytes,4,opt,name=statsResult,proto3" json:"statsResult"` + VolumeResult Cache `protobuf:"bytes,5,opt,name=volumeResult,proto3" json:"volumeResult"` +} + +func (m *Caches) Reset() { *m = Caches{} } +func (*Caches) ProtoMessage() {} +func (*Caches) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{1} +} +func (m *Caches) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Caches) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Caches.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Caches) XXX_Merge(src proto.Message) { + xxx_messageInfo_Caches.Merge(m, src) +} +func (m *Caches) XXX_Size() int { + return m.Size() +} +func (m *Caches) XXX_DiscardUnknown() { + xxx_messageInfo_Caches.DiscardUnknown(m) +} + +var xxx_messageInfo_Caches proto.InternalMessageInfo + +func (m *Caches) GetChunk() Cache { + if m != nil { + return m.Chunk + } + return Cache{} +} + +func (m *Caches) GetIndex() Cache { + if m != nil { + return m.Index + } + return Cache{} +} + +func (m *Caches) GetResult() Cache { + if m != nil { + return m.Result + } + return Cache{} +} + +func (m *Caches) GetStatsResult() Cache { + if m != nil { + return m.StatsResult + } + return Cache{} +} + +func (m *Caches) GetVolumeResult() Cache { + if m != nil { + return m.VolumeResult + } + return Cache{} +} + +// Summary is the summary of a query statistics. +type Summary struct { + // Total bytes processed per second. + BytesProcessedPerSecond int64 `protobuf:"varint,1,opt,name=bytesProcessedPerSecond,proto3" json:"bytesProcessedPerSecond"` + // Total lines processed per second. + LinesProcessedPerSecond int64 `protobuf:"varint,2,opt,name=linesProcessedPerSecond,proto3" json:"linesProcessedPerSecond"` + // Total bytes processed. Includes structured metadata bytes. + TotalBytesProcessed int64 `protobuf:"varint,3,opt,name=totalBytesProcessed,proto3" json:"totalBytesProcessed"` + // Total lines processed. + TotalLinesProcessed int64 `protobuf:"varint,4,opt,name=totalLinesProcessed,proto3" json:"totalLinesProcessed"` + // Execution time in seconds. + // In addition to internal calculations this is also returned by the HTTP API. + // Grafana expects time values to be returned in seconds as float. + ExecTime float64 `protobuf:"fixed64,5,opt,name=execTime,proto3" json:"execTime"` + // Queue time in seconds. + // In addition to internal calculations this is also returned by the HTTP API. + // Grafana expects time values to be returned in seconds as float. + QueueTime float64 `protobuf:"fixed64,6,opt,name=queueTime,proto3" json:"queueTime"` + // Subqueries exists for backwards compatibility reasons and is deprecated. Do not use. + // Instead use splits and shards + Subqueries int64 `protobuf:"varint,7,opt,name=subqueries,proto3" json:"subqueries"` + // Total number of result entries returned + TotalEntriesReturned int64 `protobuf:"varint,8,opt,name=totalEntriesReturned,proto3" json:"totalEntriesReturned"` + // Total number of splits by time + Splits int64 `protobuf:"varint,9,opt,name=splits,proto3" json:"splits"` + // Total number of shards + Shards int64 `protobuf:"varint,10,opt,name=shards,proto3" json:"shards"` + // Total lines post query filtering + TotalPostFilterLines int64 `protobuf:"varint,11,opt,name=totalPostFilterLines,proto3" json:"totalPostFilterLines"` + // Total bytes processed of metadata. + TotalStructuredMetadataBytesProcessed int64 `protobuf:"varint,12,opt,name=totalStructuredMetadataBytesProcessed,proto3" json:"totalStructuredMetadataBytesProcessed"` +} + +func (m *Summary) Reset() { *m = Summary{} } +func (*Summary) ProtoMessage() {} +func (*Summary) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{2} +} +func (m *Summary) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Summary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Summary.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Summary) XXX_Merge(src proto.Message) { + xxx_messageInfo_Summary.Merge(m, src) +} +func (m *Summary) XXX_Size() int { + return m.Size() +} +func (m *Summary) XXX_DiscardUnknown() { + xxx_messageInfo_Summary.DiscardUnknown(m) +} + +var xxx_messageInfo_Summary proto.InternalMessageInfo + +func (m *Summary) GetBytesProcessedPerSecond() int64 { + if m != nil { + return m.BytesProcessedPerSecond + } + return 0 +} + +func (m *Summary) GetLinesProcessedPerSecond() int64 { + if m != nil { + return m.LinesProcessedPerSecond + } + return 0 +} + +func (m *Summary) GetTotalBytesProcessed() int64 { + if m != nil { + return m.TotalBytesProcessed + } + return 0 +} + +func (m *Summary) GetTotalLinesProcessed() int64 { + if m != nil { + return m.TotalLinesProcessed + } + return 0 +} + +func (m *Summary) GetExecTime() float64 { + if m != nil { + return m.ExecTime + } + return 0 +} + +func (m *Summary) GetQueueTime() float64 { + if m != nil { + return m.QueueTime + } + return 0 +} + +func (m *Summary) GetSubqueries() int64 { + if m != nil { + return m.Subqueries + } + return 0 +} + +func (m *Summary) GetTotalEntriesReturned() int64 { + if m != nil { + return m.TotalEntriesReturned + } + return 0 +} + +func (m *Summary) GetSplits() int64 { + if m != nil { + return m.Splits + } + return 0 +} + +func (m *Summary) GetShards() int64 { + if m != nil { + return m.Shards + } + return 0 +} + +func (m *Summary) GetTotalPostFilterLines() int64 { + if m != nil { + return m.TotalPostFilterLines + } + return 0 +} + +func (m *Summary) GetTotalStructuredMetadataBytesProcessed() int64 { + if m != nil { + return m.TotalStructuredMetadataBytesProcessed + } + return 0 +} + +type Querier struct { + Store Store `protobuf:"bytes,1,opt,name=store,proto3" json:"store"` +} + +func (m *Querier) Reset() { *m = Querier{} } +func (*Querier) ProtoMessage() {} +func (*Querier) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{3} +} +func (m *Querier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Querier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Querier.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Querier) XXX_Merge(src proto.Message) { + xxx_messageInfo_Querier.Merge(m, src) +} +func (m *Querier) XXX_Size() int { + return m.Size() +} +func (m *Querier) XXX_DiscardUnknown() { + xxx_messageInfo_Querier.DiscardUnknown(m) +} + +var xxx_messageInfo_Querier proto.InternalMessageInfo + +func (m *Querier) GetStore() Store { + if m != nil { + return m.Store + } + return Store{} +} + +type Ingester struct { + // Total ingester reached for this query. + TotalReached int32 `protobuf:"varint,1,opt,name=totalReached,proto3" json:"totalReached"` + // Total of chunks matched by the query from ingesters + TotalChunksMatched int64 `protobuf:"varint,2,opt,name=totalChunksMatched,proto3" json:"totalChunksMatched"` + // Total of batches sent from ingesters. + TotalBatches int64 `protobuf:"varint,3,opt,name=totalBatches,proto3" json:"totalBatches"` + // Total lines sent by ingesters. + TotalLinesSent int64 `protobuf:"varint,4,opt,name=totalLinesSent,proto3" json:"totalLinesSent"` + Store Store `protobuf:"bytes,5,opt,name=store,proto3" json:"store"` +} + +func (m *Ingester) Reset() { *m = Ingester{} } +func (*Ingester) ProtoMessage() {} +func (*Ingester) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{4} +} +func (m *Ingester) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ingester) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ingester.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Ingester) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ingester.Merge(m, src) +} +func (m *Ingester) XXX_Size() int { + return m.Size() +} +func (m *Ingester) XXX_DiscardUnknown() { + xxx_messageInfo_Ingester.DiscardUnknown(m) +} + +var xxx_messageInfo_Ingester proto.InternalMessageInfo + +func (m *Ingester) GetTotalReached() int32 { + if m != nil { + return m.TotalReached + } + return 0 +} + +func (m *Ingester) GetTotalChunksMatched() int64 { + if m != nil { + return m.TotalChunksMatched + } + return 0 +} + +func (m *Ingester) GetTotalBatches() int64 { + if m != nil { + return m.TotalBatches + } + return 0 +} + +func (m *Ingester) GetTotalLinesSent() int64 { + if m != nil { + return m.TotalLinesSent + } + return 0 +} + +func (m *Ingester) GetStore() Store { + if m != nil { + return m.Store + } + return Store{} +} + +type Store struct { + // The total of chunk reference fetched from index. + TotalChunksRef int64 `protobuf:"varint,1,opt,name=totalChunksRef,proto3" json:"totalChunksRef"` + // Total number of chunks fetched. + TotalChunksDownloaded int64 `protobuf:"varint,2,opt,name=totalChunksDownloaded,proto3" json:"totalChunksDownloaded"` + // Time spent fetching chunks in nanoseconds. + ChunksDownloadTime int64 `protobuf:"varint,3,opt,name=chunksDownloadTime,proto3" json:"chunksDownloadTime"` + Chunk Chunk `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk"` + // Time spent fetching chunk refs from index. + ChunkRefsFetchTime int64 `protobuf:"varint,5,opt,name=chunkRefsFetchTime,proto3" json:"chunkRefsFetchTime"` +} + +func (m *Store) Reset() { *m = Store{} } +func (*Store) ProtoMessage() {} +func (*Store) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{5} +} +func (m *Store) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Store) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Store.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Store) XXX_Merge(src proto.Message) { + xxx_messageInfo_Store.Merge(m, src) +} +func (m *Store) XXX_Size() int { + return m.Size() +} +func (m *Store) XXX_DiscardUnknown() { + xxx_messageInfo_Store.DiscardUnknown(m) +} + +var xxx_messageInfo_Store proto.InternalMessageInfo + +func (m *Store) GetTotalChunksRef() int64 { + if m != nil { + return m.TotalChunksRef + } + return 0 +} + +func (m *Store) GetTotalChunksDownloaded() int64 { + if m != nil { + return m.TotalChunksDownloaded + } + return 0 +} + +func (m *Store) GetChunksDownloadTime() int64 { + if m != nil { + return m.ChunksDownloadTime + } + return 0 +} + +func (m *Store) GetChunk() Chunk { + if m != nil { + return m.Chunk + } + return Chunk{} +} + +func (m *Store) GetChunkRefsFetchTime() int64 { + if m != nil { + return m.ChunkRefsFetchTime + } + return 0 +} + +type Chunk struct { + // Total bytes processed but was already in memory (found in the headchunk). Includes structured metadata bytes. + HeadChunkBytes int64 `protobuf:"varint,4,opt,name=headChunkBytes,proto3" json:"headChunkBytes"` + // Total lines processed but was already in memory. (found in the headchunk) + HeadChunkLines int64 `protobuf:"varint,5,opt,name=headChunkLines,proto3" json:"headChunkLines"` + // Total bytes decompressed and processed from chunks. Includes structured metadata bytes. + DecompressedBytes int64 `protobuf:"varint,6,opt,name=decompressedBytes,proto3" json:"decompressedBytes"` + // Total lines decompressed and processed from chunks. + DecompressedLines int64 `protobuf:"varint,7,opt,name=decompressedLines,proto3" json:"decompressedLines"` + // Total bytes of compressed chunks (blocks) processed. + CompressedBytes int64 `protobuf:"varint,8,opt,name=compressedBytes,proto3" json:"compressedBytes"` + // Total duplicates found while processing. + TotalDuplicates int64 `protobuf:"varint,9,opt,name=totalDuplicates,proto3" json:"totalDuplicates"` + // Total lines post filtering + PostFilterLines int64 `protobuf:"varint,10,opt,name=postFilterLines,proto3" json:"postFilterLines"` + // Total bytes processed for metadata but was already in memory. (found in the headchunk) + HeadChunkStructuredMetadataBytes int64 `protobuf:"varint,11,opt,name=headChunkStructuredMetadataBytes,proto3" json:"headChunkStructuredMetadataBytes"` + // Total bytes of entries metadata decompressed and processed from chunks. + DecompressedStructuredMetadataBytes int64 `protobuf:"varint,12,opt,name=decompressedStructuredMetadataBytes,proto3" json:"decompressedStructuredMetadataBytes"` +} + +func (m *Chunk) Reset() { *m = Chunk{} } +func (*Chunk) ProtoMessage() {} +func (*Chunk) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{6} +} +func (m *Chunk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Chunk) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chunk.Merge(m, src) +} +func (m *Chunk) XXX_Size() int { + return m.Size() +} +func (m *Chunk) XXX_DiscardUnknown() { + xxx_messageInfo_Chunk.DiscardUnknown(m) +} + +var xxx_messageInfo_Chunk proto.InternalMessageInfo + +func (m *Chunk) GetHeadChunkBytes() int64 { + if m != nil { + return m.HeadChunkBytes + } + return 0 +} + +func (m *Chunk) GetHeadChunkLines() int64 { + if m != nil { + return m.HeadChunkLines + } + return 0 +} + +func (m *Chunk) GetDecompressedBytes() int64 { + if m != nil { + return m.DecompressedBytes + } + return 0 +} + +func (m *Chunk) GetDecompressedLines() int64 { + if m != nil { + return m.DecompressedLines + } + return 0 +} + +func (m *Chunk) GetCompressedBytes() int64 { + if m != nil { + return m.CompressedBytes + } + return 0 +} + +func (m *Chunk) GetTotalDuplicates() int64 { + if m != nil { + return m.TotalDuplicates + } + return 0 +} + +func (m *Chunk) GetPostFilterLines() int64 { + if m != nil { + return m.PostFilterLines + } + return 0 +} + +func (m *Chunk) GetHeadChunkStructuredMetadataBytes() int64 { + if m != nil { + return m.HeadChunkStructuredMetadataBytes + } + return 0 +} + +func (m *Chunk) GetDecompressedStructuredMetadataBytes() int64 { + if m != nil { + return m.DecompressedStructuredMetadataBytes + } + return 0 +} + +type Cache struct { + EntriesFound int32 `protobuf:"varint,1,opt,name=entriesFound,proto3" json:"entriesFound"` + EntriesRequested int32 `protobuf:"varint,2,opt,name=entriesRequested,proto3" json:"entriesRequested"` + EntriesStored int32 `protobuf:"varint,3,opt,name=entriesStored,proto3" json:"entriesStored"` + BytesReceived int64 `protobuf:"varint,4,opt,name=bytesReceived,proto3" json:"bytesReceived"` + BytesSent int64 `protobuf:"varint,5,opt,name=bytesSent,proto3" json:"bytesSent"` + Requests int32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests"` + DownloadTime int64 `protobuf:"varint,7,opt,name=downloadTime,proto3" json:"downloadTime"` +} + +func (m *Cache) Reset() { *m = Cache{} } +func (*Cache) ProtoMessage() {} +func (*Cache) Descriptor() ([]byte, []int) { + return fileDescriptor_6cdfe5d2aea33ebb, []int{7} +} +func (m *Cache) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Cache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Cache.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Cache) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cache.Merge(m, src) +} +func (m *Cache) XXX_Size() int { + return m.Size() +} +func (m *Cache) XXX_DiscardUnknown() { + xxx_messageInfo_Cache.DiscardUnknown(m) +} + +var xxx_messageInfo_Cache proto.InternalMessageInfo + +func (m *Cache) GetEntriesFound() int32 { + if m != nil { + return m.EntriesFound + } + return 0 +} + +func (m *Cache) GetEntriesRequested() int32 { + if m != nil { + return m.EntriesRequested + } + return 0 +} + +func (m *Cache) GetEntriesStored() int32 { + if m != nil { + return m.EntriesStored + } + return 0 +} + +func (m *Cache) GetBytesReceived() int64 { + if m != nil { + return m.BytesReceived + } + return 0 +} + +func (m *Cache) GetBytesSent() int64 { + if m != nil { + return m.BytesSent + } + return 0 +} + +func (m *Cache) GetRequests() int32 { + if m != nil { + return m.Requests + } + return 0 +} + +func (m *Cache) GetDownloadTime() int64 { + if m != nil { + return m.DownloadTime + } + return 0 +} + +func init() { + proto.RegisterType((*Result)(nil), "stats.Result") + proto.RegisterType((*Caches)(nil), "stats.Caches") + proto.RegisterType((*Summary)(nil), "stats.Summary") + proto.RegisterType((*Querier)(nil), "stats.Querier") + proto.RegisterType((*Ingester)(nil), "stats.Ingester") + proto.RegisterType((*Store)(nil), "stats.Store") + proto.RegisterType((*Chunk)(nil), "stats.Chunk") + proto.RegisterType((*Cache)(nil), "stats.Cache") +} + +func init() { proto.RegisterFile("pkg/logqlmodel/stats/stats.proto", fileDescriptor_6cdfe5d2aea33ebb) } + +var fileDescriptor_6cdfe5d2aea33ebb = []byte{ + // 1127 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x4f, 0x52, 0x9c, 0x74, 0xa7, 0x7f, 0x77, 0xda, 0x65, 0x03, 0x48, 0x76, 0x15, 0x40, 0x2c, + 0x02, 0x35, 0xe2, 0x8f, 0x84, 0x40, 0xac, 0x84, 0xdc, 0xa5, 0x52, 0xa5, 0x5d, 0x51, 0x5e, 0xe1, + 0xc2, 0xcd, 0xb5, 0xa7, 0x89, 0x55, 0xc7, 0x4e, 0xed, 0xf1, 0xb2, 0x3d, 0xc1, 0x47, 0xe0, 0x63, + 0x70, 0xe1, 0x80, 0x38, 0xf1, 0x0d, 0xf6, 0xd8, 0x1b, 0x7b, 0xb2, 0x68, 0x7a, 0x41, 0x3e, 0xad, + 0xc4, 0x1d, 0xa1, 0x79, 0x33, 0xb1, 0x3d, 0x8e, 0xa3, 0xed, 0x25, 0x9e, 0xf7, 0x7b, 0xbf, 0xdf, + 0x7b, 0xe3, 0x99, 0x79, 0xcf, 0x13, 0xb2, 0x37, 0x3d, 0x1f, 0x0d, 0x83, 0x68, 0x74, 0x11, 0x4c, + 0x22, 0x8f, 0x05, 0xc3, 0x84, 0x3b, 0x3c, 0x91, 0xbf, 0xfb, 0xd3, 0x38, 0xe2, 0x11, 0x35, 0xd0, + 0x78, 0x73, 0x77, 0x14, 0x8d, 0x22, 0x44, 0x86, 0x62, 0x24, 0x9d, 0x83, 0x7f, 0xdb, 0xa4, 0x0b, + 0x2c, 0x49, 0x03, 0x4e, 0x3f, 0x27, 0xbd, 0x24, 0x9d, 0x4c, 0x9c, 0xf8, 0xb2, 0xdf, 0xde, 0x6b, + 0x3f, 0x58, 0xfb, 0x78, 0x73, 0x5f, 0x86, 0x39, 0x91, 0xa8, 0xbd, 0xf5, 0x3c, 0xb3, 0x5a, 0x79, + 0x66, 0xcd, 0x69, 0x30, 0x1f, 0x08, 0xe9, 0x45, 0xca, 0x62, 0x9f, 0xc5, 0xfd, 0x8e, 0x26, 0xfd, + 0x56, 0xa2, 0xa5, 0x54, 0xd1, 0x60, 0x3e, 0xa0, 0x0f, 0xc9, 0xaa, 0x1f, 0x8e, 0x58, 0xc2, 0x59, + 0xdc, 0x5f, 0x41, 0xed, 0x96, 0xd2, 0x1e, 0x29, 0xd8, 0xde, 0x56, 0xe2, 0x82, 0x08, 0xc5, 0x88, + 0x7e, 0x4a, 0xba, 0xae, 0xe3, 0x8e, 0x59, 0xd2, 0x7f, 0x0d, 0xc5, 0x1b, 0x4a, 0x7c, 0x80, 0xa0, + 0xbd, 0xa1, 0xa4, 0x06, 0x92, 0x40, 0x71, 0x07, 0xbf, 0x77, 0x48, 0x57, 0x32, 0xe8, 0x47, 0xc4, + 0x70, 0xc7, 0x69, 0x78, 0xae, 0xde, 0x79, 0xbd, 0xaa, 0xaf, 0xc8, 0x05, 0x05, 0xe4, 0x43, 0x48, + 0xfc, 0xd0, 0x63, 0xcf, 0xd4, 0xbb, 0x2e, 0x91, 0x20, 0x05, 0xe4, 0x43, 0x4c, 0x33, 0xc6, 0x55, + 0x56, 0xef, 0xa8, 0x6b, 0x36, 0x95, 0x46, 0x71, 0x40, 0x3d, 0xe9, 0x01, 0x59, 0x43, 0x9a, 0xdc, + 0x20, 0xf5, 0x86, 0xba, 0x74, 0x47, 0x49, 0xab, 0x44, 0xa8, 0x1a, 0xf4, 0x90, 0xac, 0x3f, 0x8d, + 0x82, 0x74, 0xc2, 0x54, 0x14, 0xa3, 0x21, 0xca, 0xae, 0x8a, 0xa2, 0x31, 0x41, 0xb3, 0x06, 0x7f, + 0x76, 0x49, 0x4f, 0x9d, 0x04, 0xfa, 0x3d, 0xb9, 0x7f, 0x7a, 0xc9, 0x59, 0x72, 0x1c, 0x47, 0x2e, + 0x4b, 0x12, 0xe6, 0x1d, 0xb3, 0xf8, 0x84, 0xb9, 0x51, 0xe8, 0xe1, 0x32, 0xae, 0xd8, 0x6f, 0xe5, + 0x99, 0xb5, 0x8c, 0x02, 0xcb, 0x1c, 0x22, 0x6c, 0xe0, 0x87, 0x8d, 0x61, 0x3b, 0x65, 0xd8, 0x25, + 0x14, 0x58, 0xe6, 0xa0, 0x47, 0x64, 0x87, 0x47, 0xdc, 0x09, 0x6c, 0x2d, 0x2d, 0xee, 0xc4, 0x8a, + 0x7d, 0x3f, 0xcf, 0xac, 0x26, 0x37, 0x34, 0x81, 0x45, 0xa8, 0xc7, 0x5a, 0x2a, 0xdc, 0x99, 0x6a, + 0x28, 0xdd, 0x0d, 0x4d, 0x20, 0x7d, 0x40, 0x56, 0xd9, 0x33, 0xe6, 0x7e, 0xe7, 0x4f, 0x18, 0xee, + 0x49, 0xdb, 0x5e, 0x17, 0x67, 0x7c, 0x8e, 0x41, 0x31, 0xa2, 0x1f, 0x90, 0x3b, 0x17, 0x29, 0x4b, + 0x19, 0x52, 0xbb, 0x48, 0xdd, 0xc8, 0x33, 0xab, 0x04, 0xa1, 0x1c, 0xd2, 0x7d, 0x42, 0x92, 0xf4, + 0x54, 0x56, 0x57, 0xd2, 0xef, 0xe1, 0xc4, 0x36, 0xf3, 0xcc, 0xaa, 0xa0, 0x50, 0x19, 0xd3, 0xc7, + 0x64, 0x17, 0x67, 0xf7, 0x75, 0xc8, 0xd1, 0xc7, 0x78, 0x1a, 0x87, 0xcc, 0xeb, 0xaf, 0xa2, 0xb2, + 0x9f, 0x67, 0x56, 0xa3, 0x1f, 0x1a, 0x51, 0x3a, 0x20, 0xdd, 0x64, 0x1a, 0xf8, 0x3c, 0xe9, 0xdf, + 0x41, 0x3d, 0x11, 0xa7, 0x5a, 0x22, 0xa0, 0x9e, 0xc8, 0x19, 0x3b, 0xb1, 0x97, 0xf4, 0x49, 0x85, + 0x83, 0x08, 0xa8, 0x67, 0x31, 0xab, 0xe3, 0x28, 0xe1, 0x87, 0x7e, 0xc0, 0x59, 0x8c, 0xab, 0xd7, + 0x5f, 0xab, 0xcd, 0xaa, 0xe6, 0x87, 0x46, 0x94, 0xfe, 0x44, 0xde, 0x45, 0xfc, 0x84, 0xc7, 0xa9, + 0xcb, 0xd3, 0x98, 0x79, 0x4f, 0x18, 0x77, 0x3c, 0x87, 0x3b, 0xb5, 0x23, 0xb1, 0x8e, 0xe1, 0xdf, + 0xcf, 0x33, 0xeb, 0x76, 0x02, 0xb8, 0x1d, 0x6d, 0xf0, 0x25, 0xe9, 0xa9, 0x4e, 0x28, 0x9a, 0x47, + 0xc2, 0xa3, 0x98, 0xd5, 0xfa, 0xcd, 0x89, 0xc0, 0xca, 0xe6, 0x81, 0x14, 0x90, 0x8f, 0xc1, 0x6f, + 0x1d, 0xb2, 0x7a, 0x54, 0x36, 0xbc, 0x75, 0xcc, 0x09, 0x4c, 0x54, 0xae, 0xac, 0x37, 0xc3, 0xde, + 0x16, 0xc5, 0x5b, 0xc5, 0x41, 0xb3, 0xe8, 0x21, 0xa1, 0x68, 0x1f, 0x88, 0x06, 0x96, 0x3c, 0x71, + 0x38, 0x6a, 0x65, 0x51, 0xbd, 0x9e, 0x67, 0x56, 0x83, 0x17, 0x1a, 0xb0, 0x22, 0xbb, 0x8d, 0x76, + 0xa2, 0x6a, 0xa8, 0xcc, 0xae, 0x70, 0xd0, 0x2c, 0xfa, 0x05, 0xd9, 0x2c, 0x2b, 0xe0, 0x84, 0x85, + 0x5c, 0x15, 0x0c, 0xcd, 0x33, 0xab, 0xe6, 0x81, 0x9a, 0x5d, 0xae, 0x97, 0x71, 0xeb, 0xf5, 0xfa, + 0xab, 0x43, 0x0c, 0xf4, 0x17, 0x89, 0xe5, 0x4b, 0x00, 0x3b, 0x53, 0xed, 0xa9, 0x4c, 0x5c, 0x78, + 0xa0, 0x66, 0xd3, 0x6f, 0xc8, 0xbd, 0x0a, 0xf2, 0x28, 0xfa, 0x31, 0x0c, 0x22, 0xc7, 0x2b, 0x56, + 0xed, 0x8d, 0x3c, 0xb3, 0x9a, 0x09, 0xd0, 0x0c, 0x8b, 0x3d, 0x70, 0x35, 0x0c, 0xeb, 0x79, 0xa5, + 0xdc, 0x83, 0x45, 0x2f, 0x34, 0x60, 0xe5, 0x17, 0xab, 0xf6, 0x3d, 0x10, 0xd8, 0x92, 0x2f, 0xd6, + 0x3c, 0x35, 0xb0, 0xb3, 0xe4, 0x90, 0x71, 0x77, 0x5c, 0x74, 0x9d, 0x6a, 0x6a, 0xcd, 0x0b, 0x0d, + 0xd8, 0xe0, 0x0f, 0x83, 0x18, 0x98, 0x47, 0xac, 0xec, 0x98, 0x39, 0x9e, 0x4c, 0x2a, 0x0e, 0x7b, + 0x75, 0x4b, 0x75, 0x0f, 0xd4, 0x6c, 0x4d, 0x2b, 0xcb, 0xda, 0x68, 0xd0, 0xca, 0x82, 0xae, 0xd9, + 0xf4, 0x80, 0xdc, 0xf5, 0x98, 0x1b, 0x4d, 0xa6, 0x31, 0x56, 0x96, 0x4c, 0xdd, 0x45, 0xf9, 0xbd, + 0x3c, 0xb3, 0x16, 0x9d, 0xb0, 0x08, 0xd5, 0x83, 0xc8, 0x39, 0xf4, 0x9a, 0x83, 0xc8, 0x69, 0x2c, + 0x42, 0xf4, 0x21, 0xd9, 0xaa, 0xcf, 0x43, 0xf6, 0xcc, 0x9d, 0x3c, 0xb3, 0xea, 0x2e, 0xa8, 0x03, + 0x42, 0x8e, 0xc7, 0xe4, 0x51, 0x3a, 0x0d, 0x7c, 0xd7, 0x11, 0xf2, 0x3b, 0xa5, 0xbc, 0xe6, 0x82, + 0x3a, 0x20, 0xe4, 0xd3, 0x5a, 0x6f, 0x24, 0xa5, 0xbc, 0xe6, 0x82, 0x3a, 0x40, 0xa7, 0x64, 0xaf, + 0x58, 0xd8, 0x25, 0xdd, 0x4b, 0xf5, 0xda, 0x77, 0xf2, 0xcc, 0x7a, 0x25, 0x17, 0x5e, 0xc9, 0xa0, + 0x97, 0xe4, 0xed, 0xea, 0x1a, 0x2e, 0x4b, 0x2a, 0x3b, 0xf0, 0x7b, 0x79, 0x66, 0xdd, 0x86, 0x0e, + 0xb7, 0x21, 0x0d, 0xfe, 0xeb, 0x10, 0x03, 0xef, 0x39, 0xa2, 0x7d, 0x31, 0xf9, 0xc5, 0x3a, 0x8c, + 0xd2, 0x50, 0x6b, 0x9e, 0x55, 0x1c, 0x34, 0x8b, 0x7e, 0x45, 0xb6, 0xd9, 0xfc, 0x3b, 0x77, 0x91, + 0x8a, 0x36, 0x2c, 0x9b, 0x80, 0x61, 0xef, 0xe6, 0x99, 0xb5, 0xe0, 0x83, 0x05, 0x84, 0x7e, 0x46, + 0x36, 0x14, 0x86, 0x7d, 0x49, 0xde, 0x3d, 0x0c, 0xfb, 0x6e, 0x9e, 0x59, 0xba, 0x03, 0x74, 0x53, + 0x08, 0xf1, 0xb2, 0x04, 0xcc, 0x65, 0xfe, 0xd3, 0xe2, 0xa6, 0x81, 0x42, 0xcd, 0x01, 0xba, 0x29, + 0xee, 0x0c, 0x08, 0x60, 0xb7, 0x95, 0xe5, 0x85, 0x77, 0x86, 0x02, 0x84, 0x72, 0x28, 0xae, 0x22, + 0xb1, 0x9c, 0xab, 0xac, 0x25, 0x43, 0x5e, 0x45, 0xe6, 0x18, 0x14, 0x23, 0xb1, 0x80, 0x5e, 0xb5, + 0x7b, 0xf5, 0xca, 0xfe, 0x5f, 0xc5, 0x41, 0xb3, 0xec, 0xd3, 0xab, 0x6b, 0xb3, 0xf5, 0xe2, 0xda, + 0x6c, 0xbd, 0xbc, 0x36, 0xdb, 0x3f, 0xcf, 0xcc, 0xf6, 0xaf, 0x33, 0xb3, 0xfd, 0x7c, 0x66, 0xb6, + 0xaf, 0x66, 0x66, 0xfb, 0xef, 0x99, 0xd9, 0xfe, 0x67, 0x66, 0xb6, 0x5e, 0xce, 0xcc, 0xf6, 0x2f, + 0x37, 0x66, 0xeb, 0xea, 0xc6, 0x6c, 0xbd, 0xb8, 0x31, 0x5b, 0x3f, 0x7c, 0x38, 0xf2, 0xf9, 0x38, + 0x3d, 0xdd, 0x77, 0xa3, 0xc9, 0x70, 0x14, 0x3b, 0x67, 0x4e, 0xe8, 0x0c, 0x83, 0xe8, 0xdc, 0x1f, + 0x36, 0xfd, 0xe3, 0x39, 0xed, 0xe2, 0xff, 0x99, 0x4f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x14, + 0xee, 0x83, 0x9b, 0x10, 0x0d, 0x00, 0x00, +} + +func (this *Result) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Result) + if !ok { + that2, ok := that.(Result) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Summary.Equal(&that1.Summary) { + return false + } + if !this.Querier.Equal(&that1.Querier) { + return false + } + if !this.Ingester.Equal(&that1.Ingester) { + return false + } + if !this.Caches.Equal(&that1.Caches) { + return false + } + return true +} +func (this *Caches) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Caches) + if !ok { + that2, ok := that.(Caches) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Chunk.Equal(&that1.Chunk) { + return false + } + if !this.Index.Equal(&that1.Index) { + return false + } + if !this.Result.Equal(&that1.Result) { + return false + } + if !this.StatsResult.Equal(&that1.StatsResult) { + return false + } + if !this.VolumeResult.Equal(&that1.VolumeResult) { + return false + } + return true +} +func (this *Summary) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Summary) + if !ok { + that2, ok := that.(Summary) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.BytesProcessedPerSecond != that1.BytesProcessedPerSecond { + return false + } + if this.LinesProcessedPerSecond != that1.LinesProcessedPerSecond { + return false + } + if this.TotalBytesProcessed != that1.TotalBytesProcessed { + return false + } + if this.TotalLinesProcessed != that1.TotalLinesProcessed { + return false + } + if this.ExecTime != that1.ExecTime { + return false + } + if this.QueueTime != that1.QueueTime { + return false + } + if this.Subqueries != that1.Subqueries { + return false + } + if this.TotalEntriesReturned != that1.TotalEntriesReturned { + return false + } + if this.Splits != that1.Splits { + return false + } + if this.Shards != that1.Shards { + return false + } + if this.TotalPostFilterLines != that1.TotalPostFilterLines { + return false + } + if this.TotalStructuredMetadataBytesProcessed != that1.TotalStructuredMetadataBytesProcessed { + return false + } + return true +} +func (this *Querier) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Querier) + if !ok { + that2, ok := that.(Querier) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Store.Equal(&that1.Store) { + return false + } + return true +} +func (this *Ingester) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Ingester) + if !ok { + that2, ok := that.(Ingester) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TotalReached != that1.TotalReached { + return false + } + if this.TotalChunksMatched != that1.TotalChunksMatched { + return false + } + if this.TotalBatches != that1.TotalBatches { + return false + } + if this.TotalLinesSent != that1.TotalLinesSent { + return false + } + if !this.Store.Equal(&that1.Store) { + return false + } + return true +} +func (this *Store) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Store) + if !ok { + that2, ok := that.(Store) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TotalChunksRef != that1.TotalChunksRef { + return false + } + if this.TotalChunksDownloaded != that1.TotalChunksDownloaded { + return false + } + if this.ChunksDownloadTime != that1.ChunksDownloadTime { + return false + } + if !this.Chunk.Equal(&that1.Chunk) { + return false + } + if this.ChunkRefsFetchTime != that1.ChunkRefsFetchTime { + return false + } + return true +} +func (this *Chunk) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Chunk) + if !ok { + that2, ok := that.(Chunk) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.HeadChunkBytes != that1.HeadChunkBytes { + return false + } + if this.HeadChunkLines != that1.HeadChunkLines { + return false + } + if this.DecompressedBytes != that1.DecompressedBytes { + return false + } + if this.DecompressedLines != that1.DecompressedLines { + return false + } + if this.CompressedBytes != that1.CompressedBytes { + return false + } + if this.TotalDuplicates != that1.TotalDuplicates { + return false + } + if this.PostFilterLines != that1.PostFilterLines { + return false + } + if this.HeadChunkStructuredMetadataBytes != that1.HeadChunkStructuredMetadataBytes { + return false + } + if this.DecompressedStructuredMetadataBytes != that1.DecompressedStructuredMetadataBytes { + return false + } + return true +} +func (this *Cache) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Cache) + if !ok { + that2, ok := that.(Cache) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.EntriesFound != that1.EntriesFound { + return false + } + if this.EntriesRequested != that1.EntriesRequested { + return false + } + if this.EntriesStored != that1.EntriesStored { + return false + } + if this.BytesReceived != that1.BytesReceived { + return false + } + if this.BytesSent != that1.BytesSent { + return false + } + if this.Requests != that1.Requests { + return false + } + if this.DownloadTime != that1.DownloadTime { + return false + } + return true +} +func (this *Result) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&stats.Result{") + s = append(s, "Summary: "+strings.Replace(this.Summary.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Querier: "+strings.Replace(this.Querier.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Ingester: "+strings.Replace(this.Ingester.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Caches: "+strings.Replace(this.Caches.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Caches) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&stats.Caches{") + s = append(s, "Chunk: "+strings.Replace(this.Chunk.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Index: "+strings.Replace(this.Index.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Result: "+strings.Replace(this.Result.GoString(), `&`, ``, 1)+",\n") + s = append(s, "StatsResult: "+strings.Replace(this.StatsResult.GoString(), `&`, ``, 1)+",\n") + s = append(s, "VolumeResult: "+strings.Replace(this.VolumeResult.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Summary) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 16) + s = append(s, "&stats.Summary{") + s = append(s, "BytesProcessedPerSecond: "+fmt.Sprintf("%#v", this.BytesProcessedPerSecond)+",\n") + s = append(s, "LinesProcessedPerSecond: "+fmt.Sprintf("%#v", this.LinesProcessedPerSecond)+",\n") + s = append(s, "TotalBytesProcessed: "+fmt.Sprintf("%#v", this.TotalBytesProcessed)+",\n") + s = append(s, "TotalLinesProcessed: "+fmt.Sprintf("%#v", this.TotalLinesProcessed)+",\n") + s = append(s, "ExecTime: "+fmt.Sprintf("%#v", this.ExecTime)+",\n") + s = append(s, "QueueTime: "+fmt.Sprintf("%#v", this.QueueTime)+",\n") + s = append(s, "Subqueries: "+fmt.Sprintf("%#v", this.Subqueries)+",\n") + s = append(s, "TotalEntriesReturned: "+fmt.Sprintf("%#v", this.TotalEntriesReturned)+",\n") + s = append(s, "Splits: "+fmt.Sprintf("%#v", this.Splits)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + s = append(s, "TotalPostFilterLines: "+fmt.Sprintf("%#v", this.TotalPostFilterLines)+",\n") + s = append(s, "TotalStructuredMetadataBytesProcessed: "+fmt.Sprintf("%#v", this.TotalStructuredMetadataBytesProcessed)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Querier) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&stats.Querier{") + s = append(s, "Store: "+strings.Replace(this.Store.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Ingester) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&stats.Ingester{") + s = append(s, "TotalReached: "+fmt.Sprintf("%#v", this.TotalReached)+",\n") + s = append(s, "TotalChunksMatched: "+fmt.Sprintf("%#v", this.TotalChunksMatched)+",\n") + s = append(s, "TotalBatches: "+fmt.Sprintf("%#v", this.TotalBatches)+",\n") + s = append(s, "TotalLinesSent: "+fmt.Sprintf("%#v", this.TotalLinesSent)+",\n") + s = append(s, "Store: "+strings.Replace(this.Store.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Store) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&stats.Store{") + s = append(s, "TotalChunksRef: "+fmt.Sprintf("%#v", this.TotalChunksRef)+",\n") + s = append(s, "TotalChunksDownloaded: "+fmt.Sprintf("%#v", this.TotalChunksDownloaded)+",\n") + s = append(s, "ChunksDownloadTime: "+fmt.Sprintf("%#v", this.ChunksDownloadTime)+",\n") + s = append(s, "Chunk: "+strings.Replace(this.Chunk.GoString(), `&`, ``, 1)+",\n") + s = append(s, "ChunkRefsFetchTime: "+fmt.Sprintf("%#v", this.ChunkRefsFetchTime)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Chunk) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 13) + s = append(s, "&stats.Chunk{") + s = append(s, "HeadChunkBytes: "+fmt.Sprintf("%#v", this.HeadChunkBytes)+",\n") + s = append(s, "HeadChunkLines: "+fmt.Sprintf("%#v", this.HeadChunkLines)+",\n") + s = append(s, "DecompressedBytes: "+fmt.Sprintf("%#v", this.DecompressedBytes)+",\n") + s = append(s, "DecompressedLines: "+fmt.Sprintf("%#v", this.DecompressedLines)+",\n") + s = append(s, "CompressedBytes: "+fmt.Sprintf("%#v", this.CompressedBytes)+",\n") + s = append(s, "TotalDuplicates: "+fmt.Sprintf("%#v", this.TotalDuplicates)+",\n") + s = append(s, "PostFilterLines: "+fmt.Sprintf("%#v", this.PostFilterLines)+",\n") + s = append(s, "HeadChunkStructuredMetadataBytes: "+fmt.Sprintf("%#v", this.HeadChunkStructuredMetadataBytes)+",\n") + s = append(s, "DecompressedStructuredMetadataBytes: "+fmt.Sprintf("%#v", this.DecompressedStructuredMetadataBytes)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Cache) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 11) + s = append(s, "&stats.Cache{") + s = append(s, "EntriesFound: "+fmt.Sprintf("%#v", this.EntriesFound)+",\n") + s = append(s, "EntriesRequested: "+fmt.Sprintf("%#v", this.EntriesRequested)+",\n") + s = append(s, "EntriesStored: "+fmt.Sprintf("%#v", this.EntriesStored)+",\n") + s = append(s, "BytesReceived: "+fmt.Sprintf("%#v", this.BytesReceived)+",\n") + s = append(s, "BytesSent: "+fmt.Sprintf("%#v", this.BytesSent)+",\n") + s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") + s = append(s, "DownloadTime: "+fmt.Sprintf("%#v", this.DownloadTime)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringStats(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Result) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Caches.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Ingester.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Querier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Summary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Caches) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Caches) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Caches) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.VolumeResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.StatsResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Index.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Chunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Summary) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Summary) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Summary) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalStructuredMetadataBytesProcessed != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalStructuredMetadataBytesProcessed)) + i-- + dAtA[i] = 0x60 + } + if m.TotalPostFilterLines != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalPostFilterLines)) + i-- + dAtA[i] = 0x58 + } + if m.Shards != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.Shards)) + i-- + dAtA[i] = 0x50 + } + if m.Splits != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.Splits)) + i-- + dAtA[i] = 0x48 + } + if m.TotalEntriesReturned != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalEntriesReturned)) + i-- + dAtA[i] = 0x40 + } + if m.Subqueries != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.Subqueries)) + i-- + dAtA[i] = 0x38 + } + if m.QueueTime != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.QueueTime)))) + i-- + dAtA[i] = 0x31 + } + if m.ExecTime != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ExecTime)))) + i-- + dAtA[i] = 0x29 + } + if m.TotalLinesProcessed != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalLinesProcessed)) + i-- + dAtA[i] = 0x20 + } + if m.TotalBytesProcessed != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalBytesProcessed)) + i-- + dAtA[i] = 0x18 + } + if m.LinesProcessedPerSecond != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.LinesProcessedPerSecond)) + i-- + dAtA[i] = 0x10 + } + if m.BytesProcessedPerSecond != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.BytesProcessedPerSecond)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Querier) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Querier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Querier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Ingester) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Ingester) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ingester) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.TotalLinesSent != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalLinesSent)) + i-- + dAtA[i] = 0x20 + } + if m.TotalBatches != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalBatches)) + i-- + dAtA[i] = 0x18 + } + if m.TotalChunksMatched != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksMatched)) + i-- + dAtA[i] = 0x10 + } + if m.TotalReached != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalReached)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Store) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Store) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Store) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChunkRefsFetchTime != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ChunkRefsFetchTime)) + i-- + dAtA[i] = 0x28 + } + { + size, err := m.Chunk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.ChunksDownloadTime != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ChunksDownloadTime)) + i-- + dAtA[i] = 0x18 + } + if m.TotalChunksDownloaded != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksDownloaded)) + i-- + dAtA[i] = 0x10 + } + if m.TotalChunksRef != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalChunksRef)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Chunk) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + if m.DecompressedStructuredMetadataBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.DecompressedStructuredMetadataBytes)) + i-- + dAtA[i] = 0x60 + } + if m.HeadChunkStructuredMetadataBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkStructuredMetadataBytes)) + i-- + dAtA[i] = 0x58 + } + if m.PostFilterLines != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.PostFilterLines)) + i-- + dAtA[i] = 0x50 + } + if m.TotalDuplicates != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalDuplicates)) + i-- + dAtA[i] = 0x48 + } + if m.CompressedBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.CompressedBytes)) + i-- + dAtA[i] = 0x40 + } + if m.DecompressedLines != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.DecompressedLines)) + i-- + dAtA[i] = 0x38 + } + if m.DecompressedBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.DecompressedBytes)) + i-- + dAtA[i] = 0x30 + } + if m.HeadChunkLines != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkLines)) + i-- + dAtA[i] = 0x28 + } + if m.HeadChunkBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.HeadChunkBytes)) + i-- + dAtA[i] = 0x20 + } + return len(dAtA) - i, nil +} + +func (m *Cache) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Cache) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cache) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DownloadTime != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.DownloadTime)) + i-- + dAtA[i] = 0x38 + } + if m.Requests != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.Requests)) + i-- + dAtA[i] = 0x30 + } + if m.BytesSent != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.BytesSent)) + i-- + dAtA[i] = 0x28 + } + if m.BytesReceived != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.BytesReceived)) + i-- + dAtA[i] = 0x20 + } + if m.EntriesStored != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.EntriesStored)) + i-- + dAtA[i] = 0x18 + } + if m.EntriesRequested != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.EntriesRequested)) + i-- + dAtA[i] = 0x10 + } + if m.EntriesFound != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.EntriesFound)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintStats(dAtA []byte, offset int, v uint64) int { + offset -= sovStats(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Summary.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.Querier.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.Ingester.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.Caches.Size() + n += 1 + l + sovStats(uint64(l)) + return n +} + +func (m *Caches) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Chunk.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.Index.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.Result.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.StatsResult.Size() + n += 1 + l + sovStats(uint64(l)) + l = m.VolumeResult.Size() + n += 1 + l + sovStats(uint64(l)) + return n +} + +func (m *Summary) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BytesProcessedPerSecond != 0 { + n += 1 + sovStats(uint64(m.BytesProcessedPerSecond)) + } + if m.LinesProcessedPerSecond != 0 { + n += 1 + sovStats(uint64(m.LinesProcessedPerSecond)) + } + if m.TotalBytesProcessed != 0 { + n += 1 + sovStats(uint64(m.TotalBytesProcessed)) + } + if m.TotalLinesProcessed != 0 { + n += 1 + sovStats(uint64(m.TotalLinesProcessed)) + } + if m.ExecTime != 0 { + n += 9 + } + if m.QueueTime != 0 { + n += 9 + } + if m.Subqueries != 0 { + n += 1 + sovStats(uint64(m.Subqueries)) + } + if m.TotalEntriesReturned != 0 { + n += 1 + sovStats(uint64(m.TotalEntriesReturned)) + } + if m.Splits != 0 { + n += 1 + sovStats(uint64(m.Splits)) + } + if m.Shards != 0 { + n += 1 + sovStats(uint64(m.Shards)) + } + if m.TotalPostFilterLines != 0 { + n += 1 + sovStats(uint64(m.TotalPostFilterLines)) + } + if m.TotalStructuredMetadataBytesProcessed != 0 { + n += 1 + sovStats(uint64(m.TotalStructuredMetadataBytesProcessed)) + } + return n +} + +func (m *Querier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Store.Size() + n += 1 + l + sovStats(uint64(l)) + return n +} + +func (m *Ingester) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalReached != 0 { + n += 1 + sovStats(uint64(m.TotalReached)) + } + if m.TotalChunksMatched != 0 { + n += 1 + sovStats(uint64(m.TotalChunksMatched)) + } + if m.TotalBatches != 0 { + n += 1 + sovStats(uint64(m.TotalBatches)) + } + if m.TotalLinesSent != 0 { + n += 1 + sovStats(uint64(m.TotalLinesSent)) + } + l = m.Store.Size() + n += 1 + l + sovStats(uint64(l)) + return n +} + +func (m *Store) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalChunksRef != 0 { + n += 1 + sovStats(uint64(m.TotalChunksRef)) + } + if m.TotalChunksDownloaded != 0 { + n += 1 + sovStats(uint64(m.TotalChunksDownloaded)) + } + if m.ChunksDownloadTime != 0 { + n += 1 + sovStats(uint64(m.ChunksDownloadTime)) + } + l = m.Chunk.Size() + n += 1 + l + sovStats(uint64(l)) + if m.ChunkRefsFetchTime != 0 { + n += 1 + sovStats(uint64(m.ChunkRefsFetchTime)) + } + return n +} + +func (m *Chunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HeadChunkBytes != 0 { + n += 1 + sovStats(uint64(m.HeadChunkBytes)) + } + if m.HeadChunkLines != 0 { + n += 1 + sovStats(uint64(m.HeadChunkLines)) + } + if m.DecompressedBytes != 0 { + n += 1 + sovStats(uint64(m.DecompressedBytes)) + } + if m.DecompressedLines != 0 { + n += 1 + sovStats(uint64(m.DecompressedLines)) + } + if m.CompressedBytes != 0 { + n += 1 + sovStats(uint64(m.CompressedBytes)) + } + if m.TotalDuplicates != 0 { + n += 1 + sovStats(uint64(m.TotalDuplicates)) + } + if m.PostFilterLines != 0 { + n += 1 + sovStats(uint64(m.PostFilterLines)) + } + if m.HeadChunkStructuredMetadataBytes != 0 { + n += 1 + sovStats(uint64(m.HeadChunkStructuredMetadataBytes)) + } + if m.DecompressedStructuredMetadataBytes != 0 { + n += 1 + sovStats(uint64(m.DecompressedStructuredMetadataBytes)) + } + return n +} + +func (m *Cache) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EntriesFound != 0 { + n += 1 + sovStats(uint64(m.EntriesFound)) + } + if m.EntriesRequested != 0 { + n += 1 + sovStats(uint64(m.EntriesRequested)) + } + if m.EntriesStored != 0 { + n += 1 + sovStats(uint64(m.EntriesStored)) + } + if m.BytesReceived != 0 { + n += 1 + sovStats(uint64(m.BytesReceived)) + } + if m.BytesSent != 0 { + n += 1 + sovStats(uint64(m.BytesSent)) + } + if m.Requests != 0 { + n += 1 + sovStats(uint64(m.Requests)) + } + if m.DownloadTime != 0 { + n += 1 + sovStats(uint64(m.DownloadTime)) + } + return n +} + +func sovStats(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStats(x uint64) (n int) { + return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Result) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Result{`, + `Summary:` + strings.Replace(strings.Replace(this.Summary.String(), "Summary", "Summary", 1), `&`, ``, 1) + `,`, + `Querier:` + strings.Replace(strings.Replace(this.Querier.String(), "Querier", "Querier", 1), `&`, ``, 1) + `,`, + `Ingester:` + strings.Replace(strings.Replace(this.Ingester.String(), "Ingester", "Ingester", 1), `&`, ``, 1) + `,`, + `Caches:` + strings.Replace(strings.Replace(this.Caches.String(), "Caches", "Caches", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Caches) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Caches{`, + `Chunk:` + strings.Replace(strings.Replace(this.Chunk.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, + `Index:` + strings.Replace(strings.Replace(this.Index.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, + `Result:` + strings.Replace(strings.Replace(this.Result.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, + `StatsResult:` + strings.Replace(strings.Replace(this.StatsResult.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, + `VolumeResult:` + strings.Replace(strings.Replace(this.VolumeResult.String(), "Cache", "Cache", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Summary) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Summary{`, + `BytesProcessedPerSecond:` + fmt.Sprintf("%v", this.BytesProcessedPerSecond) + `,`, + `LinesProcessedPerSecond:` + fmt.Sprintf("%v", this.LinesProcessedPerSecond) + `,`, + `TotalBytesProcessed:` + fmt.Sprintf("%v", this.TotalBytesProcessed) + `,`, + `TotalLinesProcessed:` + fmt.Sprintf("%v", this.TotalLinesProcessed) + `,`, + `ExecTime:` + fmt.Sprintf("%v", this.ExecTime) + `,`, + `QueueTime:` + fmt.Sprintf("%v", this.QueueTime) + `,`, + `Subqueries:` + fmt.Sprintf("%v", this.Subqueries) + `,`, + `TotalEntriesReturned:` + fmt.Sprintf("%v", this.TotalEntriesReturned) + `,`, + `Splits:` + fmt.Sprintf("%v", this.Splits) + `,`, + `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `TotalPostFilterLines:` + fmt.Sprintf("%v", this.TotalPostFilterLines) + `,`, + `TotalStructuredMetadataBytesProcessed:` + fmt.Sprintf("%v", this.TotalStructuredMetadataBytesProcessed) + `,`, + `}`, + }, "") + return s +} +func (this *Querier) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Querier{`, + `Store:` + strings.Replace(strings.Replace(this.Store.String(), "Store", "Store", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Ingester) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Ingester{`, + `TotalReached:` + fmt.Sprintf("%v", this.TotalReached) + `,`, + `TotalChunksMatched:` + fmt.Sprintf("%v", this.TotalChunksMatched) + `,`, + `TotalBatches:` + fmt.Sprintf("%v", this.TotalBatches) + `,`, + `TotalLinesSent:` + fmt.Sprintf("%v", this.TotalLinesSent) + `,`, + `Store:` + strings.Replace(strings.Replace(this.Store.String(), "Store", "Store", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *Store) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Store{`, + `TotalChunksRef:` + fmt.Sprintf("%v", this.TotalChunksRef) + `,`, + `TotalChunksDownloaded:` + fmt.Sprintf("%v", this.TotalChunksDownloaded) + `,`, + `ChunksDownloadTime:` + fmt.Sprintf("%v", this.ChunksDownloadTime) + `,`, + `Chunk:` + strings.Replace(strings.Replace(this.Chunk.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + `,`, + `ChunkRefsFetchTime:` + fmt.Sprintf("%v", this.ChunkRefsFetchTime) + `,`, + `}`, + }, "") + return s +} +func (this *Chunk) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Chunk{`, + `HeadChunkBytes:` + fmt.Sprintf("%v", this.HeadChunkBytes) + `,`, + `HeadChunkLines:` + fmt.Sprintf("%v", this.HeadChunkLines) + `,`, + `DecompressedBytes:` + fmt.Sprintf("%v", this.DecompressedBytes) + `,`, + `DecompressedLines:` + fmt.Sprintf("%v", this.DecompressedLines) + `,`, + `CompressedBytes:` + fmt.Sprintf("%v", this.CompressedBytes) + `,`, + `TotalDuplicates:` + fmt.Sprintf("%v", this.TotalDuplicates) + `,`, + `PostFilterLines:` + fmt.Sprintf("%v", this.PostFilterLines) + `,`, + `HeadChunkStructuredMetadataBytes:` + fmt.Sprintf("%v", this.HeadChunkStructuredMetadataBytes) + `,`, + `DecompressedStructuredMetadataBytes:` + fmt.Sprintf("%v", this.DecompressedStructuredMetadataBytes) + `,`, + `}`, + }, "") + return s +} +func (this *Cache) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Cache{`, + `EntriesFound:` + fmt.Sprintf("%v", this.EntriesFound) + `,`, + `EntriesRequested:` + fmt.Sprintf("%v", this.EntriesRequested) + `,`, + `EntriesStored:` + fmt.Sprintf("%v", this.EntriesStored) + `,`, + `BytesReceived:` + fmt.Sprintf("%v", this.BytesReceived) + `,`, + `BytesSent:` + fmt.Sprintf("%v", this.BytesSent) + `,`, + `Requests:` + fmt.Sprintf("%v", this.Requests) + `,`, + `DownloadTime:` + fmt.Sprintf("%v", this.DownloadTime) + `,`, + `}`, + }, "") + return s +} +func valueToStringStats(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Result) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Summary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Querier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Querier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ingester", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Ingester.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Caches", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Caches.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Caches) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Caches: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Caches: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Chunk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Index.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatsResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StatsResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VolumeResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Summary) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Summary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Summary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BytesProcessedPerSecond", wireType) + } + m.BytesProcessedPerSecond = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BytesProcessedPerSecond |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LinesProcessedPerSecond", wireType) + } + m.LinesProcessedPerSecond = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LinesProcessedPerSecond |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesProcessed", wireType) + } + m.TotalBytesProcessed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBytesProcessed |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalLinesProcessed", wireType) + } + m.TotalLinesProcessed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalLinesProcessed |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecTime", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.ExecTime = float64(math.Float64frombits(v)) + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueTime", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.QueueTime = float64(math.Float64frombits(v)) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Subqueries", wireType) + } + m.Subqueries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Subqueries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalEntriesReturned", wireType) + } + m.TotalEntriesReturned = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalEntriesReturned |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Splits", wireType) + } + m.Splits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Splits |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + m.Shards = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Shards |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPostFilterLines", wireType) + } + m.TotalPostFilterLines = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalPostFilterLines |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStructuredMetadataBytesProcessed", wireType) + } + m.TotalStructuredMetadataBytesProcessed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStructuredMetadataBytesProcessed |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Querier) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Querier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Querier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Ingester) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Ingester: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ingester: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalReached", wireType) + } + m.TotalReached = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalReached |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksMatched", wireType) + } + m.TotalChunksMatched = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalChunksMatched |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBatches", wireType) + } + m.TotalBatches = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBatches |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalLinesSent", wireType) + } + m.TotalLinesSent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalLinesSent |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Store.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Store) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Store: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Store: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksRef", wireType) + } + m.TotalChunksRef = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalChunksRef |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalChunksDownloaded", wireType) + } + m.TotalChunksDownloaded = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalChunksDownloaded |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunksDownloadTime", wireType) + } + m.ChunksDownloadTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunksDownloadTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Chunk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkRefsFetchTime", wireType) + } + m.ChunkRefsFetchTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChunkRefsFetchTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Chunk) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkBytes", wireType) + } + m.HeadChunkBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeadChunkBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkLines", wireType) + } + m.HeadChunkLines = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeadChunkLines |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DecompressedBytes", wireType) + } + m.DecompressedBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DecompressedBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DecompressedLines", wireType) + } + m.DecompressedLines = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DecompressedLines |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CompressedBytes", wireType) + } + m.CompressedBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CompressedBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDuplicates", wireType) + } + m.TotalDuplicates = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalDuplicates |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PostFilterLines", wireType) + } + m.PostFilterLines = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PostFilterLines |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeadChunkStructuredMetadataBytes", wireType) + } + m.HeadChunkStructuredMetadataBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeadChunkStructuredMetadataBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DecompressedStructuredMetadataBytes", wireType) + } + m.DecompressedStructuredMetadataBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DecompressedStructuredMetadataBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Cache) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Cache: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Cache: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EntriesFound", wireType) + } + m.EntriesFound = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EntriesFound |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EntriesRequested", wireType) + } + m.EntriesRequested = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EntriesRequested |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EntriesStored", wireType) + } + m.EntriesStored = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EntriesStored |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BytesReceived", wireType) + } + m.BytesReceived = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BytesReceived |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BytesSent", wireType) + } + m.BytesSent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BytesSent |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + } + m.Requests = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Requests |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadTime", wireType) + } + m.DownloadTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DownloadTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStats(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStats + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + 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 := skipStats(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go b/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go new file mode 100644 index 0000000000000..3773159c0cc37 --- /dev/null +++ b/pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.pb.go @@ -0,0 +1,1014 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto + +package frontendv2pb + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + httpgrpc "github.com/grafana/dskit/httpgrpc" + queryrange "github.com/grafana/loki/pkg/querier/queryrange" + stats "github.com/grafana/loki/pkg/querier/stats" + 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" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryResultRequest struct { + QueryID uint64 `protobuf:"varint,1,opt,name=queryID,proto3" json:"queryID,omitempty"` + // Types that are valid to be assigned to Response: + // *QueryResultRequest_HttpResponse + // *QueryResultRequest_QueryResponse + Response isQueryResultRequest_Response `protobuf_oneof:"response"` + Stats *stats.Stats `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"` +} + +func (m *QueryResultRequest) Reset() { *m = QueryResultRequest{} } +func (*QueryResultRequest) ProtoMessage() {} +func (*QueryResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_85a7e5cdf8261f06, []int{0} +} +func (m *QueryResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResultRequest.Merge(m, src) +} +func (m *QueryResultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResultRequest proto.InternalMessageInfo + +type isQueryResultRequest_Response interface { + isQueryResultRequest_Response() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryResultRequest_HttpResponse struct { + HttpResponse *httpgrpc.HTTPResponse `protobuf:"bytes,2,opt,name=httpResponse,proto3,oneof"` +} +type QueryResultRequest_QueryResponse struct { + QueryResponse *queryrange.QueryResponse `protobuf:"bytes,4,opt,name=queryResponse,proto3,oneof"` +} + +func (*QueryResultRequest_HttpResponse) isQueryResultRequest_Response() {} +func (*QueryResultRequest_QueryResponse) isQueryResultRequest_Response() {} + +func (m *QueryResultRequest) GetResponse() isQueryResultRequest_Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *QueryResultRequest) GetQueryID() uint64 { + if m != nil { + return m.QueryID + } + return 0 +} + +// Deprecated: Do not use. +func (m *QueryResultRequest) GetHttpResponse() *httpgrpc.HTTPResponse { + if x, ok := m.GetResponse().(*QueryResultRequest_HttpResponse); ok { + return x.HttpResponse + } + return nil +} + +func (m *QueryResultRequest) GetQueryResponse() *queryrange.QueryResponse { + if x, ok := m.GetResponse().(*QueryResultRequest_QueryResponse); ok { + return x.QueryResponse + } + return nil +} + +func (m *QueryResultRequest) GetStats() *stats.Stats { + if m != nil { + return m.Stats + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryResultRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryResultRequest_HttpResponse)(nil), + (*QueryResultRequest_QueryResponse)(nil), + } +} + +type QueryResultResponse struct { +} + +func (m *QueryResultResponse) Reset() { *m = QueryResultResponse{} } +func (*QueryResultResponse) ProtoMessage() {} +func (*QueryResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_85a7e5cdf8261f06, []int{1} +} +func (m *QueryResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResultResponse.Merge(m, src) +} +func (m *QueryResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResultResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryResultRequest)(nil), "frontendv2pb.QueryResultRequest") + proto.RegisterType((*QueryResultResponse)(nil), "frontendv2pb.QueryResultResponse") +} + +func init() { + proto.RegisterFile("pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto", fileDescriptor_85a7e5cdf8261f06) +} + +var fileDescriptor_85a7e5cdf8261f06 = []byte{ + // 379 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xbd, 0x4e, 0xc3, 0x30, + 0x18, 0xb4, 0x4b, 0xf9, 0x91, 0x5b, 0x16, 0xf3, 0xa3, 0x50, 0x09, 0xab, 0x74, 0xa1, 0x53, 0x82, + 0xc2, 0xc2, 0x08, 0x11, 0xaa, 0xca, 0x46, 0x43, 0x27, 0xb6, 0xb4, 0x75, 0xd3, 0xd0, 0x12, 0xa7, + 0x8e, 0x53, 0x89, 0x8d, 0x47, 0xe0, 0x31, 0x78, 0x14, 0xc6, 0x8e, 0x1d, 0x69, 0xb2, 0x30, 0xf6, + 0x11, 0x50, 0xe2, 0x34, 0x72, 0x84, 0xc4, 0xe2, 0x9c, 0x7d, 0x77, 0x5f, 0xee, 0xf3, 0x67, 0x74, + 0x13, 0x4c, 0x5d, 0x63, 0xc6, 0xa6, 0xde, 0x98, 0x33, 0x5f, 0x50, 0x7f, 0x64, 0x14, 0x60, 0x61, + 0x16, 0x78, 0x61, 0x06, 0x83, 0x62, 0xa3, 0x07, 0x9c, 0x09, 0x86, 0xeb, 0x2a, 0xd9, 0xb8, 0x72, + 0x3d, 0x31, 0x89, 0x06, 0xfa, 0x90, 0xbd, 0x1a, 0x2e, 0x77, 0xc6, 0x8e, 0xef, 0x18, 0xa3, 0x70, + 0xea, 0x09, 0x63, 0x22, 0x44, 0xe0, 0xf2, 0x60, 0x58, 0x00, 0xe9, 0x6f, 0x1c, 0xbb, 0xcc, 0x65, + 0x19, 0x34, 0x52, 0x94, 0x9f, 0x5e, 0xa6, 0x79, 0xe6, 0x11, 0xe5, 0x1e, 0xe5, 0xd9, 0xf7, 0x8d, + 0x3b, 0xbe, 0x4b, 0x15, 0x98, 0x0b, 0xcf, 0x55, 0x61, 0x28, 0x1c, 0x11, 0xca, 0x55, 0xd2, 0xad, + 0x04, 0x22, 0xdc, 0x4b, 0x3d, 0x36, 0x0d, 0xa3, 0x99, 0xb0, 0xe9, 0x3c, 0xa2, 0xa1, 0xc0, 0x1a, + 0xda, 0xcf, 0x2a, 0x3d, 0xdc, 0x6b, 0xb0, 0x09, 0xdb, 0x55, 0x7b, 0xbb, 0xc5, 0xb7, 0xa8, 0x9e, + 0x06, 0xb4, 0x69, 0x18, 0x30, 0x3f, 0xa4, 0x5a, 0xa5, 0x09, 0xdb, 0x35, 0xf3, 0x54, 0x2f, 0x52, + 0x77, 0xfb, 0xfd, 0xc7, 0x2d, 0x6b, 0x55, 0x34, 0xd8, 0x05, 0x76, 0xc9, 0x81, 0xef, 0xd0, 0xe1, + 0x3c, 0xff, 0xa3, 0x2c, 0x51, 0xcd, 0x4a, 0x9c, 0xe9, 0x4a, 0xf6, 0x9e, 0x2a, 0xe8, 0x02, 0xbb, + 0xec, 0xc0, 0x2d, 0xb4, 0x9b, 0x35, 0xa1, 0xed, 0x64, 0xd6, 0xba, 0x2e, 0x5b, 0x7a, 0x4a, 0x57, + 0x5b, 0x52, 0x16, 0x42, 0x07, 0x3c, 0xd7, 0xb7, 0x4e, 0xd0, 0x51, 0xa9, 0x49, 0x79, 0x6c, 0xbe, + 0x20, 0xdc, 0xc9, 0x87, 0xd3, 0x61, 0xbc, 0x27, 0x2f, 0x09, 0xf7, 0x51, 0x4d, 0x11, 0xe3, 0xa6, + 0xae, 0x0e, 0x50, 0xff, 0x7b, 0x59, 0x8d, 0x8b, 0x7f, 0x14, 0x79, 0x00, 0x60, 0x59, 0xcb, 0x35, + 0x01, 0xab, 0x35, 0x01, 0x9b, 0x35, 0x81, 0xef, 0x31, 0x81, 0x9f, 0x31, 0x81, 0x5f, 0x31, 0x81, + 0xcb, 0x98, 0xc0, 0xef, 0x98, 0xc0, 0x9f, 0x98, 0x80, 0x4d, 0x4c, 0xe0, 0x47, 0x42, 0xc0, 0x32, + 0x21, 0x60, 0x95, 0x10, 0xf0, 0x5c, 0x7a, 0x3c, 0x83, 0xbd, 0x6c, 0x66, 0xd7, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x8f, 0x20, 0x57, 0xb2, 0x8d, 0x02, 0x00, 0x00, +} + +func (this *QueryResultRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResultRequest) + if !ok { + that2, ok := that.(QueryResultRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.QueryID != that1.QueryID { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if this.Response == nil { + return false + } else if !this.Response.Equal(that1.Response) { + return false + } + if !this.Stats.Equal(that1.Stats) { + return false + } + return true +} +func (this *QueryResultRequest_HttpResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResultRequest_HttpResponse) + if !ok { + that2, ok := that.(QueryResultRequest_HttpResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.HttpResponse.Equal(that1.HttpResponse) { + return false + } + return true +} +func (this *QueryResultRequest_QueryResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResultRequest_QueryResponse) + if !ok { + that2, ok := that.(QueryResultRequest_QueryResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.QueryResponse.Equal(that1.QueryResponse) { + return false + } + return true +} +func (this *QueryResultResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResultResponse) + if !ok { + that2, ok := that.(QueryResultResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *QueryResultRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&frontendv2pb.QueryResultRequest{") + s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") + if this.Response != nil { + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + } + if this.Stats != nil { + s = append(s, "Stats: "+fmt.Sprintf("%#v", this.Stats)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryResultRequest_HttpResponse) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&frontendv2pb.QueryResultRequest_HttpResponse{` + + `HttpResponse:` + fmt.Sprintf("%#v", this.HttpResponse) + `}`}, ", ") + return s +} +func (this *QueryResultRequest_QueryResponse) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&frontendv2pb.QueryResultRequest_QueryResponse{` + + `QueryResponse:` + fmt.Sprintf("%#v", this.QueryResponse) + `}`}, ", ") + return s +} +func (this *QueryResultResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&frontendv2pb.QueryResultResponse{") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringFrontend(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// FrontendForQuerierClient is the client API for FrontendForQuerier service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type FrontendForQuerierClient interface { + QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) +} + +type frontendForQuerierClient struct { + cc *grpc.ClientConn +} + +func NewFrontendForQuerierClient(cc *grpc.ClientConn) FrontendForQuerierClient { + return &frontendForQuerierClient{cc} +} + +func (c *frontendForQuerierClient) QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) { + out := new(QueryResultResponse) + err := c.cc.Invoke(ctx, "/frontendv2pb.FrontendForQuerier/QueryResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// FrontendForQuerierServer is the server API for FrontendForQuerier service. +type FrontendForQuerierServer interface { + QueryResult(context.Context, *QueryResultRequest) (*QueryResultResponse, error) +} + +// UnimplementedFrontendForQuerierServer can be embedded to have forward compatible implementations. +type UnimplementedFrontendForQuerierServer struct { +} + +func (*UnimplementedFrontendForQuerierServer) QueryResult(ctx context.Context, req *QueryResultRequest) (*QueryResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryResult not implemented") +} + +func RegisterFrontendForQuerierServer(s *grpc.Server, srv FrontendForQuerierServer) { + s.RegisterService(&_FrontendForQuerier_serviceDesc, srv) +} + +func _FrontendForQuerier_QueryResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FrontendForQuerierServer).QueryResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/frontendv2pb.FrontendForQuerier/QueryResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FrontendForQuerierServer).QueryResult(ctx, req.(*QueryResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _FrontendForQuerier_serviceDesc = grpc.ServiceDesc{ + ServiceName: "frontendv2pb.FrontendForQuerier", + HandlerType: (*FrontendForQuerierServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryResult", + Handler: _FrontendForQuerier_QueryResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/lokifrontend/frontend/v2/frontendv2pb/frontend.proto", +} + +func (m *QueryResultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFrontend(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.QueryID != 0 { + i = encodeVarintFrontend(dAtA, i, uint64(m.QueryID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryResultRequest_HttpResponse) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResultRequest_HttpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.HttpResponse != nil { + { + size, err := m.HttpResponse.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFrontend(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *QueryResultRequest_QueryResponse) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResultRequest_QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.QueryResponse != nil { + { + size, err := m.QueryResponse.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFrontend(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *QueryResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintFrontend(dAtA []byte, offset int, v uint64) int { + offset -= sovFrontend(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryID != 0 { + n += 1 + sovFrontend(uint64(m.QueryID)) + } + if m.Response != nil { + n += m.Response.Size() + } + if m.Stats != nil { + l = m.Stats.Size() + n += 1 + l + sovFrontend(uint64(l)) + } + return n +} + +func (m *QueryResultRequest_HttpResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpResponse != nil { + l = m.HttpResponse.Size() + n += 1 + l + sovFrontend(uint64(l)) + } + return n +} +func (m *QueryResultRequest_QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryResponse != nil { + l = m.QueryResponse.Size() + n += 1 + l + sovFrontend(uint64(l)) + } + return n +} +func (m *QueryResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovFrontend(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFrontend(x uint64) (n int) { + return sovFrontend(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *QueryResultRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResultRequest{`, + `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "Stats", "stats.Stats", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResultRequest_HttpResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResultRequest_HttpResponse{`, + `HttpResponse:` + strings.Replace(fmt.Sprintf("%v", this.HttpResponse), "HTTPResponse", "httpgrpc.HTTPResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResultRequest_QueryResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResultRequest_QueryResponse{`, + `QueryResponse:` + strings.Replace(fmt.Sprintf("%v", this.QueryResponse), "QueryResponse", "queryrange.QueryResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResultResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResultResponse{`, + `}`, + }, "") + return s +} +func valueToStringFrontend(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *QueryResultRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) + } + m.QueryID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFrontend + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFrontend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &httpgrpc.HTTPResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResultRequest_HttpResponse{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFrontend + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFrontend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Stats == nil { + m.Stats = &stats.Stats{} + } + if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFrontend + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFrontend + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &queryrange.QueryResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResultRequest_QueryResponse{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFrontend(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthFrontend + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthFrontend + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFrontend + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipFrontend(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthFrontend + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthFrontend + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFrontend(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFrontend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFrontend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFrontend + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFrontend + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthFrontend + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFrontend + } + 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 := skipFrontend(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthFrontend + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthFrontend = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFrontend = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/push/push.pb.go b/pkg/push/push.pb.go new file mode 100644 index 0000000000000..3b07d850ff162 --- /dev/null +++ b/pkg/push/push.pb.go @@ -0,0 +1,1739 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/push/push.proto + +package push + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + 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" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PushRequest struct { + Streams []Stream `protobuf:"bytes,1,rep,name=streams,proto3,customtype=Stream" json:"streams"` +} + +func (m *PushRequest) Reset() { *m = PushRequest{} } +func (*PushRequest) ProtoMessage() {} +func (*PushRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_35ec442956852c9e, []int{0} +} +func (m *PushRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PushRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PushRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PushRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushRequest.Merge(m, src) +} +func (m *PushRequest) XXX_Size() int { + return m.Size() +} +func (m *PushRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PushRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PushRequest proto.InternalMessageInfo + +type PushResponse struct { +} + +func (m *PushResponse) Reset() { *m = PushResponse{} } +func (*PushResponse) ProtoMessage() {} +func (*PushResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_35ec442956852c9e, []int{1} +} +func (m *PushResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PushResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PushResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PushResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushResponse.Merge(m, src) +} +func (m *PushResponse) XXX_Size() int { + return m.Size() +} +func (m *PushResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PushResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PushResponse proto.InternalMessageInfo + +type StreamAdapter struct { + Labels string `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + Entries []EntryAdapter `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries"` + // hash contains the original hash of the stream. + Hash uint64 `protobuf:"varint,3,opt,name=hash,proto3" json:"-"` +} + +func (m *StreamAdapter) Reset() { *m = StreamAdapter{} } +func (*StreamAdapter) ProtoMessage() {} +func (*StreamAdapter) Descriptor() ([]byte, []int) { + return fileDescriptor_35ec442956852c9e, []int{2} +} +func (m *StreamAdapter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamAdapter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StreamAdapter) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamAdapter.Merge(m, src) +} +func (m *StreamAdapter) XXX_Size() int { + return m.Size() +} +func (m *StreamAdapter) XXX_DiscardUnknown() { + xxx_messageInfo_StreamAdapter.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamAdapter proto.InternalMessageInfo + +func (m *StreamAdapter) GetLabels() string { + if m != nil { + return m.Labels + } + return "" +} + +func (m *StreamAdapter) GetEntries() []EntryAdapter { + if m != nil { + return m.Entries + } + return nil +} + +func (m *StreamAdapter) GetHash() uint64 { + if m != nil { + return m.Hash + } + return 0 +} + +type LabelPairAdapter struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *LabelPairAdapter) Reset() { *m = LabelPairAdapter{} } +func (*LabelPairAdapter) ProtoMessage() {} +func (*LabelPairAdapter) Descriptor() ([]byte, []int) { + return fileDescriptor_35ec442956852c9e, []int{3} +} +func (m *LabelPairAdapter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LabelPairAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LabelPairAdapter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LabelPairAdapter) XXX_Merge(src proto.Message) { + xxx_messageInfo_LabelPairAdapter.Merge(m, src) +} +func (m *LabelPairAdapter) XXX_Size() int { + return m.Size() +} +func (m *LabelPairAdapter) XXX_DiscardUnknown() { + xxx_messageInfo_LabelPairAdapter.DiscardUnknown(m) +} + +var xxx_messageInfo_LabelPairAdapter proto.InternalMessageInfo + +func (m *LabelPairAdapter) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LabelPairAdapter) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +type EntryAdapter struct { + Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"ts"` + Line string `protobuf:"bytes,2,opt,name=line,proto3" json:"line"` + StructuredMetadata []LabelPairAdapter `protobuf:"bytes,3,rep,name=structuredMetadata,proto3" json:"structuredMetadata,omitempty"` + // This field shouldn't be used by clients to push data to Loki. + // It is only used by Loki to return parsed log lines in query responses. + // TODO: Remove this field from the write path Proto. + Parsed []LabelPairAdapter `protobuf:"bytes,4,rep,name=parsed,proto3" json:"parsed,omitempty"` +} + +func (m *EntryAdapter) Reset() { *m = EntryAdapter{} } +func (*EntryAdapter) ProtoMessage() {} +func (*EntryAdapter) Descriptor() ([]byte, []int) { + return fileDescriptor_35ec442956852c9e, []int{4} +} +func (m *EntryAdapter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EntryAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EntryAdapter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EntryAdapter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EntryAdapter.Merge(m, src) +} +func (m *EntryAdapter) XXX_Size() int { + return m.Size() +} +func (m *EntryAdapter) XXX_DiscardUnknown() { + xxx_messageInfo_EntryAdapter.DiscardUnknown(m) +} + +var xxx_messageInfo_EntryAdapter proto.InternalMessageInfo + +func (m *EntryAdapter) GetTimestamp() time.Time { + if m != nil { + return m.Timestamp + } + return time.Time{} +} + +func (m *EntryAdapter) GetLine() string { + if m != nil { + return m.Line + } + return "" +} + +func (m *EntryAdapter) GetStructuredMetadata() []LabelPairAdapter { + if m != nil { + return m.StructuredMetadata + } + return nil +} + +func (m *EntryAdapter) GetParsed() []LabelPairAdapter { + if m != nil { + return m.Parsed + } + return nil +} + +func init() { + proto.RegisterType((*PushRequest)(nil), "logproto.PushRequest") + proto.RegisterType((*PushResponse)(nil), "logproto.PushResponse") + proto.RegisterType((*StreamAdapter)(nil), "logproto.StreamAdapter") + proto.RegisterType((*LabelPairAdapter)(nil), "logproto.LabelPairAdapter") + proto.RegisterType((*EntryAdapter)(nil), "logproto.EntryAdapter") +} + +func init() { proto.RegisterFile("pkg/push/push.proto", fileDescriptor_35ec442956852c9e) } + +var fileDescriptor_35ec442956852c9e = []byte{ + // 527 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xf5, 0x26, 0x6e, 0xda, 0x6e, 0x4a, 0xa9, 0x96, 0xb6, 0x18, 0xab, 0x5a, 0x47, 0x16, 0x87, + 0x1c, 0xc0, 0x96, 0xc2, 0x81, 0x0b, 0x97, 0x58, 0x42, 0xea, 0xa1, 0x48, 0x95, 0x41, 0x20, 0x71, + 0xdb, 0x34, 0x5b, 0xdb, 0xaa, 0xed, 0x35, 0xbb, 0x6b, 0xa4, 0xde, 0xf8, 0x84, 0xf2, 0x17, 0x7c, + 0x01, 0xdf, 0xd0, 0x63, 0x8e, 0x15, 0x07, 0x43, 0x9c, 0x0b, 0xca, 0xa9, 0x9f, 0x80, 0xbc, 0xb6, + 0x49, 0x28, 0x48, 0x5c, 0x36, 0x6f, 0x66, 0x67, 0xde, 0x7b, 0x99, 0x1d, 0xc3, 0x07, 0xd9, 0x45, + 0xe0, 0x66, 0xb9, 0x08, 0xd5, 0xe1, 0x64, 0x9c, 0x49, 0x86, 0xb6, 0x62, 0x16, 0x28, 0x64, 0xee, + 0x07, 0x2c, 0x60, 0x0a, 0xba, 0x15, 0xaa, 0xef, 0x4d, 0x2b, 0x60, 0x2c, 0x88, 0xa9, 0xab, 0xa2, + 0x49, 0x7e, 0xee, 0xca, 0x28, 0xa1, 0x42, 0x92, 0x24, 0xab, 0x0b, 0xec, 0x77, 0xb0, 0x7f, 0x9a, + 0x8b, 0xd0, 0xa7, 0x1f, 0x72, 0x2a, 0x24, 0x3a, 0x86, 0x9b, 0x42, 0x72, 0x4a, 0x12, 0x61, 0x80, + 0x41, 0x77, 0xd8, 0x1f, 0x3d, 0x74, 0x5a, 0x05, 0xe7, 0xb5, 0xba, 0x18, 0x4f, 0x49, 0x26, 0x29, + 0xf7, 0x0e, 0xbe, 0x15, 0x56, 0xaf, 0x4e, 0x2d, 0x0b, 0xab, 0xed, 0xf2, 0x5b, 0x60, 0xef, 0xc2, + 0x9d, 0x9a, 0x58, 0x64, 0x2c, 0x15, 0xd4, 0xfe, 0x0c, 0xe0, 0xbd, 0x3f, 0x18, 0x90, 0x0d, 0x7b, + 0x31, 0x99, 0xd0, 0xb8, 0x92, 0x02, 0xc3, 0x6d, 0x0f, 0x2e, 0x0b, 0xab, 0xc9, 0xf8, 0xcd, 0x2f, + 0x1a, 0xc3, 0x4d, 0x9a, 0x4a, 0x1e, 0x51, 0x61, 0x74, 0x94, 0x9f, 0xc3, 0x95, 0x9f, 0x97, 0xa9, + 0xe4, 0x97, 0xad, 0x9d, 0xfb, 0xd7, 0x85, 0xa5, 0x55, 0x46, 0x9a, 0x72, 0xbf, 0x05, 0xe8, 0x11, + 0xd4, 0x43, 0x22, 0x42, 0xa3, 0x3b, 0x00, 0x43, 0xdd, 0xdb, 0x58, 0x16, 0x16, 0x78, 0xea, 0xab, + 0x94, 0xfd, 0x02, 0xee, 0x9d, 0x54, 0x3a, 0xa7, 0x24, 0xe2, 0xad, 0x2b, 0x04, 0xf5, 0x94, 0x24, + 0xb4, 0xf6, 0xe4, 0x2b, 0x8c, 0xf6, 0xe1, 0xc6, 0x47, 0x12, 0xe7, 0xd4, 0xe8, 0xa8, 0x64, 0x1d, + 0xd8, 0x5f, 0x3b, 0x70, 0x67, 0xdd, 0x03, 0x3a, 0x86, 0xdb, 0xbf, 0xc7, 0xab, 0xfa, 0xfb, 0x23, + 0xd3, 0xa9, 0x1f, 0xc0, 0x69, 0x1f, 0xc0, 0x79, 0xd3, 0x56, 0x78, 0xbb, 0x8d, 0xe5, 0x8e, 0x14, + 0x57, 0xdf, 0x2d, 0xe0, 0xaf, 0x9a, 0xd1, 0x11, 0xd4, 0xe3, 0x28, 0x6d, 0xf4, 0xbc, 0xad, 0x65, + 0x61, 0xa9, 0xd8, 0x57, 0x27, 0xca, 0x20, 0x12, 0x92, 0xe7, 0x67, 0x32, 0xe7, 0x74, 0xfa, 0x8a, + 0x4a, 0x32, 0x25, 0x92, 0x18, 0x5d, 0x35, 0x1f, 0x73, 0x35, 0x9f, 0xbb, 0x7f, 0xcd, 0x7b, 0xdc, + 0x08, 0x1e, 0xfd, 0xdd, 0xfd, 0x84, 0x25, 0x91, 0xa4, 0x49, 0x26, 0x2f, 0xfd, 0x7f, 0x70, 0xa3, + 0x13, 0xd8, 0xcb, 0x08, 0x17, 0x74, 0x6a, 0xe8, 0xff, 0x55, 0x31, 0x1a, 0x95, 0xbd, 0xba, 0x63, + 0x8d, 0xb9, 0xe1, 0x18, 0x8d, 0x61, 0xaf, 0x5a, 0x0d, 0xca, 0xd1, 0x73, 0xa8, 0x57, 0x08, 0x1d, + 0xac, 0xf8, 0xd6, 0xb6, 0xd1, 0x3c, 0xbc, 0x9b, 0x6e, 0x76, 0x49, 0xf3, 0xde, 0xce, 0xe6, 0x58, + 0xbb, 0x99, 0x63, 0xed, 0x76, 0x8e, 0xc1, 0xa7, 0x12, 0x83, 0x2f, 0x25, 0x06, 0xd7, 0x25, 0x06, + 0xb3, 0x12, 0x83, 0x1f, 0x25, 0x06, 0x3f, 0x4b, 0xac, 0xdd, 0x96, 0x18, 0x5c, 0x2d, 0xb0, 0x36, + 0x5b, 0x60, 0xed, 0x66, 0x81, 0xb5, 0xf7, 0x83, 0x20, 0x92, 0x61, 0x3e, 0x71, 0xce, 0x58, 0xe2, + 0x06, 0x9c, 0x9c, 0x93, 0x94, 0xb8, 0x31, 0xbb, 0x88, 0xdc, 0xf6, 0xd3, 0x9a, 0xf4, 0x94, 0xda, + 0xb3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xaa, 0x57, 0xd3, 0x6d, 0x03, 0x00, 0x00, +} + +func (this *PushRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PushRequest) + if !ok { + that2, ok := that.(PushRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Streams) != len(that1.Streams) { + return false + } + for i := range this.Streams { + if !this.Streams[i].Equal(that1.Streams[i]) { + return false + } + } + return true +} +func (this *PushResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PushResponse) + if !ok { + that2, ok := that.(PushResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *StreamAdapter) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*StreamAdapter) + if !ok { + that2, ok := that.(StreamAdapter) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Labels != that1.Labels { + return false + } + if len(this.Entries) != len(that1.Entries) { + return false + } + for i := range this.Entries { + if !this.Entries[i].Equal(&that1.Entries[i]) { + return false + } + } + if this.Hash != that1.Hash { + return false + } + return true +} +func (this *LabelPairAdapter) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LabelPairAdapter) + if !ok { + that2, ok := that.(LabelPairAdapter) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (this *EntryAdapter) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*EntryAdapter) + if !ok { + that2, ok := that.(EntryAdapter) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Timestamp.Equal(that1.Timestamp) { + return false + } + if this.Line != that1.Line { + return false + } + if len(this.StructuredMetadata) != len(that1.StructuredMetadata) { + return false + } + for i := range this.StructuredMetadata { + if !this.StructuredMetadata[i].Equal(&that1.StructuredMetadata[i]) { + return false + } + } + if len(this.Parsed) != len(that1.Parsed) { + return false + } + for i := range this.Parsed { + if !this.Parsed[i].Equal(&that1.Parsed[i]) { + return false + } + } + return true +} +func (this *PushRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&push.PushRequest{") + s = append(s, "Streams: "+fmt.Sprintf("%#v", this.Streams)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PushResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&push.PushResponse{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *StreamAdapter) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&push.StreamAdapter{") + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Entries != nil { + vs := make([]*EntryAdapter, len(this.Entries)) + for i := range vs { + vs[i] = &this.Entries[i] + } + s = append(s, "Entries: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "Hash: "+fmt.Sprintf("%#v", this.Hash)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LabelPairAdapter) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&push.LabelPairAdapter{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *EntryAdapter) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&push.EntryAdapter{") + s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") + s = append(s, "Line: "+fmt.Sprintf("%#v", this.Line)+",\n") + if this.StructuredMetadata != nil { + vs := make([]*LabelPairAdapter, len(this.StructuredMetadata)) + for i := range vs { + vs[i] = &this.StructuredMetadata[i] + } + s = append(s, "StructuredMetadata: "+fmt.Sprintf("%#v", vs)+",\n") + } + if this.Parsed != nil { + vs := make([]*LabelPairAdapter, len(this.Parsed)) + for i := range vs { + vs[i] = &this.Parsed[i] + } + s = append(s, "Parsed: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringPush(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// PusherClient is the client API for Pusher service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type PusherClient interface { + Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) +} + +type pusherClient struct { + cc *grpc.ClientConn +} + +func NewPusherClient(cc *grpc.ClientConn) PusherClient { + return &pusherClient{cc} +} + +func (c *pusherClient) Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) { + out := new(PushResponse) + err := c.cc.Invoke(ctx, "/logproto.Pusher/Push", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PusherServer is the server API for Pusher service. +type PusherServer interface { + Push(context.Context, *PushRequest) (*PushResponse, error) +} + +// UnimplementedPusherServer can be embedded to have forward compatible implementations. +type UnimplementedPusherServer struct { +} + +func (*UnimplementedPusherServer) Push(ctx context.Context, req *PushRequest) (*PushResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Push not implemented") +} + +func RegisterPusherServer(s *grpc.Server, srv PusherServer) { + s.RegisterService(&_Pusher_serviceDesc, srv) +} + +func _Pusher_Push_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PusherServer).Push(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/logproto.Pusher/Push", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PusherServer).Push(ctx, req.(*PushRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Pusher_serviceDesc = grpc.ServiceDesc{ + ServiceName: "logproto.Pusher", + HandlerType: (*PusherServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Push", + Handler: _Pusher_Push_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/push/push.proto", +} + +func (m *PushRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PushRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Streams) > 0 { + for iNdEx := len(m.Streams) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Streams[iNdEx].Size() + i -= size + if _, err := m.Streams[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPush(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PushResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PushResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PushResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *StreamAdapter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StreamAdapter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Hash != 0 { + i = encodeVarintPush(dAtA, i, uint64(m.Hash)) + i-- + dAtA[i] = 0x18 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPush(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Labels) > 0 { + i -= len(m.Labels) + copy(dAtA[i:], m.Labels) + i = encodeVarintPush(dAtA, i, uint64(len(m.Labels))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LabelPairAdapter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelPairAdapter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LabelPairAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintPush(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 = encodeVarintPush(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EntryAdapter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EntryAdapter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EntryAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Parsed) > 0 { + for iNdEx := len(m.Parsed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Parsed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPush(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.StructuredMetadata) > 0 { + for iNdEx := len(m.StructuredMetadata) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StructuredMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPush(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Line) > 0 { + i -= len(m.Line) + copy(dAtA[i:], m.Line) + i = encodeVarintPush(dAtA, i, uint64(len(m.Line))) + i-- + dAtA[i] = 0x12 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintPush(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintPush(dAtA []byte, offset int, v uint64) int { + offset -= sovPush(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PushRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Streams) > 0 { + for _, e := range m.Streams { + l = e.Size() + n += 1 + l + sovPush(uint64(l)) + } + } + return n +} + +func (m *PushResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *StreamAdapter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Labels) + if l > 0 { + n += 1 + l + sovPush(uint64(l)) + } + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovPush(uint64(l)) + } + } + if m.Hash != 0 { + n += 1 + sovPush(uint64(m.Hash)) + } + return n +} + +func (m *LabelPairAdapter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPush(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovPush(uint64(l)) + } + return n +} + +func (m *EntryAdapter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovPush(uint64(l)) + l = len(m.Line) + if l > 0 { + n += 1 + l + sovPush(uint64(l)) + } + if len(m.StructuredMetadata) > 0 { + for _, e := range m.StructuredMetadata { + l = e.Size() + n += 1 + l + sovPush(uint64(l)) + } + } + if len(m.Parsed) > 0 { + for _, e := range m.Parsed { + l = e.Size() + n += 1 + l + sovPush(uint64(l)) + } + } + return n +} + +func sovPush(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPush(x uint64) (n int) { + return sovPush(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *PushRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PushRequest{`, + `Streams:` + fmt.Sprintf("%v", this.Streams) + `,`, + `}`, + }, "") + return s +} +func (this *PushResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PushResponse{`, + `}`, + }, "") + return s +} +func (this *StreamAdapter) String() string { + if this == nil { + return "nil" + } + repeatedStringForEntries := "[]EntryAdapter{" + for _, f := range this.Entries { + repeatedStringForEntries += strings.Replace(strings.Replace(f.String(), "EntryAdapter", "EntryAdapter", 1), `&`, ``, 1) + "," + } + repeatedStringForEntries += "}" + s := strings.Join([]string{`&StreamAdapter{`, + `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Entries:` + repeatedStringForEntries + `,`, + `Hash:` + fmt.Sprintf("%v", this.Hash) + `,`, + `}`, + }, "") + return s +} +func (this *LabelPairAdapter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LabelPairAdapter{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *EntryAdapter) String() string { + if this == nil { + return "nil" + } + repeatedStringForStructuredMetadata := "[]LabelPairAdapter{" + for _, f := range this.StructuredMetadata { + repeatedStringForStructuredMetadata += strings.Replace(strings.Replace(f.String(), "LabelPairAdapter", "LabelPairAdapter", 1), `&`, ``, 1) + "," + } + repeatedStringForStructuredMetadata += "}" + repeatedStringForParsed := "[]LabelPairAdapter{" + for _, f := range this.Parsed { + repeatedStringForParsed += strings.Replace(strings.Replace(f.String(), "LabelPairAdapter", "LabelPairAdapter", 1), `&`, ``, 1) + "," + } + repeatedStringForParsed += "}" + s := strings.Join([]string{`&EntryAdapter{`, + `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Line:` + fmt.Sprintf("%v", this.Line) + `,`, + `StructuredMetadata:` + repeatedStringForStructuredMetadata + `,`, + `Parsed:` + repeatedStringForParsed + `,`, + `}`, + }, "") + return s +} +func valueToStringPush(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *PushRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PushRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PushRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Streams = append(m.Streams, Stream{}) + if err := m.Streams[len(m.Streams)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPush(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PushResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PushResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PushResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipPush(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StreamAdapter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StreamAdapter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamAdapter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, EntryAdapter{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + m.Hash = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Hash |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPush(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LabelPairAdapter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelPairAdapter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelPairAdapter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPush(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EntryAdapter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EntryAdapter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EntryAdapter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Line = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StructuredMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StructuredMetadata = append(m.StructuredMetadata, LabelPairAdapter{}) + if err := m.StructuredMetadata[len(m.StructuredMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parsed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPush + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPush + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPush + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parsed = append(m.Parsed, LabelPairAdapter{}) + if err := m.Parsed[len(m.Parsed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPush(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthPush + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPush(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPush + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPush + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPush + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPush + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthPush + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPush + } + 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 := skipPush(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthPush + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthPush = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPush = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/querier/http.go b/pkg/querier/http.go index 1ecde15626ecb..970e0be1a6f1e 100644 --- a/pkg/querier/http.go +++ b/pkg/querier/http.go @@ -45,7 +45,7 @@ type QueryResponse struct { } type Engine interface { - Query(logql.Params) logql.Query + Query(logql.Params, syntax.Expr) logql.Query } // nolint // QuerierAPI defines HTTP handler functions for the querier. @@ -78,7 +78,7 @@ func (q *QuerierAPI) RangeQueryHandler(ctx context.Context, req *queryrange.Loki return logqlmodel.Result{}, err } - query := q.engine.Query(params) + query := q.engine.Query(params, req.Plan.AST) return query.Exec(ctx) } @@ -92,7 +92,7 @@ func (q *QuerierAPI) InstantQueryHandler(ctx context.Context, req *queryrange.Lo if err != nil { return logqlmodel.Result{}, err } - query := q.engine.Query(params) + query := q.engine.Query(params, req.Plan.AST) return query.Exec(ctx) } diff --git a/pkg/querier/plan.go b/pkg/querier/plan.go deleted file mode 100644 index a5f2c13eef760..0000000000000 --- a/pkg/querier/plan.go +++ /dev/null @@ -1,30 +0,0 @@ -package querier - -import ( - "bytes" - - "github.com/grafana/loki/pkg/logql/syntax" -) - -type QueryPlan struct { - AST syntax.Expr -} - -func (t QueryPlan) Marshal() ([]byte, error) { - var buf bytes.Buffer - err := syntax.EncodeJSON(t.AST, &buf) - if err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -func (t *QueryPlan) MarshalTo(data []byte) (n int, err error) { -} - -func (t *QueryPlan) Unmarshal(data []byte) error {} -func (t *QueryPlan) Size() int {} - -func (t QueryPlan) MarshalJSON() ([]byte, error) {} -func (t *QueryPlan) UnmarshalJSON(data []byte) error {} diff --git a/pkg/querier/plan/plan.go b/pkg/querier/plan/plan.go new file mode 100644 index 0000000000000..43f802d07159d --- /dev/null +++ b/pkg/querier/plan/plan.go @@ -0,0 +1,61 @@ +package plan + +import ( + "bytes" + + "github.com/grafana/loki/pkg/logql/syntax" +) + +type QueryPlan struct { + AST syntax.Expr +} + +func (t QueryPlan) Marshal() ([]byte, error) { + return t.MarshalJSON() +} + +func (t *QueryPlan) MarshalTo(data []byte) (n int, err error) { + // TODO: we probably want to write to data directly + src, err := t.Marshal() + if err != nil { + return 0, err + } + + return copy(src, data), nil +} + +func (t *QueryPlan) Unmarshal(data []byte) error { + return t.UnmarshalJSON(data) +} + +func (t *QueryPlan) Size() int { + + // TODO: we probably want to calculate the size directly. + src, _ := t.Marshal() + + return len(src) +} + +func (t QueryPlan) MarshalJSON() ([]byte, error) { + var buf bytes.Buffer + err := syntax.EncodeJSON(t.AST, &buf) + if err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func (t *QueryPlan) UnmarshalJSON(data []byte) error { + expr, err := syntax.DecodeJSON(string(data)) + if err != nil { + return err + } + + t.AST = expr + return nil +} + +func (t QueryPlan) Equal(other QueryPlan) bool { + return syntax.Equal(t.AST, other.AST) +} diff --git a/pkg/querier/queryrange/queryrange.pb.go b/pkg/querier/queryrange/queryrange.pb.go new file mode 100644 index 0000000000000..f113127d7b428 --- /dev/null +++ b/pkg/querier/queryrange/queryrange.pb.go @@ -0,0 +1,7529 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/querier/queryrange/queryrange.proto + +package queryrange + +import ( + fmt "fmt" + rpc "github.com/gogo/googleapis/google/rpc" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" + logproto "github.com/grafana/loki/pkg/logproto" + stats "github.com/grafana/loki/pkg/logqlmodel/stats" + _ "github.com/grafana/loki/pkg/push" + github_com_grafana_loki_pkg_push "github.com/grafana/loki/pkg/push" + github_com_grafana_loki_pkg_querier_plan "github.com/grafana/loki/pkg/querier/plan" + queryrangebase "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" + _ "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" + github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type LokiRequest struct { + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Step int64 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` + Interval int64 `protobuf:"varint,9,opt,name=interval,proto3" json:"interval,omitempty"` + StartTs time.Time `protobuf:"bytes,4,opt,name=startTs,proto3,stdtime" json:"startTs"` + EndTs time.Time `protobuf:"bytes,5,opt,name=endTs,proto3,stdtime" json:"endTs"` + Direction logproto.Direction `protobuf:"varint,6,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` + Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` + Shards []string `protobuf:"bytes,8,rep,name=shards,proto3" json:"shards"` + Plan *github_com_grafana_loki_pkg_querier_plan.QueryPlan `protobuf:"bytes,10,opt,name=plan,proto3,customtype=github.com/grafana/loki/pkg/querier/plan.QueryPlan" json:"plan,omitempty"` +} + +func (m *LokiRequest) Reset() { *m = LokiRequest{} } +func (*LokiRequest) ProtoMessage() {} +func (*LokiRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{0} +} +func (m *LokiRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiRequest.Merge(m, src) +} +func (m *LokiRequest) XXX_Size() int { + return m.Size() +} +func (m *LokiRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LokiRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiRequest proto.InternalMessageInfo + +func (m *LokiRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *LokiRequest) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *LokiRequest) GetStep() int64 { + if m != nil { + return m.Step + } + return 0 +} + +func (m *LokiRequest) GetInterval() int64 { + if m != nil { + return m.Interval + } + return 0 +} + +func (m *LokiRequest) GetStartTs() time.Time { + if m != nil { + return m.StartTs + } + return time.Time{} +} + +func (m *LokiRequest) GetEndTs() time.Time { + if m != nil { + return m.EndTs + } + return time.Time{} +} + +func (m *LokiRequest) GetDirection() logproto.Direction { + if m != nil { + return m.Direction + } + return logproto.FORWARD +} + +func (m *LokiRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *LokiRequest) GetShards() []string { + if m != nil { + return m.Shards + } + return nil +} + +type LokiInstantRequest struct { + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + TimeTs time.Time `protobuf:"bytes,3,opt,name=timeTs,proto3,stdtime" json:"timeTs"` + Direction logproto.Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` + Shards []string `protobuf:"bytes,6,rep,name=shards,proto3" json:"shards"` +} + +func (m *LokiInstantRequest) Reset() { *m = LokiInstantRequest{} } +func (*LokiInstantRequest) ProtoMessage() {} +func (*LokiInstantRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{1} +} +func (m *LokiInstantRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiInstantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiInstantRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiInstantRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiInstantRequest.Merge(m, src) +} +func (m *LokiInstantRequest) XXX_Size() int { + return m.Size() +} +func (m *LokiInstantRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LokiInstantRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiInstantRequest proto.InternalMessageInfo + +func (m *LokiInstantRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *LokiInstantRequest) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *LokiInstantRequest) GetTimeTs() time.Time { + if m != nil { + return m.TimeTs + } + return time.Time{} +} + +func (m *LokiInstantRequest) GetDirection() logproto.Direction { + if m != nil { + return m.Direction + } + return logproto.FORWARD +} + +func (m *LokiInstantRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *LokiInstantRequest) GetShards() []string { + if m != nil { + return m.Shards + } + return nil +} + +type LokiResponse struct { + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` + Data LokiData `protobuf:"bytes,2,opt,name=Data,proto3" json:"data,omitempty"` + ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` + Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` + Direction logproto.Direction `protobuf:"varint,5,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` + Limit uint32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"` + Version uint32 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"` + Statistics stats.Result `protobuf:"bytes,8,opt,name=statistics,proto3" json:"statistics"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,9,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` +} + +func (m *LokiResponse) Reset() { *m = LokiResponse{} } +func (*LokiResponse) ProtoMessage() {} +func (*LokiResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{2} +} +func (m *LokiResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiResponse.Merge(m, src) +} +func (m *LokiResponse) XXX_Size() int { + return m.Size() +} +func (m *LokiResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LokiResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiResponse proto.InternalMessageInfo + +func (m *LokiResponse) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *LokiResponse) GetData() LokiData { + if m != nil { + return m.Data + } + return LokiData{} +} + +func (m *LokiResponse) GetErrorType() string { + if m != nil { + return m.ErrorType + } + return "" +} + +func (m *LokiResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *LokiResponse) GetDirection() logproto.Direction { + if m != nil { + return m.Direction + } + return logproto.FORWARD +} + +func (m *LokiResponse) GetLimit() uint32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *LokiResponse) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *LokiResponse) GetStatistics() stats.Result { + if m != nil { + return m.Statistics + } + return stats.Result{} +} + +type LokiSeriesRequest struct { + Match []string `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"` + StartTs time.Time `protobuf:"bytes,2,opt,name=startTs,proto3,stdtime" json:"startTs"` + EndTs time.Time `protobuf:"bytes,3,opt,name=endTs,proto3,stdtime" json:"endTs"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + Shards []string `protobuf:"bytes,5,rep,name=shards,proto3" json:"shards"` +} + +func (m *LokiSeriesRequest) Reset() { *m = LokiSeriesRequest{} } +func (*LokiSeriesRequest) ProtoMessage() {} +func (*LokiSeriesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{3} +} +func (m *LokiSeriesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiSeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiSeriesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiSeriesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiSeriesRequest.Merge(m, src) +} +func (m *LokiSeriesRequest) XXX_Size() int { + return m.Size() +} +func (m *LokiSeriesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LokiSeriesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiSeriesRequest proto.InternalMessageInfo + +func (m *LokiSeriesRequest) GetMatch() []string { + if m != nil { + return m.Match + } + return nil +} + +func (m *LokiSeriesRequest) GetStartTs() time.Time { + if m != nil { + return m.StartTs + } + return time.Time{} +} + +func (m *LokiSeriesRequest) GetEndTs() time.Time { + if m != nil { + return m.EndTs + } + return time.Time{} +} + +func (m *LokiSeriesRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *LokiSeriesRequest) GetShards() []string { + if m != nil { + return m.Shards + } + return nil +} + +type LokiSeriesResponse struct { + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` + Data []logproto.SeriesIdentifier `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"` + Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,4,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` + Statistics stats.Result `protobuf:"bytes,5,opt,name=statistics,proto3" json:"statistics"` +} + +func (m *LokiSeriesResponse) Reset() { *m = LokiSeriesResponse{} } +func (*LokiSeriesResponse) ProtoMessage() {} +func (*LokiSeriesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{4} +} +func (m *LokiSeriesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiSeriesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiSeriesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiSeriesResponse.Merge(m, src) +} +func (m *LokiSeriesResponse) XXX_Size() int { + return m.Size() +} +func (m *LokiSeriesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LokiSeriesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiSeriesResponse proto.InternalMessageInfo + +func (m *LokiSeriesResponse) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *LokiSeriesResponse) GetData() []logproto.SeriesIdentifier { + if m != nil { + return m.Data + } + return nil +} + +func (m *LokiSeriesResponse) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *LokiSeriesResponse) GetStatistics() stats.Result { + if m != nil { + return m.Statistics + } + return stats.Result{} +} + +type LokiLabelNamesResponse struct { + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` + Data []string `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"` + Version uint32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,4,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` + Statistics stats.Result `protobuf:"bytes,5,opt,name=statistics,proto3" json:"statistics"` +} + +func (m *LokiLabelNamesResponse) Reset() { *m = LokiLabelNamesResponse{} } +func (*LokiLabelNamesResponse) ProtoMessage() {} +func (*LokiLabelNamesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{5} +} +func (m *LokiLabelNamesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiLabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiLabelNamesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiLabelNamesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiLabelNamesResponse.Merge(m, src) +} +func (m *LokiLabelNamesResponse) XXX_Size() int { + return m.Size() +} +func (m *LokiLabelNamesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LokiLabelNamesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiLabelNamesResponse proto.InternalMessageInfo + +func (m *LokiLabelNamesResponse) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *LokiLabelNamesResponse) GetData() []string { + if m != nil { + return m.Data + } + return nil +} + +func (m *LokiLabelNamesResponse) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *LokiLabelNamesResponse) GetStatistics() stats.Result { + if m != nil { + return m.Statistics + } + return stats.Result{} +} + +type LokiData struct { + ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` + Result []github_com_grafana_loki_pkg_push.Stream `protobuf:"bytes,2,rep,name=Result,proto3,customtype=github.com/grafana/loki/pkg/push.Stream" json:"result"` +} + +func (m *LokiData) Reset() { *m = LokiData{} } +func (*LokiData) ProtoMessage() {} +func (*LokiData) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{6} +} +func (m *LokiData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiData) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiData.Merge(m, src) +} +func (m *LokiData) XXX_Size() int { + return m.Size() +} +func (m *LokiData) XXX_DiscardUnknown() { + xxx_messageInfo_LokiData.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiData proto.InternalMessageInfo + +func (m *LokiData) GetResultType() string { + if m != nil { + return m.ResultType + } + return "" +} + +// LokiPromResponse wraps a Prometheus response with statistics. +type LokiPromResponse struct { + Response *queryrangebase.PrometheusResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + Statistics stats.Result `protobuf:"bytes,2,opt,name=statistics,proto3" json:"statistics"` +} + +func (m *LokiPromResponse) Reset() { *m = LokiPromResponse{} } +func (*LokiPromResponse) ProtoMessage() {} +func (*LokiPromResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{7} +} +func (m *LokiPromResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LokiPromResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LokiPromResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LokiPromResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LokiPromResponse.Merge(m, src) +} +func (m *LokiPromResponse) XXX_Size() int { + return m.Size() +} +func (m *LokiPromResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LokiPromResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_LokiPromResponse proto.InternalMessageInfo + +func (m *LokiPromResponse) GetResponse() *queryrangebase.PrometheusResponse { + if m != nil { + return m.Response + } + return nil +} + +func (m *LokiPromResponse) GetStatistics() stats.Result { + if m != nil { + return m.Statistics + } + return stats.Result{} +} + +type IndexStatsResponse struct { + Response *github_com_grafana_loki_pkg_logproto.IndexStatsResponse `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.IndexStatsResponse" json:"response,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` +} + +func (m *IndexStatsResponse) Reset() { *m = IndexStatsResponse{} } +func (*IndexStatsResponse) ProtoMessage() {} +func (*IndexStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{8} +} +func (m *IndexStatsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexStatsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexStatsResponse.Merge(m, src) +} +func (m *IndexStatsResponse) XXX_Size() int { + return m.Size() +} +func (m *IndexStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_IndexStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexStatsResponse proto.InternalMessageInfo + +type VolumeResponse struct { + Response *github_com_grafana_loki_pkg_logproto.VolumeResponse `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.VolumeResponse" json:"response,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` +} + +func (m *VolumeResponse) Reset() { *m = VolumeResponse{} } +func (*VolumeResponse) ProtoMessage() {} +func (*VolumeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{9} +} +func (m *VolumeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VolumeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VolumeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VolumeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_VolumeResponse.Merge(m, src) +} +func (m *VolumeResponse) XXX_Size() int { + return m.Size() +} +func (m *VolumeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_VolumeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_VolumeResponse proto.InternalMessageInfo + +type TopKSketchesResponse struct { + Response *github_com_grafana_loki_pkg_logproto.TopKMatrix `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.TopKMatrix" json:"response,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` +} + +func (m *TopKSketchesResponse) Reset() { *m = TopKSketchesResponse{} } +func (*TopKSketchesResponse) ProtoMessage() {} +func (*TopKSketchesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{10} +} +func (m *TopKSketchesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TopKSketchesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TopKSketchesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TopKSketchesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TopKSketchesResponse.Merge(m, src) +} +func (m *TopKSketchesResponse) XXX_Size() int { + return m.Size() +} +func (m *TopKSketchesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TopKSketchesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TopKSketchesResponse proto.InternalMessageInfo + +type QuantileSketchResponse struct { + Response *github_com_grafana_loki_pkg_logproto.QuantileSketchMatrix `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/logproto.QuantileSketchMatrix" json:"response,omitempty"` + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions.PrometheusResponseHeader" json:"-"` +} + +func (m *QuantileSketchResponse) Reset() { *m = QuantileSketchResponse{} } +func (*QuantileSketchResponse) ProtoMessage() {} +func (*QuantileSketchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{11} +} +func (m *QuantileSketchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuantileSketchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuantileSketchResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuantileSketchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuantileSketchResponse.Merge(m, src) +} +func (m *QuantileSketchResponse) XXX_Size() int { + return m.Size() +} +func (m *QuantileSketchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuantileSketchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuantileSketchResponse proto.InternalMessageInfo + +type QueryResponse struct { + Status *rpc.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + // Types that are valid to be assigned to Response: + // *QueryResponse_Series + // *QueryResponse_Labels + // *QueryResponse_Stats + // *QueryResponse_Prom + // *QueryResponse_Streams + // *QueryResponse_Volume + // *QueryResponse_TopkSketches + // *QueryResponse_QuantileSketches + Response isQueryResponse_Response `protobuf_oneof:"response"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{12} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +type isQueryResponse_Response interface { + isQueryResponse_Response() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryResponse_Series struct { + Series *LokiSeriesResponse `protobuf:"bytes,2,opt,name=series,proto3,oneof"` +} +type QueryResponse_Labels struct { + Labels *LokiLabelNamesResponse `protobuf:"bytes,3,opt,name=labels,proto3,oneof"` +} +type QueryResponse_Stats struct { + Stats *IndexStatsResponse `protobuf:"bytes,4,opt,name=stats,proto3,oneof"` +} +type QueryResponse_Prom struct { + Prom *LokiPromResponse `protobuf:"bytes,5,opt,name=prom,proto3,oneof"` +} +type QueryResponse_Streams struct { + Streams *LokiResponse `protobuf:"bytes,6,opt,name=streams,proto3,oneof"` +} +type QueryResponse_Volume struct { + Volume *VolumeResponse `protobuf:"bytes,7,opt,name=volume,proto3,oneof"` +} +type QueryResponse_TopkSketches struct { + TopkSketches *TopKSketchesResponse `protobuf:"bytes,8,opt,name=topkSketches,proto3,oneof"` +} +type QueryResponse_QuantileSketches struct { + QuantileSketches *QuantileSketchResponse `protobuf:"bytes,9,opt,name=quantileSketches,proto3,oneof"` +} + +func (*QueryResponse_Series) isQueryResponse_Response() {} +func (*QueryResponse_Labels) isQueryResponse_Response() {} +func (*QueryResponse_Stats) isQueryResponse_Response() {} +func (*QueryResponse_Prom) isQueryResponse_Response() {} +func (*QueryResponse_Streams) isQueryResponse_Response() {} +func (*QueryResponse_Volume) isQueryResponse_Response() {} +func (*QueryResponse_TopkSketches) isQueryResponse_Response() {} +func (*QueryResponse_QuantileSketches) isQueryResponse_Response() {} + +func (m *QueryResponse) GetResponse() isQueryResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *QueryResponse) GetStatus() *rpc.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *QueryResponse) GetSeries() *LokiSeriesResponse { + if x, ok := m.GetResponse().(*QueryResponse_Series); ok { + return x.Series + } + return nil +} + +func (m *QueryResponse) GetLabels() *LokiLabelNamesResponse { + if x, ok := m.GetResponse().(*QueryResponse_Labels); ok { + return x.Labels + } + return nil +} + +func (m *QueryResponse) GetStats() *IndexStatsResponse { + if x, ok := m.GetResponse().(*QueryResponse_Stats); ok { + return x.Stats + } + return nil +} + +func (m *QueryResponse) GetProm() *LokiPromResponse { + if x, ok := m.GetResponse().(*QueryResponse_Prom); ok { + return x.Prom + } + return nil +} + +func (m *QueryResponse) GetStreams() *LokiResponse { + if x, ok := m.GetResponse().(*QueryResponse_Streams); ok { + return x.Streams + } + return nil +} + +func (m *QueryResponse) GetVolume() *VolumeResponse { + if x, ok := m.GetResponse().(*QueryResponse_Volume); ok { + return x.Volume + } + return nil +} + +func (m *QueryResponse) GetTopkSketches() *TopKSketchesResponse { + if x, ok := m.GetResponse().(*QueryResponse_TopkSketches); ok { + return x.TopkSketches + } + return nil +} + +func (m *QueryResponse) GetQuantileSketches() *QuantileSketchResponse { + if x, ok := m.GetResponse().(*QueryResponse_QuantileSketches); ok { + return x.QuantileSketches + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryResponse) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryResponse_Series)(nil), + (*QueryResponse_Labels)(nil), + (*QueryResponse_Stats)(nil), + (*QueryResponse_Prom)(nil), + (*QueryResponse_Streams)(nil), + (*QueryResponse_Volume)(nil), + (*QueryResponse_TopkSketches)(nil), + (*QueryResponse_QuantileSketches)(nil), + } +} + +type QueryRequest struct { + // Types that are valid to be assigned to Request: + // *QueryRequest_Series + // *QueryRequest_Labels + // *QueryRequest_Stats + // *QueryRequest_Instant + // *QueryRequest_Streams + // *QueryRequest_Volume + Request isQueryRequest_Request `protobuf_oneof:"request"` + Metadata map[string]string `protobuf:"bytes,7,rep,name=metadata,proto3" json:"metadata" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51b9d53b40d11902, []int{13} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +type isQueryRequest_Request interface { + isQueryRequest_Request() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryRequest_Series struct { + Series *LokiSeriesRequest `protobuf:"bytes,1,opt,name=series,proto3,oneof"` +} +type QueryRequest_Labels struct { + Labels *logproto.LabelRequest `protobuf:"bytes,2,opt,name=labels,proto3,oneof"` +} +type QueryRequest_Stats struct { + Stats *logproto.IndexStatsRequest `protobuf:"bytes,3,opt,name=stats,proto3,oneof"` +} +type QueryRequest_Instant struct { + Instant *LokiInstantRequest `protobuf:"bytes,4,opt,name=instant,proto3,oneof"` +} +type QueryRequest_Streams struct { + Streams *LokiRequest `protobuf:"bytes,5,opt,name=streams,proto3,oneof"` +} +type QueryRequest_Volume struct { + Volume *logproto.VolumeRequest `protobuf:"bytes,6,opt,name=volume,proto3,oneof"` +} + +func (*QueryRequest_Series) isQueryRequest_Request() {} +func (*QueryRequest_Labels) isQueryRequest_Request() {} +func (*QueryRequest_Stats) isQueryRequest_Request() {} +func (*QueryRequest_Instant) isQueryRequest_Request() {} +func (*QueryRequest_Streams) isQueryRequest_Request() {} +func (*QueryRequest_Volume) isQueryRequest_Request() {} + +func (m *QueryRequest) GetRequest() isQueryRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (m *QueryRequest) GetSeries() *LokiSeriesRequest { + if x, ok := m.GetRequest().(*QueryRequest_Series); ok { + return x.Series + } + return nil +} + +func (m *QueryRequest) GetLabels() *logproto.LabelRequest { + if x, ok := m.GetRequest().(*QueryRequest_Labels); ok { + return x.Labels + } + return nil +} + +func (m *QueryRequest) GetStats() *logproto.IndexStatsRequest { + if x, ok := m.GetRequest().(*QueryRequest_Stats); ok { + return x.Stats + } + return nil +} + +func (m *QueryRequest) GetInstant() *LokiInstantRequest { + if x, ok := m.GetRequest().(*QueryRequest_Instant); ok { + return x.Instant + } + return nil +} + +func (m *QueryRequest) GetStreams() *LokiRequest { + if x, ok := m.GetRequest().(*QueryRequest_Streams); ok { + return x.Streams + } + return nil +} + +func (m *QueryRequest) GetVolume() *logproto.VolumeRequest { + if x, ok := m.GetRequest().(*QueryRequest_Volume); ok { + return x.Volume + } + return nil +} + +func (m *QueryRequest) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryRequest_Series)(nil), + (*QueryRequest_Labels)(nil), + (*QueryRequest_Stats)(nil), + (*QueryRequest_Instant)(nil), + (*QueryRequest_Streams)(nil), + (*QueryRequest_Volume)(nil), + } +} + +func init() { + proto.RegisterType((*LokiRequest)(nil), "queryrange.LokiRequest") + proto.RegisterType((*LokiInstantRequest)(nil), "queryrange.LokiInstantRequest") + proto.RegisterType((*LokiResponse)(nil), "queryrange.LokiResponse") + proto.RegisterType((*LokiSeriesRequest)(nil), "queryrange.LokiSeriesRequest") + proto.RegisterType((*LokiSeriesResponse)(nil), "queryrange.LokiSeriesResponse") + proto.RegisterType((*LokiLabelNamesResponse)(nil), "queryrange.LokiLabelNamesResponse") + proto.RegisterType((*LokiData)(nil), "queryrange.LokiData") + proto.RegisterType((*LokiPromResponse)(nil), "queryrange.LokiPromResponse") + proto.RegisterType((*IndexStatsResponse)(nil), "queryrange.IndexStatsResponse") + proto.RegisterType((*VolumeResponse)(nil), "queryrange.VolumeResponse") + proto.RegisterType((*TopKSketchesResponse)(nil), "queryrange.TopKSketchesResponse") + proto.RegisterType((*QuantileSketchResponse)(nil), "queryrange.QuantileSketchResponse") + proto.RegisterType((*QueryResponse)(nil), "queryrange.QueryResponse") + proto.RegisterType((*QueryRequest)(nil), "queryrange.QueryRequest") + proto.RegisterMapType((map[string]string)(nil), "queryrange.QueryRequest.MetadataEntry") +} + +func init() { + proto.RegisterFile("pkg/querier/queryrange/queryrange.proto", fileDescriptor_51b9d53b40d11902) +} + +var fileDescriptor_51b9d53b40d11902 = []byte{ + // 1488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xf6, 0xfa, 0x33, 0x9e, 0x7c, 0x50, 0x26, 0x51, 0xba, 0xa4, 0x65, 0xd7, 0xb2, 0x44, 0x6b, + 0x10, 0xac, 0x69, 0x52, 0xfa, 0x09, 0x88, 0x2e, 0x6d, 0x95, 0x42, 0x8b, 0xda, 0x4d, 0xc4, 0x81, + 0xdb, 0x24, 0x9e, 0xd8, 0x8b, 0xf7, 0x2b, 0x3b, 0xe3, 0xa8, 0xb9, 0xf1, 0x03, 0x40, 0xea, 0x0f, + 0xe0, 0x8c, 0x90, 0xa8, 0x90, 0xb8, 0x72, 0xe4, 0xd4, 0x63, 0x8f, 0x95, 0x25, 0x16, 0xea, 0x72, + 0x80, 0x9c, 0xfa, 0x13, 0xd0, 0x7c, 0xec, 0x7a, 0xd7, 0x76, 0x5a, 0xa7, 0x5c, 0x5a, 0x89, 0x4b, + 0x32, 0x33, 0xfb, 0x3e, 0xbb, 0x33, 0xcf, 0xf3, 0xbc, 0xef, 0xcc, 0x18, 0x9c, 0x0e, 0xba, 0xed, + 0xe6, 0x6e, 0x0f, 0x87, 0x36, 0x0e, 0xf9, 0xff, 0xfd, 0x10, 0x79, 0x6d, 0x9c, 0x6a, 0x1a, 0x41, + 0xe8, 0x53, 0x1f, 0x82, 0xe1, 0xc8, 0xca, 0x6a, 0xdb, 0xa6, 0x9d, 0xde, 0x96, 0xb1, 0xed, 0xbb, + 0xcd, 0xb6, 0xdf, 0xf6, 0x9b, 0x6d, 0xdf, 0x6f, 0x3b, 0x18, 0x05, 0x36, 0x91, 0xcd, 0x66, 0x18, + 0x6c, 0x37, 0x09, 0x45, 0xb4, 0x47, 0x04, 0x7e, 0x65, 0x89, 0x05, 0xf2, 0x26, 0x87, 0xc8, 0x51, + 0x5d, 0x86, 0xf3, 0xde, 0x56, 0x6f, 0xa7, 0x49, 0x6d, 0x17, 0x13, 0x8a, 0xdc, 0x40, 0x06, 0x9c, + 0x60, 0xf3, 0x73, 0xfc, 0xb6, 0x40, 0xc6, 0x0d, 0xf9, 0xf0, 0x8d, 0xcc, 0x43, 0xd2, 0xc5, 0x74, + 0xbb, 0x23, 0x1f, 0xd5, 0xe4, 0xa3, 0x5d, 0xc7, 0xf5, 0x5b, 0xd8, 0xe1, 0x73, 0x21, 0xe2, 0xaf, + 0x8c, 0x58, 0x64, 0x11, 0x41, 0x8f, 0x74, 0xf8, 0x1f, 0x39, 0xf8, 0xe9, 0x73, 0xe9, 0xd8, 0x42, + 0x04, 0x37, 0x5b, 0x78, 0xc7, 0xf6, 0x6c, 0x6a, 0xfb, 0x1e, 0x49, 0xb7, 0xe5, 0x4b, 0xce, 0x4d, + 0xf7, 0x92, 0x51, 0x8a, 0xeb, 0xdf, 0x17, 0xc0, 0xec, 0x4d, 0xbf, 0x6b, 0x5b, 0x78, 0xb7, 0x87, + 0x09, 0x85, 0x4b, 0xa0, 0xc4, 0x63, 0x54, 0xa5, 0xa6, 0x34, 0xaa, 0x96, 0xe8, 0xb0, 0x51, 0xc7, + 0x76, 0x6d, 0xaa, 0xe6, 0x6b, 0x4a, 0x63, 0xde, 0x12, 0x1d, 0x08, 0x41, 0x91, 0x50, 0x1c, 0xa8, + 0x85, 0x9a, 0xd2, 0x28, 0x58, 0xbc, 0x0d, 0x57, 0xc0, 0x8c, 0xed, 0x51, 0x1c, 0xee, 0x21, 0x47, + 0xad, 0xf2, 0xf1, 0xa4, 0x0f, 0x3f, 0x06, 0x15, 0x42, 0x51, 0x48, 0x37, 0x89, 0x5a, 0xac, 0x29, + 0x8d, 0xd9, 0xd5, 0x15, 0x43, 0x48, 0x61, 0xc4, 0x52, 0x18, 0x9b, 0xb1, 0x14, 0xe6, 0xcc, 0x83, + 0x48, 0xcf, 0xdd, 0xfb, 0x43, 0x57, 0xac, 0x18, 0x04, 0x2f, 0x81, 0x12, 0xf6, 0x5a, 0x9b, 0x44, + 0x2d, 0x1d, 0x01, 0x2d, 0x20, 0xf0, 0x0c, 0xa8, 0xb6, 0xec, 0x10, 0x6f, 0x33, 0xce, 0xd4, 0x72, + 0x4d, 0x69, 0x2c, 0xac, 0x2e, 0x1a, 0x89, 0xb4, 0x57, 0xe3, 0x47, 0xd6, 0x30, 0x8a, 0x2d, 0x2f, + 0x40, 0xb4, 0xa3, 0x56, 0x38, 0x13, 0xbc, 0x0d, 0xeb, 0xa0, 0x4c, 0x3a, 0x28, 0x6c, 0x11, 0x75, + 0xa6, 0x56, 0x68, 0x54, 0x4d, 0x70, 0x10, 0xe9, 0x72, 0xc4, 0x92, 0xff, 0xe1, 0x67, 0xa0, 0x18, + 0x38, 0xc8, 0x53, 0x41, 0x4d, 0x69, 0xcc, 0x99, 0xe7, 0xfa, 0x91, 0x9e, 0xf1, 0x6e, 0x88, 0x76, + 0x90, 0x87, 0x9a, 0x8e, 0xdf, 0xb5, 0x9b, 0x69, 0xd1, 0x18, 0xc6, 0xb8, 0xc3, 0xe8, 0xbe, 0xed, + 0x20, 0xcf, 0xe2, 0xef, 0xa8, 0xff, 0xa3, 0x00, 0xc8, 0xe4, 0xb9, 0xe1, 0x11, 0x8a, 0x3c, 0xfa, + 0x22, 0x2a, 0x7d, 0x08, 0xca, 0xcc, 0xe0, 0x9b, 0x84, 0xeb, 0x34, 0x2d, 0x6d, 0x12, 0x93, 0xe5, + 0xad, 0x78, 0x24, 0xde, 0x4a, 0x13, 0x79, 0x2b, 0x1f, 0xc6, 0x5b, 0xfd, 0xa7, 0x22, 0x98, 0x13, + 0x56, 0x24, 0x81, 0xef, 0x11, 0xcc, 0x40, 0x1b, 0x3c, 0x9d, 0xc5, 0x32, 0x25, 0x88, 0x8f, 0x58, + 0xf2, 0x09, 0xfc, 0x04, 0x14, 0xaf, 0x22, 0x8a, 0xf8, 0x92, 0x67, 0x57, 0x97, 0x8c, 0x94, 0xc1, + 0xd9, 0xbb, 0xd8, 0x33, 0x73, 0x99, 0xad, 0xea, 0x20, 0xd2, 0x17, 0x5a, 0x88, 0xa2, 0x77, 0x7d, + 0xd7, 0xa6, 0xd8, 0x0d, 0xe8, 0xbe, 0xc5, 0x91, 0xf0, 0x03, 0x50, 0xbd, 0x16, 0x86, 0x7e, 0xb8, + 0xb9, 0x1f, 0x60, 0x4e, 0x51, 0xd5, 0x3c, 0x7e, 0x10, 0xe9, 0x8b, 0x38, 0x1e, 0x4c, 0x21, 0x86, + 0x91, 0xf0, 0x6d, 0x50, 0xe2, 0x1d, 0x4e, 0x4a, 0xd5, 0x5c, 0x3c, 0x88, 0xf4, 0xd7, 0x38, 0x24, + 0x15, 0x2e, 0x22, 0xb2, 0x1c, 0x96, 0xa6, 0xe2, 0x30, 0x91, 0xb2, 0x9c, 0x96, 0x52, 0x05, 0x95, + 0x3d, 0x1c, 0x12, 0xf6, 0x9a, 0x0a, 0x1f, 0x8f, 0xbb, 0xf0, 0x0a, 0x00, 0x8c, 0x18, 0x9b, 0x50, + 0x7b, 0x9b, 0x79, 0x93, 0x91, 0x31, 0x6f, 0x88, 0xd2, 0x63, 0x61, 0xd2, 0x73, 0xa8, 0x09, 0x25, + 0x0b, 0xa9, 0x40, 0x2b, 0xd5, 0x86, 0xf7, 0x15, 0x50, 0x59, 0xc7, 0xa8, 0x85, 0x43, 0xa2, 0x56, + 0x6b, 0x85, 0xc6, 0xec, 0xea, 0x5b, 0x46, 0xba, 0xce, 0xdc, 0x0e, 0x7d, 0x17, 0xd3, 0x0e, 0xee, + 0x91, 0x58, 0x20, 0x11, 0x6d, 0x76, 0xfb, 0x91, 0xbe, 0x35, 0x8d, 0xc3, 0xa7, 0xaa, 0x6d, 0x87, + 0x7e, 0xe7, 0x20, 0xd2, 0x95, 0xf7, 0xac, 0x78, 0x8a, 0xf5, 0xdf, 0x15, 0xf0, 0x3a, 0x53, 0x78, + 0x83, 0xbd, 0x9b, 0xa4, 0x12, 0xc3, 0x45, 0x74, 0xbb, 0xa3, 0x2a, 0xcc, 0x66, 0x96, 0xe8, 0xa4, + 0x0b, 0x4f, 0xfe, 0x3f, 0x15, 0x9e, 0xc2, 0xd1, 0x0b, 0x4f, 0x9c, 0x0d, 0xc5, 0x89, 0xd9, 0x50, + 0x3a, 0x34, 0x1b, 0xbe, 0x2d, 0x88, 0xcc, 0x8f, 0xd7, 0x77, 0x84, 0x9c, 0xb8, 0x9e, 0xe4, 0x44, + 0x81, 0xcf, 0x36, 0xb1, 0x9a, 0x78, 0xd7, 0x8d, 0x16, 0xf6, 0xa8, 0xbd, 0x63, 0xe3, 0xf0, 0x39, + 0x99, 0x91, 0xb2, 0x5b, 0x21, 0x6b, 0xb7, 0xb4, 0x57, 0x8a, 0x2f, 0xbd, 0x57, 0x46, 0xb2, 0xa3, + 0xf4, 0x02, 0xd9, 0x51, 0x7f, 0x9a, 0x07, 0xcb, 0x4c, 0x8e, 0x9b, 0x68, 0x0b, 0x3b, 0x5f, 0x20, + 0xf7, 0x88, 0x92, 0x9c, 0x4a, 0x49, 0x52, 0x35, 0xe1, 0xff, 0x94, 0x4f, 0x41, 0xf9, 0x0f, 0x0a, + 0x98, 0x89, 0x6b, 0x38, 0x34, 0x00, 0x10, 0x30, 0x5e, 0xa6, 0x05, 0xd1, 0x0b, 0x0c, 0x1c, 0x26, + 0xa3, 0x56, 0x2a, 0x02, 0x7e, 0x0d, 0xca, 0xa2, 0x27, 0xb3, 0xe0, 0x78, 0x2a, 0x0b, 0x68, 0x88, + 0x91, 0x7b, 0xa5, 0x85, 0x02, 0x8a, 0x43, 0xf3, 0x22, 0x9b, 0x45, 0x3f, 0xd2, 0x4f, 0x3f, 0x8b, + 0x22, 0x7e, 0x5a, 0x13, 0x38, 0x26, 0xae, 0xf8, 0xa6, 0x25, 0xbf, 0x50, 0xff, 0x4e, 0x01, 0xc7, + 0xd8, 0x44, 0x19, 0x35, 0x89, 0x2b, 0xae, 0x82, 0x99, 0x50, 0xb6, 0xf9, 0x74, 0x67, 0x57, 0xeb, + 0x46, 0x96, 0xd6, 0x09, 0x54, 0x9a, 0xc5, 0x07, 0x91, 0xae, 0x58, 0x09, 0x12, 0xae, 0x65, 0x68, + 0xcc, 0x4f, 0xa2, 0x91, 0x41, 0x72, 0x19, 0xe2, 0x7e, 0xcd, 0x03, 0x78, 0xc3, 0x6b, 0xe1, 0xbb, + 0xcc, 0x7c, 0x43, 0x9f, 0xf6, 0xc6, 0x66, 0x74, 0x72, 0x48, 0xca, 0x78, 0xbc, 0x79, 0xb9, 0x1f, + 0xe9, 0xe7, 0x9f, 0xc5, 0xca, 0x33, 0xc0, 0xa9, 0x25, 0xa4, 0x8d, 0x9b, 0x7f, 0xf9, 0xf7, 0x95, + 0x9f, 0xf3, 0x60, 0xe1, 0x4b, 0xdf, 0xe9, 0xb9, 0x38, 0x21, 0xce, 0x1d, 0x23, 0x4e, 0x1d, 0x12, + 0x97, 0x8d, 0x35, 0xcf, 0xf7, 0x23, 0x7d, 0x6d, 0x2a, 0xd2, 0xb2, 0xc0, 0x57, 0x97, 0xb0, 0xfb, + 0x79, 0xb0, 0xb4, 0xe9, 0x07, 0x9f, 0x6f, 0xf0, 0xab, 0x50, 0xaa, 0x2e, 0xe2, 0x31, 0xda, 0x96, + 0x86, 0xb4, 0x31, 0xc4, 0x2d, 0x44, 0x43, 0xfb, 0xae, 0xb9, 0xd6, 0x8f, 0xf4, 0xe6, 0x54, 0x94, + 0x0d, 0x41, 0xaf, 0x2e, 0x5d, 0xbf, 0xe5, 0xc1, 0xf2, 0x9d, 0x1e, 0xf2, 0xa8, 0xed, 0x60, 0x41, + 0x59, 0x42, 0xd8, 0xfe, 0x18, 0x61, 0xda, 0x90, 0xb0, 0x2c, 0x46, 0x52, 0xf7, 0x51, 0x3f, 0xd2, + 0x2f, 0x4e, 0x45, 0xdd, 0x24, 0xf8, 0xab, 0x4b, 0xe2, 0x2f, 0x45, 0x30, 0xcf, 0xaf, 0x4a, 0x09, + 0x77, 0xef, 0x00, 0xb9, 0xe5, 0x4a, 0xe6, 0x60, 0x7c, 0x46, 0x0b, 0x83, 0x6d, 0x63, 0x43, 0x6e, + 0xc6, 0x22, 0x02, 0x5e, 0x00, 0x65, 0xc2, 0x4f, 0x42, 0xb2, 0xa0, 0x6a, 0xa3, 0xb7, 0x86, 0xec, + 0x99, 0x6b, 0x3d, 0x67, 0xc9, 0x78, 0x76, 0x97, 0x72, 0xd8, 0x01, 0x20, 0x3e, 0x09, 0xd6, 0x47, + 0x91, 0xe3, 0xc7, 0x03, 0x86, 0x16, 0x18, 0x78, 0x0e, 0x94, 0x78, 0xe5, 0x96, 0xb7, 0xdf, 0xcc, + 0x67, 0xc7, 0x4b, 0xe8, 0x7a, 0xce, 0x12, 0xe1, 0x70, 0x15, 0x14, 0x83, 0xd0, 0x77, 0xe5, 0x2e, + 0x7a, 0x72, 0xf4, 0x9b, 0xe9, 0x6d, 0x67, 0x3d, 0x67, 0xf1, 0x58, 0x78, 0x96, 0x1d, 0x79, 0xd9, + 0x7e, 0x45, 0xf8, 0x15, 0x82, 0x95, 0xac, 0x11, 0x58, 0x0a, 0x12, 0x87, 0xc2, 0xb3, 0xa0, 0xbc, + 0xc7, 0xcb, 0x12, 0xbf, 0x5f, 0xb0, 0xb3, 0x63, 0x0a, 0x94, 0x2d, 0x58, 0x6c, 0x5d, 0x22, 0x16, + 0x5e, 0x07, 0x73, 0xd4, 0x0f, 0xba, 0x71, 0x01, 0x90, 0xd7, 0x8f, 0x5a, 0x1a, 0x3b, 0xa9, 0x40, + 0xac, 0xe7, 0xac, 0x0c, 0x0e, 0xde, 0x06, 0xc7, 0x76, 0x33, 0x36, 0xc5, 0x84, 0xff, 0x86, 0x30, + 0xc2, 0xf3, 0xe4, 0xec, 0x59, 0xcf, 0x59, 0x63, 0x68, 0x13, 0x0c, 0x33, 0xaa, 0xfe, 0x57, 0x01, + 0xcc, 0x49, 0xcf, 0x88, 0xbb, 0xc2, 0xf9, 0xc4, 0x06, 0xc2, 0x32, 0x6f, 0x1e, 0x66, 0x03, 0x1e, + 0x9e, 0x72, 0xc1, 0xfb, 0x89, 0x0b, 0x84, 0x7f, 0x96, 0x87, 0x59, 0xca, 0xf5, 0x4f, 0x21, 0xa4, + 0xf2, 0x6b, 0xb1, 0xf2, 0xc2, 0x36, 0x27, 0x26, 0xef, 0xbb, 0x31, 0x4a, 0xca, 0x7e, 0x09, 0x54, + 0x6c, 0x71, 0xed, 0x9f, 0x64, 0x98, 0xf1, 0x5f, 0x05, 0x98, 0x90, 0x12, 0x00, 0xd7, 0x86, 0xf2, + 0x0b, 0xd7, 0x1c, 0x1f, 0x97, 0x3f, 0x01, 0xc5, 0xea, 0x9f, 0x49, 0xd4, 0x2f, 0x4b, 0xcc, 0xd8, + 0x66, 0x95, 0x2c, 0x4c, 0x4a, 0xbf, 0x0e, 0x66, 0x5c, 0x4c, 0x11, 0x3b, 0xcb, 0xaa, 0x15, 0x5e, + 0x37, 0x4e, 0x65, 0xa5, 0x1a, 0xf2, 0x6d, 0xdc, 0x92, 0x81, 0xd7, 0x3c, 0x1a, 0xee, 0xcb, 0x63, + 0x4b, 0x82, 0x5e, 0xb9, 0x0c, 0xe6, 0x33, 0x01, 0xf0, 0x18, 0x28, 0x74, 0x71, 0xfc, 0x0b, 0x07, + 0x6b, 0xb2, 0xcb, 0xdd, 0x1e, 0x72, 0x7a, 0x98, 0xd3, 0x5e, 0xb5, 0x44, 0xe7, 0x52, 0xfe, 0x82, + 0x62, 0x56, 0x41, 0x25, 0x14, 0x5f, 0x31, 0x5b, 0x0f, 0x1f, 0x6b, 0xb9, 0x47, 0x8f, 0xb5, 0xdc, + 0xd3, 0xc7, 0x9a, 0xf2, 0xcd, 0x40, 0x53, 0x7e, 0x1c, 0x68, 0xca, 0x83, 0x81, 0xa6, 0x3c, 0x1c, + 0x68, 0xca, 0x9f, 0x03, 0x4d, 0xf9, 0x7b, 0xa0, 0xe5, 0x9e, 0x0e, 0x34, 0xe5, 0xde, 0x13, 0x2d, + 0xf7, 0xf0, 0x89, 0x96, 0x7b, 0xf4, 0x44, 0xcb, 0x7d, 0x65, 0x1c, 0xad, 0x84, 0x6d, 0x95, 0x39, + 0x2d, 0x6b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x2b, 0x59, 0x8b, 0xcb, 0x14, 0x00, 0x00, +} + +func (this *LokiRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiRequest) + if !ok { + that2, ok := that.(LokiRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Query != that1.Query { + return false + } + if this.Limit != that1.Limit { + return false + } + if this.Step != that1.Step { + return false + } + if this.Interval != that1.Interval { + return false + } + if !this.StartTs.Equal(that1.StartTs) { + return false + } + if !this.EndTs.Equal(that1.EndTs) { + return false + } + if this.Direction != that1.Direction { + return false + } + if this.Path != that1.Path { + return false + } + if len(this.Shards) != len(that1.Shards) { + return false + } + for i := range this.Shards { + if this.Shards[i] != that1.Shards[i] { + return false + } + } + if that1.Plan == nil { + if this.Plan != nil { + return false + } + } else if !this.Plan.Equal(*that1.Plan) { + return false + } + return true +} +func (this *LokiInstantRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiInstantRequest) + if !ok { + that2, ok := that.(LokiInstantRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Query != that1.Query { + return false + } + if this.Limit != that1.Limit { + return false + } + if !this.TimeTs.Equal(that1.TimeTs) { + return false + } + if this.Direction != that1.Direction { + return false + } + if this.Path != that1.Path { + return false + } + if len(this.Shards) != len(that1.Shards) { + return false + } + for i := range this.Shards { + if this.Shards[i] != that1.Shards[i] { + return false + } + } + return true +} +func (this *LokiResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiResponse) + if !ok { + that2, ok := that.(LokiResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Status != that1.Status { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.ErrorType != that1.ErrorType { + return false + } + if this.Error != that1.Error { + return false + } + if this.Direction != that1.Direction { + return false + } + if this.Limit != that1.Limit { + return false + } + if this.Version != that1.Version { + return false + } + if !this.Statistics.Equal(&that1.Statistics) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *LokiSeriesRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiSeriesRequest) + if !ok { + that2, ok := that.(LokiSeriesRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Match) != len(that1.Match) { + return false + } + for i := range this.Match { + if this.Match[i] != that1.Match[i] { + return false + } + } + if !this.StartTs.Equal(that1.StartTs) { + return false + } + if !this.EndTs.Equal(that1.EndTs) { + return false + } + if this.Path != that1.Path { + return false + } + if len(this.Shards) != len(that1.Shards) { + return false + } + for i := range this.Shards { + if this.Shards[i] != that1.Shards[i] { + return false + } + } + return true +} +func (this *LokiSeriesResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiSeriesResponse) + if !ok { + that2, ok := that.(LokiSeriesResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Status != that1.Status { + return false + } + if len(this.Data) != len(that1.Data) { + return false + } + for i := range this.Data { + if !this.Data[i].Equal(&that1.Data[i]) { + return false + } + } + if this.Version != that1.Version { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + if !this.Statistics.Equal(&that1.Statistics) { + return false + } + return true +} +func (this *LokiLabelNamesResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiLabelNamesResponse) + if !ok { + that2, ok := that.(LokiLabelNamesResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Status != that1.Status { + return false + } + if len(this.Data) != len(that1.Data) { + return false + } + for i := range this.Data { + if this.Data[i] != that1.Data[i] { + return false + } + } + if this.Version != that1.Version { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + if !this.Statistics.Equal(&that1.Statistics) { + return false + } + return true +} +func (this *LokiData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiData) + if !ok { + that2, ok := that.(LokiData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ResultType != that1.ResultType { + return false + } + if len(this.Result) != len(that1.Result) { + return false + } + for i := range this.Result { + if !this.Result[i].Equal(that1.Result[i]) { + return false + } + } + return true +} +func (this *LokiPromResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LokiPromResponse) + if !ok { + that2, ok := that.(LokiPromResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Response.Equal(that1.Response) { + return false + } + if !this.Statistics.Equal(&that1.Statistics) { + return false + } + return true +} +func (this *IndexStatsResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*IndexStatsResponse) + if !ok { + that2, ok := that.(IndexStatsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if !this.Response.Equal(*that1.Response) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *VolumeResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*VolumeResponse) + if !ok { + that2, ok := that.(VolumeResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if !this.Response.Equal(*that1.Response) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *TopKSketchesResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TopKSketchesResponse) + if !ok { + that2, ok := that.(TopKSketchesResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if !this.Response.Equal(*that1.Response) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *QuantileSketchResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QuantileSketchResponse) + if !ok { + that2, ok := that.(QuantileSketchResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if !this.Response.Equal(*that1.Response) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *QueryResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse) + if !ok { + that2, ok := that.(QueryResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Status.Equal(that1.Status) { + return false + } + if that1.Response == nil { + if this.Response != nil { + return false + } + } else if this.Response == nil { + return false + } else if !this.Response.Equal(that1.Response) { + return false + } + return true +} +func (this *QueryResponse_Series) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Series) + if !ok { + that2, ok := that.(QueryResponse_Series) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Series.Equal(that1.Series) { + return false + } + return true +} +func (this *QueryResponse_Labels) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Labels) + if !ok { + that2, ok := that.(QueryResponse_Labels) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Labels.Equal(that1.Labels) { + return false + } + return true +} +func (this *QueryResponse_Stats) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Stats) + if !ok { + that2, ok := that.(QueryResponse_Stats) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Stats.Equal(that1.Stats) { + return false + } + return true +} +func (this *QueryResponse_Prom) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Prom) + if !ok { + that2, ok := that.(QueryResponse_Prom) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Prom.Equal(that1.Prom) { + return false + } + return true +} +func (this *QueryResponse_Streams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Streams) + if !ok { + that2, ok := that.(QueryResponse_Streams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Streams.Equal(that1.Streams) { + return false + } + return true +} +func (this *QueryResponse_Volume) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_Volume) + if !ok { + that2, ok := that.(QueryResponse_Volume) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Volume.Equal(that1.Volume) { + return false + } + return true +} +func (this *QueryResponse_TopkSketches) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_TopkSketches) + if !ok { + that2, ok := that.(QueryResponse_TopkSketches) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.TopkSketches.Equal(that1.TopkSketches) { + return false + } + return true +} +func (this *QueryResponse_QuantileSketches) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryResponse_QuantileSketches) + if !ok { + that2, ok := that.(QueryResponse_QuantileSketches) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.QuantileSketches.Equal(that1.QuantileSketches) { + return false + } + return true +} +func (this *QueryRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest) + if !ok { + that2, ok := that.(QueryRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if that1.Request == nil { + if this.Request != nil { + return false + } + } else if this.Request == nil { + return false + } else if !this.Request.Equal(that1.Request) { + return false + } + if len(this.Metadata) != len(that1.Metadata) { + return false + } + for i := range this.Metadata { + if this.Metadata[i] != that1.Metadata[i] { + return false + } + } + return true +} +func (this *QueryRequest_Series) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Series) + if !ok { + that2, ok := that.(QueryRequest_Series) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Series.Equal(that1.Series) { + return false + } + return true +} +func (this *QueryRequest_Labels) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Labels) + if !ok { + that2, ok := that.(QueryRequest_Labels) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Labels.Equal(that1.Labels) { + return false + } + return true +} +func (this *QueryRequest_Stats) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Stats) + if !ok { + that2, ok := that.(QueryRequest_Stats) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Stats.Equal(that1.Stats) { + return false + } + return true +} +func (this *QueryRequest_Instant) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Instant) + if !ok { + that2, ok := that.(QueryRequest_Instant) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Instant.Equal(that1.Instant) { + return false + } + return true +} +func (this *QueryRequest_Streams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Streams) + if !ok { + that2, ok := that.(QueryRequest_Streams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Streams.Equal(that1.Streams) { + return false + } + return true +} +func (this *QueryRequest_Volume) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryRequest_Volume) + if !ok { + that2, ok := that.(QueryRequest_Volume) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Volume.Equal(that1.Volume) { + return false + } + return true +} +func (this *LokiRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 14) + s = append(s, "&queryrange.LokiRequest{") + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "Step: "+fmt.Sprintf("%#v", this.Step)+",\n") + s = append(s, "Interval: "+fmt.Sprintf("%#v", this.Interval)+",\n") + s = append(s, "StartTs: "+fmt.Sprintf("%#v", this.StartTs)+",\n") + s = append(s, "EndTs: "+fmt.Sprintf("%#v", this.EndTs)+",\n") + s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") + s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + s = append(s, "Plan: "+fmt.Sprintf("%#v", this.Plan)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiInstantRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 10) + s = append(s, "&queryrange.LokiInstantRequest{") + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "TimeTs: "+fmt.Sprintf("%#v", this.TimeTs)+",\n") + s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") + s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 13) + s = append(s, "&queryrange.LokiResponse{") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + s = append(s, "Data: "+strings.Replace(this.Data.GoString(), `&`, ``, 1)+",\n") + s = append(s, "ErrorType: "+fmt.Sprintf("%#v", this.ErrorType)+",\n") + s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") + s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") + s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiSeriesRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&queryrange.LokiSeriesRequest{") + s = append(s, "Match: "+fmt.Sprintf("%#v", this.Match)+",\n") + s = append(s, "StartTs: "+fmt.Sprintf("%#v", this.StartTs)+",\n") + s = append(s, "EndTs: "+fmt.Sprintf("%#v", this.EndTs)+",\n") + s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") + s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiSeriesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&queryrange.LokiSeriesResponse{") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + if this.Data != nil { + vs := make([]*logproto.SeriesIdentifier, len(this.Data)) + for i := range vs { + vs[i] = &this.Data[i] + } + s = append(s, "Data: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiLabelNamesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&queryrange.LokiLabelNamesResponse{") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") + s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiData) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.LokiData{") + s = append(s, "ResultType: "+fmt.Sprintf("%#v", this.ResultType)+",\n") + s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LokiPromResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.LokiPromResponse{") + if this.Response != nil { + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + } + s = append(s, "Statistics: "+strings.Replace(this.Statistics.GoString(), `&`, ``, 1)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *IndexStatsResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.IndexStatsResponse{") + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *VolumeResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.VolumeResponse{") + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *TopKSketchesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.TopKSketchesResponse{") + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QuantileSketchResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrange.QuantileSketchResponse{") + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 13) + s = append(s, "&queryrange.QueryResponse{") + if this.Status != nil { + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + } + if this.Response != nil { + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryResponse_Series) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Series{` + + `Series:` + fmt.Sprintf("%#v", this.Series) + `}`}, ", ") + return s +} +func (this *QueryResponse_Labels) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Labels{` + + `Labels:` + fmt.Sprintf("%#v", this.Labels) + `}`}, ", ") + return s +} +func (this *QueryResponse_Stats) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Stats{` + + `Stats:` + fmt.Sprintf("%#v", this.Stats) + `}`}, ", ") + return s +} +func (this *QueryResponse_Prom) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Prom{` + + `Prom:` + fmt.Sprintf("%#v", this.Prom) + `}`}, ", ") + return s +} +func (this *QueryResponse_Streams) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Streams{` + + `Streams:` + fmt.Sprintf("%#v", this.Streams) + `}`}, ", ") + return s +} +func (this *QueryResponse_Volume) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_Volume{` + + `Volume:` + fmt.Sprintf("%#v", this.Volume) + `}`}, ", ") + return s +} +func (this *QueryResponse_TopkSketches) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_TopkSketches{` + + `TopkSketches:` + fmt.Sprintf("%#v", this.TopkSketches) + `}`}, ", ") + return s +} +func (this *QueryResponse_QuantileSketches) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryResponse_QuantileSketches{` + + `QuantileSketches:` + fmt.Sprintf("%#v", this.QuantileSketches) + `}`}, ", ") + return s +} +func (this *QueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 11) + s = append(s, "&queryrange.QueryRequest{") + if this.Request != nil { + s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k, _ := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%#v: %#v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + if this.Metadata != nil { + s = append(s, "Metadata: "+mapStringForMetadata+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryRequest_Series) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Series{` + + `Series:` + fmt.Sprintf("%#v", this.Series) + `}`}, ", ") + return s +} +func (this *QueryRequest_Labels) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Labels{` + + `Labels:` + fmt.Sprintf("%#v", this.Labels) + `}`}, ", ") + return s +} +func (this *QueryRequest_Stats) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Stats{` + + `Stats:` + fmt.Sprintf("%#v", this.Stats) + `}`}, ", ") + return s +} +func (this *QueryRequest_Instant) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Instant{` + + `Instant:` + fmt.Sprintf("%#v", this.Instant) + `}`}, ", ") + return s +} +func (this *QueryRequest_Streams) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Streams{` + + `Streams:` + fmt.Sprintf("%#v", this.Streams) + `}`}, ", ") + return s +} +func (this *QueryRequest_Volume) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&queryrange.QueryRequest_Volume{` + + `Volume:` + fmt.Sprintf("%#v", this.Volume) + `}`}, ", ") + return s +} +func valueToGoStringQueryrange(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *LokiRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Plan != nil { + { + size := m.Plan.Size() + i -= size + if _, err := m.Plan.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.Interval != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Interval)) + i-- + dAtA[i] = 0x48 + } + if len(m.Shards) > 0 { + for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Shards[iNdEx]) + copy(dAtA[i:], m.Shards[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x3a + } + if m.Direction != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) + i-- + dAtA[i] = 0x30 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQueryrange(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQueryrange(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x22 + if m.Step != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Step)) + i-- + dAtA[i] = 0x18 + } + if m.Limit != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiInstantRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiInstantRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiInstantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Shards) > 0 { + for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Shards[iNdEx]) + copy(dAtA[i:], m.Shards[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x2a + } + if m.Direction != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) + i-- + dAtA[i] = 0x20 + } + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.TimeTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.TimeTs):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintQueryrange(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1a + if m.Limit != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x10 + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + { + size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Version != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x38 + } + if m.Limit != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x30 + } + if m.Direction != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Direction)) + i-- + dAtA[i] = 0x28 + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if len(m.ErrorType) > 0 { + i -= len(m.ErrorType) + copy(dAtA[i:], m.ErrorType) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ErrorType))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiSeriesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiSeriesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiSeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Shards) > 0 { + for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Shards[iNdEx]) + copy(dAtA[i:], m.Shards[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Shards[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x22 + } + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintQueryrange(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1a + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintQueryrange(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Match[iNdEx]) + copy(dAtA[i:], m.Match[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Match[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LokiSeriesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiSeriesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Version != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiLabelNamesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiLabelNamesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiLabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Version != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Data[iNdEx]) + copy(dAtA[i:], m.Data[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Data[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Result) > 0 { + for iNdEx := len(m.Result) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Result[iNdEx].Size() + i -= size + if _, err := m.Result[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ResultType) > 0 { + i -= len(m.ResultType) + copy(dAtA[i:], m.ResultType) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ResultType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LokiPromResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LokiPromResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LokiPromResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Statistics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IndexStatsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexStatsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VolumeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VolumeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TopKSketchesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TopKSketchesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TopKSketchesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuantileSketchResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuantileSketchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuantileSketchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Headers[iNdEx].Size() + i -= size + if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse_Series) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Series != nil { + { + size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Labels) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Labels) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Labels != nil { + { + size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Stats) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Prom) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Prom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Prom != nil { + { + size, err := m.Prom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Streams) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Streams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Streams != nil { + { + size, err := m.Streams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_Volume) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Volume != nil { + { + size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_TopkSketches) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_TopkSketches) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.TopkSketches != nil { + { + size, err := m.TopkSketches.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil +} +func (m *QueryResponse_QuantileSketches) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryResponse_QuantileSketches) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.QuantileSketches != nil { + { + size, err := m.QuantileSketches.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *QueryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQueryrange(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQueryrange(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQueryrange(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.Request != nil { + { + size := m.Request.Size() + i -= size + if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *QueryRequest_Series) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Series != nil { + { + size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *QueryRequest_Labels) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Labels) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Labels != nil { + { + size, err := m.Labels.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *QueryRequest_Stats) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *QueryRequest_Instant) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Instant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Instant != nil { + { + size, err := m.Instant.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *QueryRequest_Streams) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Streams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Streams != nil { + { + size, err := m.Streams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *QueryRequest_Volume) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *QueryRequest_Volume) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Volume != nil { + { + size, err := m.Volume.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func encodeVarintQueryrange(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryrange(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LokiRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sovQueryrange(uint64(m.Limit)) + } + if m.Step != 0 { + n += 1 + sovQueryrange(uint64(m.Step)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs) + n += 1 + l + sovQueryrange(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs) + n += 1 + l + sovQueryrange(uint64(l)) + if m.Direction != 0 { + n += 1 + sovQueryrange(uint64(m.Direction)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Shards) > 0 { + for _, s := range m.Shards { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } + if m.Interval != 0 { + n += 1 + sovQueryrange(uint64(m.Interval)) + } + if m.Plan != nil { + l = m.Plan.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} + +func (m *LokiInstantRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Query) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sovQueryrange(uint64(m.Limit)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.TimeTs) + n += 1 + l + sovQueryrange(uint64(l)) + if m.Direction != 0 { + n += 1 + sovQueryrange(uint64(m.Direction)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Shards) > 0 { + for _, s := range m.Shards { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *LokiResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovQueryrange(uint64(l)) + l = len(m.ErrorType) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if m.Direction != 0 { + n += 1 + sovQueryrange(uint64(m.Direction)) + } + if m.Limit != 0 { + n += 1 + sovQueryrange(uint64(m.Limit)) + } + if m.Version != 0 { + n += 1 + sovQueryrange(uint64(m.Version)) + } + l = m.Statistics.Size() + n += 1 + l + sovQueryrange(uint64(l)) + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *LokiSeriesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Match) > 0 { + for _, s := range m.Match { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs) + n += 1 + l + sovQueryrange(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs) + n += 1 + l + sovQueryrange(uint64(l)) + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Shards) > 0 { + for _, s := range m.Shards { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *LokiSeriesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + if m.Version != 0 { + n += 1 + sovQueryrange(uint64(m.Version)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + l = m.Statistics.Size() + n += 1 + l + sovQueryrange(uint64(l)) + return n +} + +func (m *LokiLabelNamesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Data) > 0 { + for _, s := range m.Data { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } + if m.Version != 0 { + n += 1 + sovQueryrange(uint64(m.Version)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + l = m.Statistics.Size() + n += 1 + l + sovQueryrange(uint64(l)) + return n +} + +func (m *LokiData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ResultType) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Result) > 0 { + for _, e := range m.Result { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *LokiPromResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + l = m.Statistics.Size() + n += 1 + l + sovQueryrange(uint64(l)) + return n +} + +func (m *IndexStatsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *VolumeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *TopKSketchesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *QuantileSketchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + if m.Response != nil { + n += m.Response.Size() + } + return n +} + +func (m *QueryResponse_Series) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Series != nil { + l = m.Series.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_Labels) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_Stats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_Prom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Prom != nil { + l = m.Prom.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_Streams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Streams != nil { + l = m.Streams.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_Volume) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Volume != nil { + l = m.Volume.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_TopkSketches) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TopkSketches != nil { + l = m.TopkSketches.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryResponse_QuantileSketches) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QuantileSketches != nil { + l = m.QuantileSketches.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + n += m.Request.Size() + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovQueryrange(uint64(len(k))) + 1 + len(v) + sovQueryrange(uint64(len(v))) + n += mapEntrySize + 1 + sovQueryrange(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryRequest_Series) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Series != nil { + l = m.Series.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest_Labels) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Labels != nil { + l = m.Labels.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest_Stats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest_Instant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Instant != nil { + l = m.Instant.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest_Streams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Streams != nil { + l = m.Streams.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} +func (m *QueryRequest_Volume) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Volume != nil { + l = m.Volume.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} + +func sovQueryrange(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryrange(x uint64) (n int) { + return sovQueryrange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *LokiRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiRequest{`, + `Query:` + fmt.Sprintf("%v", this.Query) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `Step:` + fmt.Sprintf("%v", this.Step) + `,`, + `StartTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `EndTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EndTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `Interval:` + fmt.Sprintf("%v", this.Interval) + `,`, + `Plan:` + fmt.Sprintf("%v", this.Plan) + `,`, + `}`, + }, "") + return s +} +func (this *LokiInstantRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiInstantRequest{`, + `Query:` + fmt.Sprintf("%v", this.Query) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `TimeTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.TimeTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `}`, + }, "") + return s +} +func (this *LokiResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiResponse{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Data:` + strings.Replace(strings.Replace(this.Data.String(), "LokiData", "LokiData", 1), `&`, ``, 1) + `,`, + `ErrorType:` + fmt.Sprintf("%v", this.ErrorType) + `,`, + `Error:` + fmt.Sprintf("%v", this.Error) + `,`, + `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `}`, + }, "") + return s +} +func (this *LokiSeriesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiSeriesRequest{`, + `Match:` + fmt.Sprintf("%v", this.Match) + `,`, + `StartTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `EndTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EndTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `}`, + }, "") + return s +} +func (this *LokiSeriesResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForData := "[]SeriesIdentifier{" + for _, f := range this.Data { + repeatedStringForData += fmt.Sprintf("%v", f) + "," + } + repeatedStringForData += "}" + s := strings.Join([]string{`&LokiSeriesResponse{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Data:` + repeatedStringForData + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *LokiLabelNamesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiLabelNamesResponse{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *LokiData) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiData{`, + `ResultType:` + fmt.Sprintf("%v", this.ResultType) + `,`, + `Result:` + fmt.Sprintf("%v", this.Result) + `,`, + `}`, + }, "") + return s +} +func (this *LokiPromResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LokiPromResponse{`, + `Response:` + strings.Replace(fmt.Sprintf("%v", this.Response), "PrometheusResponse", "queryrangebase.PrometheusResponse", 1) + `,`, + `Statistics:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Statistics), "Result", "stats.Result", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *IndexStatsResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IndexStatsResponse{`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeResponse{`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `}`, + }, "") + return s +} +func (this *TopKSketchesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TopKSketchesResponse{`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `}`, + }, "") + return s +} +func (this *QuantileSketchResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QuantileSketchResponse{`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `Headers:` + fmt.Sprintf("%v", this.Headers) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse{`, + `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1) + `,`, + `Response:` + fmt.Sprintf("%v", this.Response) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Series) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Series{`, + `Series:` + strings.Replace(fmt.Sprintf("%v", this.Series), "LokiSeriesResponse", "LokiSeriesResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Labels) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Labels{`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "LokiLabelNamesResponse", "LokiLabelNamesResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Stats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Stats{`, + `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "IndexStatsResponse", "IndexStatsResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Prom) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Prom{`, + `Prom:` + strings.Replace(fmt.Sprintf("%v", this.Prom), "LokiPromResponse", "LokiPromResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Streams) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Streams{`, + `Streams:` + strings.Replace(fmt.Sprintf("%v", this.Streams), "LokiResponse", "LokiResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_Volume) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_Volume{`, + `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "VolumeResponse", "VolumeResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_TopkSketches) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_TopkSketches{`, + `TopkSketches:` + strings.Replace(fmt.Sprintf("%v", this.TopkSketches), "TopKSketchesResponse", "TopKSketchesResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryResponse_QuantileSketches) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryResponse_QuantileSketches{`, + `QuantileSketches:` + strings.Replace(fmt.Sprintf("%v", this.QuantileSketches), "QuantileSketchResponse", "QuantileSketchResponse", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest) String() string { + if this == nil { + return "nil" + } + keysForMetadata := make([]string, 0, len(this.Metadata)) + for k, _ := range this.Metadata { + keysForMetadata = append(keysForMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) + mapStringForMetadata := "map[string]string{" + for _, k := range keysForMetadata { + mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) + } + mapStringForMetadata += "}" + s := strings.Join([]string{`&QueryRequest{`, + `Request:` + fmt.Sprintf("%v", this.Request) + `,`, + `Metadata:` + mapStringForMetadata + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Series) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Series{`, + `Series:` + strings.Replace(fmt.Sprintf("%v", this.Series), "LokiSeriesRequest", "LokiSeriesRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Labels) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Labels{`, + `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "LabelRequest", "logproto.LabelRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Stats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Stats{`, + `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "IndexStatsRequest", "logproto.IndexStatsRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Instant) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Instant{`, + `Instant:` + strings.Replace(fmt.Sprintf("%v", this.Instant), "LokiInstantRequest", "LokiInstantRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Streams) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Streams{`, + `Streams:` + strings.Replace(fmt.Sprintf("%v", this.Streams), "LokiRequest", "LokiRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *QueryRequest_Volume) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryRequest_Volume{`, + `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "VolumeRequest", "logproto.VolumeRequest", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringQueryrange(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *LokiRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + m.Step = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Step |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) + } + m.Direction = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Direction |= logproto.Direction(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + m.Interval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Interval |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_grafana_loki_pkg_querier_plan.QueryPlan + m.Plan = &v + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiInstantRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiInstantRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiInstantRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.TimeTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) + } + m.Direction = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Direction |= logproto.Direction(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Direction", wireType) + } + m.Direction = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Direction |= logproto.Direction(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiSeriesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiSeriesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiSeriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = append(m.Match, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTs, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiSeriesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiSeriesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiSeriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, logproto.SeriesIdentifier{}) + if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiLabelNamesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiLabelNamesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiLabelNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResultType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResultType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = append(m.Result, github_com_grafana_loki_pkg_push.Stream{}) + if err := m.Result[len(m.Result)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LokiPromResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LokiPromResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LokiPromResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &queryrangebase.PrometheusResponse{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Statistics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IndexStatsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexStatsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &github_com_grafana_loki_pkg_logproto.IndexStatsResponse{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &github_com_grafana_loki_pkg_logproto.VolumeResponse{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TopKSketchesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TopKSketchesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TopKSketchesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &github_com_grafana_loki_pkg_logproto.TopKMatrix{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuantileSketchResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuantileSketchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuantileSketchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &github_com_grafana_loki_pkg_logproto.QuantileSketchMatrix{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = &rpc.Status{} + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiSeriesResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Series{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiLabelNamesResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Labels{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &IndexStatsResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Stats{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiPromResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Prom{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Streams{v} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &VolumeResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_Volume{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TopkSketches", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &TopKSketchesResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_TopkSketches{v} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuantileSketches", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &QuantileSketchResponse{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Response = &QueryResponse_QuantileSketches{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiSeriesRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Series{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &logproto.LabelRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Labels{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &logproto.IndexStatsRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Stats{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Instant", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiInstantRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Instant{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Streams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LokiRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Streams{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &logproto.VolumeRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &QueryRequest_Volume{v} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQueryrange + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQueryrange + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthQueryrange + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthQueryrange + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryrange(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQueryrange + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryrange + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + 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 := skipQueryrange(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryrange + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/querier/queryrange/queryrange.proto b/pkg/querier/queryrange/queryrange.proto index 6de74cde1464d..89058eef22fe6 100644 --- a/pkg/querier/queryrange/queryrange.proto +++ b/pkg/querier/queryrange/queryrange.proto @@ -33,7 +33,7 @@ message LokiRequest { logproto.Direction direction = 6; string path = 7; repeated string shards = 8 [(gogoproto.jsontag) = "shards"]; - optional plan.QueryPlan = 0 [ + bytes plan = 10 [ (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" ]; } @@ -48,6 +48,9 @@ message LokiInstantRequest { logproto.Direction direction = 4; string path = 5; repeated string shards = 6 [(gogoproto.jsontag) = "shards"]; + bytes plan = 6 [ + (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" + ]; } message LokiResponse { diff --git a/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go b/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go new file mode 100644 index 0000000000000..f9ee4b21059bb --- /dev/null +++ b/pkg/querier/queryrange/queryrangebase/definitions/definitions.pb.go @@ -0,0 +1,969 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/querier/queryrange/queryrangebase/definitions/definitions.proto + +package definitions + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Defined here to prevent circular imports between logproto & queryrangebase +type CachingOptions struct { + Disabled bool `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"` +} + +func (m *CachingOptions) Reset() { *m = CachingOptions{} } +func (*CachingOptions) ProtoMessage() {} +func (*CachingOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_d1a37772b6ae2c5c, []int{0} +} +func (m *CachingOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CachingOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CachingOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CachingOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_CachingOptions.Merge(m, src) +} +func (m *CachingOptions) XXX_Size() int { + return m.Size() +} +func (m *CachingOptions) XXX_DiscardUnknown() { + xxx_messageInfo_CachingOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_CachingOptions proto.InternalMessageInfo + +func (m *CachingOptions) GetDisabled() bool { + if m != nil { + return m.Disabled + } + return false +} + +type PrometheusRequestHeader struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` + Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` +} + +func (m *PrometheusRequestHeader) Reset() { *m = PrometheusRequestHeader{} } +func (*PrometheusRequestHeader) ProtoMessage() {} +func (*PrometheusRequestHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_d1a37772b6ae2c5c, []int{1} +} +func (m *PrometheusRequestHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusRequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusRequestHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PrometheusRequestHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusRequestHeader.Merge(m, src) +} +func (m *PrometheusRequestHeader) XXX_Size() int { + return m.Size() +} +func (m *PrometheusRequestHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusRequestHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusRequestHeader proto.InternalMessageInfo + +func (m *PrometheusRequestHeader) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PrometheusRequestHeader) GetValues() []string { + if m != nil { + return m.Values + } + return nil +} + +type PrometheusResponseHeader struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` + Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` +} + +func (m *PrometheusResponseHeader) Reset() { *m = PrometheusResponseHeader{} } +func (*PrometheusResponseHeader) ProtoMessage() {} +func (*PrometheusResponseHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_d1a37772b6ae2c5c, []int{2} +} +func (m *PrometheusResponseHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusResponseHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PrometheusResponseHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusResponseHeader.Merge(m, src) +} +func (m *PrometheusResponseHeader) XXX_Size() int { + return m.Size() +} +func (m *PrometheusResponseHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusResponseHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusResponseHeader proto.InternalMessageInfo + +func (m *PrometheusResponseHeader) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *PrometheusResponseHeader) GetValues() []string { + if m != nil { + return m.Values + } + return nil +} + +func init() { + proto.RegisterType((*CachingOptions)(nil), "definitions.CachingOptions") + proto.RegisterType((*PrometheusRequestHeader)(nil), "definitions.PrometheusRequestHeader") + proto.RegisterType((*PrometheusResponseHeader)(nil), "definitions.PrometheusResponseHeader") +} + +func init() { + proto.RegisterFile("pkg/querier/queryrange/queryrangebase/definitions/definitions.proto", fileDescriptor_d1a37772b6ae2c5c) +} + +var fileDescriptor_d1a37772b6ae2c5c = []byte{ + // 294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0x31, 0x4e, 0x33, 0x31, + 0x10, 0x85, 0xed, 0xff, 0x87, 0x28, 0x18, 0x89, 0x62, 0x85, 0x44, 0x88, 0xc4, 0x10, 0xa5, 0xa2, + 0x80, 0xb8, 0xe0, 0x06, 0x49, 0x03, 0x0d, 0xa0, 0x80, 0x28, 0xe8, 0xbc, 0xd9, 0x89, 0x63, 0x25, + 0xb1, 0x37, 0xf6, 0x6e, 0x41, 0x05, 0x47, 0xe0, 0x18, 0x1c, 0x85, 0x72, 0xcb, 0x54, 0x88, 0xf5, + 0x36, 0x88, 0x2a, 0x47, 0x40, 0x18, 0x04, 0xdb, 0x22, 0xaa, 0x79, 0xf3, 0xcd, 0x9b, 0x57, 0xcc, + 0xb0, 0x41, 0x3a, 0x95, 0x7c, 0x91, 0xa3, 0x55, 0x68, 0x43, 0xbd, 0xb5, 0x42, 0x4b, 0xac, 0xc9, + 0x58, 0x38, 0xe4, 0x09, 0x8e, 0x95, 0x56, 0x99, 0x32, 0xda, 0xd5, 0x75, 0x2f, 0xb5, 0x26, 0x33, + 0xd1, 0x66, 0x0d, 0xb5, 0xb7, 0xa5, 0x91, 0x26, 0x70, 0xfe, 0xa1, 0x3e, 0x2d, 0xdd, 0x43, 0xb6, + 0x35, 0x10, 0xa3, 0x89, 0xd2, 0xf2, 0x3c, 0x0d, 0xbe, 0xa8, 0xcd, 0x9a, 0x89, 0x72, 0x22, 0x9e, + 0x61, 0xd2, 0xa2, 0x1d, 0x7a, 0xd0, 0x1c, 0x7e, 0xf7, 0xdd, 0x4b, 0xb6, 0x73, 0x61, 0xcd, 0x1c, + 0xb3, 0x09, 0xe6, 0x6e, 0x88, 0x8b, 0x1c, 0x5d, 0x76, 0x82, 0x22, 0x41, 0x1b, 0xed, 0xb2, 0xb5, + 0x33, 0x31, 0xc7, 0xb0, 0xb2, 0xd1, 0x5f, 0x7f, 0x7b, 0xde, 0xa7, 0x47, 0xc3, 0x80, 0xa2, 0x3d, + 0xd6, 0xb8, 0x16, 0xb3, 0x1c, 0x5d, 0xeb, 0x5f, 0xe7, 0xff, 0xcf, 0xf0, 0x0b, 0x76, 0xaf, 0x58, + 0xab, 0x1e, 0xea, 0x52, 0xa3, 0x1d, 0xfe, 0x35, 0xb5, 0x7f, 0x57, 0x94, 0x40, 0x96, 0x25, 0x90, + 0x55, 0x09, 0xf4, 0xde, 0x03, 0x7d, 0xf4, 0x40, 0x9f, 0x3c, 0xd0, 0xc2, 0x03, 0x7d, 0xf1, 0x40, + 0x5f, 0x3d, 0x90, 0x95, 0x07, 0xfa, 0x50, 0x01, 0x29, 0x2a, 0x20, 0xcb, 0x0a, 0xc8, 0xcd, 0xa9, + 0x54, 0xd9, 0x24, 0x8f, 0x7b, 0x23, 0x33, 0xe7, 0xd2, 0x8a, 0xb1, 0xd0, 0x82, 0xcf, 0xcc, 0x54, + 0xf1, 0x5f, 0xbf, 0x23, 0x6e, 0x84, 0x03, 0x1f, 0xbf, 0x07, 0x00, 0x00, 0xff, 0xff, 0x09, 0x36, + 0xa9, 0xa5, 0xca, 0x01, 0x00, 0x00, +} + +func (this *CachingOptions) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CachingOptions) + if !ok { + that2, ok := that.(CachingOptions) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Disabled != that1.Disabled { + return false + } + return true +} +func (this *PrometheusRequestHeader) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PrometheusRequestHeader) + if !ok { + that2, ok := that.(PrometheusRequestHeader) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if len(this.Values) != len(that1.Values) { + return false + } + for i := range this.Values { + if this.Values[i] != that1.Values[i] { + return false + } + } + return true +} +func (this *PrometheusResponseHeader) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PrometheusResponseHeader) + if !ok { + that2, ok := that.(PrometheusResponseHeader) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if len(this.Values) != len(that1.Values) { + return false + } + for i := range this.Values { + if this.Values[i] != that1.Values[i] { + return false + } + } + return true +} +func (this *CachingOptions) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&definitions.CachingOptions{") + s = append(s, "Disabled: "+fmt.Sprintf("%#v", this.Disabled)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PrometheusRequestHeader) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&definitions.PrometheusRequestHeader{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PrometheusResponseHeader) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&definitions.PrometheusResponseHeader{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringDefinitions(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *CachingOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CachingOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CachingOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Disabled { + i-- + if m.Disabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrometheusRequestHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusRequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrometheusResponseHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrometheusResponseHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDefinitions(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDefinitions(dAtA []byte, offset int, v uint64) int { + offset -= sovDefinitions(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CachingOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Disabled { + n += 2 + } + return n +} + +func (m *PrometheusRequestHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovDefinitions(uint64(l)) + } + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + sovDefinitions(uint64(l)) + } + } + return n +} + +func (m *PrometheusResponseHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovDefinitions(uint64(l)) + } + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + sovDefinitions(uint64(l)) + } + } + return n +} + +func sovDefinitions(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDefinitions(x uint64) (n int) { + return sovDefinitions(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *CachingOptions) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CachingOptions{`, + `Disabled:` + fmt.Sprintf("%v", this.Disabled) + `,`, + `}`, + }, "") + return s +} +func (this *PrometheusRequestHeader) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PrometheusRequestHeader{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Values:` + fmt.Sprintf("%v", this.Values) + `,`, + `}`, + }, "") + return s +} +func (this *PrometheusResponseHeader) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PrometheusResponseHeader{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Values:` + fmt.Sprintf("%v", this.Values) + `,`, + `}`, + }, "") + return s +} +func valueToStringDefinitions(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *CachingOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CachingOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CachingOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Disabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Disabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipDefinitions(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrometheusRequestHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrometheusRequestHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusRequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDefinitions + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDefinitions + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDefinitions + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDefinitions + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDefinitions(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrometheusResponseHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrometheusResponseHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDefinitions + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDefinitions + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDefinitions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDefinitions + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDefinitions + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDefinitions(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDefinitions + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDefinitions(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDefinitions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDefinitions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDefinitions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDefinitions + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthDefinitions + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDefinitions + } + 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 := skipDefinitions(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthDefinitions + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthDefinitions = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDefinitions = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/querier/queryrange/queryrangebase/queryrange.pb.go b/pkg/querier/queryrange/queryrangebase/queryrange.pb.go new file mode 100644 index 0000000000000..121b3ffb15351 --- /dev/null +++ b/pkg/querier/queryrange/queryrangebase/queryrange.pb.go @@ -0,0 +1,2594 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/querier/queryrange/queryrangebase/queryrange.proto + +package queryrangebase + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" + logproto "github.com/grafana/loki/pkg/logproto" + definitions "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PrometheusRequest struct { + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Start time.Time `protobuf:"bytes,2,opt,name=start,proto3,stdtime" json:"start"` + End time.Time `protobuf:"bytes,3,opt,name=end,proto3,stdtime" json:"end"` + Step int64 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"` + Timeout time.Duration `protobuf:"bytes,5,opt,name=timeout,proto3,stdduration" json:"timeout"` + Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` + CachingOptions definitions.CachingOptions `protobuf:"bytes,7,opt,name=cachingOptions,proto3" json:"cachingOptions"` + Headers []*definitions.PrometheusRequestHeader `protobuf:"bytes,8,rep,name=Headers,proto3" json:"-"` +} + +func (m *PrometheusRequest) Reset() { *m = PrometheusRequest{} } +func (*PrometheusRequest) ProtoMessage() {} +func (*PrometheusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{0} +} +func (m *PrometheusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PrometheusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusRequest.Merge(m, src) +} +func (m *PrometheusRequest) XXX_Size() int { + return m.Size() +} +func (m *PrometheusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusRequest proto.InternalMessageInfo + +func (m *PrometheusRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *PrometheusRequest) GetStart() time.Time { + if m != nil { + return m.Start + } + return time.Time{} +} + +func (m *PrometheusRequest) GetEnd() time.Time { + if m != nil { + return m.End + } + return time.Time{} +} + +func (m *PrometheusRequest) GetStep() int64 { + if m != nil { + return m.Step + } + return 0 +} + +func (m *PrometheusRequest) GetTimeout() time.Duration { + if m != nil { + return m.Timeout + } + return 0 +} + +func (m *PrometheusRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *PrometheusRequest) GetCachingOptions() definitions.CachingOptions { + if m != nil { + return m.CachingOptions + } + return definitions.CachingOptions{} +} + +func (m *PrometheusRequest) GetHeaders() []*definitions.PrometheusRequestHeader { + if m != nil { + return m.Headers + } + return nil +} + +type PrometheusResponse struct { + Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"` + Data PrometheusData `protobuf:"bytes,2,opt,name=Data,proto3" json:"data,omitempty"` + ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` + Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` + Headers []*definitions.PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` +} + +func (m *PrometheusResponse) Reset() { *m = PrometheusResponse{} } +func (*PrometheusResponse) ProtoMessage() {} +func (*PrometheusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{1} +} +func (m *PrometheusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PrometheusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusResponse.Merge(m, src) +} +func (m *PrometheusResponse) XXX_Size() int { + return m.Size() +} +func (m *PrometheusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusResponse proto.InternalMessageInfo + +func (m *PrometheusResponse) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *PrometheusResponse) GetData() PrometheusData { + if m != nil { + return m.Data + } + return PrometheusData{} +} + +func (m *PrometheusResponse) GetErrorType() string { + if m != nil { + return m.ErrorType + } + return "" +} + +func (m *PrometheusResponse) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *PrometheusResponse) GetHeaders() []*definitions.PrometheusResponseHeader { + if m != nil { + return m.Headers + } + return nil +} + +type PrometheusData struct { + ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` + Result []SampleStream `protobuf:"bytes,2,rep,name=Result,proto3" json:"result"` +} + +func (m *PrometheusData) Reset() { *m = PrometheusData{} } +func (*PrometheusData) ProtoMessage() {} +func (*PrometheusData) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{2} +} +func (m *PrometheusData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PrometheusData) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusData.Merge(m, src) +} +func (m *PrometheusData) XXX_Size() int { + return m.Size() +} +func (m *PrometheusData) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusData.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusData proto.InternalMessageInfo + +func (m *PrometheusData) GetResultType() string { + if m != nil { + return m.ResultType + } + return "" +} + +func (m *PrometheusData) GetResult() []SampleStream { + if m != nil { + return m.Result + } + return nil +} + +type SampleStream struct { + Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"metric"` + Samples []logproto.LegacySample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` +} + +func (m *SampleStream) Reset() { *m = SampleStream{} } +func (*SampleStream) ProtoMessage() {} +func (*SampleStream) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{3} +} +func (m *SampleStream) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SampleStream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SampleStream.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SampleStream) XXX_Merge(src proto.Message) { + xxx_messageInfo_SampleStream.Merge(m, src) +} +func (m *SampleStream) XXX_Size() int { + return m.Size() +} +func (m *SampleStream) XXX_DiscardUnknown() { + xxx_messageInfo_SampleStream.DiscardUnknown(m) +} + +var xxx_messageInfo_SampleStream proto.InternalMessageInfo + +func (m *SampleStream) GetSamples() []logproto.LegacySample { + if m != nil { + return m.Samples + } + return nil +} + +type CachedResponse struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"` + // List of cached responses; non-overlapping and in order. + Extents []Extent `protobuf:"bytes,2,rep,name=extents,proto3" json:"extents"` +} + +func (m *CachedResponse) Reset() { *m = CachedResponse{} } +func (*CachedResponse) ProtoMessage() {} +func (*CachedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{4} +} +func (m *CachedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CachedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CachedResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CachedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CachedResponse.Merge(m, src) +} +func (m *CachedResponse) XXX_Size() int { + return m.Size() +} +func (m *CachedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CachedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CachedResponse proto.InternalMessageInfo + +func (m *CachedResponse) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *CachedResponse) GetExtents() []Extent { + if m != nil { + return m.Extents + } + return nil +} + +type Extent struct { + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` + End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` + TraceId string `protobuf:"bytes,4,opt,name=trace_id,json=traceId,proto3" json:"-"` + Response *types.Any `protobuf:"bytes,5,opt,name=response,proto3" json:"response"` +} + +func (m *Extent) Reset() { *m = Extent{} } +func (*Extent) ProtoMessage() {} +func (*Extent) Descriptor() ([]byte, []int) { + return fileDescriptor_4cc6a0c1d6b614c4, []int{5} +} +func (m *Extent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Extent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Extent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Extent) XXX_Merge(src proto.Message) { + xxx_messageInfo_Extent.Merge(m, src) +} +func (m *Extent) XXX_Size() int { + return m.Size() +} +func (m *Extent) XXX_DiscardUnknown() { + xxx_messageInfo_Extent.DiscardUnknown(m) +} + +var xxx_messageInfo_Extent proto.InternalMessageInfo + +func (m *Extent) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Extent) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +func (m *Extent) GetTraceId() string { + if m != nil { + return m.TraceId + } + return "" +} + +func (m *Extent) GetResponse() *types.Any { + if m != nil { + return m.Response + } + return nil +} + +func init() { + proto.RegisterType((*PrometheusRequest)(nil), "queryrangebase.PrometheusRequest") + proto.RegisterType((*PrometheusResponse)(nil), "queryrangebase.PrometheusResponse") + proto.RegisterType((*PrometheusData)(nil), "queryrangebase.PrometheusData") + proto.RegisterType((*SampleStream)(nil), "queryrangebase.SampleStream") + proto.RegisterType((*CachedResponse)(nil), "queryrangebase.CachedResponse") + proto.RegisterType((*Extent)(nil), "queryrangebase.Extent") +} + +func init() { + proto.RegisterFile("pkg/querier/queryrange/queryrangebase/queryrange.proto", fileDescriptor_4cc6a0c1d6b614c4) +} + +var fileDescriptor_4cc6a0c1d6b614c4 = []byte{ + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x5f, 0xc7, 0xfb, 0x77, 0x5a, 0x6d, 0x61, 0x1a, 0x15, 0x27, 0x45, 0xf6, 0x6a, 0x05, 0x52, + 0x90, 0xc0, 0x2b, 0x8a, 0xe8, 0x01, 0xa9, 0x88, 0x38, 0x09, 0xa2, 0x55, 0x25, 0x2a, 0xa7, 0x27, + 0x2e, 0x68, 0x76, 0xfd, 0xe2, 0x58, 0xf1, 0xbf, 0xce, 0x8c, 0x2b, 0xf6, 0xc6, 0x89, 0x73, 0x4f, + 0x88, 0x8f, 0xc0, 0x01, 0xf1, 0x39, 0x72, 0xcc, 0xb1, 0xe2, 0x60, 0xc8, 0xe6, 0x82, 0x7c, 0xea, + 0x47, 0x40, 0xf3, 0xc7, 0xbb, 0xde, 0x8d, 0x02, 0xf4, 0xb2, 0xfb, 0x66, 0xde, 0xef, 0xbd, 0xf7, + 0x7b, 0xbf, 0x79, 0x7e, 0xe8, 0x61, 0x7e, 0x16, 0x4e, 0x5e, 0x14, 0x40, 0x23, 0xa0, 0xf2, 0x7f, + 0x4e, 0x49, 0x1a, 0x42, 0xc3, 0x9c, 0x12, 0xd6, 0x3c, 0xba, 0x39, 0xcd, 0x78, 0x86, 0x87, 0xeb, + 0x80, 0xdd, 0xed, 0x30, 0x0b, 0x33, 0xe9, 0x9a, 0x08, 0x4b, 0xa1, 0x76, 0x77, 0xc2, 0x2c, 0x0b, + 0x63, 0x98, 0xc8, 0xd3, 0xb4, 0x38, 0x99, 0x90, 0x74, 0xae, 0x5d, 0xf6, 0xa6, 0x2b, 0x28, 0x28, + 0xe1, 0x51, 0x96, 0x6a, 0xbf, 0xb3, 0xe9, 0xe7, 0x51, 0x02, 0x8c, 0x93, 0x24, 0xd7, 0x80, 0xfb, + 0x82, 0x79, 0x9c, 0x85, 0xaa, 0x68, 0x6d, 0x68, 0xe7, 0xc1, 0xff, 0x6b, 0x2b, 0x80, 0x93, 0x28, + 0x8d, 0x44, 0x55, 0xd6, 0xb4, 0x55, 0x92, 0xf1, 0xcf, 0x26, 0x7a, 0xf7, 0x19, 0xcd, 0x12, 0xe0, + 0xa7, 0x50, 0x30, 0x1f, 0x5e, 0x14, 0xc0, 0x38, 0xc6, 0xa8, 0x9d, 0x13, 0x7e, 0x6a, 0x19, 0x23, + 0x63, 0x6f, 0xe0, 0x4b, 0x1b, 0x7f, 0x81, 0x3a, 0x8c, 0x13, 0xca, 0xad, 0xad, 0x91, 0xb1, 0x77, + 0xeb, 0xc1, 0xae, 0xab, 0xc8, 0xbb, 0x35, 0x79, 0xf7, 0x79, 0x4d, 0xde, 0xeb, 0x9f, 0x97, 0x4e, + 0xeb, 0xd5, 0x9f, 0x8e, 0xe1, 0xab, 0x10, 0xfc, 0x10, 0x99, 0x90, 0x06, 0x96, 0xf9, 0x16, 0x91, + 0x22, 0x40, 0xf0, 0x60, 0x1c, 0x72, 0xab, 0x3d, 0x32, 0xf6, 0x4c, 0x5f, 0xda, 0xf8, 0x11, 0xea, + 0x09, 0x99, 0xb2, 0x82, 0x5b, 0x1d, 0x99, 0x6f, 0xe7, 0x5a, 0xbe, 0x43, 0x2d, 0xb3, 0x4a, 0xf7, + 0x8b, 0x48, 0x57, 0xc7, 0xe0, 0x6d, 0xd4, 0x91, 0x02, 0x59, 0x5d, 0xd9, 0x9b, 0x3a, 0xe0, 0xc7, + 0x68, 0x38, 0x23, 0xb3, 0xd3, 0x28, 0x0d, 0xbf, 0xcd, 0xa5, 0x3c, 0x56, 0x4f, 0xe6, 0xbe, 0xef, + 0x36, 0x25, 0x3b, 0x58, 0x83, 0x78, 0x6d, 0x91, 0xdd, 0xdf, 0x08, 0xc4, 0x47, 0xa8, 0xf7, 0x0d, + 0x90, 0x00, 0x28, 0xb3, 0xfa, 0x23, 0x73, 0xef, 0xd6, 0x83, 0x0f, 0xd6, 0x72, 0x5c, 0x13, 0x5b, + 0x81, 0xbd, 0x4e, 0x55, 0x3a, 0xc6, 0x27, 0x7e, 0x1d, 0x3b, 0xfe, 0x7d, 0x0b, 0xe1, 0x26, 0x96, + 0xe5, 0x59, 0xca, 0x00, 0x8f, 0x51, 0xf7, 0x98, 0x13, 0x5e, 0x30, 0xf5, 0x36, 0x1e, 0xaa, 0x4a, + 0xa7, 0xcb, 0xe4, 0x8d, 0xaf, 0x3d, 0xf8, 0x09, 0x6a, 0x1f, 0x12, 0x4e, 0xf4, 0x43, 0xd9, 0xee, + 0xfa, 0x40, 0x34, 0x18, 0x08, 0x94, 0x77, 0x4f, 0x74, 0x51, 0x95, 0xce, 0x30, 0x20, 0x9c, 0x7c, + 0x9c, 0x25, 0x11, 0x87, 0x24, 0xe7, 0x73, 0x5f, 0xe6, 0xc0, 0x9f, 0xa3, 0xc1, 0x11, 0xa5, 0x19, + 0x7d, 0x3e, 0xcf, 0x41, 0xbe, 0xdf, 0xc0, 0x7b, 0xaf, 0x2a, 0x9d, 0xbb, 0x50, 0x5f, 0x36, 0x22, + 0x56, 0x48, 0xfc, 0x11, 0xea, 0xc8, 0x83, 0x7c, 0xb9, 0x81, 0x77, 0xb7, 0x2a, 0x9d, 0x3b, 0x32, + 0xa4, 0x01, 0x57, 0x08, 0xfc, 0xf5, 0x4a, 0xaf, 0x8e, 0xd4, 0xeb, 0xc3, 0x1b, 0xf5, 0x52, 0x1a, + 0xdc, 0x20, 0xd8, 0x4f, 0x06, 0x1a, 0xae, 0xb7, 0x86, 0x5d, 0x84, 0x7c, 0x60, 0x45, 0xcc, 0x25, + 0x7b, 0x25, 0xd8, 0xb0, 0x2a, 0x1d, 0x44, 0x97, 0xb7, 0x7e, 0x03, 0x81, 0x0f, 0x51, 0x57, 0x9d, + 0xac, 0x2d, 0xc9, 0xe4, 0xfd, 0x4d, 0xe9, 0x8e, 0x49, 0x92, 0xc7, 0x70, 0xcc, 0x29, 0x90, 0xc4, + 0x1b, 0x6a, 0xe1, 0xba, 0x2a, 0x9b, 0xaf, 0x63, 0xc7, 0xe7, 0x06, 0xba, 0xdd, 0x04, 0xe2, 0x97, + 0xa8, 0x1b, 0x93, 0x29, 0xc4, 0xe2, 0xcd, 0x4c, 0x39, 0xb0, 0xcb, 0x2f, 0xf9, 0x29, 0x84, 0x64, + 0x36, 0x7f, 0x2a, 0xbc, 0xcf, 0x48, 0x44, 0xbd, 0x03, 0x91, 0xf3, 0x8f, 0xd2, 0xf9, 0x34, 0x8c, + 0xf8, 0x69, 0x31, 0x75, 0x67, 0x59, 0x32, 0x09, 0x29, 0x39, 0x21, 0x29, 0x99, 0xc4, 0xd9, 0x59, + 0x34, 0x69, 0x2e, 0x04, 0x57, 0xc6, 0xed, 0x07, 0x24, 0xe7, 0x40, 0x05, 0x91, 0x04, 0x38, 0x8d, + 0x66, 0xbe, 0xae, 0x86, 0xbf, 0x42, 0x3d, 0x26, 0x79, 0x30, 0xdd, 0xcf, 0xbd, 0xcd, 0xc2, 0x8a, + 0xe6, 0xaa, 0x93, 0x97, 0x24, 0x2e, 0x80, 0xf9, 0x75, 0xd8, 0x38, 0x45, 0x43, 0x31, 0xf3, 0x10, + 0x2c, 0xe7, 0x6f, 0x07, 0x99, 0x67, 0x30, 0xd7, 0x5a, 0xf6, 0xaa, 0xd2, 0x11, 0x47, 0x5f, 0xfc, + 0xe0, 0x7d, 0xd4, 0x83, 0x1f, 0x38, 0xa4, 0x7c, 0x55, 0x6e, 0x43, 0xbe, 0x23, 0xe9, 0xf6, 0xee, + 0xe8, 0x72, 0x35, 0xdc, 0xaf, 0x8d, 0xf1, 0x6f, 0x06, 0xea, 0x2a, 0x10, 0x76, 0xea, 0x75, 0x23, + 0x4a, 0x99, 0xde, 0xa0, 0x2a, 0x1d, 0x75, 0x51, 0xef, 0x94, 0x1d, 0xb5, 0x53, 0xb6, 0xa4, 0x5b, + 0x32, 0x81, 0x34, 0x50, 0x6b, 0x63, 0x84, 0xfa, 0x9c, 0x92, 0x19, 0x7c, 0x1f, 0x05, 0x7a, 0x00, + 0xeb, 0x61, 0x91, 0xd7, 0x8f, 0x03, 0xfc, 0x25, 0xea, 0x53, 0xdd, 0x92, 0xde, 0x22, 0xdb, 0xd7, + 0xb6, 0xc8, 0x7e, 0x3a, 0xf7, 0x6e, 0x57, 0xa5, 0xb3, 0x44, 0xfa, 0x4b, 0xeb, 0x49, 0xbb, 0x6f, + 0xbe, 0xd3, 0xf6, 0xd8, 0xc5, 0xa5, 0xdd, 0x7a, 0x7d, 0x69, 0xb7, 0xde, 0x5c, 0xda, 0xc6, 0x8f, + 0x0b, 0xdb, 0xf8, 0x75, 0x61, 0x1b, 0xe7, 0x0b, 0xdb, 0xb8, 0x58, 0xd8, 0xc6, 0x5f, 0x0b, 0xdb, + 0xf8, 0x7b, 0x61, 0xb7, 0xde, 0x2c, 0x6c, 0xe3, 0xd5, 0x95, 0xdd, 0xba, 0xb8, 0xb2, 0x5b, 0xaf, + 0xaf, 0xec, 0xd6, 0x77, 0x8f, 0xfe, 0xed, 0x6d, 0xff, 0x73, 0x9f, 0x4f, 0xbb, 0x92, 0xe0, 0x67, + 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x63, 0x5c, 0x0b, 0x88, 0xd6, 0x06, 0x00, 0x00, +} + +func (this *PrometheusRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PrometheusRequest) + if !ok { + that2, ok := that.(PrometheusRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Path != that1.Path { + return false + } + if !this.Start.Equal(that1.Start) { + return false + } + if !this.End.Equal(that1.End) { + return false + } + if this.Step != that1.Step { + return false + } + if this.Timeout != that1.Timeout { + return false + } + if this.Query != that1.Query { + return false + } + if !this.CachingOptions.Equal(&that1.CachingOptions) { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *PrometheusResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PrometheusResponse) + if !ok { + that2, ok := that.(PrometheusResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Status != that1.Status { + return false + } + if !this.Data.Equal(&that1.Data) { + return false + } + if this.ErrorType != that1.ErrorType { + return false + } + if this.Error != that1.Error { + return false + } + if len(this.Headers) != len(that1.Headers) { + return false + } + for i := range this.Headers { + if !this.Headers[i].Equal(that1.Headers[i]) { + return false + } + } + return true +} +func (this *PrometheusData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PrometheusData) + if !ok { + that2, ok := that.(PrometheusData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ResultType != that1.ResultType { + return false + } + if len(this.Result) != len(that1.Result) { + return false + } + for i := range this.Result { + if !this.Result[i].Equal(&that1.Result[i]) { + return false + } + } + return true +} +func (this *SampleStream) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SampleStream) + if !ok { + that2, ok := that.(SampleStream) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if len(this.Samples) != len(that1.Samples) { + return false + } + for i := range this.Samples { + if !this.Samples[i].Equal(&that1.Samples[i]) { + return false + } + } + return true +} +func (this *CachedResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CachedResponse) + if !ok { + that2, ok := that.(CachedResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Key != that1.Key { + return false + } + if len(this.Extents) != len(that1.Extents) { + return false + } + for i := range this.Extents { + if !this.Extents[i].Equal(&that1.Extents[i]) { + return false + } + } + return true +} +func (this *Extent) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Extent) + if !ok { + that2, ok := that.(Extent) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Start != that1.Start { + return false + } + if this.End != that1.End { + return false + } + if this.TraceId != that1.TraceId { + return false + } + if !this.Response.Equal(that1.Response) { + return false + } + return true +} +func (this *PrometheusRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 12) + s = append(s, "&queryrangebase.PrometheusRequest{") + s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") + s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") + s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") + s = append(s, "Step: "+fmt.Sprintf("%#v", this.Step)+",\n") + s = append(s, "Timeout: "+fmt.Sprintf("%#v", this.Timeout)+",\n") + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + s = append(s, "CachingOptions: "+strings.Replace(this.CachingOptions.GoString(), `&`, ``, 1)+",\n") + if this.Headers != nil { + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PrometheusResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&queryrangebase.PrometheusResponse{") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + s = append(s, "Data: "+strings.Replace(this.Data.GoString(), `&`, ``, 1)+",\n") + s = append(s, "ErrorType: "+fmt.Sprintf("%#v", this.ErrorType)+",\n") + s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") + if this.Headers != nil { + s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PrometheusData) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrangebase.PrometheusData{") + s = append(s, "ResultType: "+fmt.Sprintf("%#v", this.ResultType)+",\n") + if this.Result != nil { + vs := make([]*SampleStream, len(this.Result)) + for i := range vs { + vs[i] = &this.Result[i] + } + s = append(s, "Result: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *SampleStream) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrangebase.SampleStream{") + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Samples != nil { + vs := make([]*logproto.LegacySample, len(this.Samples)) + for i := range vs { + vs[i] = &this.Samples[i] + } + s = append(s, "Samples: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *CachedResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&queryrangebase.CachedResponse{") + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + if this.Extents != nil { + vs := make([]*Extent, len(this.Extents)) + for i := range vs { + vs[i] = &this.Extents[i] + } + s = append(s, "Extents: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Extent) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&queryrangebase.Extent{") + s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") + s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") + s = append(s, "TraceId: "+fmt.Sprintf("%#v", this.TraceId)+",\n") + if this.Response != nil { + s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringQueryrange(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *PrometheusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrometheusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + { + size, err := m.CachingOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x32 + } + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQueryrange(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + if m.Step != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Step)) + i-- + dAtA[i] = 0x20 + } + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.End):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintQueryrange(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1a + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Start):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintQueryrange(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x12 + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrometheusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrometheusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if len(m.ErrorType) > 0 { + i -= len(m.ErrorType) + copy(dAtA[i:], m.ErrorType) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ErrorType))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrometheusData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrometheusData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Result) > 0 { + for iNdEx := len(m.Result) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Result[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ResultType) > 0 { + i -= len(m.ResultType) + copy(dAtA[i:], m.ResultType) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.ResultType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SampleStream) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SampleStream) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CachedResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CachedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CachedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Extents) > 0 { + for iNdEx := len(m.Extents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Extents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Extent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Extent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Extent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0x22 + } + if m.End != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.End)) + i-- + dAtA[i] = 0x10 + } + if m.Start != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.Start)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryrange(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryrange(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PrometheusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Start) + n += 1 + l + sovQueryrange(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.End) + n += 1 + l + sovQueryrange(uint64(l)) + if m.Step != 0 { + n += 1 + sovQueryrange(uint64(m.Step)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout) + n += 1 + l + sovQueryrange(uint64(l)) + l = len(m.Query) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = m.CachingOptions.Size() + n += 1 + l + sovQueryrange(uint64(l)) + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *PrometheusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = m.Data.Size() + n += 1 + l + sovQueryrange(uint64(l)) + l = len(m.ErrorType) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *PrometheusData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ResultType) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Result) > 0 { + for _, e := range m.Result { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *SampleStream) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + if len(m.Samples) > 0 { + for _, e := range m.Samples { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *CachedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if len(m.Extents) > 0 { + for _, e := range m.Extents { + l = e.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + } + return n +} + +func (m *Extent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Start != 0 { + n += 1 + sovQueryrange(uint64(m.Start)) + } + if m.End != 0 { + n += 1 + sovQueryrange(uint64(m.End)) + } + l = len(m.TraceId) + if l > 0 { + n += 1 + l + sovQueryrange(uint64(l)) + } + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } + return n +} + +func sovQueryrange(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryrange(x uint64) (n int) { + return sovQueryrange(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *PrometheusRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForHeaders := "[]*PrometheusRequestHeader{" + for _, f := range this.Headers { + repeatedStringForHeaders += strings.Replace(fmt.Sprintf("%v", f), "PrometheusRequestHeader", "definitions.PrometheusRequestHeader", 1) + "," + } + repeatedStringForHeaders += "}" + s := strings.Join([]string{`&PrometheusRequest{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Start:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Start), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `End:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.End), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Step:` + fmt.Sprintf("%v", this.Step) + `,`, + `Timeout:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timeout), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `Query:` + fmt.Sprintf("%v", this.Query) + `,`, + `CachingOptions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CachingOptions), "CachingOptions", "definitions.CachingOptions", 1), `&`, ``, 1) + `,`, + `Headers:` + repeatedStringForHeaders + `,`, + `}`, + }, "") + return s +} +func (this *PrometheusResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForHeaders := "[]*PrometheusResponseHeader{" + for _, f := range this.Headers { + repeatedStringForHeaders += strings.Replace(fmt.Sprintf("%v", f), "PrometheusResponseHeader", "definitions.PrometheusResponseHeader", 1) + "," + } + repeatedStringForHeaders += "}" + s := strings.Join([]string{`&PrometheusResponse{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Data:` + strings.Replace(strings.Replace(this.Data.String(), "PrometheusData", "PrometheusData", 1), `&`, ``, 1) + `,`, + `ErrorType:` + fmt.Sprintf("%v", this.ErrorType) + `,`, + `Error:` + fmt.Sprintf("%v", this.Error) + `,`, + `Headers:` + repeatedStringForHeaders + `,`, + `}`, + }, "") + return s +} +func (this *PrometheusData) String() string { + if this == nil { + return "nil" + } + repeatedStringForResult := "[]SampleStream{" + for _, f := range this.Result { + repeatedStringForResult += strings.Replace(strings.Replace(f.String(), "SampleStream", "SampleStream", 1), `&`, ``, 1) + "," + } + repeatedStringForResult += "}" + s := strings.Join([]string{`&PrometheusData{`, + `ResultType:` + fmt.Sprintf("%v", this.ResultType) + `,`, + `Result:` + repeatedStringForResult + `,`, + `}`, + }, "") + return s +} +func (this *SampleStream) String() string { + if this == nil { + return "nil" + } + repeatedStringForSamples := "[]LegacySample{" + for _, f := range this.Samples { + repeatedStringForSamples += fmt.Sprintf("%v", f) + "," + } + repeatedStringForSamples += "}" + s := strings.Join([]string{`&SampleStream{`, + `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Samples:` + repeatedStringForSamples + `,`, + `}`, + }, "") + return s +} +func (this *CachedResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForExtents := "[]Extent{" + for _, f := range this.Extents { + repeatedStringForExtents += strings.Replace(strings.Replace(f.String(), "Extent", "Extent", 1), `&`, ``, 1) + "," + } + repeatedStringForExtents += "}" + s := strings.Join([]string{`&CachedResponse{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Extents:` + repeatedStringForExtents + `,`, + `}`, + }, "") + return s +} +func (this *Extent) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Extent{`, + `Start:` + fmt.Sprintf("%v", this.Start) + `,`, + `End:` + fmt.Sprintf("%v", this.End) + `,`, + `TraceId:` + fmt.Sprintf("%v", this.TraceId) + `,`, + `Response:` + strings.Replace(fmt.Sprintf("%v", this.Response), "Any", "types.Any", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringQueryrange(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *PrometheusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrometheusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Start, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.End, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + m.Step = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Step |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Timeout, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CachingOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CachingOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, &definitions.PrometheusRequestHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrometheusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrometheusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Headers = append(m.Headers, &definitions.PrometheusResponseHeader{}) + if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrometheusData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrometheusData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrometheusData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResultType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResultType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = append(m.Result, SampleStream{}) + if err := m.Result[len(m.Result)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SampleStream) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SampleStream: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SampleStream: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Samples = append(m.Samples, logproto.LegacySample{}) + if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CachedResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CachedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CachedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Extents = append(m.Extents, Extent{}) + if err := m.Extents[len(m.Extents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Extent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Extent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Extent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + m.Start = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Start |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) + } + m.End = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.End |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &types.Any{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryrange(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQueryrange + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryrange + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQueryrange + } + 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 := skipQueryrange(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryrange + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/querier/stats/stats.pb.go b/pkg/querier/stats/stats.pb.go new file mode 100644 index 0000000000000..bb56bb26c49c0 --- /dev/null +++ b/pkg/querier/stats/stats.pb.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/querier/stats/stats.proto + +package stats + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Stats struct { + // The sum of all wall time spent in the querier to execute the query. + WallTime time.Duration `protobuf:"bytes,1,opt,name=wall_time,json=wallTime,proto3,stdduration" json:"wall_time"` + // The number of series fetched for the query + FetchedSeriesCount uint64 `protobuf:"varint,2,opt,name=fetched_series_count,json=fetchedSeriesCount,proto3" json:"fetched_series_count,omitempty"` + // The number of bytes of the chunks fetched for the query + FetchedChunkBytes uint64 `protobuf:"varint,3,opt,name=fetched_chunk_bytes,json=fetchedChunkBytes,proto3" json:"fetched_chunk_bytes,omitempty"` +} + +func (m *Stats) Reset() { *m = Stats{} } +func (*Stats) ProtoMessage() {} +func (*Stats) Descriptor() ([]byte, []int) { + return fileDescriptor_8ca2404f80bab2e8, []int{0} +} +func (m *Stats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Stats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Stats) XXX_Merge(src proto.Message) { + xxx_messageInfo_Stats.Merge(m, src) +} +func (m *Stats) XXX_Size() int { + return m.Size() +} +func (m *Stats) XXX_DiscardUnknown() { + xxx_messageInfo_Stats.DiscardUnknown(m) +} + +var xxx_messageInfo_Stats proto.InternalMessageInfo + +func (m *Stats) GetWallTime() time.Duration { + if m != nil { + return m.WallTime + } + return 0 +} + +func (m *Stats) GetFetchedSeriesCount() uint64 { + if m != nil { + return m.FetchedSeriesCount + } + return 0 +} + +func (m *Stats) GetFetchedChunkBytes() uint64 { + if m != nil { + return m.FetchedChunkBytes + } + return 0 +} + +func init() { + proto.RegisterType((*Stats)(nil), "stats.Stats") +} + +func init() { proto.RegisterFile("pkg/querier/stats/stats.proto", fileDescriptor_8ca2404f80bab2e8) } + +var fileDescriptor_8ca2404f80bab2e8 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0xd0, 0xb1, 0x4e, 0x3a, 0x31, + 0x1c, 0xc0, 0xf1, 0xfe, 0xfe, 0x7f, 0x31, 0x78, 0x4e, 0x9e, 0x0c, 0x48, 0xe2, 0x0f, 0xe2, 0x84, + 0xcb, 0xd5, 0xe8, 0x0b, 0x18, 0xf0, 0x09, 0xc0, 0xc9, 0xe5, 0xd2, 0x3b, 0x4a, 0x69, 0x38, 0xae, + 0x78, 0xd7, 0xc6, 0xb8, 0xf9, 0x08, 0x8e, 0x3e, 0x82, 0x89, 0x2f, 0xc2, 0xc8, 0xc8, 0xa4, 0x52, + 0x16, 0x47, 0x1e, 0xc1, 0xb4, 0x07, 0x93, 0x4b, 0xd3, 0x5f, 0x3f, 0xf9, 0x26, 0x6d, 0x83, 0xf3, + 0xf9, 0x54, 0xd0, 0x47, 0xc3, 0x0b, 0xc9, 0x0b, 0x5a, 0x6a, 0xa6, 0xcb, 0x6a, 0x8d, 0xe6, 0x85, + 0xd2, 0x2a, 0xac, 0xf9, 0xa1, 0xd5, 0x10, 0x4a, 0x28, 0x7f, 0x42, 0xdd, 0xae, 0xc2, 0x16, 0x0a, + 0xa5, 0x44, 0xc6, 0xa9, 0x9f, 0x12, 0x33, 0xa6, 0x23, 0x53, 0x30, 0x2d, 0x55, 0x5e, 0xf9, 0xc5, + 0x07, 0x04, 0xb5, 0xa1, 0xeb, 0xc3, 0xdb, 0xe0, 0xe8, 0x89, 0x65, 0x59, 0xac, 0xe5, 0x8c, 0x37, + 0xa1, 0x03, 0xdd, 0xe3, 0xeb, 0xb3, 0xa8, 0xaa, 0xa3, 0x7d, 0x1d, 0xdd, 0xed, 0xea, 0x5e, 0x7d, + 0xf1, 0xd9, 0x26, 0x6f, 0x5f, 0x6d, 0x18, 0xd4, 0x5d, 0x75, 0x2f, 0x67, 0x3c, 0xbc, 0x0a, 0x1a, + 0x63, 0xae, 0xd3, 0x09, 0x1f, 0xc5, 0xa5, 0xbb, 0x6c, 0x19, 0xa7, 0xca, 0xe4, 0xba, 0xf9, 0xaf, + 0x03, 0xdd, 0x83, 0x41, 0xb8, 0xb3, 0xa1, 0xa7, 0xbe, 0x93, 0x30, 0x0a, 0x4e, 0xf7, 0x45, 0x3a, + 0x31, 0xf9, 0x34, 0x4e, 0x9e, 0x35, 0x2f, 0x9b, 0xff, 0x7d, 0x70, 0xb2, 0xa3, 0xbe, 0x93, 0x9e, + 0x83, 0x5e, 0xbc, 0x5c, 0x23, 0x59, 0xad, 0x91, 0x6c, 0xd7, 0x08, 0x2f, 0x16, 0xe1, 0xdd, 0x22, + 0x2c, 0x2c, 0xc2, 0xd2, 0x22, 0x7c, 0x5b, 0x84, 0x1f, 0x8b, 0x64, 0x6b, 0x11, 0x5e, 0x37, 0x48, + 0x96, 0x1b, 0x24, 0xab, 0x0d, 0x92, 0x87, 0x4b, 0x21, 0xf5, 0xc4, 0x24, 0x51, 0xaa, 0x66, 0x54, + 0x14, 0x6c, 0xcc, 0x72, 0x46, 0x33, 0x35, 0x95, 0xf4, 0xcf, 0xbf, 0x26, 0x87, 0xfe, 0xa5, 0x37, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe6, 0x22, 0x2b, 0x73, 0x01, 0x00, 0x00, +} + +func (this *Stats) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Stats) + if !ok { + that2, ok := that.(Stats) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.WallTime != that1.WallTime { + return false + } + if this.FetchedSeriesCount != that1.FetchedSeriesCount { + return false + } + if this.FetchedChunkBytes != that1.FetchedChunkBytes { + return false + } + return true +} +func (this *Stats) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&stats.Stats{") + s = append(s, "WallTime: "+fmt.Sprintf("%#v", this.WallTime)+",\n") + s = append(s, "FetchedSeriesCount: "+fmt.Sprintf("%#v", this.FetchedSeriesCount)+",\n") + s = append(s, "FetchedChunkBytes: "+fmt.Sprintf("%#v", this.FetchedChunkBytes)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringStats(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Stats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Stats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FetchedChunkBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.FetchedChunkBytes)) + i-- + dAtA[i] = 0x18 + } + if m.FetchedSeriesCount != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.FetchedSeriesCount)) + i-- + dAtA[i] = 0x10 + } + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.WallTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.WallTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintStats(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintStats(dAtA []byte, offset int, v uint64) int { + offset -= sovStats(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Stats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.WallTime) + n += 1 + l + sovStats(uint64(l)) + if m.FetchedSeriesCount != 0 { + n += 1 + sovStats(uint64(m.FetchedSeriesCount)) + } + if m.FetchedChunkBytes != 0 { + n += 1 + sovStats(uint64(m.FetchedChunkBytes)) + } + return n +} + +func sovStats(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStats(x uint64) (n int) { + return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Stats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Stats{`, + `WallTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.WallTime), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `FetchedSeriesCount:` + fmt.Sprintf("%v", this.FetchedSeriesCount) + `,`, + `FetchedChunkBytes:` + fmt.Sprintf("%v", this.FetchedChunkBytes) + `,`, + `}`, + }, "") + return s +} +func valueToStringStats(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Stats) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Stats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Stats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WallTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStats + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStats + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.WallTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FetchedSeriesCount", wireType) + } + m.FetchedSeriesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FetchedSeriesCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FetchedChunkBytes", wireType) + } + m.FetchedChunkBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStats + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FetchedChunkBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStats(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStats + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStats(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStats + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStats + } + 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 := skipStats(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/ruler/base/ruler.pb.go b/pkg/ruler/base/ruler.pb.go new file mode 100644 index 0000000000000..b53b55afc96ee --- /dev/null +++ b/pkg/ruler/base/ruler.pb.go @@ -0,0 +1,2380 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/ruler/base/ruler.proto + +package base + +import ( + context "context" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + _ "github.com/grafana/loki/pkg/logproto" + github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" + rulespb "github.com/grafana/loki/pkg/ruler/rulespb" + 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" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type RulesRequest struct { +} + +func (m *RulesRequest) Reset() { *m = RulesRequest{} } +func (*RulesRequest) ProtoMessage() {} +func (*RulesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ca810a0fd7057a73, []int{0} +} +func (m *RulesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RulesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RulesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RulesRequest.Merge(m, src) +} +func (m *RulesRequest) XXX_Size() int { + return m.Size() +} +func (m *RulesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RulesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RulesRequest proto.InternalMessageInfo + +type RulesResponse struct { + Groups []*GroupStateDesc `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` +} + +func (m *RulesResponse) Reset() { *m = RulesResponse{} } +func (*RulesResponse) ProtoMessage() {} +func (*RulesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ca810a0fd7057a73, []int{1} +} +func (m *RulesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RulesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RulesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RulesResponse.Merge(m, src) +} +func (m *RulesResponse) XXX_Size() int { + return m.Size() +} +func (m *RulesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RulesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RulesResponse proto.InternalMessageInfo + +func (m *RulesResponse) GetGroups() []*GroupStateDesc { + if m != nil { + return m.Groups + } + return nil +} + +// GroupStateDesc is a proto representation of a rule group +type GroupStateDesc struct { + Group *rulespb.RuleGroupDesc `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + ActiveRules []*RuleStateDesc `protobuf:"bytes,2,rep,name=active_rules,json=activeRules,proto3" json:"active_rules,omitempty"` + EvaluationTimestamp time.Time `protobuf:"bytes,3,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` + EvaluationDuration time.Duration `protobuf:"bytes,4,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` +} + +func (m *GroupStateDesc) Reset() { *m = GroupStateDesc{} } +func (*GroupStateDesc) ProtoMessage() {} +func (*GroupStateDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_ca810a0fd7057a73, []int{2} +} +func (m *GroupStateDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GroupStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GroupStateDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GroupStateDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupStateDesc.Merge(m, src) +} +func (m *GroupStateDesc) XXX_Size() int { + return m.Size() +} +func (m *GroupStateDesc) XXX_DiscardUnknown() { + xxx_messageInfo_GroupStateDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupStateDesc proto.InternalMessageInfo + +func (m *GroupStateDesc) GetGroup() *rulespb.RuleGroupDesc { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupStateDesc) GetActiveRules() []*RuleStateDesc { + if m != nil { + return m.ActiveRules + } + return nil +} + +func (m *GroupStateDesc) GetEvaluationTimestamp() time.Time { + if m != nil { + return m.EvaluationTimestamp + } + return time.Time{} +} + +func (m *GroupStateDesc) GetEvaluationDuration() time.Duration { + if m != nil { + return m.EvaluationDuration + } + return 0 +} + +// RuleStateDesc is a proto representation of a Prometheus Rule +type RuleStateDesc struct { + Rule *rulespb.RuleDesc `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Health string `protobuf:"bytes,3,opt,name=health,proto3" json:"health,omitempty"` + LastError string `protobuf:"bytes,4,opt,name=lastError,proto3" json:"lastError,omitempty"` + Alerts []*AlertStateDesc `protobuf:"bytes,5,rep,name=alerts,proto3" json:"alerts,omitempty"` + EvaluationTimestamp time.Time `protobuf:"bytes,6,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` + EvaluationDuration time.Duration `protobuf:"bytes,7,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` +} + +func (m *RuleStateDesc) Reset() { *m = RuleStateDesc{} } +func (*RuleStateDesc) ProtoMessage() {} +func (*RuleStateDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_ca810a0fd7057a73, []int{3} +} +func (m *RuleStateDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RuleStateDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RuleStateDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleStateDesc.Merge(m, src) +} +func (m *RuleStateDesc) XXX_Size() int { + return m.Size() +} +func (m *RuleStateDesc) XXX_DiscardUnknown() { + xxx_messageInfo_RuleStateDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleStateDesc proto.InternalMessageInfo + +func (m *RuleStateDesc) GetRule() *rulespb.RuleDesc { + if m != nil { + return m.Rule + } + return nil +} + +func (m *RuleStateDesc) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *RuleStateDesc) GetHealth() string { + if m != nil { + return m.Health + } + return "" +} + +func (m *RuleStateDesc) GetLastError() string { + if m != nil { + return m.LastError + } + return "" +} + +func (m *RuleStateDesc) GetAlerts() []*AlertStateDesc { + if m != nil { + return m.Alerts + } + return nil +} + +func (m *RuleStateDesc) GetEvaluationTimestamp() time.Time { + if m != nil { + return m.EvaluationTimestamp + } + return time.Time{} +} + +func (m *RuleStateDesc) GetEvaluationDuration() time.Duration { + if m != nil { + return m.EvaluationDuration + } + return 0 +} + +type AlertStateDesc struct { + State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` + Annotations []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"annotations"` + Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` + FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` + ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` + LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` + ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` +} + +func (m *AlertStateDesc) Reset() { *m = AlertStateDesc{} } +func (*AlertStateDesc) ProtoMessage() {} +func (*AlertStateDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_ca810a0fd7057a73, []int{4} +} +func (m *AlertStateDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AlertStateDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AlertStateDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AlertStateDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlertStateDesc.Merge(m, src) +} +func (m *AlertStateDesc) XXX_Size() int { + return m.Size() +} +func (m *AlertStateDesc) XXX_DiscardUnknown() { + xxx_messageInfo_AlertStateDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_AlertStateDesc proto.InternalMessageInfo + +func (m *AlertStateDesc) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *AlertStateDesc) GetValue() float64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *AlertStateDesc) GetActiveAt() time.Time { + if m != nil { + return m.ActiveAt + } + return time.Time{} +} + +func (m *AlertStateDesc) GetFiredAt() time.Time { + if m != nil { + return m.FiredAt + } + return time.Time{} +} + +func (m *AlertStateDesc) GetResolvedAt() time.Time { + if m != nil { + return m.ResolvedAt + } + return time.Time{} +} + +func (m *AlertStateDesc) GetLastSentAt() time.Time { + if m != nil { + return m.LastSentAt + } + return time.Time{} +} + +func (m *AlertStateDesc) GetValidUntil() time.Time { + if m != nil { + return m.ValidUntil + } + return time.Time{} +} + +func init() { + proto.RegisterType((*RulesRequest)(nil), "base.RulesRequest") + proto.RegisterType((*RulesResponse)(nil), "base.RulesResponse") + proto.RegisterType((*GroupStateDesc)(nil), "base.GroupStateDesc") + proto.RegisterType((*RuleStateDesc)(nil), "base.RuleStateDesc") + proto.RegisterType((*AlertStateDesc)(nil), "base.AlertStateDesc") +} + +func init() { proto.RegisterFile("pkg/ruler/base/ruler.proto", fileDescriptor_ca810a0fd7057a73) } + +var fileDescriptor_ca810a0fd7057a73 = []byte{ + // 682 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0x8e, 0xbb, 0xb6, 0x6b, 0xdd, 0x31, 0x24, 0x6f, 0x42, 0x59, 0x01, 0x77, 0x2a, 0x97, 0x09, + 0xa1, 0x44, 0x0c, 0x84, 0x84, 0x10, 0x42, 0x9d, 0x36, 0xb8, 0xec, 0x80, 0x32, 0xe0, 0x3a, 0xb9, + 0xad, 0x97, 0x45, 0xf3, 0xe2, 0x60, 0x3b, 0x95, 0xb8, 0xf1, 0x13, 0x76, 0xe4, 0xca, 0x8d, 0x9f, + 0xb2, 0xe3, 0x8e, 0x13, 0x48, 0x83, 0x65, 0x17, 0x8e, 0xfb, 0x01, 0x1c, 0x90, 0xed, 0x64, 0xc9, + 0x60, 0x1c, 0x2a, 0xb4, 0x4b, 0x6b, 0xbf, 0xf7, 0xbe, 0xef, 0x7b, 0xef, 0xb3, 0x1d, 0xd8, 0x4d, + 0xf6, 0x42, 0x5f, 0xa4, 0x8c, 0x0a, 0x7f, 0x48, 0x24, 0xb5, 0x4b, 0x2f, 0x11, 0x5c, 0x71, 0x54, + 0xd7, 0x91, 0xee, 0x62, 0xc8, 0x43, 0x6e, 0x02, 0xbe, 0x5e, 0xd9, 0x5c, 0x17, 0x87, 0x9c, 0x87, + 0x8c, 0xfa, 0x66, 0x37, 0x4c, 0x77, 0xfc, 0x71, 0x2a, 0x88, 0x8a, 0x78, 0x9c, 0xe7, 0x7b, 0x7f, + 0xe6, 0x55, 0xb4, 0x4f, 0xa5, 0x22, 0xfb, 0x49, 0x5e, 0x70, 0x5b, 0x0b, 0x33, 0x1e, 0x5a, 0xe6, + 0x62, 0x91, 0x27, 0xef, 0x96, 0x5d, 0xe9, 0x5f, 0x99, 0x0c, 0xed, 0xbf, 0x4d, 0xf7, 0xe7, 0xe1, + 0x5c, 0xa0, 0xb7, 0x01, 0x7d, 0x9f, 0x52, 0xa9, 0xfa, 0xcf, 0xe1, 0x8d, 0x7c, 0x2f, 0x13, 0x1e, + 0x4b, 0x8a, 0x1e, 0xc0, 0x66, 0x28, 0x78, 0x9a, 0x48, 0x17, 0x2c, 0xcf, 0xac, 0x74, 0x56, 0x17, + 0x3d, 0x3d, 0x8a, 0xf7, 0x4a, 0xc7, 0xb6, 0x14, 0x51, 0x74, 0x9d, 0xca, 0x51, 0x90, 0xd7, 0xf4, + 0x3f, 0xd7, 0xe0, 0xfc, 0xe5, 0x14, 0xba, 0x0f, 0x1b, 0x26, 0xe9, 0x82, 0x65, 0x60, 0xf0, 0x56, + 0x5e, 0xab, 0x98, 0x4a, 0x83, 0xb7, 0x25, 0xe8, 0x09, 0x9c, 0x23, 0x23, 0x15, 0x4d, 0xe8, 0xb6, + 0x29, 0x72, 0x6b, 0x46, 0x72, 0xc1, 0x4a, 0x6a, 0x44, 0xa9, 0xd8, 0xb1, 0x85, 0xa6, 0x59, 0xf4, + 0x0e, 0x2e, 0xd0, 0x09, 0x61, 0xa9, 0xb1, 0xed, 0x4d, 0x61, 0x8f, 0x3b, 0x63, 0x14, 0xbb, 0x9e, + 0x35, 0xd0, 0x2b, 0x0c, 0xf4, 0x2e, 0x2a, 0xd6, 0x5a, 0x87, 0x27, 0x3d, 0xe7, 0xe0, 0x7b, 0x0f, + 0x04, 0x57, 0x11, 0xa0, 0x2d, 0x88, 0xca, 0xf0, 0x7a, 0x7e, 0x2c, 0x6e, 0xdd, 0xd0, 0x2e, 0xfd, + 0x45, 0x5b, 0x14, 0x58, 0xd6, 0x4f, 0x9a, 0xf5, 0x0a, 0x78, 0xff, 0x5b, 0xcd, 0x7a, 0x5c, 0x5a, + 0x74, 0x0f, 0xd6, 0xf5, 0xbc, 0xb9, 0x43, 0x37, 0x2b, 0x0e, 0x99, 0x51, 0x4d, 0x12, 0x2d, 0xc2, + 0x86, 0xd4, 0x08, 0xb7, 0xb6, 0x0c, 0x56, 0xda, 0x81, 0xdd, 0xa0, 0x5b, 0xb0, 0xb9, 0x4b, 0x09, + 0x53, 0xbb, 0x66, 0xd8, 0x76, 0x90, 0xef, 0xd0, 0x1d, 0xd8, 0x66, 0x44, 0xaa, 0x0d, 0x21, 0xb8, + 0x30, 0x0d, 0xb7, 0x83, 0x32, 0xa0, 0x0f, 0x95, 0x30, 0x2a, 0x94, 0x74, 0x1b, 0xd5, 0x43, 0x1d, + 0xe8, 0x58, 0xe5, 0x50, 0x6d, 0xcd, 0xbf, 0xdc, 0x6d, 0x5e, 0x8f, 0xbb, 0xb3, 0xff, 0xe7, 0xee, + 0xaf, 0x3a, 0x9c, 0xbf, 0x3c, 0x47, 0xe9, 0x1c, 0xa8, 0x3a, 0xc7, 0x60, 0x93, 0x91, 0x21, 0x65, + 0xc5, 0x2d, 0x5b, 0xf2, 0x2e, 0x5e, 0xce, 0x26, 0x0d, 0xc9, 0xe8, 0xc3, 0xa6, 0xce, 0xbe, 0x26, + 0x91, 0x58, 0x7b, 0xaa, 0x15, 0xbf, 0x9e, 0xf4, 0x1e, 0x86, 0x91, 0xda, 0x4d, 0x87, 0xde, 0x88, + 0xef, 0xfb, 0xa1, 0x20, 0x3b, 0x24, 0x26, 0x3e, 0xe3, 0x7b, 0x91, 0x5f, 0x7d, 0x80, 0x9e, 0xc1, + 0x0d, 0xc6, 0x24, 0x51, 0x54, 0x04, 0xb9, 0x06, 0x9a, 0xc0, 0x0e, 0x89, 0x63, 0xae, 0x4c, 0x93, + 0xd2, 0x9d, 0xb9, 0x46, 0xc9, 0xaa, 0x90, 0x9e, 0x5d, 0x7b, 0x44, 0xcd, 0x1d, 0x00, 0x81, 0xdd, + 0xa0, 0x01, 0x6c, 0xe7, 0xef, 0x8c, 0x28, 0xb7, 0x31, 0xc5, 0x39, 0xb6, 0x2c, 0x6c, 0xa0, 0xd0, + 0x0b, 0xd8, 0xda, 0x89, 0x04, 0x1d, 0x6b, 0x86, 0x69, 0x6e, 0xc2, 0xac, 0x41, 0x0d, 0x14, 0xda, + 0x80, 0x1d, 0x41, 0x25, 0x67, 0x13, 0xcb, 0x31, 0x3b, 0x05, 0x07, 0x2c, 0x80, 0x03, 0x85, 0x5e, + 0xc2, 0x39, 0x7d, 0xaf, 0xb7, 0x25, 0x8d, 0x95, 0xe6, 0x69, 0x4d, 0xc3, 0xa3, 0x91, 0x5b, 0x34, + 0x56, 0xb6, 0x9d, 0x09, 0x61, 0xd1, 0x78, 0x3b, 0x8d, 0x55, 0xc4, 0xdc, 0xf6, 0x34, 0x34, 0x06, + 0xf8, 0x56, 0xe3, 0x56, 0x9f, 0xc1, 0x86, 0x7e, 0xb7, 0x02, 0xad, 0xda, 0x85, 0x44, 0xa8, 0xfc, + 0x7a, 0x15, 0x5f, 0xd9, 0xee, 0xc2, 0xa5, 0x98, 0xfd, 0xd2, 0xf6, 0x9d, 0xb5, 0xc7, 0x47, 0xa7, + 0xd8, 0x39, 0x3e, 0xc5, 0xce, 0xf9, 0x29, 0x06, 0x1f, 0x33, 0x0c, 0xbe, 0x64, 0x18, 0x1c, 0x66, + 0x18, 0x1c, 0x65, 0x18, 0xfc, 0xc8, 0x30, 0xf8, 0x99, 0x61, 0xe7, 0x3c, 0xc3, 0xe0, 0xe0, 0x0c, + 0x3b, 0x47, 0x67, 0xd8, 0x39, 0x3e, 0xc3, 0xce, 0xb0, 0x69, 0x9a, 0x7b, 0xf4, 0x3b, 0x00, 0x00, + 0xff, 0xff, 0x35, 0xb6, 0x62, 0xce, 0x80, 0x06, 0x00, 0x00, +} + +func (this *RulesRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RulesRequest) + if !ok { + that2, ok := that.(RulesRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *RulesResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RulesResponse) + if !ok { + that2, ok := that.(RulesResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Groups) != len(that1.Groups) { + return false + } + for i := range this.Groups { + if !this.Groups[i].Equal(that1.Groups[i]) { + return false + } + } + return true +} +func (this *GroupStateDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GroupStateDesc) + if !ok { + that2, ok := that.(GroupStateDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Group.Equal(that1.Group) { + return false + } + if len(this.ActiveRules) != len(that1.ActiveRules) { + return false + } + for i := range this.ActiveRules { + if !this.ActiveRules[i].Equal(that1.ActiveRules[i]) { + return false + } + } + if !this.EvaluationTimestamp.Equal(that1.EvaluationTimestamp) { + return false + } + if this.EvaluationDuration != that1.EvaluationDuration { + return false + } + return true +} +func (this *RuleStateDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RuleStateDesc) + if !ok { + that2, ok := that.(RuleStateDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Rule.Equal(that1.Rule) { + return false + } + if this.State != that1.State { + return false + } + if this.Health != that1.Health { + return false + } + if this.LastError != that1.LastError { + return false + } + if len(this.Alerts) != len(that1.Alerts) { + return false + } + for i := range this.Alerts { + if !this.Alerts[i].Equal(that1.Alerts[i]) { + return false + } + } + if !this.EvaluationTimestamp.Equal(that1.EvaluationTimestamp) { + return false + } + if this.EvaluationDuration != that1.EvaluationDuration { + return false + } + return true +} +func (this *AlertStateDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*AlertStateDesc) + if !ok { + that2, ok := that.(AlertStateDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.State != that1.State { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if len(this.Annotations) != len(that1.Annotations) { + return false + } + for i := range this.Annotations { + if !this.Annotations[i].Equal(that1.Annotations[i]) { + return false + } + } + if this.Value != that1.Value { + return false + } + if !this.ActiveAt.Equal(that1.ActiveAt) { + return false + } + if !this.FiredAt.Equal(that1.FiredAt) { + return false + } + if !this.ResolvedAt.Equal(that1.ResolvedAt) { + return false + } + if !this.LastSentAt.Equal(that1.LastSentAt) { + return false + } + if !this.ValidUntil.Equal(that1.ValidUntil) { + return false + } + return true +} +func (this *RulesRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&base.RulesRequest{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RulesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&base.RulesResponse{") + if this.Groups != nil { + s = append(s, "Groups: "+fmt.Sprintf("%#v", this.Groups)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GroupStateDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&base.GroupStateDesc{") + if this.Group != nil { + s = append(s, "Group: "+fmt.Sprintf("%#v", this.Group)+",\n") + } + if this.ActiveRules != nil { + s = append(s, "ActiveRules: "+fmt.Sprintf("%#v", this.ActiveRules)+",\n") + } + s = append(s, "EvaluationTimestamp: "+fmt.Sprintf("%#v", this.EvaluationTimestamp)+",\n") + s = append(s, "EvaluationDuration: "+fmt.Sprintf("%#v", this.EvaluationDuration)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RuleStateDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 11) + s = append(s, "&base.RuleStateDesc{") + if this.Rule != nil { + s = append(s, "Rule: "+fmt.Sprintf("%#v", this.Rule)+",\n") + } + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + s = append(s, "Health: "+fmt.Sprintf("%#v", this.Health)+",\n") + s = append(s, "LastError: "+fmt.Sprintf("%#v", this.LastError)+",\n") + if this.Alerts != nil { + s = append(s, "Alerts: "+fmt.Sprintf("%#v", this.Alerts)+",\n") + } + s = append(s, "EvaluationTimestamp: "+fmt.Sprintf("%#v", this.EvaluationTimestamp)+",\n") + s = append(s, "EvaluationDuration: "+fmt.Sprintf("%#v", this.EvaluationDuration)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *AlertStateDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 13) + s = append(s, "&base.AlertStateDesc{") + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "ActiveAt: "+fmt.Sprintf("%#v", this.ActiveAt)+",\n") + s = append(s, "FiredAt: "+fmt.Sprintf("%#v", this.FiredAt)+",\n") + s = append(s, "ResolvedAt: "+fmt.Sprintf("%#v", this.ResolvedAt)+",\n") + s = append(s, "LastSentAt: "+fmt.Sprintf("%#v", this.LastSentAt)+",\n") + s = append(s, "ValidUntil: "+fmt.Sprintf("%#v", this.ValidUntil)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringRuler(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// RulerClient is the client API for Ruler service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RulerClient interface { + Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (*RulesResponse, error) +} + +type rulerClient struct { + cc *grpc.ClientConn +} + +func NewRulerClient(cc *grpc.ClientConn) RulerClient { + return &rulerClient{cc} +} + +func (c *rulerClient) Rules(ctx context.Context, in *RulesRequest, opts ...grpc.CallOption) (*RulesResponse, error) { + out := new(RulesResponse) + err := c.cc.Invoke(ctx, "/base.Ruler/Rules", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RulerServer is the server API for Ruler service. +type RulerServer interface { + Rules(context.Context, *RulesRequest) (*RulesResponse, error) +} + +// UnimplementedRulerServer can be embedded to have forward compatible implementations. +type UnimplementedRulerServer struct { +} + +func (*UnimplementedRulerServer) Rules(ctx context.Context, req *RulesRequest) (*RulesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rules not implemented") +} + +func RegisterRulerServer(s *grpc.Server, srv RulerServer) { + s.RegisterService(&_Ruler_serviceDesc, srv) +} + +func _Ruler_Rules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RulesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RulerServer).Rules(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/base.Ruler/Rules", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RulerServer).Rules(ctx, req.(*RulesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Ruler_serviceDesc = grpc.ServiceDesc{ + ServiceName: "base.Ruler", + HandlerType: (*RulerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Rules", + Handler: _Ruler_Rules_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/ruler/base/ruler.proto", +} + +func (m *RulesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *RulesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = 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 = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GroupStateDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GroupStateDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GroupStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.EvaluationDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintRuler(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x22 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EvaluationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintRuler(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + if len(m.ActiveRules) > 0 { + for iNdEx := len(m.ActiveRules) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ActiveRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Group != nil { + { + size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RuleStateDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleStateDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.EvaluationDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintRuler(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EvaluationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintRuler(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x32 + 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 = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.LastError) > 0 { + i -= len(m.LastError) + copy(dAtA[i:], m.LastError) + i = encodeVarintRuler(dAtA, i, uint64(len(m.LastError))) + i-- + dAtA[i] = 0x22 + } + if len(m.Health) > 0 { + i -= len(m.Health) + copy(dAtA[i:], m.Health) + i = encodeVarintRuler(dAtA, i, uint64(len(m.Health))) + i-- + dAtA[i] = 0x1a + } + if len(m.State) > 0 { + i -= len(m.State) + copy(dAtA[i:], m.State) + i = encodeVarintRuler(dAtA, i, uint64(len(m.State))) + i-- + dAtA[i] = 0x12 + } + if m.Rule != nil { + { + size, err := m.Rule.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AlertStateDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AlertStateDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AlertStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ValidUntil, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ValidUntil):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintRuler(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x4a + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastSentAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSentAt):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintRuler(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x42 + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ResolvedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ResolvedAt):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintRuler(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x3a + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FiredAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FiredAt):]) + if err10 != nil { + return 0, err10 + } + i -= n10 + i = encodeVarintRuler(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x32 + n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ActiveAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ActiveAt):]) + if err11 != nil { + return 0, err11 + } + i -= n11 + i = encodeVarintRuler(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0x2a + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x21 + } + if len(m.Annotations) > 0 { + for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Annotations[iNdEx].Size() + i -= size + if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRuler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.State) > 0 { + i -= len(m.State) + copy(dAtA[i:], m.State) + i = encodeVarintRuler(dAtA, i, uint64(len(m.State))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRuler(dAtA []byte, offset int, v uint64) int { + offset -= sovRuler(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RulesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *RulesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Groups) > 0 { + for _, e := range m.Groups { + l = e.Size() + n += 1 + l + sovRuler(uint64(l)) + } + } + return n +} + +func (m *GroupStateDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Group != nil { + l = m.Group.Size() + n += 1 + l + sovRuler(uint64(l)) + } + if len(m.ActiveRules) > 0 { + for _, e := range m.ActiveRules { + l = e.Size() + n += 1 + l + sovRuler(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration) + n += 1 + l + sovRuler(uint64(l)) + return n +} + +func (m *RuleStateDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Rule != nil { + l = m.Rule.Size() + n += 1 + l + sovRuler(uint64(l)) + } + l = len(m.State) + if l > 0 { + n += 1 + l + sovRuler(uint64(l)) + } + l = len(m.Health) + if l > 0 { + n += 1 + l + sovRuler(uint64(l)) + } + l = len(m.LastError) + if l > 0 { + n += 1 + l + sovRuler(uint64(l)) + } + if len(m.Alerts) > 0 { + for _, e := range m.Alerts { + l = e.Size() + n += 1 + l + sovRuler(uint64(l)) + } + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration) + n += 1 + l + sovRuler(uint64(l)) + return n +} + +func (m *AlertStateDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.State) + if l > 0 { + n += 1 + l + sovRuler(uint64(l)) + } + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovRuler(uint64(l)) + } + } + if len(m.Annotations) > 0 { + for _, e := range m.Annotations { + l = e.Size() + n += 1 + l + sovRuler(uint64(l)) + } + } + if m.Value != 0 { + n += 9 + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ActiveAt) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FiredAt) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ResolvedAt) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSentAt) + n += 1 + l + sovRuler(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ValidUntil) + n += 1 + l + sovRuler(uint64(l)) + return n +} + +func sovRuler(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRuler(x uint64) (n int) { + return sovRuler(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *RulesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RulesRequest{`, + `}`, + }, "") + return s +} +func (this *RulesResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForGroups := "[]*GroupStateDesc{" + for _, f := range this.Groups { + repeatedStringForGroups += strings.Replace(f.String(), "GroupStateDesc", "GroupStateDesc", 1) + "," + } + repeatedStringForGroups += "}" + s := strings.Join([]string{`&RulesResponse{`, + `Groups:` + repeatedStringForGroups + `,`, + `}`, + }, "") + return s +} +func (this *GroupStateDesc) String() string { + if this == nil { + return "nil" + } + repeatedStringForActiveRules := "[]*RuleStateDesc{" + for _, f := range this.ActiveRules { + repeatedStringForActiveRules += strings.Replace(f.String(), "RuleStateDesc", "RuleStateDesc", 1) + "," + } + repeatedStringForActiveRules += "}" + s := strings.Join([]string{`&GroupStateDesc{`, + `Group:` + strings.Replace(fmt.Sprintf("%v", this.Group), "RuleGroupDesc", "rulespb.RuleGroupDesc", 1) + `,`, + `ActiveRules:` + repeatedStringForActiveRules + `,`, + `EvaluationTimestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationTimestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `EvaluationDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationDuration), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *RuleStateDesc) String() string { + if this == nil { + return "nil" + } + repeatedStringForAlerts := "[]*AlertStateDesc{" + for _, f := range this.Alerts { + repeatedStringForAlerts += strings.Replace(f.String(), "AlertStateDesc", "AlertStateDesc", 1) + "," + } + repeatedStringForAlerts += "}" + s := strings.Join([]string{`&RuleStateDesc{`, + `Rule:` + strings.Replace(fmt.Sprintf("%v", this.Rule), "RuleDesc", "rulespb.RuleDesc", 1) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Health:` + fmt.Sprintf("%v", this.Health) + `,`, + `LastError:` + fmt.Sprintf("%v", this.LastError) + `,`, + `Alerts:` + repeatedStringForAlerts + `,`, + `EvaluationTimestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationTimestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `EvaluationDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EvaluationDuration), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *AlertStateDesc) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AlertStateDesc{`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `ActiveAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActiveAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `FiredAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FiredAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `ResolvedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ResolvedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `LastSentAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastSentAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `ValidUntil:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidUntil), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringRuler(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *RulesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RulesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RulesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRuler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RulesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RulesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RulesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, &GroupStateDesc{}) + if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRuler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GroupStateDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GroupStateDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GroupStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Group == nil { + m.Group = &rulespb.RuleGroupDesc{} + } + if err := m.Group.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveRules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActiveRules = append(m.ActiveRules, &RuleStateDesc{}) + if err := m.ActiveRules[len(m.ActiveRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EvaluationTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.EvaluationDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRuler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleStateDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleStateDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Rule == nil { + m.Rule = &rulespb.RuleDesc{} + } + if err := m.Rule.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Health = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastError", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastError = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alerts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Alerts = append(m.Alerts, &AlertStateDesc{}) + if err := m.Alerts[len(m.Alerts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EvaluationTimestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvaluationDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.EvaluationDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRuler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AlertStateDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AlertStateDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Annotations = append(m.Annotations, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ActiveAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FiredAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FiredAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResolvedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ResolvedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastSentAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastSentAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidUntil", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRuler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRuler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ValidUntil, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRuler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRuler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRuler(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRuler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRuler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRuler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRuler + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRuler + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRuler + } + 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 := skipRuler(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRuler + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthRuler = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRuler = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/ruler/rulespb/rules.pb.go b/pkg/ruler/rulespb/rules.pb.go new file mode 100644 index 0000000000000..ead0d482791be --- /dev/null +++ b/pkg/ruler/rulespb/rules.pb.go @@ -0,0 +1,1320 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/ruler/rulespb/rules.proto + +package rulespb + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + _ "github.com/grafana/loki/pkg/logproto" + github_com_grafana_loki_pkg_logproto "github.com/grafana/loki/pkg/logproto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// RuleGroupDesc is a proto representation of a rule group. +type RuleGroupDesc struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Interval time.Duration `protobuf:"bytes,3,opt,name=interval,proto3,stdduration" json:"interval"` + Rules []*RuleDesc `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` + User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` + // The options field can be used to extend Ruler functionality without + // having to repeatedly redefine the proto description. It can also be leveraged + // to create custom `ManagerOpts` based on rule configs which can then be passed + // to the Prometheus Manager. + Options []*types.Any `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"` + Limit int64 `protobuf:"varint,10,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (m *RuleGroupDesc) Reset() { *m = RuleGroupDesc{} } +func (*RuleGroupDesc) ProtoMessage() {} +func (*RuleGroupDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_dd3ef3757f506fba, []int{0} +} +func (m *RuleGroupDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleGroupDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RuleGroupDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RuleGroupDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleGroupDesc.Merge(m, src) +} +func (m *RuleGroupDesc) XXX_Size() int { + return m.Size() +} +func (m *RuleGroupDesc) XXX_DiscardUnknown() { + xxx_messageInfo_RuleGroupDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleGroupDesc proto.InternalMessageInfo + +func (m *RuleGroupDesc) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *RuleGroupDesc) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *RuleGroupDesc) GetInterval() time.Duration { + if m != nil { + return m.Interval + } + return 0 +} + +func (m *RuleGroupDesc) GetRules() []*RuleDesc { + if m != nil { + return m.Rules + } + return nil +} + +func (m *RuleGroupDesc) GetUser() string { + if m != nil { + return m.User + } + return "" +} + +func (m *RuleGroupDesc) GetOptions() []*types.Any { + if m != nil { + return m.Options + } + return nil +} + +func (m *RuleGroupDesc) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +// RuleDesc is a proto representation of a Prometheus Rule +type RuleDesc struct { + Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` + Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` + For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` + Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"labels"` + Annotations []github_com_grafana_loki_pkg_logproto.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3,customtype=github.com/grafana/loki/pkg/logproto.LabelAdapter" json:"annotations"` +} + +func (m *RuleDesc) Reset() { *m = RuleDesc{} } +func (*RuleDesc) ProtoMessage() {} +func (*RuleDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_dd3ef3757f506fba, []int{1} +} +func (m *RuleDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RuleDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RuleDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RuleDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_RuleDesc.Merge(m, src) +} +func (m *RuleDesc) XXX_Size() int { + return m.Size() +} +func (m *RuleDesc) XXX_DiscardUnknown() { + xxx_messageInfo_RuleDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_RuleDesc proto.InternalMessageInfo + +func (m *RuleDesc) GetExpr() string { + if m != nil { + return m.Expr + } + return "" +} + +func (m *RuleDesc) GetRecord() string { + if m != nil { + return m.Record + } + return "" +} + +func (m *RuleDesc) GetAlert() string { + if m != nil { + return m.Alert + } + return "" +} + +func (m *RuleDesc) GetFor() time.Duration { + if m != nil { + return m.For + } + return 0 +} + +func init() { + proto.RegisterType((*RuleGroupDesc)(nil), "rules.RuleGroupDesc") + proto.RegisterType((*RuleDesc)(nil), "rules.RuleDesc") +} + +func init() { proto.RegisterFile("pkg/ruler/rulespb/rules.proto", fileDescriptor_dd3ef3757f506fba) } + +var fileDescriptor_dd3ef3757f506fba = []byte{ + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x41, 0x6f, 0xd3, 0x30, + 0x18, 0x8d, 0xdb, 0x34, 0x4b, 0x5c, 0x4d, 0x54, 0x56, 0x85, 0xd2, 0x01, 0x6e, 0x35, 0x09, 0xa9, + 0x5c, 0x12, 0x31, 0xc4, 0x81, 0x13, 0x5a, 0x35, 0x09, 0xa9, 0xda, 0x01, 0xe5, 0xc8, 0x05, 0x39, + 0xa9, 0x6b, 0xa2, 0xb9, 0x71, 0xe4, 0x24, 0x13, 0xbd, 0xf1, 0x13, 0xb8, 0x20, 0xf1, 0x13, 0xf8, + 0x29, 0x3b, 0xf6, 0x38, 0x71, 0x18, 0x34, 0xbd, 0x70, 0x63, 0x3f, 0x01, 0xd9, 0x4e, 0xc6, 0x00, + 0x09, 0x71, 0xe1, 0x12, 0x7f, 0xcf, 0xcf, 0x9f, 0xdf, 0xfb, 0x5e, 0x12, 0xf8, 0x20, 0x3f, 0x63, + 0xa1, 0xac, 0x38, 0x95, 0xfa, 0x59, 0xe4, 0xb1, 0x59, 0x83, 0x5c, 0x8a, 0x52, 0xa0, 0x9e, 0x06, + 0x07, 0x43, 0x26, 0x98, 0xd0, 0x3b, 0xa1, 0xaa, 0x0c, 0x79, 0x30, 0x62, 0x42, 0x30, 0x4e, 0x43, + 0x8d, 0xe2, 0x6a, 0x19, 0x92, 0x6c, 0xdd, 0x50, 0xf8, 0x77, 0x6a, 0x51, 0x49, 0x52, 0xa6, 0x22, + 0x6b, 0xf8, 0x7b, 0x4a, 0x96, 0x0b, 0x66, 0xee, 0x6c, 0x0b, 0x43, 0x1e, 0x7e, 0xe8, 0xc0, 0xfd, + 0xa8, 0xe2, 0xf4, 0x85, 0x14, 0x55, 0x7e, 0x42, 0x8b, 0x04, 0x21, 0x68, 0x67, 0x64, 0x45, 0x7d, + 0x30, 0x01, 0x53, 0x2f, 0xd2, 0x35, 0xba, 0x0f, 0x3d, 0xb5, 0x16, 0x39, 0x49, 0xa8, 0xdf, 0xd1, + 0xc4, 0xcf, 0x0d, 0xf4, 0x1c, 0xba, 0x69, 0x56, 0x52, 0x79, 0x4e, 0xb8, 0xdf, 0x9d, 0x80, 0x69, + 0xff, 0x68, 0x14, 0x18, 0x4f, 0x41, 0xeb, 0x29, 0x38, 0x69, 0x3c, 0xcd, 0xdc, 0x8b, 0xab, 0xb1, + 0xf5, 0xf1, 0xcb, 0x18, 0x44, 0x37, 0x4d, 0xe8, 0x21, 0x34, 0xb3, 0xfb, 0xf6, 0xa4, 0x3b, 0xed, + 0x1f, 0xdd, 0x09, 0x4c, 0x2c, 0xca, 0x97, 0xb2, 0x14, 0x19, 0x56, 0x39, 0xab, 0x0a, 0x2a, 0x7d, + 0xc7, 0x38, 0x53, 0x35, 0x0a, 0xe0, 0x9e, 0xc8, 0xd5, 0xc5, 0x85, 0xef, 0xe9, 0xe6, 0xe1, 0x1f, + 0xd2, 0xc7, 0xd9, 0x3a, 0x6a, 0x0f, 0xa1, 0x21, 0xec, 0xf1, 0x74, 0x95, 0x96, 0x3e, 0x9c, 0x80, + 0x69, 0x37, 0x32, 0x60, 0x6e, 0xbb, 0xbd, 0x81, 0x33, 0xb7, 0xdd, 0xbd, 0x81, 0x3b, 0xb7, 0x5d, + 0x77, 0xe0, 0x1d, 0x7e, 0xef, 0x40, 0xb7, 0xd5, 0x57, 0xc2, 0xf4, 0x6d, 0x2e, 0xdb, 0x48, 0x54, + 0x8d, 0xee, 0x42, 0x47, 0xd2, 0x44, 0xc8, 0x45, 0x93, 0x47, 0x83, 0x94, 0x00, 0xe1, 0x54, 0x96, + 0x3a, 0x09, 0x2f, 0x32, 0x00, 0x3d, 0x85, 0xdd, 0xa5, 0x90, 0xbe, 0xfd, 0xef, 0xe9, 0xa8, 0xf3, + 0x88, 0x43, 0x87, 0x93, 0x98, 0xf2, 0xc2, 0xef, 0xe9, 0xe1, 0x46, 0xc1, 0xcd, 0xeb, 0x3b, 0xa5, + 0x8c, 0x24, 0xeb, 0x53, 0xc5, 0xbe, 0x24, 0xa9, 0x9c, 0x3d, 0x53, 0x9d, 0x9f, 0xaf, 0xc6, 0x8f, + 0x59, 0x5a, 0xbe, 0xa9, 0xe2, 0x20, 0x11, 0xab, 0x90, 0x49, 0xb2, 0x24, 0x19, 0x09, 0xb9, 0x38, + 0x4b, 0xc3, 0xdb, 0x5f, 0x41, 0xa0, 0xfb, 0x8e, 0x17, 0x24, 0x2f, 0xa9, 0x8c, 0x1a, 0x0d, 0x74, + 0x0e, 0xfb, 0x24, 0xcb, 0x44, 0x49, 0x4c, 0x9e, 0xce, 0x7f, 0x94, 0xbc, 0x2d, 0xa4, 0x73, 0xdf, + 0x9f, 0xbd, 0xde, 0x6c, 0xb1, 0x75, 0xb9, 0xc5, 0xd6, 0xf5, 0x16, 0x83, 0x77, 0x35, 0x06, 0x9f, + 0x6a, 0x0c, 0x2e, 0x6a, 0x0c, 0x36, 0x35, 0x06, 0x5f, 0x6b, 0x0c, 0xbe, 0xd5, 0xd8, 0xba, 0xae, + 0x31, 0x78, 0xbf, 0xc3, 0xd6, 0x66, 0x87, 0xad, 0xcb, 0x1d, 0xb6, 0x5e, 0x3d, 0xfa, 0x9b, 0xf6, + 0x2f, 0xff, 0x5a, 0xec, 0x68, 0x1f, 0x4f, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6f, 0xf3, 0x96, + 0x82, 0x87, 0x03, 0x00, 0x00, +} + +func (this *RuleGroupDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RuleGroupDesc) + if !ok { + that2, ok := that.(RuleGroupDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Namespace != that1.Namespace { + return false + } + if this.Interval != that1.Interval { + return false + } + if len(this.Rules) != len(that1.Rules) { + return false + } + for i := range this.Rules { + if !this.Rules[i].Equal(that1.Rules[i]) { + return false + } + } + if this.User != that1.User { + return false + } + if len(this.Options) != len(that1.Options) { + return false + } + for i := range this.Options { + if !this.Options[i].Equal(that1.Options[i]) { + return false + } + } + if this.Limit != that1.Limit { + return false + } + return true +} +func (this *RuleDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RuleDesc) + if !ok { + that2, ok := that.(RuleDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Expr != that1.Expr { + return false + } + if this.Record != that1.Record { + return false + } + if this.Alert != that1.Alert { + return false + } + if this.For != that1.For { + return false + } + if len(this.Labels) != len(that1.Labels) { + return false + } + for i := range this.Labels { + if !this.Labels[i].Equal(that1.Labels[i]) { + return false + } + } + if len(this.Annotations) != len(that1.Annotations) { + return false + } + for i := range this.Annotations { + if !this.Annotations[i].Equal(that1.Annotations[i]) { + return false + } + } + return true +} +func (this *RuleGroupDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 11) + s = append(s, "&rulespb.RuleGroupDesc{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Namespace: "+fmt.Sprintf("%#v", this.Namespace)+",\n") + s = append(s, "Interval: "+fmt.Sprintf("%#v", this.Interval)+",\n") + if this.Rules != nil { + s = append(s, "Rules: "+fmt.Sprintf("%#v", this.Rules)+",\n") + } + s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") + if this.Options != nil { + s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") + } + s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RuleDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 10) + s = append(s, "&rulespb.RuleDesc{") + s = append(s, "Expr: "+fmt.Sprintf("%#v", this.Expr)+",\n") + s = append(s, "Record: "+fmt.Sprintf("%#v", this.Record)+",\n") + s = append(s, "Alert: "+fmt.Sprintf("%#v", this.Alert)+",\n") + s = append(s, "For: "+fmt.Sprintf("%#v", this.For)+",\n") + s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringRules(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *RuleGroupDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleGroupDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleGroupDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Limit != 0 { + i = encodeVarintRules(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x50 + } + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRules(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintRules(dAtA, i, uint64(len(m.User))) + i-- + dAtA[i] = 0x32 + } + 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 = encodeVarintRules(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Interval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintRules(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintRules(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRules(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RuleDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuleDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Annotations) > 0 { + for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Annotations[iNdEx].Size() + i -= size + if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRules(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintRules(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.For, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.For):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintRules(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x22 + if len(m.Alert) > 0 { + i -= len(m.Alert) + copy(dAtA[i:], m.Alert) + i = encodeVarintRules(dAtA, i, uint64(len(m.Alert))) + i-- + dAtA[i] = 0x1a + } + if len(m.Record) > 0 { + i -= len(m.Record) + copy(dAtA[i:], m.Record) + i = encodeVarintRules(dAtA, i, uint64(len(m.Record))) + i-- + dAtA[i] = 0x12 + } + if len(m.Expr) > 0 { + i -= len(m.Expr) + copy(dAtA[i:], m.Expr) + i = encodeVarintRules(dAtA, i, uint64(len(m.Expr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRules(dAtA []byte, offset int, v uint64) int { + offset -= sovRules(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RuleGroupDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + l = len(m.Namespace) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Interval) + n += 1 + l + sovRules(uint64(l)) + if len(m.Rules) > 0 { + for _, e := range m.Rules { + l = e.Size() + n += 1 + l + sovRules(uint64(l)) + } + } + l = len(m.User) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + if len(m.Options) > 0 { + for _, e := range m.Options { + l = e.Size() + n += 1 + l + sovRules(uint64(l)) + } + } + if m.Limit != 0 { + n += 1 + sovRules(uint64(m.Limit)) + } + return n +} + +func (m *RuleDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expr) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + l = len(m.Record) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + l = len(m.Alert) + if l > 0 { + n += 1 + l + sovRules(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.For) + n += 1 + l + sovRules(uint64(l)) + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovRules(uint64(l)) + } + } + if len(m.Annotations) > 0 { + for _, e := range m.Annotations { + l = e.Size() + n += 1 + l + sovRules(uint64(l)) + } + } + return n +} + +func sovRules(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRules(x uint64) (n int) { + return sovRules(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *RuleGroupDesc) String() string { + if this == nil { + return "nil" + } + repeatedStringForRules := "[]*RuleDesc{" + for _, f := range this.Rules { + repeatedStringForRules += strings.Replace(f.String(), "RuleDesc", "RuleDesc", 1) + "," + } + repeatedStringForRules += "}" + repeatedStringForOptions := "[]*Any{" + for _, f := range this.Options { + repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," + } + repeatedStringForOptions += "}" + s := strings.Join([]string{`&RuleGroupDesc{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Interval:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Interval), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `Rules:` + repeatedStringForRules + `,`, + `User:` + fmt.Sprintf("%v", this.User) + `,`, + `Options:` + repeatedStringForOptions + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `}`, + }, "") + return s +} +func (this *RuleDesc) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RuleDesc{`, + `Expr:` + fmt.Sprintf("%v", this.Expr) + `,`, + `Record:` + fmt.Sprintf("%v", this.Record) + `,`, + `Alert:` + fmt.Sprintf("%v", this.Alert) + `,`, + `For:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.For), "Duration", "duration.Duration", 1), `&`, ``, 1) + `,`, + `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, + `}`, + }, "") + return s +} +func valueToStringRules(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *RuleGroupDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleGroupDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleGroupDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Interval, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rules = append(m.Rules, &RuleDesc{}) + if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.User = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, &types.Any{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRules(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRules + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRules + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RuleDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RuleDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RuleDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Record = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alert", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Alert = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field For", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.For, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRules + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRules + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRules + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Annotations = append(m.Annotations, github_com_grafana_loki_pkg_logproto.LabelAdapter{}) + if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRules(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthRules + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRules + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRules(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRules + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRules + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRules + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRules + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRules + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRules + } + 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 := skipRules(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRules + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthRules = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRules = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/scheduler/schedulerpb/scheduler.pb.go b/pkg/scheduler/schedulerpb/scheduler.pb.go new file mode 100644 index 0000000000000..c2f95e59cdae4 --- /dev/null +++ b/pkg/scheduler/schedulerpb/scheduler.pb.go @@ -0,0 +1,2850 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/scheduler/schedulerpb/scheduler.proto + +package schedulerpb + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + httpgrpc "github.com/grafana/dskit/httpgrpc" + queryrange "github.com/grafana/loki/pkg/querier/queryrange" + 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" + reflect "reflect" + strconv "strconv" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type FrontendToSchedulerType int32 + +const ( + INIT FrontendToSchedulerType = 0 + ENQUEUE FrontendToSchedulerType = 1 + CANCEL FrontendToSchedulerType = 2 +) + +var FrontendToSchedulerType_name = map[int32]string{ + 0: "INIT", + 1: "ENQUEUE", + 2: "CANCEL", +} + +var FrontendToSchedulerType_value = map[string]int32{ + "INIT": 0, + "ENQUEUE": 1, + "CANCEL": 2, +} + +func (FrontendToSchedulerType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{0} +} + +type SchedulerToFrontendStatus int32 + +const ( + OK SchedulerToFrontendStatus = 0 + TOO_MANY_REQUESTS_PER_TENANT SchedulerToFrontendStatus = 1 + ERROR SchedulerToFrontendStatus = 2 + SHUTTING_DOWN SchedulerToFrontendStatus = 3 +) + +var SchedulerToFrontendStatus_name = map[int32]string{ + 0: "OK", + 1: "TOO_MANY_REQUESTS_PER_TENANT", + 2: "ERROR", + 3: "SHUTTING_DOWN", +} + +var SchedulerToFrontendStatus_value = map[string]int32{ + "OK": 0, + "TOO_MANY_REQUESTS_PER_TENANT": 1, + "ERROR": 2, + "SHUTTING_DOWN": 3, +} + +func (SchedulerToFrontendStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{1} +} + +// Querier reports its own clientID when it connects, so that scheduler knows how many *different* queriers are connected. +// To signal that querier is ready to accept another request, querier sends empty message. +type QuerierToScheduler struct { + QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"` +} + +func (m *QuerierToScheduler) Reset() { *m = QuerierToScheduler{} } +func (*QuerierToScheduler) ProtoMessage() {} +func (*QuerierToScheduler) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{0} +} +func (m *QuerierToScheduler) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerierToScheduler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerierToScheduler.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerierToScheduler) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerierToScheduler.Merge(m, src) +} +func (m *QuerierToScheduler) XXX_Size() int { + return m.Size() +} +func (m *QuerierToScheduler) XXX_DiscardUnknown() { + xxx_messageInfo_QuerierToScheduler.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerierToScheduler proto.InternalMessageInfo + +func (m *QuerierToScheduler) GetQuerierID() string { + if m != nil { + return m.QuerierID + } + return "" +} + +type SchedulerToQuerier struct { + // Query ID as reported by frontend. When querier sends the response back to frontend (using frontendAddress), + // it identifies the query by using this ID. + QueryID uint64 `protobuf:"varint,1,opt,name=queryID,proto3" json:"queryID,omitempty"` + // Types that are valid to be assigned to Request: + // *SchedulerToQuerier_HttpRequest + // *SchedulerToQuerier_QueryRequest + Request isSchedulerToQuerier_Request `protobuf_oneof:"request"` + // Where should querier send HTTP Response to (using FrontendForQuerier interface). + FrontendAddress string `protobuf:"bytes,3,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"` + // User who initiated the request. Needed to send reply back to frontend. + UserID string `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"` + // Whether query statistics tracking should be enabled. The response will include + // statistics only when this option is enabled. + StatsEnabled bool `protobuf:"varint,5,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"` +} + +func (m *SchedulerToQuerier) Reset() { *m = SchedulerToQuerier{} } +func (*SchedulerToQuerier) ProtoMessage() {} +func (*SchedulerToQuerier) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{1} +} +func (m *SchedulerToQuerier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SchedulerToQuerier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SchedulerToQuerier.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SchedulerToQuerier) XXX_Merge(src proto.Message) { + xxx_messageInfo_SchedulerToQuerier.Merge(m, src) +} +func (m *SchedulerToQuerier) XXX_Size() int { + return m.Size() +} +func (m *SchedulerToQuerier) XXX_DiscardUnknown() { + xxx_messageInfo_SchedulerToQuerier.DiscardUnknown(m) +} + +var xxx_messageInfo_SchedulerToQuerier proto.InternalMessageInfo + +type isSchedulerToQuerier_Request interface { + isSchedulerToQuerier_Request() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type SchedulerToQuerier_HttpRequest struct { + HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,2,opt,name=httpRequest,proto3,oneof"` +} +type SchedulerToQuerier_QueryRequest struct { + QueryRequest *queryrange.QueryRequest `protobuf:"bytes,8,opt,name=queryRequest,proto3,oneof"` +} + +func (*SchedulerToQuerier_HttpRequest) isSchedulerToQuerier_Request() {} +func (*SchedulerToQuerier_QueryRequest) isSchedulerToQuerier_Request() {} + +func (m *SchedulerToQuerier) GetRequest() isSchedulerToQuerier_Request { + if m != nil { + return m.Request + } + return nil +} + +func (m *SchedulerToQuerier) GetQueryID() uint64 { + if m != nil { + return m.QueryID + } + return 0 +} + +// Deprecated: Do not use. +func (m *SchedulerToQuerier) GetHttpRequest() *httpgrpc.HTTPRequest { + if x, ok := m.GetRequest().(*SchedulerToQuerier_HttpRequest); ok { + return x.HttpRequest + } + return nil +} + +func (m *SchedulerToQuerier) GetQueryRequest() *queryrange.QueryRequest { + if x, ok := m.GetRequest().(*SchedulerToQuerier_QueryRequest); ok { + return x.QueryRequest + } + return nil +} + +func (m *SchedulerToQuerier) GetFrontendAddress() string { + if m != nil { + return m.FrontendAddress + } + return "" +} + +func (m *SchedulerToQuerier) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SchedulerToQuerier) GetStatsEnabled() bool { + if m != nil { + return m.StatsEnabled + } + return false +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SchedulerToQuerier) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SchedulerToQuerier_HttpRequest)(nil), + (*SchedulerToQuerier_QueryRequest)(nil), + } +} + +type FrontendToScheduler struct { + Type FrontendToSchedulerType `protobuf:"varint,1,opt,name=type,proto3,enum=schedulerpb.FrontendToSchedulerType" json:"type,omitempty"` + // Used by INIT message. Will be put into all requests passed to querier. + FrontendAddress string `protobuf:"bytes,2,opt,name=frontendAddress,proto3" json:"frontendAddress,omitempty"` + // Used by ENQUEUE and CANCEL. + // Each frontend manages its own queryIDs. Different frontends may use same set of query IDs. + QueryID uint64 `protobuf:"varint,3,opt,name=queryID,proto3" json:"queryID,omitempty"` + // Following are used by ENQUEUE only. + UserID string `protobuf:"bytes,4,opt,name=userID,proto3" json:"userID,omitempty"` + // Types that are valid to be assigned to Request: + // *FrontendToScheduler_HttpRequest + // *FrontendToScheduler_QueryRequest + Request isFrontendToScheduler_Request `protobuf_oneof:"request"` + StatsEnabled bool `protobuf:"varint,6,opt,name=statsEnabled,proto3" json:"statsEnabled,omitempty"` + // Path to queue to which the request will be enqueued. + QueuePath []string `protobuf:"bytes,7,rep,name=queuePath,proto3" json:"queuePath,omitempty"` +} + +func (m *FrontendToScheduler) Reset() { *m = FrontendToScheduler{} } +func (*FrontendToScheduler) ProtoMessage() {} +func (*FrontendToScheduler) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{2} +} +func (m *FrontendToScheduler) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FrontendToScheduler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FrontendToScheduler.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FrontendToScheduler) XXX_Merge(src proto.Message) { + xxx_messageInfo_FrontendToScheduler.Merge(m, src) +} +func (m *FrontendToScheduler) XXX_Size() int { + return m.Size() +} +func (m *FrontendToScheduler) XXX_DiscardUnknown() { + xxx_messageInfo_FrontendToScheduler.DiscardUnknown(m) +} + +var xxx_messageInfo_FrontendToScheduler proto.InternalMessageInfo + +type isFrontendToScheduler_Request interface { + isFrontendToScheduler_Request() + Equal(interface{}) bool + MarshalTo([]byte) (int, error) + Size() int +} + +type FrontendToScheduler_HttpRequest struct { + HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,5,opt,name=httpRequest,proto3,oneof"` +} +type FrontendToScheduler_QueryRequest struct { + QueryRequest *queryrange.QueryRequest `protobuf:"bytes,8,opt,name=queryRequest,proto3,oneof"` +} + +func (*FrontendToScheduler_HttpRequest) isFrontendToScheduler_Request() {} +func (*FrontendToScheduler_QueryRequest) isFrontendToScheduler_Request() {} + +func (m *FrontendToScheduler) GetRequest() isFrontendToScheduler_Request { + if m != nil { + return m.Request + } + return nil +} + +func (m *FrontendToScheduler) GetType() FrontendToSchedulerType { + if m != nil { + return m.Type + } + return INIT +} + +func (m *FrontendToScheduler) GetFrontendAddress() string { + if m != nil { + return m.FrontendAddress + } + return "" +} + +func (m *FrontendToScheduler) GetQueryID() uint64 { + if m != nil { + return m.QueryID + } + return 0 +} + +func (m *FrontendToScheduler) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +// Deprecated: Do not use. +func (m *FrontendToScheduler) GetHttpRequest() *httpgrpc.HTTPRequest { + if x, ok := m.GetRequest().(*FrontendToScheduler_HttpRequest); ok { + return x.HttpRequest + } + return nil +} + +func (m *FrontendToScheduler) GetQueryRequest() *queryrange.QueryRequest { + if x, ok := m.GetRequest().(*FrontendToScheduler_QueryRequest); ok { + return x.QueryRequest + } + return nil +} + +func (m *FrontendToScheduler) GetStatsEnabled() bool { + if m != nil { + return m.StatsEnabled + } + return false +} + +func (m *FrontendToScheduler) GetQueuePath() []string { + if m != nil { + return m.QueuePath + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*FrontendToScheduler) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*FrontendToScheduler_HttpRequest)(nil), + (*FrontendToScheduler_QueryRequest)(nil), + } +} + +type SchedulerToFrontend struct { + Status SchedulerToFrontendStatus `protobuf:"varint,1,opt,name=status,proto3,enum=schedulerpb.SchedulerToFrontendStatus" json:"status,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` +} + +func (m *SchedulerToFrontend) Reset() { *m = SchedulerToFrontend{} } +func (*SchedulerToFrontend) ProtoMessage() {} +func (*SchedulerToFrontend) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{3} +} +func (m *SchedulerToFrontend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SchedulerToFrontend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SchedulerToFrontend.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SchedulerToFrontend) XXX_Merge(src proto.Message) { + xxx_messageInfo_SchedulerToFrontend.Merge(m, src) +} +func (m *SchedulerToFrontend) XXX_Size() int { + return m.Size() +} +func (m *SchedulerToFrontend) XXX_DiscardUnknown() { + xxx_messageInfo_SchedulerToFrontend.DiscardUnknown(m) +} + +var xxx_messageInfo_SchedulerToFrontend proto.InternalMessageInfo + +func (m *SchedulerToFrontend) GetStatus() SchedulerToFrontendStatus { + if m != nil { + return m.Status + } + return OK +} + +func (m *SchedulerToFrontend) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +type NotifyQuerierShutdownRequest struct { + QuerierID string `protobuf:"bytes,1,opt,name=querierID,proto3" json:"querierID,omitempty"` +} + +func (m *NotifyQuerierShutdownRequest) Reset() { *m = NotifyQuerierShutdownRequest{} } +func (*NotifyQuerierShutdownRequest) ProtoMessage() {} +func (*NotifyQuerierShutdownRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{4} +} +func (m *NotifyQuerierShutdownRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotifyQuerierShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotifyQuerierShutdownRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NotifyQuerierShutdownRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotifyQuerierShutdownRequest.Merge(m, src) +} +func (m *NotifyQuerierShutdownRequest) XXX_Size() int { + return m.Size() +} +func (m *NotifyQuerierShutdownRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NotifyQuerierShutdownRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NotifyQuerierShutdownRequest proto.InternalMessageInfo + +func (m *NotifyQuerierShutdownRequest) GetQuerierID() string { + if m != nil { + return m.QuerierID + } + return "" +} + +type NotifyQuerierShutdownResponse struct { +} + +func (m *NotifyQuerierShutdownResponse) Reset() { *m = NotifyQuerierShutdownResponse{} } +func (*NotifyQuerierShutdownResponse) ProtoMessage() {} +func (*NotifyQuerierShutdownResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3657184e8d38989, []int{5} +} +func (m *NotifyQuerierShutdownResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotifyQuerierShutdownResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NotifyQuerierShutdownResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NotifyQuerierShutdownResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotifyQuerierShutdownResponse.Merge(m, src) +} +func (m *NotifyQuerierShutdownResponse) XXX_Size() int { + return m.Size() +} +func (m *NotifyQuerierShutdownResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NotifyQuerierShutdownResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NotifyQuerierShutdownResponse proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("schedulerpb.FrontendToSchedulerType", FrontendToSchedulerType_name, FrontendToSchedulerType_value) + proto.RegisterEnum("schedulerpb.SchedulerToFrontendStatus", SchedulerToFrontendStatus_name, SchedulerToFrontendStatus_value) + proto.RegisterType((*QuerierToScheduler)(nil), "schedulerpb.QuerierToScheduler") + proto.RegisterType((*SchedulerToQuerier)(nil), "schedulerpb.SchedulerToQuerier") + proto.RegisterType((*FrontendToScheduler)(nil), "schedulerpb.FrontendToScheduler") + proto.RegisterType((*SchedulerToFrontend)(nil), "schedulerpb.SchedulerToFrontend") + proto.RegisterType((*NotifyQuerierShutdownRequest)(nil), "schedulerpb.NotifyQuerierShutdownRequest") + proto.RegisterType((*NotifyQuerierShutdownResponse)(nil), "schedulerpb.NotifyQuerierShutdownResponse") +} + +func init() { + proto.RegisterFile("pkg/scheduler/schedulerpb/scheduler.proto", fileDescriptor_c3657184e8d38989) +} + +var fileDescriptor_c3657184e8d38989 = []byte{ + // 714 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x3d, 0x53, 0xdb, 0x4a, + 0x14, 0xd5, 0xca, 0x5f, 0xf8, 0x9a, 0xf7, 0x9e, 0xdf, 0x02, 0xef, 0x29, 0x1e, 0x22, 0x3c, 0x9e, + 0x4c, 0x62, 0x28, 0x6c, 0xc6, 0x69, 0x52, 0x10, 0x66, 0x0c, 0x88, 0xd8, 0x13, 0x22, 0x63, 0x59, + 0x9e, 0x7c, 0x34, 0x1e, 0x7f, 0x2c, 0xb6, 0x07, 0xa2, 0x15, 0x2b, 0x69, 0x32, 0xee, 0xf2, 0x13, + 0xf2, 0x0b, 0x52, 0xe7, 0xa7, 0xa4, 0xa4, 0xa4, 0x48, 0x11, 0x44, 0x93, 0x92, 0x2e, 0x6d, 0xc6, + 0xd2, 0xca, 0xc8, 0x60, 0x43, 0xaa, 0x54, 0xbe, 0x7b, 0xf7, 0x9c, 0xab, 0x3d, 0xe7, 0xde, 0x5d, + 0xc3, 0xba, 0x79, 0xdc, 0x2f, 0x5a, 0xdd, 0x01, 0xe9, 0x39, 0x27, 0x84, 0x5d, 0x47, 0x66, 0xe7, + 0x3a, 0x2e, 0x98, 0x8c, 0xda, 0x14, 0xa7, 0x42, 0x9b, 0x99, 0xcd, 0xfe, 0xd0, 0x1e, 0x38, 0x9d, + 0x42, 0x97, 0xbe, 0x2f, 0xf6, 0x59, 0xfb, 0xa8, 0x6d, 0xb4, 0x8b, 0x3d, 0xeb, 0x78, 0x68, 0x17, + 0x07, 0xb6, 0x6d, 0xf6, 0x99, 0xd9, 0x9d, 0x04, 0x3e, 0x3d, 0xb3, 0xdc, 0xa7, 0x7d, 0xea, 0x85, + 0xc5, 0x71, 0xc4, 0xb3, 0x4f, 0xc6, 0xdf, 0x3f, 0x75, 0x08, 0x1b, 0x12, 0xe6, 0xfd, 0x8e, 0x58, + 0xdb, 0xe8, 0x93, 0x50, 0xe8, 0x03, 0x73, 0x25, 0xc0, 0x75, 0x1f, 0xa6, 0xd3, 0x46, 0x70, 0x10, + 0xbc, 0x0a, 0x49, 0x4e, 0xae, 0xee, 0x49, 0x28, 0x8b, 0xf2, 0x49, 0xed, 0x3a, 0x91, 0xfb, 0x2c, + 0x02, 0x9e, 0x60, 0x75, 0xca, 0xf9, 0x58, 0x82, 0x84, 0x57, 0x9e, 0x53, 0xa2, 0x5a, 0xb0, 0xc4, + 0xcf, 0x21, 0x35, 0x3e, 0xb5, 0x46, 0x4e, 0x1d, 0x62, 0xd9, 0x92, 0x98, 0x45, 0xf9, 0x54, 0x69, + 0xa5, 0x30, 0x51, 0x52, 0xd1, 0xf5, 0x43, 0xbe, 0xb9, 0x23, 0x4a, 0xa8, 0x22, 0x68, 0x61, 0x3c, + 0xde, 0x86, 0x45, 0xaf, 0x52, 0xc0, 0x5f, 0xf0, 0xf8, 0x52, 0x21, 0x24, 0xa6, 0x1e, 0xda, 0xaf, + 0x08, 0xda, 0x14, 0x1e, 0xe7, 0xe1, 0x9f, 0x23, 0x46, 0x0d, 0x9b, 0x18, 0xbd, 0x72, 0xaf, 0xc7, + 0x88, 0x65, 0x49, 0x11, 0x4f, 0xd3, 0xcd, 0x34, 0xfe, 0x0f, 0xe2, 0x8e, 0xe5, 0x89, 0x8e, 0x7a, + 0x00, 0xbe, 0xc2, 0x39, 0x58, 0xb4, 0xec, 0xb6, 0x6d, 0x29, 0x46, 0xbb, 0x73, 0x42, 0x7a, 0x52, + 0x2c, 0x8b, 0xf2, 0x0b, 0xda, 0x54, 0x6e, 0x27, 0x09, 0x09, 0xe6, 0x7f, 0x30, 0xf7, 0x53, 0x84, + 0xa5, 0x7d, 0x5e, 0x3a, 0x6c, 0xeb, 0x33, 0x88, 0xda, 0x23, 0x93, 0x78, 0xf6, 0xfc, 0x5d, 0x7a, + 0x54, 0x08, 0x75, 0xbe, 0x30, 0x03, 0xaf, 0x8f, 0x4c, 0xa2, 0x79, 0x8c, 0x59, 0x12, 0xc4, 0xd9, + 0x12, 0x42, 0x5d, 0x88, 0x4c, 0x77, 0x61, 0x9e, 0xb8, 0x1b, 0xdd, 0x89, 0xfd, 0xe1, 0xee, 0xdc, + 0xf4, 0x36, 0x7e, 0xdb, 0x5b, 0x3e, 0x8f, 0x0e, 0x39, 0x6c, 0xdb, 0x03, 0x29, 0x91, 0x8d, 0xf0, + 0x79, 0xf4, 0x13, 0x61, 0xe7, 0x8f, 0x61, 0x29, 0x34, 0x99, 0x81, 0xa7, 0x78, 0x1b, 0xe2, 0xe3, + 0x7a, 0x8e, 0xc5, 0xad, 0x7f, 0x3c, 0x65, 0xfd, 0x0c, 0x46, 0xc3, 0x43, 0x6b, 0x9c, 0x85, 0x97, + 0x21, 0x46, 0x18, 0xa3, 0x8c, 0x9b, 0xee, 0x2f, 0x72, 0x5b, 0xb0, 0xaa, 0x52, 0x7b, 0x78, 0x34, + 0xe2, 0x37, 0xa0, 0x31, 0x70, 0xec, 0x1e, 0xfd, 0x60, 0x04, 0xca, 0xee, 0xbe, 0x45, 0x6b, 0xf0, + 0x70, 0x0e, 0xdb, 0x32, 0xa9, 0x61, 0x91, 0x8d, 0x2d, 0xf8, 0x7f, 0xce, 0x50, 0xe0, 0x05, 0x88, + 0x56, 0xd5, 0xaa, 0x9e, 0x16, 0x70, 0x0a, 0x12, 0x8a, 0x5a, 0x6f, 0x2a, 0x4d, 0x25, 0x8d, 0x30, + 0x40, 0x7c, 0xb7, 0xac, 0xee, 0x2a, 0x07, 0x69, 0x71, 0xa3, 0x0b, 0x0f, 0xe6, 0xea, 0xc2, 0x71, + 0x10, 0x6b, 0x2f, 0xd3, 0x02, 0xce, 0xc2, 0xaa, 0x5e, 0xab, 0xb5, 0x5e, 0x95, 0xd5, 0xb7, 0x2d, + 0x4d, 0xa9, 0x37, 0x95, 0x86, 0xde, 0x68, 0x1d, 0x2a, 0x5a, 0x4b, 0x57, 0xd4, 0xb2, 0xaa, 0xa7, + 0x11, 0x4e, 0x42, 0x4c, 0xd1, 0xb4, 0x9a, 0x96, 0x16, 0xf1, 0xbf, 0xf0, 0x57, 0xa3, 0xd2, 0xd4, + 0xf5, 0xaa, 0xfa, 0xa2, 0xb5, 0x57, 0x7b, 0xad, 0xa6, 0x23, 0xa5, 0x6f, 0x28, 0xe4, 0xf7, 0x3e, + 0x65, 0xc1, 0x53, 0xd0, 0x84, 0x14, 0x0f, 0x0f, 0x28, 0x35, 0xf1, 0xda, 0x94, 0xdd, 0xb7, 0xdf, + 0x9b, 0xcc, 0xda, 0xbc, 0x7e, 0x70, 0x6c, 0x4e, 0xc8, 0xa3, 0x4d, 0x84, 0x0d, 0x58, 0x99, 0x69, + 0x19, 0x5e, 0x9f, 0xe2, 0xdf, 0xd5, 0x94, 0xcc, 0xc6, 0xef, 0x40, 0xfd, 0x0e, 0x94, 0x4c, 0x58, + 0x0e, 0xab, 0x9b, 0x8c, 0xd3, 0x1b, 0x58, 0x0c, 0x62, 0x4f, 0x5f, 0xf6, 0xbe, 0x9b, 0x9c, 0xc9, + 0xde, 0x37, 0x70, 0xbe, 0xc2, 0x9d, 0xf2, 0xd9, 0x85, 0x2c, 0x9c, 0x5f, 0xc8, 0xc2, 0xd5, 0x85, + 0x8c, 0x3e, 0xba, 0x32, 0xfa, 0xe2, 0xca, 0xe8, 0xab, 0x2b, 0xa3, 0x33, 0x57, 0x46, 0xdf, 0x5d, + 0x19, 0xfd, 0x70, 0x65, 0xe1, 0xca, 0x95, 0xd1, 0xa7, 0x4b, 0x59, 0x38, 0xbb, 0x94, 0x85, 0xf3, + 0x4b, 0x59, 0x78, 0x17, 0xfe, 0x0b, 0xe9, 0xc4, 0xbd, 0x87, 0xfd, 0xe9, 0xaf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x0a, 0x15, 0x06, 0xe2, 0x83, 0x06, 0x00, 0x00, +} + +func (x FrontendToSchedulerType) String() string { + s, ok := FrontendToSchedulerType_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} +func (x SchedulerToFrontendStatus) String() string { + s, ok := SchedulerToFrontendStatus_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} +func (this *QuerierToScheduler) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QuerierToScheduler) + if !ok { + that2, ok := that.(QuerierToScheduler) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.QuerierID != that1.QuerierID { + return false + } + return true +} +func (this *SchedulerToQuerier) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SchedulerToQuerier) + if !ok { + that2, ok := that.(SchedulerToQuerier) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.QueryID != that1.QueryID { + return false + } + if that1.Request == nil { + if this.Request != nil { + return false + } + } else if this.Request == nil { + return false + } else if !this.Request.Equal(that1.Request) { + return false + } + if this.FrontendAddress != that1.FrontendAddress { + return false + } + if this.UserID != that1.UserID { + return false + } + if this.StatsEnabled != that1.StatsEnabled { + return false + } + return true +} +func (this *SchedulerToQuerier_HttpRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SchedulerToQuerier_HttpRequest) + if !ok { + that2, ok := that.(SchedulerToQuerier_HttpRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.HttpRequest.Equal(that1.HttpRequest) { + return false + } + return true +} +func (this *SchedulerToQuerier_QueryRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SchedulerToQuerier_QueryRequest) + if !ok { + that2, ok := that.(SchedulerToQuerier_QueryRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.QueryRequest.Equal(that1.QueryRequest) { + return false + } + return true +} +func (this *FrontendToScheduler) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FrontendToScheduler) + if !ok { + that2, ok := that.(FrontendToScheduler) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Type != that1.Type { + return false + } + if this.FrontendAddress != that1.FrontendAddress { + return false + } + if this.QueryID != that1.QueryID { + return false + } + if this.UserID != that1.UserID { + return false + } + if that1.Request == nil { + if this.Request != nil { + return false + } + } else if this.Request == nil { + return false + } else if !this.Request.Equal(that1.Request) { + return false + } + if this.StatsEnabled != that1.StatsEnabled { + return false + } + if len(this.QueuePath) != len(that1.QueuePath) { + return false + } + for i := range this.QueuePath { + if this.QueuePath[i] != that1.QueuePath[i] { + return false + } + } + return true +} +func (this *FrontendToScheduler_HttpRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FrontendToScheduler_HttpRequest) + if !ok { + that2, ok := that.(FrontendToScheduler_HttpRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.HttpRequest.Equal(that1.HttpRequest) { + return false + } + return true +} +func (this *FrontendToScheduler_QueryRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FrontendToScheduler_QueryRequest) + if !ok { + that2, ok := that.(FrontendToScheduler_QueryRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.QueryRequest.Equal(that1.QueryRequest) { + return false + } + return true +} +func (this *SchedulerToFrontend) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SchedulerToFrontend) + if !ok { + that2, ok := that.(SchedulerToFrontend) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Status != that1.Status { + return false + } + if this.Error != that1.Error { + return false + } + return true +} +func (this *NotifyQuerierShutdownRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*NotifyQuerierShutdownRequest) + if !ok { + that2, ok := that.(NotifyQuerierShutdownRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.QuerierID != that1.QuerierID { + return false + } + return true +} +func (this *NotifyQuerierShutdownResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*NotifyQuerierShutdownResponse) + if !ok { + that2, ok := that.(NotifyQuerierShutdownResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *QuerierToScheduler) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&schedulerpb.QuerierToScheduler{") + s = append(s, "QuerierID: "+fmt.Sprintf("%#v", this.QuerierID)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *SchedulerToQuerier) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 10) + s = append(s, "&schedulerpb.SchedulerToQuerier{") + s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") + if this.Request != nil { + s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") + } + s = append(s, "FrontendAddress: "+fmt.Sprintf("%#v", this.FrontendAddress)+",\n") + s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") + s = append(s, "StatsEnabled: "+fmt.Sprintf("%#v", this.StatsEnabled)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *SchedulerToQuerier_HttpRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&schedulerpb.SchedulerToQuerier_HttpRequest{` + + `HttpRequest:` + fmt.Sprintf("%#v", this.HttpRequest) + `}`}, ", ") + return s +} +func (this *SchedulerToQuerier_QueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&schedulerpb.SchedulerToQuerier_QueryRequest{` + + `QueryRequest:` + fmt.Sprintf("%#v", this.QueryRequest) + `}`}, ", ") + return s +} +func (this *FrontendToScheduler) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 12) + s = append(s, "&schedulerpb.FrontendToScheduler{") + s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") + s = append(s, "FrontendAddress: "+fmt.Sprintf("%#v", this.FrontendAddress)+",\n") + s = append(s, "QueryID: "+fmt.Sprintf("%#v", this.QueryID)+",\n") + s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") + if this.Request != nil { + s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") + } + s = append(s, "StatsEnabled: "+fmt.Sprintf("%#v", this.StatsEnabled)+",\n") + s = append(s, "QueuePath: "+fmt.Sprintf("%#v", this.QueuePath)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *FrontendToScheduler_HttpRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&schedulerpb.FrontendToScheduler_HttpRequest{` + + `HttpRequest:` + fmt.Sprintf("%#v", this.HttpRequest) + `}`}, ", ") + return s +} +func (this *FrontendToScheduler_QueryRequest) GoString() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&schedulerpb.FrontendToScheduler_QueryRequest{` + + `QueryRequest:` + fmt.Sprintf("%#v", this.QueryRequest) + `}`}, ", ") + return s +} +func (this *SchedulerToFrontend) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&schedulerpb.SchedulerToFrontend{") + s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") + s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *NotifyQuerierShutdownRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&schedulerpb.NotifyQuerierShutdownRequest{") + s = append(s, "QuerierID: "+fmt.Sprintf("%#v", this.QuerierID)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *NotifyQuerierShutdownResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&schedulerpb.NotifyQuerierShutdownResponse{") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringScheduler(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// SchedulerForQuerierClient is the client API for SchedulerForQuerier service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SchedulerForQuerierClient interface { + // After calling this method, both Querier and Scheduler enter a loop, in which querier waits for + // "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request, + // querier signals that it is ready to accept another one by sending empty QuerierToScheduler message. + // + // Long-running loop is used to detect broken connection between scheduler and querier. This is important + // for scheduler to keep a list of connected queriers up-to-date. + QuerierLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForQuerier_QuerierLoopClient, error) + // The querier notifies the query-scheduler that it started a graceful shutdown. + NotifyQuerierShutdown(ctx context.Context, in *NotifyQuerierShutdownRequest, opts ...grpc.CallOption) (*NotifyQuerierShutdownResponse, error) +} + +type schedulerForQuerierClient struct { + cc *grpc.ClientConn +} + +func NewSchedulerForQuerierClient(cc *grpc.ClientConn) SchedulerForQuerierClient { + return &schedulerForQuerierClient{cc} +} + +func (c *schedulerForQuerierClient) QuerierLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForQuerier_QuerierLoopClient, error) { + stream, err := c.cc.NewStream(ctx, &_SchedulerForQuerier_serviceDesc.Streams[0], "/schedulerpb.SchedulerForQuerier/QuerierLoop", opts...) + if err != nil { + return nil, err + } + x := &schedulerForQuerierQuerierLoopClient{stream} + return x, nil +} + +type SchedulerForQuerier_QuerierLoopClient interface { + Send(*QuerierToScheduler) error + Recv() (*SchedulerToQuerier, error) + grpc.ClientStream +} + +type schedulerForQuerierQuerierLoopClient struct { + grpc.ClientStream +} + +func (x *schedulerForQuerierQuerierLoopClient) Send(m *QuerierToScheduler) error { + return x.ClientStream.SendMsg(m) +} + +func (x *schedulerForQuerierQuerierLoopClient) Recv() (*SchedulerToQuerier, error) { + m := new(SchedulerToQuerier) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *schedulerForQuerierClient) NotifyQuerierShutdown(ctx context.Context, in *NotifyQuerierShutdownRequest, opts ...grpc.CallOption) (*NotifyQuerierShutdownResponse, error) { + out := new(NotifyQuerierShutdownResponse) + err := c.cc.Invoke(ctx, "/schedulerpb.SchedulerForQuerier/NotifyQuerierShutdown", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SchedulerForQuerierServer is the server API for SchedulerForQuerier service. +type SchedulerForQuerierServer interface { + // After calling this method, both Querier and Scheduler enter a loop, in which querier waits for + // "SchedulerToQuerier" messages containing HTTP requests and processes them. After processing the request, + // querier signals that it is ready to accept another one by sending empty QuerierToScheduler message. + // + // Long-running loop is used to detect broken connection between scheduler and querier. This is important + // for scheduler to keep a list of connected queriers up-to-date. + QuerierLoop(SchedulerForQuerier_QuerierLoopServer) error + // The querier notifies the query-scheduler that it started a graceful shutdown. + NotifyQuerierShutdown(context.Context, *NotifyQuerierShutdownRequest) (*NotifyQuerierShutdownResponse, error) +} + +// UnimplementedSchedulerForQuerierServer can be embedded to have forward compatible implementations. +type UnimplementedSchedulerForQuerierServer struct { +} + +func (*UnimplementedSchedulerForQuerierServer) QuerierLoop(srv SchedulerForQuerier_QuerierLoopServer) error { + return status.Errorf(codes.Unimplemented, "method QuerierLoop not implemented") +} +func (*UnimplementedSchedulerForQuerierServer) NotifyQuerierShutdown(ctx context.Context, req *NotifyQuerierShutdownRequest) (*NotifyQuerierShutdownResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NotifyQuerierShutdown not implemented") +} + +func RegisterSchedulerForQuerierServer(s *grpc.Server, srv SchedulerForQuerierServer) { + s.RegisterService(&_SchedulerForQuerier_serviceDesc, srv) +} + +func _SchedulerForQuerier_QuerierLoop_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SchedulerForQuerierServer).QuerierLoop(&schedulerForQuerierQuerierLoopServer{stream}) +} + +type SchedulerForQuerier_QuerierLoopServer interface { + Send(*SchedulerToQuerier) error + Recv() (*QuerierToScheduler, error) + grpc.ServerStream +} + +type schedulerForQuerierQuerierLoopServer struct { + grpc.ServerStream +} + +func (x *schedulerForQuerierQuerierLoopServer) Send(m *SchedulerToQuerier) error { + return x.ServerStream.SendMsg(m) +} + +func (x *schedulerForQuerierQuerierLoopServer) Recv() (*QuerierToScheduler, error) { + m := new(QuerierToScheduler) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _SchedulerForQuerier_NotifyQuerierShutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NotifyQuerierShutdownRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SchedulerForQuerierServer).NotifyQuerierShutdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/schedulerpb.SchedulerForQuerier/NotifyQuerierShutdown", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SchedulerForQuerierServer).NotifyQuerierShutdown(ctx, req.(*NotifyQuerierShutdownRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _SchedulerForQuerier_serviceDesc = grpc.ServiceDesc{ + ServiceName: "schedulerpb.SchedulerForQuerier", + HandlerType: (*SchedulerForQuerierServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NotifyQuerierShutdown", + Handler: _SchedulerForQuerier_NotifyQuerierShutdown_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "QuerierLoop", + Handler: _SchedulerForQuerier_QuerierLoop_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "pkg/scheduler/schedulerpb/scheduler.proto", +} + +// SchedulerForFrontendClient is the client API for SchedulerForFrontend service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SchedulerForFrontendClient interface { + // After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and + // CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request. + // + // Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both + // parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending + // requests sent to this scheduler, while scheduler can cancel queued requests from given frontend. + FrontendLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForFrontend_FrontendLoopClient, error) +} + +type schedulerForFrontendClient struct { + cc *grpc.ClientConn +} + +func NewSchedulerForFrontendClient(cc *grpc.ClientConn) SchedulerForFrontendClient { + return &schedulerForFrontendClient{cc} +} + +func (c *schedulerForFrontendClient) FrontendLoop(ctx context.Context, opts ...grpc.CallOption) (SchedulerForFrontend_FrontendLoopClient, error) { + stream, err := c.cc.NewStream(ctx, &_SchedulerForFrontend_serviceDesc.Streams[0], "/schedulerpb.SchedulerForFrontend/FrontendLoop", opts...) + if err != nil { + return nil, err + } + x := &schedulerForFrontendFrontendLoopClient{stream} + return x, nil +} + +type SchedulerForFrontend_FrontendLoopClient interface { + Send(*FrontendToScheduler) error + Recv() (*SchedulerToFrontend, error) + grpc.ClientStream +} + +type schedulerForFrontendFrontendLoopClient struct { + grpc.ClientStream +} + +func (x *schedulerForFrontendFrontendLoopClient) Send(m *FrontendToScheduler) error { + return x.ClientStream.SendMsg(m) +} + +func (x *schedulerForFrontendFrontendLoopClient) Recv() (*SchedulerToFrontend, error) { + m := new(SchedulerToFrontend) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// SchedulerForFrontendServer is the server API for SchedulerForFrontend service. +type SchedulerForFrontendServer interface { + // After calling this method, both Frontend and Scheduler enter a loop. Frontend will keep sending ENQUEUE and + // CANCEL requests, and scheduler is expected to process them. Scheduler returns one response for each request. + // + // Long-running loop is used to detect broken connection between frontend and scheduler. This is important for both + // parties... if connection breaks, frontend can cancel (and possibly retry on different scheduler) all pending + // requests sent to this scheduler, while scheduler can cancel queued requests from given frontend. + FrontendLoop(SchedulerForFrontend_FrontendLoopServer) error +} + +// UnimplementedSchedulerForFrontendServer can be embedded to have forward compatible implementations. +type UnimplementedSchedulerForFrontendServer struct { +} + +func (*UnimplementedSchedulerForFrontendServer) FrontendLoop(srv SchedulerForFrontend_FrontendLoopServer) error { + return status.Errorf(codes.Unimplemented, "method FrontendLoop not implemented") +} + +func RegisterSchedulerForFrontendServer(s *grpc.Server, srv SchedulerForFrontendServer) { + s.RegisterService(&_SchedulerForFrontend_serviceDesc, srv) +} + +func _SchedulerForFrontend_FrontendLoop_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(SchedulerForFrontendServer).FrontendLoop(&schedulerForFrontendFrontendLoopServer{stream}) +} + +type SchedulerForFrontend_FrontendLoopServer interface { + Send(*SchedulerToFrontend) error + Recv() (*FrontendToScheduler, error) + grpc.ServerStream +} + +type schedulerForFrontendFrontendLoopServer struct { + grpc.ServerStream +} + +func (x *schedulerForFrontendFrontendLoopServer) Send(m *SchedulerToFrontend) error { + return x.ServerStream.SendMsg(m) +} + +func (x *schedulerForFrontendFrontendLoopServer) Recv() (*FrontendToScheduler, error) { + m := new(FrontendToScheduler) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _SchedulerForFrontend_serviceDesc = grpc.ServiceDesc{ + ServiceName: "schedulerpb.SchedulerForFrontend", + HandlerType: (*SchedulerForFrontendServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "FrontendLoop", + Handler: _SchedulerForFrontend_FrontendLoop_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "pkg/scheduler/schedulerpb/scheduler.proto", +} + +func (m *QuerierToScheduler) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerierToScheduler) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerierToScheduler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QuerierID) > 0 { + i -= len(m.QuerierID) + copy(dAtA[i:], m.QuerierID) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.QuerierID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SchedulerToQuerier) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SchedulerToQuerier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SchedulerToQuerier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Request != nil { + { + size := m.Request.Size() + i -= size + if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.StatsEnabled { + i-- + if m.StatsEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.UserID) > 0 { + i -= len(m.UserID) + copy(dAtA[i:], m.UserID) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.UserID))) + i-- + dAtA[i] = 0x22 + } + if len(m.FrontendAddress) > 0 { + i -= len(m.FrontendAddress) + copy(dAtA[i:], m.FrontendAddress) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.FrontendAddress))) + i-- + dAtA[i] = 0x1a + } + if m.QueryID != 0 { + i = encodeVarintScheduler(dAtA, i, uint64(m.QueryID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SchedulerToQuerier_HttpRequest) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *SchedulerToQuerier_HttpRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.HttpRequest != nil { + { + size, err := m.HttpRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintScheduler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SchedulerToQuerier_QueryRequest) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *SchedulerToQuerier_QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.QueryRequest != nil { + { + size, err := m.QueryRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintScheduler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil +} +func (m *FrontendToScheduler) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FrontendToScheduler) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FrontendToScheduler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Request != nil { + { + size := m.Request.Size() + i -= size + if _, err := m.Request.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.QueuePath) > 0 { + for iNdEx := len(m.QueuePath) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.QueuePath[iNdEx]) + copy(dAtA[i:], m.QueuePath[iNdEx]) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.QueuePath[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.StatsEnabled { + i-- + if m.StatsEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.UserID) > 0 { + i -= len(m.UserID) + copy(dAtA[i:], m.UserID) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.UserID))) + i-- + dAtA[i] = 0x22 + } + if m.QueryID != 0 { + i = encodeVarintScheduler(dAtA, i, uint64(m.QueryID)) + i-- + dAtA[i] = 0x18 + } + if len(m.FrontendAddress) > 0 { + i -= len(m.FrontendAddress) + copy(dAtA[i:], m.FrontendAddress) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.FrontendAddress))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintScheduler(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FrontendToScheduler_HttpRequest) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *FrontendToScheduler_HttpRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.HttpRequest != nil { + { + size, err := m.HttpRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintScheduler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *FrontendToScheduler_QueryRequest) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *FrontendToScheduler_QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.QueryRequest != nil { + { + size, err := m.QueryRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintScheduler(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil +} +func (m *SchedulerToFrontend) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SchedulerToFrontend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SchedulerToFrontend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = encodeVarintScheduler(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *NotifyQuerierShutdownRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NotifyQuerierShutdownRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotifyQuerierShutdownRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QuerierID) > 0 { + i -= len(m.QuerierID) + copy(dAtA[i:], m.QuerierID) + i = encodeVarintScheduler(dAtA, i, uint64(len(m.QuerierID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NotifyQuerierShutdownResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NotifyQuerierShutdownResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotifyQuerierShutdownResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintScheduler(dAtA []byte, offset int, v uint64) int { + offset -= sovScheduler(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QuerierToScheduler) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.QuerierID) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} + +func (m *SchedulerToQuerier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryID != 0 { + n += 1 + sovScheduler(uint64(m.QueryID)) + } + if m.Request != nil { + n += m.Request.Size() + } + l = len(m.FrontendAddress) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + l = len(m.UserID) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + if m.StatsEnabled { + n += 2 + } + return n +} + +func (m *SchedulerToQuerier_HttpRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpRequest != nil { + l = m.HttpRequest.Size() + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} +func (m *SchedulerToQuerier_QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryRequest != nil { + l = m.QueryRequest.Size() + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} +func (m *FrontendToScheduler) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovScheduler(uint64(m.Type)) + } + l = len(m.FrontendAddress) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + if m.QueryID != 0 { + n += 1 + sovScheduler(uint64(m.QueryID)) + } + l = len(m.UserID) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + if m.Request != nil { + n += m.Request.Size() + } + if m.StatsEnabled { + n += 2 + } + if len(m.QueuePath) > 0 { + for _, s := range m.QueuePath { + l = len(s) + n += 1 + l + sovScheduler(uint64(l)) + } + } + return n +} + +func (m *FrontendToScheduler_HttpRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpRequest != nil { + l = m.HttpRequest.Size() + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} +func (m *FrontendToScheduler_QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryRequest != nil { + l = m.QueryRequest.Size() + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} +func (m *SchedulerToFrontend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovScheduler(uint64(m.Status)) + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} + +func (m *NotifyQuerierShutdownRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.QuerierID) + if l > 0 { + n += 1 + l + sovScheduler(uint64(l)) + } + return n +} + +func (m *NotifyQuerierShutdownResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovScheduler(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozScheduler(x uint64) (n int) { + return sovScheduler(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *QuerierToScheduler) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QuerierToScheduler{`, + `QuerierID:` + fmt.Sprintf("%v", this.QuerierID) + `,`, + `}`, + }, "") + return s +} +func (this *SchedulerToQuerier) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchedulerToQuerier{`, + `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, + `Request:` + fmt.Sprintf("%v", this.Request) + `,`, + `FrontendAddress:` + fmt.Sprintf("%v", this.FrontendAddress) + `,`, + `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, + `StatsEnabled:` + fmt.Sprintf("%v", this.StatsEnabled) + `,`, + `}`, + }, "") + return s +} +func (this *SchedulerToQuerier_HttpRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchedulerToQuerier_HttpRequest{`, + `HttpRequest:` + strings.Replace(fmt.Sprintf("%v", this.HttpRequest), "HTTPRequest", "httpgrpc.HTTPRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SchedulerToQuerier_QueryRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchedulerToQuerier_QueryRequest{`, + `QueryRequest:` + strings.Replace(fmt.Sprintf("%v", this.QueryRequest), "QueryRequest", "queryrange.QueryRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FrontendToScheduler) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FrontendToScheduler{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `FrontendAddress:` + fmt.Sprintf("%v", this.FrontendAddress) + `,`, + `QueryID:` + fmt.Sprintf("%v", this.QueryID) + `,`, + `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, + `Request:` + fmt.Sprintf("%v", this.Request) + `,`, + `StatsEnabled:` + fmt.Sprintf("%v", this.StatsEnabled) + `,`, + `QueuePath:` + fmt.Sprintf("%v", this.QueuePath) + `,`, + `}`, + }, "") + return s +} +func (this *FrontendToScheduler_HttpRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FrontendToScheduler_HttpRequest{`, + `HttpRequest:` + strings.Replace(fmt.Sprintf("%v", this.HttpRequest), "HTTPRequest", "httpgrpc.HTTPRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *FrontendToScheduler_QueryRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FrontendToScheduler_QueryRequest{`, + `QueryRequest:` + strings.Replace(fmt.Sprintf("%v", this.QueryRequest), "QueryRequest", "queryrange.QueryRequest", 1) + `,`, + `}`, + }, "") + return s +} +func (this *SchedulerToFrontend) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SchedulerToFrontend{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Error:` + fmt.Sprintf("%v", this.Error) + `,`, + `}`, + }, "") + return s +} +func (this *NotifyQuerierShutdownRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NotifyQuerierShutdownRequest{`, + `QuerierID:` + fmt.Sprintf("%v", this.QuerierID) + `,`, + `}`, + }, "") + return s +} +func (this *NotifyQuerierShutdownResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NotifyQuerierShutdownResponse{`, + `}`, + }, "") + return s +} +func valueToStringScheduler(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *QuerierToScheduler) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerierToScheduler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerierToScheduler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuerierID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuerierID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SchedulerToQuerier) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchedulerToQuerier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchedulerToQuerier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) + } + m.QueryID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &httpgrpc.HTTPRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &SchedulerToQuerier_HttpRequest{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontendAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FrontendAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StatsEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StatsEnabled = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &queryrange.QueryRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &SchedulerToQuerier_QueryRequest{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FrontendToScheduler) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FrontendToScheduler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FrontendToScheduler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= FrontendToSchedulerType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontendAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FrontendAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) + } + m.QueryID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &httpgrpc.HTTPRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &FrontendToScheduler_HttpRequest{v} + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StatsEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StatsEnabled = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueuePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueuePath = append(m.QueuePath, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &queryrange.QueryRequest{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Request = &FrontendToScheduler_QueryRequest{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SchedulerToFrontend) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SchedulerToFrontend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SchedulerToFrontend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= SchedulerToFrontendStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotifyQuerierShutdownRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NotifyQuerierShutdownRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotifyQuerierShutdownRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuerierID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthScheduler + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthScheduler + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QuerierID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotifyQuerierShutdownResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowScheduler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NotifyQuerierShutdownResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotifyQuerierShutdownResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipScheduler(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthScheduler + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipScheduler(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowScheduler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowScheduler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowScheduler + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthScheduler + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthScheduler + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowScheduler + } + 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 := skipScheduler(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthScheduler + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthScheduler = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowScheduler = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/storage/chunk/client/grpc/grpc.pb.go b/pkg/storage/chunk/client/grpc/grpc.pb.go new file mode 100644 index 0000000000000..d76002adfc384 --- /dev/null +++ b/pkg/storage/chunk/client/grpc/grpc.pb.go @@ -0,0 +1,6484 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/storage/chunk/client/grpc/grpc.proto + +package grpc + +import ( + bytes "bytes" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + empty "github.com/golang/protobuf/ptypes/empty" + 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" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PutChunksRequest struct { + Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` +} + +func (m *PutChunksRequest) Reset() { *m = PutChunksRequest{} } +func (*PutChunksRequest) ProtoMessage() {} +func (*PutChunksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{0} +} +func (m *PutChunksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PutChunksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PutChunksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PutChunksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PutChunksRequest.Merge(m, src) +} +func (m *PutChunksRequest) XXX_Size() int { + return m.Size() +} +func (m *PutChunksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PutChunksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PutChunksRequest proto.InternalMessageInfo + +func (m *PutChunksRequest) GetChunks() []*Chunk { + if m != nil { + return m.Chunks + } + return nil +} + +type GetChunksRequest struct { + Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` +} + +func (m *GetChunksRequest) Reset() { *m = GetChunksRequest{} } +func (*GetChunksRequest) ProtoMessage() {} +func (*GetChunksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{1} +} +func (m *GetChunksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetChunksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetChunksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetChunksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetChunksRequest.Merge(m, src) +} +func (m *GetChunksRequest) XXX_Size() int { + return m.Size() +} +func (m *GetChunksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetChunksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetChunksRequest proto.InternalMessageInfo + +func (m *GetChunksRequest) GetChunks() []*Chunk { + if m != nil { + return m.Chunks + } + return nil +} + +type GetChunksResponse struct { + Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` +} + +func (m *GetChunksResponse) Reset() { *m = GetChunksResponse{} } +func (*GetChunksResponse) ProtoMessage() {} +func (*GetChunksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{2} +} +func (m *GetChunksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetChunksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetChunksResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetChunksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetChunksResponse.Merge(m, src) +} +func (m *GetChunksResponse) XXX_Size() int { + return m.Size() +} +func (m *GetChunksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetChunksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetChunksResponse proto.InternalMessageInfo + +func (m *GetChunksResponse) GetChunks() []*Chunk { + if m != nil { + return m.Chunks + } + return nil +} + +type Chunk struct { + Encoded []byte `protobuf:"bytes,1,opt,name=encoded,proto3" json:"encoded,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=tableName,proto3" json:"tableName,omitempty"` +} + +func (m *Chunk) Reset() { *m = Chunk{} } +func (*Chunk) ProtoMessage() {} +func (*Chunk) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{3} +} +func (m *Chunk) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Chunk) XXX_Merge(src proto.Message) { + xxx_messageInfo_Chunk.Merge(m, src) +} +func (m *Chunk) XXX_Size() int { + return m.Size() +} +func (m *Chunk) XXX_DiscardUnknown() { + xxx_messageInfo_Chunk.DiscardUnknown(m) +} + +var xxx_messageInfo_Chunk proto.InternalMessageInfo + +func (m *Chunk) GetEncoded() []byte { + if m != nil { + return m.Encoded + } + return nil +} + +func (m *Chunk) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Chunk) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +type ChunkID struct { + ChunkID string `protobuf:"bytes,1,opt,name=chunkID,proto3" json:"chunkID,omitempty"` +} + +func (m *ChunkID) Reset() { *m = ChunkID{} } +func (*ChunkID) ProtoMessage() {} +func (*ChunkID) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{4} +} +func (m *ChunkID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChunkID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChunkID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChunkID) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChunkID.Merge(m, src) +} +func (m *ChunkID) XXX_Size() int { + return m.Size() +} +func (m *ChunkID) XXX_DiscardUnknown() { + xxx_messageInfo_ChunkID.DiscardUnknown(m) +} + +var xxx_messageInfo_ChunkID proto.InternalMessageInfo + +func (m *ChunkID) GetChunkID() string { + if m != nil { + return m.ChunkID + } + return "" +} + +type DeleteTableRequest struct { + TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` +} + +func (m *DeleteTableRequest) Reset() { *m = DeleteTableRequest{} } +func (*DeleteTableRequest) ProtoMessage() {} +func (*DeleteTableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{5} +} +func (m *DeleteTableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteTableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteTableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteTableRequest.Merge(m, src) +} +func (m *DeleteTableRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteTableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteTableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteTableRequest proto.InternalMessageInfo + +func (m *DeleteTableRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +type DescribeTableRequest struct { + TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` +} + +func (m *DescribeTableRequest) Reset() { *m = DescribeTableRequest{} } +func (*DescribeTableRequest) ProtoMessage() {} +func (*DescribeTableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{6} +} +func (m *DescribeTableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DescribeTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DescribeTableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DescribeTableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DescribeTableRequest.Merge(m, src) +} +func (m *DescribeTableRequest) XXX_Size() int { + return m.Size() +} +func (m *DescribeTableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DescribeTableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DescribeTableRequest proto.InternalMessageInfo + +func (m *DescribeTableRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +type WriteBatch struct { + Writes []*IndexEntry `protobuf:"bytes,1,rep,name=writes,proto3" json:"writes,omitempty"` + Deletes []*IndexEntry `protobuf:"bytes,2,rep,name=deletes,proto3" json:"deletes,omitempty"` +} + +func (m *WriteBatch) Reset() { *m = WriteBatch{} } +func (*WriteBatch) ProtoMessage() {} +func (*WriteBatch) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{7} +} +func (m *WriteBatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WriteBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WriteBatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WriteBatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteBatch.Merge(m, src) +} +func (m *WriteBatch) XXX_Size() int { + return m.Size() +} +func (m *WriteBatch) XXX_DiscardUnknown() { + xxx_messageInfo_WriteBatch.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteBatch proto.InternalMessageInfo + +func (m *WriteBatch) GetWrites() []*IndexEntry { + if m != nil { + return m.Writes + } + return nil +} + +func (m *WriteBatch) GetDeletes() []*IndexEntry { + if m != nil { + return m.Deletes + } + return nil +} + +type WriteIndexRequest struct { + Writes []*IndexEntry `protobuf:"bytes,1,rep,name=writes,proto3" json:"writes,omitempty"` +} + +func (m *WriteIndexRequest) Reset() { *m = WriteIndexRequest{} } +func (*WriteIndexRequest) ProtoMessage() {} +func (*WriteIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{8} +} +func (m *WriteIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WriteIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WriteIndexRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WriteIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_WriteIndexRequest.Merge(m, src) +} +func (m *WriteIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *WriteIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_WriteIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_WriteIndexRequest proto.InternalMessageInfo + +func (m *WriteIndexRequest) GetWrites() []*IndexEntry { + if m != nil { + return m.Writes + } + return nil +} + +type DeleteIndexRequest struct { + Deletes []*IndexEntry `protobuf:"bytes,1,rep,name=deletes,proto3" json:"deletes,omitempty"` +} + +func (m *DeleteIndexRequest) Reset() { *m = DeleteIndexRequest{} } +func (*DeleteIndexRequest) ProtoMessage() {} +func (*DeleteIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{9} +} +func (m *DeleteIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DeleteIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DeleteIndexRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DeleteIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteIndexRequest.Merge(m, src) +} +func (m *DeleteIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *DeleteIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteIndexRequest proto.InternalMessageInfo + +func (m *DeleteIndexRequest) GetDeletes() []*IndexEntry { + if m != nil { + return m.Deletes + } + return nil +} + +type QueryIndexResponse struct { + Rows []*Row `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"` +} + +func (m *QueryIndexResponse) Reset() { *m = QueryIndexResponse{} } +func (*QueryIndexResponse) ProtoMessage() {} +func (*QueryIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{10} +} +func (m *QueryIndexResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIndexResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIndexResponse.Merge(m, src) +} +func (m *QueryIndexResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIndexResponse proto.InternalMessageInfo + +func (m *QueryIndexResponse) GetRows() []*Row { + if m != nil { + return m.Rows + } + return nil +} + +type Row struct { + RangeValue []byte `protobuf:"bytes,1,opt,name=rangeValue,proto3" json:"rangeValue,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Row) Reset() { *m = Row{} } +func (*Row) ProtoMessage() {} +func (*Row) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{11} +} +func (m *Row) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Row) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Row.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Row) XXX_Merge(src proto.Message) { + xxx_messageInfo_Row.Merge(m, src) +} +func (m *Row) XXX_Size() int { + return m.Size() +} +func (m *Row) XXX_DiscardUnknown() { + xxx_messageInfo_Row.DiscardUnknown(m) +} + +var xxx_messageInfo_Row proto.InternalMessageInfo + +func (m *Row) GetRangeValue() []byte { + if m != nil { + return m.RangeValue + } + return nil +} + +func (m *Row) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type IndexEntry struct { + TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` + HashValue string `protobuf:"bytes,2,opt,name=hashValue,proto3" json:"hashValue,omitempty"` + RangeValue []byte `protobuf:"bytes,3,opt,name=rangeValue,proto3" json:"rangeValue,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *IndexEntry) Reset() { *m = IndexEntry{} } +func (*IndexEntry) ProtoMessage() {} +func (*IndexEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{12} +} +func (m *IndexEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IndexEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IndexEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IndexEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexEntry.Merge(m, src) +} +func (m *IndexEntry) XXX_Size() int { + return m.Size() +} +func (m *IndexEntry) XXX_DiscardUnknown() { + xxx_messageInfo_IndexEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexEntry proto.InternalMessageInfo + +func (m *IndexEntry) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *IndexEntry) GetHashValue() string { + if m != nil { + return m.HashValue + } + return "" +} + +func (m *IndexEntry) GetRangeValue() []byte { + if m != nil { + return m.RangeValue + } + return nil +} + +func (m *IndexEntry) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +type QueryIndexRequest struct { + TableName string `protobuf:"bytes,1,opt,name=tableName,proto3" json:"tableName,omitempty"` + HashValue string `protobuf:"bytes,2,opt,name=hashValue,proto3" json:"hashValue,omitempty"` + RangeValuePrefix []byte `protobuf:"bytes,3,opt,name=rangeValuePrefix,proto3" json:"rangeValuePrefix,omitempty"` + RangeValueStart []byte `protobuf:"bytes,4,opt,name=rangeValueStart,proto3" json:"rangeValueStart,omitempty"` + ValueEqual []byte `protobuf:"bytes,5,opt,name=valueEqual,proto3" json:"valueEqual,omitempty"` + Immutable bool `protobuf:"varint,6,opt,name=immutable,proto3" json:"immutable,omitempty"` +} + +func (m *QueryIndexRequest) Reset() { *m = QueryIndexRequest{} } +func (*QueryIndexRequest) ProtoMessage() {} +func (*QueryIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{13} +} +func (m *QueryIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIndexRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIndexRequest.Merge(m, src) +} +func (m *QueryIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIndexRequest proto.InternalMessageInfo + +func (m *QueryIndexRequest) GetTableName() string { + if m != nil { + return m.TableName + } + return "" +} + +func (m *QueryIndexRequest) GetHashValue() string { + if m != nil { + return m.HashValue + } + return "" +} + +func (m *QueryIndexRequest) GetRangeValuePrefix() []byte { + if m != nil { + return m.RangeValuePrefix + } + return nil +} + +func (m *QueryIndexRequest) GetRangeValueStart() []byte { + if m != nil { + return m.RangeValueStart + } + return nil +} + +func (m *QueryIndexRequest) GetValueEqual() []byte { + if m != nil { + return m.ValueEqual + } + return nil +} + +func (m *QueryIndexRequest) GetImmutable() bool { + if m != nil { + return m.Immutable + } + return false +} + +type UpdateTableRequest struct { + Current *TableDesc `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"` + Expected *TableDesc `protobuf:"bytes,2,opt,name=expected,proto3" json:"expected,omitempty"` +} + +func (m *UpdateTableRequest) Reset() { *m = UpdateTableRequest{} } +func (*UpdateTableRequest) ProtoMessage() {} +func (*UpdateTableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{14} +} +func (m *UpdateTableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateTableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateTableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateTableRequest.Merge(m, src) +} +func (m *UpdateTableRequest) XXX_Size() int { + return m.Size() +} +func (m *UpdateTableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateTableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateTableRequest proto.InternalMessageInfo + +func (m *UpdateTableRequest) GetCurrent() *TableDesc { + if m != nil { + return m.Current + } + return nil +} + +func (m *UpdateTableRequest) GetExpected() *TableDesc { + if m != nil { + return m.Expected + } + return nil +} + +type DescribeTableResponse struct { + Desc *TableDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` + IsActive bool `protobuf:"varint,2,opt,name=isActive,proto3" json:"isActive,omitempty"` +} + +func (m *DescribeTableResponse) Reset() { *m = DescribeTableResponse{} } +func (*DescribeTableResponse) ProtoMessage() {} +func (*DescribeTableResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{15} +} +func (m *DescribeTableResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DescribeTableResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DescribeTableResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DescribeTableResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DescribeTableResponse.Merge(m, src) +} +func (m *DescribeTableResponse) XXX_Size() int { + return m.Size() +} +func (m *DescribeTableResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DescribeTableResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DescribeTableResponse proto.InternalMessageInfo + +func (m *DescribeTableResponse) GetDesc() *TableDesc { + if m != nil { + return m.Desc + } + return nil +} + +func (m *DescribeTableResponse) GetIsActive() bool { + if m != nil { + return m.IsActive + } + return false +} + +type CreateTableRequest struct { + Desc *TableDesc `protobuf:"bytes,1,opt,name=desc,proto3" json:"desc,omitempty"` +} + +func (m *CreateTableRequest) Reset() { *m = CreateTableRequest{} } +func (*CreateTableRequest) ProtoMessage() {} +func (*CreateTableRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{16} +} +func (m *CreateTableRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateTableRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateTableRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateTableRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTableRequest.Merge(m, src) +} +func (m *CreateTableRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateTableRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateTableRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateTableRequest proto.InternalMessageInfo + +func (m *CreateTableRequest) GetDesc() *TableDesc { + if m != nil { + return m.Desc + } + return nil +} + +type TableDesc struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + UseOnDemandIOMode bool `protobuf:"varint,2,opt,name=useOnDemandIOMode,proto3" json:"useOnDemandIOMode,omitempty"` + ProvisionedRead int64 `protobuf:"varint,3,opt,name=provisionedRead,proto3" json:"provisionedRead,omitempty"` + ProvisionedWrite int64 `protobuf:"varint,4,opt,name=provisionedWrite,proto3" json:"provisionedWrite,omitempty"` + Tags map[string]string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *TableDesc) Reset() { *m = TableDesc{} } +func (*TableDesc) ProtoMessage() {} +func (*TableDesc) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{17} +} +func (m *TableDesc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TableDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TableDesc.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TableDesc) XXX_Merge(src proto.Message) { + xxx_messageInfo_TableDesc.Merge(m, src) +} +func (m *TableDesc) XXX_Size() int { + return m.Size() +} +func (m *TableDesc) XXX_DiscardUnknown() { + xxx_messageInfo_TableDesc.DiscardUnknown(m) +} + +var xxx_messageInfo_TableDesc proto.InternalMessageInfo + +func (m *TableDesc) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *TableDesc) GetUseOnDemandIOMode() bool { + if m != nil { + return m.UseOnDemandIOMode + } + return false +} + +func (m *TableDesc) GetProvisionedRead() int64 { + if m != nil { + return m.ProvisionedRead + } + return 0 +} + +func (m *TableDesc) GetProvisionedWrite() int64 { + if m != nil { + return m.ProvisionedWrite + } + return 0 +} + +func (m *TableDesc) GetTags() map[string]string { + if m != nil { + return m.Tags + } + return nil +} + +type ListTablesResponse struct { + TableNames []string `protobuf:"bytes,1,rep,name=tableNames,proto3" json:"tableNames,omitempty"` +} + +func (m *ListTablesResponse) Reset() { *m = ListTablesResponse{} } +func (*ListTablesResponse) ProtoMessage() {} +func (*ListTablesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{18} +} +func (m *ListTablesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListTablesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListTablesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListTablesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListTablesResponse.Merge(m, src) +} +func (m *ListTablesResponse) XXX_Size() int { + return m.Size() +} +func (m *ListTablesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListTablesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListTablesResponse proto.InternalMessageInfo + +func (m *ListTablesResponse) GetTableNames() []string { + if m != nil { + return m.TableNames + } + return nil +} + +type Labels struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Labels) Reset() { *m = Labels{} } +func (*Labels) ProtoMessage() {} +func (*Labels) Descriptor() ([]byte, []int) { + return fileDescriptor_70cfe0ce419fcf8f, []int{19} +} +func (m *Labels) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Labels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Labels.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Labels) XXX_Merge(src proto.Message) { + xxx_messageInfo_Labels.Merge(m, src) +} +func (m *Labels) XXX_Size() int { + return m.Size() +} +func (m *Labels) XXX_DiscardUnknown() { + xxx_messageInfo_Labels.DiscardUnknown(m) +} + +var xxx_messageInfo_Labels proto.InternalMessageInfo + +func (m *Labels) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Labels) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func init() { + proto.RegisterType((*PutChunksRequest)(nil), "grpc.PutChunksRequest") + proto.RegisterType((*GetChunksRequest)(nil), "grpc.GetChunksRequest") + proto.RegisterType((*GetChunksResponse)(nil), "grpc.GetChunksResponse") + proto.RegisterType((*Chunk)(nil), "grpc.Chunk") + proto.RegisterType((*ChunkID)(nil), "grpc.ChunkID") + proto.RegisterType((*DeleteTableRequest)(nil), "grpc.DeleteTableRequest") + proto.RegisterType((*DescribeTableRequest)(nil), "grpc.DescribeTableRequest") + proto.RegisterType((*WriteBatch)(nil), "grpc.WriteBatch") + proto.RegisterType((*WriteIndexRequest)(nil), "grpc.WriteIndexRequest") + proto.RegisterType((*DeleteIndexRequest)(nil), "grpc.DeleteIndexRequest") + proto.RegisterType((*QueryIndexResponse)(nil), "grpc.QueryIndexResponse") + proto.RegisterType((*Row)(nil), "grpc.Row") + proto.RegisterType((*IndexEntry)(nil), "grpc.IndexEntry") + proto.RegisterType((*QueryIndexRequest)(nil), "grpc.QueryIndexRequest") + proto.RegisterType((*UpdateTableRequest)(nil), "grpc.UpdateTableRequest") + proto.RegisterType((*DescribeTableResponse)(nil), "grpc.DescribeTableResponse") + proto.RegisterType((*CreateTableRequest)(nil), "grpc.CreateTableRequest") + proto.RegisterType((*TableDesc)(nil), "grpc.TableDesc") + proto.RegisterMapType((map[string]string)(nil), "grpc.TableDesc.TagsEntry") + proto.RegisterType((*ListTablesResponse)(nil), "grpc.ListTablesResponse") + proto.RegisterType((*Labels)(nil), "grpc.Labels") +} + +func init() { + proto.RegisterFile("pkg/storage/chunk/client/grpc/grpc.proto", fileDescriptor_70cfe0ce419fcf8f) +} + +var fileDescriptor_70cfe0ce419fcf8f = []byte{ + // 944 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x92, 0xdb, 0x44, + 0x10, 0xf6, 0xf8, 0x6f, 0x57, 0xed, 0xa4, 0xb2, 0x3b, 0x15, 0x12, 0xe1, 0x80, 0x6a, 0x4b, 0xb9, + 0x98, 0x00, 0x36, 0xe5, 0x2c, 0x95, 0x40, 0x2a, 0x84, 0x24, 0xde, 0x82, 0xad, 0x0a, 0x24, 0x11, + 0x21, 0x70, 0xa3, 0x64, 0xa9, 0xe3, 0x55, 0xad, 0x2d, 0x39, 0x9a, 0xd1, 0xfe, 0x5c, 0x28, 0xee, + 0x5c, 0x78, 0x0c, 0x1e, 0x85, 0xe3, 0x1e, 0x73, 0x64, 0xbd, 0x17, 0x8e, 0x79, 0x04, 0x6a, 0x46, + 0x1a, 0x49, 0x96, 0xac, 0xec, 0xc2, 0x45, 0xa5, 0xf9, 0xba, 0xfb, 0x9b, 0xaf, 0x67, 0xa6, 0xbb, + 0xa1, 0x37, 0xdf, 0x9f, 0x0c, 0x18, 0x0f, 0x42, 0x7b, 0x82, 0x03, 0x67, 0x2f, 0xf2, 0xf7, 0x07, + 0xce, 0xd4, 0x43, 0x9f, 0x0f, 0x26, 0xe1, 0xdc, 0x91, 0x9f, 0xfe, 0x3c, 0x0c, 0x78, 0x40, 0x9b, + 0xe2, 0xbf, 0x7b, 0x63, 0x12, 0x04, 0x93, 0x29, 0x0e, 0x24, 0x36, 0x8e, 0x5e, 0x0d, 0x70, 0x36, + 0xe7, 0xc7, 0xb1, 0x8b, 0x79, 0x07, 0x36, 0x9e, 0x45, 0xfc, 0xb1, 0x60, 0x61, 0x16, 0xbe, 0x8e, + 0x90, 0x71, 0x7a, 0x13, 0xda, 0x92, 0x96, 0xe9, 0x64, 0xab, 0xd1, 0xeb, 0x0c, 0x3b, 0x7d, 0xc9, + 0x29, 0x9d, 0xac, 0xc4, 0x24, 0x02, 0xbf, 0xc1, 0xff, 0x13, 0x78, 0x17, 0x36, 0x73, 0x81, 0x6c, + 0x1e, 0xf8, 0x0c, 0x2f, 0x16, 0xf9, 0x1c, 0x5a, 0x12, 0xa0, 0x3a, 0xac, 0xa1, 0xef, 0x04, 0x2e, + 0xba, 0x3a, 0xd9, 0x22, 0xbd, 0x4b, 0x96, 0x5a, 0xd2, 0x0d, 0x68, 0xec, 0xe3, 0xb1, 0x5e, 0xdf, + 0x22, 0x3d, 0xcd, 0x12, 0xbf, 0xf4, 0x03, 0xd0, 0xb8, 0x3d, 0x9e, 0xe2, 0xf7, 0xf6, 0x0c, 0xf5, + 0x86, 0xc4, 0x33, 0xc0, 0xbc, 0x09, 0x6b, 0x92, 0x72, 0x77, 0x24, 0x48, 0x9d, 0xf8, 0x57, 0x92, + 0x6a, 0x96, 0x5a, 0x9a, 0x43, 0xa0, 0x23, 0x9c, 0x22, 0xc7, 0x17, 0x22, 0x4e, 0x25, 0xbb, 0x44, + 0x4c, 0x8a, 0xc4, 0xdb, 0x70, 0x75, 0x84, 0xcc, 0x09, 0xbd, 0xf1, 0x7f, 0x89, 0x1a, 0x03, 0xfc, + 0x14, 0x7a, 0x1c, 0x1f, 0xd9, 0xdc, 0xd9, 0xa3, 0x3d, 0x68, 0x1f, 0x8a, 0x95, 0x3a, 0x94, 0x8d, + 0xf8, 0x50, 0x76, 0x7d, 0x17, 0x8f, 0x76, 0x7c, 0x1e, 0x1e, 0x5b, 0x89, 0x9d, 0xde, 0x82, 0x35, + 0x57, 0x2a, 0x64, 0x7a, 0xbd, 0xc2, 0x55, 0x39, 0x98, 0xf7, 0x61, 0x53, 0xee, 0x21, 0x6d, 0x4a, + 0xd6, 0x85, 0xb7, 0x32, 0xbf, 0x56, 0x87, 0xb1, 0x14, 0x9f, 0x13, 0x40, 0xce, 0x13, 0x70, 0x1b, + 0xe8, 0xf3, 0x08, 0xc3, 0xe3, 0x84, 0x20, 0x79, 0x01, 0x1f, 0x42, 0x33, 0x0c, 0x0e, 0x55, 0xb8, + 0x16, 0x87, 0x5b, 0xc1, 0xa1, 0x25, 0x61, 0xf3, 0x1e, 0x34, 0xac, 0xe0, 0x90, 0x1a, 0x00, 0xa1, + 0xed, 0x4f, 0xf0, 0xa5, 0x3d, 0x8d, 0x30, 0xb9, 0xfc, 0x1c, 0x42, 0xaf, 0x42, 0xeb, 0x40, 0x9a, + 0xea, 0xd2, 0x14, 0x2f, 0xcc, 0x5f, 0x01, 0x32, 0x21, 0xef, 0xbe, 0x02, 0x61, 0xdd, 0xb3, 0xd9, + 0xde, 0xcb, 0x94, 0x45, 0xb3, 0x32, 0xa0, 0xb0, 0x7f, 0xa3, 0x7a, 0xff, 0x66, 0x7e, 0xff, 0x33, + 0x02, 0x9b, 0xf9, 0x94, 0x2f, 0xf0, 0x14, 0xce, 0xd1, 0x71, 0x0b, 0x36, 0xb2, 0x5d, 0x9f, 0x85, + 0xf8, 0xca, 0x3b, 0x4a, 0xd4, 0x94, 0x70, 0xda, 0x83, 0x2b, 0x19, 0xf6, 0x03, 0xb7, 0x43, 0x9e, + 0xa8, 0x2b, 0xc2, 0x22, 0x3b, 0x29, 0x78, 0xe7, 0x75, 0x64, 0x4f, 0xf5, 0x56, 0x9c, 0x5d, 0x86, + 0x08, 0x4d, 0xde, 0x6c, 0x16, 0x49, 0x91, 0x7a, 0x7b, 0x8b, 0xf4, 0xd6, 0xad, 0x0c, 0x30, 0xa7, + 0x40, 0x7f, 0x9c, 0xbb, 0x76, 0xa1, 0x4c, 0x3e, 0x82, 0x35, 0x27, 0x0a, 0x43, 0xf4, 0xb9, 0xcc, + 0xb1, 0x33, 0xbc, 0x12, 0x5f, 0xad, 0x74, 0x12, 0x25, 0x62, 0x29, 0x3b, 0xfd, 0x18, 0xd6, 0xf1, + 0x68, 0x8e, 0x0e, 0x47, 0x57, 0x66, 0xbc, 0xc2, 0x37, 0x75, 0x30, 0x7f, 0x86, 0xf7, 0x0a, 0x05, + 0x96, 0xb6, 0x92, 0xa6, 0x8b, 0xcc, 0xa9, 0xda, 0x4d, 0x1a, 0x69, 0x17, 0xd6, 0x3d, 0xf6, 0xd0, + 0xe1, 0xde, 0x41, 0x7c, 0xb8, 0xeb, 0x56, 0xba, 0x36, 0xbf, 0x00, 0xfa, 0x38, 0xc4, 0x62, 0x1e, + 0x17, 0xa1, 0x35, 0x7f, 0xaf, 0x83, 0x96, 0x62, 0x94, 0x42, 0xd3, 0xcf, 0xee, 0x56, 0xfe, 0xd3, + 0x4f, 0x60, 0x33, 0x62, 0xf8, 0xd4, 0x1f, 0xe1, 0xcc, 0xf6, 0xdd, 0xdd, 0xa7, 0xdf, 0x05, 0xae, + 0x52, 0x50, 0x36, 0x88, 0xab, 0x9b, 0x87, 0xc1, 0x81, 0xc7, 0xbc, 0xc0, 0x47, 0xd7, 0x42, 0xdb, + 0x95, 0xb7, 0xdc, 0xb0, 0x8a, 0xb0, 0x78, 0x10, 0x39, 0x48, 0x16, 0xb8, 0xbc, 0xe5, 0x86, 0x55, + 0xc2, 0xe9, 0xa7, 0xd0, 0xe4, 0xf6, 0x84, 0xe9, 0x2d, 0x59, 0x6a, 0xef, 0x17, 0x52, 0xe9, 0xbf, + 0xb0, 0x27, 0x2c, 0x2e, 0x59, 0xe9, 0xd6, 0xbd, 0x23, 0x72, 0x4a, 0x20, 0xd5, 0x60, 0x49, 0xd6, + 0x60, 0x97, 0x4a, 0x4e, 0x4b, 0x9e, 0xfc, 0x97, 0xf5, 0xbb, 0xc4, 0xdc, 0x06, 0xfa, 0xc4, 0x63, + 0x5c, 0x32, 0x67, 0xad, 0xde, 0x00, 0x48, 0x5f, 0x79, 0x5c, 0xee, 0x9a, 0x95, 0x43, 0xcc, 0x21, + 0xb4, 0x9f, 0xd8, 0x63, 0x9c, 0xb2, 0x95, 0xe7, 0xb7, 0x72, 0xb7, 0xe1, 0x49, 0x0b, 0x40, 0x64, + 0xf1, 0x8b, 0x18, 0x8b, 0x48, 0xef, 0x27, 0x6d, 0x54, 0x96, 0x1b, 0xbd, 0x1e, 0x27, 0x58, 0x6a, + 0x7a, 0xdd, 0x6b, 0xfd, 0x78, 0x32, 0xf6, 0xd5, 0x64, 0xec, 0xef, 0x88, 0xc9, 0x48, 0x1f, 0x02, + 0x64, 0xd5, 0xaa, 0xc2, 0x4b, 0xf5, 0xdb, 0xd5, 0xcb, 0x86, 0x38, 0xc5, 0xcf, 0x08, 0x7d, 0x00, + 0x9d, 0x5c, 0x97, 0xa4, 0x89, 0x6b, 0xb9, 0x71, 0x56, 0x6a, 0xb8, 0x07, 0x5a, 0x3a, 0x97, 0xe9, + 0xb5, 0x38, 0xbc, 0x38, 0xa8, 0x2b, 0x83, 0xbf, 0x02, 0x2d, 0x1d, 0xb1, 0x2a, 0xb8, 0x38, 0xac, + 0xbb, 0xd7, 0x4b, 0x78, 0xaa, 0xfe, 0x73, 0xb8, 0x14, 0x4b, 0x4d, 0x28, 0x2e, 0xe7, 0xa6, 0xf1, + 0xee, 0xe8, 0x1d, 0xdb, 0x42, 0x76, 0xdf, 0xb4, 0xc2, 0x4b, 0x1d, 0xdb, 0x8a, 0x97, 0xf1, 0x00, + 0x3a, 0xb9, 0xc2, 0x53, 0x87, 0x56, 0xae, 0xc5, 0x4a, 0x01, 0xe9, 0xa9, 0x2f, 0x11, 0x94, 0x67, + 0x77, 0x25, 0xc1, 0xb7, 0x70, 0x79, 0xa9, 0xa9, 0xd0, 0xae, 0xa2, 0x28, 0x8f, 0xf2, 0xee, 0x8d, + 0x95, 0xb6, 0x2c, 0x97, 0x5c, 0x33, 0x54, 0x52, 0xca, 0xfd, 0xb1, 0x4a, 0xca, 0xa3, 0xed, 0x93, + 0x53, 0xa3, 0xf6, 0xe6, 0xd4, 0xa8, 0xbd, 0x3d, 0x35, 0xc8, 0x6f, 0x0b, 0x83, 0xfc, 0xb9, 0x30, + 0xc8, 0x5f, 0x0b, 0x83, 0x9c, 0x2c, 0x0c, 0xf2, 0xf7, 0xc2, 0x20, 0xff, 0x2c, 0x8c, 0xda, 0xdb, + 0x85, 0x41, 0xfe, 0x38, 0x33, 0x6a, 0x27, 0x67, 0x46, 0xed, 0xcd, 0x99, 0x51, 0x1b, 0xb7, 0x25, + 0xcb, 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xba, 0x8d, 0xe6, 0x24, 0x0a, 0x00, 0x00, +} + +func (this *PutChunksRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PutChunksRequest) + if !ok { + that2, ok := that.(PutChunksRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Chunks) != len(that1.Chunks) { + return false + } + for i := range this.Chunks { + if !this.Chunks[i].Equal(that1.Chunks[i]) { + return false + } + } + return true +} +func (this *GetChunksRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetChunksRequest) + if !ok { + that2, ok := that.(GetChunksRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Chunks) != len(that1.Chunks) { + return false + } + for i := range this.Chunks { + if !this.Chunks[i].Equal(that1.Chunks[i]) { + return false + } + } + return true +} +func (this *GetChunksResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GetChunksResponse) + if !ok { + that2, ok := that.(GetChunksResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Chunks) != len(that1.Chunks) { + return false + } + for i := range this.Chunks { + if !this.Chunks[i].Equal(that1.Chunks[i]) { + return false + } + } + return true +} +func (this *Chunk) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Chunk) + if !ok { + that2, ok := that.(Chunk) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Encoded, that1.Encoded) { + return false + } + if this.Key != that1.Key { + return false + } + if this.TableName != that1.TableName { + return false + } + return true +} +func (this *ChunkID) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ChunkID) + if !ok { + that2, ok := that.(ChunkID) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ChunkID != that1.ChunkID { + return false + } + return true +} +func (this *DeleteTableRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DeleteTableRequest) + if !ok { + that2, ok := that.(DeleteTableRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TableName != that1.TableName { + return false + } + return true +} +func (this *DescribeTableRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DescribeTableRequest) + if !ok { + that2, ok := that.(DescribeTableRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TableName != that1.TableName { + return false + } + return true +} +func (this *WriteBatch) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*WriteBatch) + if !ok { + that2, ok := that.(WriteBatch) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Writes) != len(that1.Writes) { + return false + } + for i := range this.Writes { + if !this.Writes[i].Equal(that1.Writes[i]) { + return false + } + } + if len(this.Deletes) != len(that1.Deletes) { + return false + } + for i := range this.Deletes { + if !this.Deletes[i].Equal(that1.Deletes[i]) { + return false + } + } + return true +} +func (this *WriteIndexRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*WriteIndexRequest) + if !ok { + that2, ok := that.(WriteIndexRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Writes) != len(that1.Writes) { + return false + } + for i := range this.Writes { + if !this.Writes[i].Equal(that1.Writes[i]) { + return false + } + } + return true +} +func (this *DeleteIndexRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DeleteIndexRequest) + if !ok { + that2, ok := that.(DeleteIndexRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Deletes) != len(that1.Deletes) { + return false + } + for i := range this.Deletes { + if !this.Deletes[i].Equal(that1.Deletes[i]) { + return false + } + } + return true +} +func (this *QueryIndexResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryIndexResponse) + if !ok { + that2, ok := that.(QueryIndexResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Rows) != len(that1.Rows) { + return false + } + for i := range this.Rows { + if !this.Rows[i].Equal(that1.Rows[i]) { + return false + } + } + return true +} +func (this *Row) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Row) + if !ok { + that2, ok := that.(Row) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.RangeValue, that1.RangeValue) { + return false + } + if !bytes.Equal(this.Value, that1.Value) { + return false + } + return true +} +func (this *IndexEntry) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*IndexEntry) + if !ok { + that2, ok := that.(IndexEntry) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TableName != that1.TableName { + return false + } + if this.HashValue != that1.HashValue { + return false + } + if !bytes.Equal(this.RangeValue, that1.RangeValue) { + return false + } + if !bytes.Equal(this.Value, that1.Value) { + return false + } + return true +} +func (this *QueryIndexRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QueryIndexRequest) + if !ok { + that2, ok := that.(QueryIndexRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TableName != that1.TableName { + return false + } + if this.HashValue != that1.HashValue { + return false + } + if !bytes.Equal(this.RangeValuePrefix, that1.RangeValuePrefix) { + return false + } + if !bytes.Equal(this.RangeValueStart, that1.RangeValueStart) { + return false + } + if !bytes.Equal(this.ValueEqual, that1.ValueEqual) { + return false + } + if this.Immutable != that1.Immutable { + return false + } + return true +} +func (this *UpdateTableRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UpdateTableRequest) + if !ok { + that2, ok := that.(UpdateTableRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Current.Equal(that1.Current) { + return false + } + if !this.Expected.Equal(that1.Expected) { + return false + } + return true +} +func (this *DescribeTableResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DescribeTableResponse) + if !ok { + that2, ok := that.(DescribeTableResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Desc.Equal(that1.Desc) { + return false + } + if this.IsActive != that1.IsActive { + return false + } + return true +} +func (this *CreateTableRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CreateTableRequest) + if !ok { + that2, ok := that.(CreateTableRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Desc.Equal(that1.Desc) { + return false + } + return true +} +func (this *TableDesc) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TableDesc) + if !ok { + that2, ok := that.(TableDesc) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.UseOnDemandIOMode != that1.UseOnDemandIOMode { + return false + } + if this.ProvisionedRead != that1.ProvisionedRead { + return false + } + if this.ProvisionedWrite != that1.ProvisionedWrite { + return false + } + if len(this.Tags) != len(that1.Tags) { + return false + } + for i := range this.Tags { + if this.Tags[i] != that1.Tags[i] { + return false + } + } + return true +} +func (this *ListTablesResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ListTablesResponse) + if !ok { + that2, ok := that.(ListTablesResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.TableNames) != len(that1.TableNames) { + return false + } + for i := range this.TableNames { + if this.TableNames[i] != that1.TableNames[i] { + return false + } + } + return true +} +func (this *Labels) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Labels) + if !ok { + that2, ok := that.(Labels) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (this *PutChunksRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.PutChunksRequest{") + if this.Chunks != nil { + s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetChunksRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.GetChunksRequest{") + if this.Chunks != nil { + s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *GetChunksResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.GetChunksResponse{") + if this.Chunks != nil { + s = append(s, "Chunks: "+fmt.Sprintf("%#v", this.Chunks)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Chunk) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&grpc.Chunk{") + s = append(s, "Encoded: "+fmt.Sprintf("%#v", this.Encoded)+",\n") + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ChunkID) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.ChunkID{") + s = append(s, "ChunkID: "+fmt.Sprintf("%#v", this.ChunkID)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DeleteTableRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.DeleteTableRequest{") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DescribeTableRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.DescribeTableRequest{") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *WriteBatch) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&grpc.WriteBatch{") + if this.Writes != nil { + s = append(s, "Writes: "+fmt.Sprintf("%#v", this.Writes)+",\n") + } + if this.Deletes != nil { + s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *WriteIndexRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.WriteIndexRequest{") + if this.Writes != nil { + s = append(s, "Writes: "+fmt.Sprintf("%#v", this.Writes)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DeleteIndexRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.DeleteIndexRequest{") + if this.Deletes != nil { + s = append(s, "Deletes: "+fmt.Sprintf("%#v", this.Deletes)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryIndexResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.QueryIndexResponse{") + if this.Rows != nil { + s = append(s, "Rows: "+fmt.Sprintf("%#v", this.Rows)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Row) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&grpc.Row{") + s = append(s, "RangeValue: "+fmt.Sprintf("%#v", this.RangeValue)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *IndexEntry) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&grpc.IndexEntry{") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + s = append(s, "HashValue: "+fmt.Sprintf("%#v", this.HashValue)+",\n") + s = append(s, "RangeValue: "+fmt.Sprintf("%#v", this.RangeValue)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QueryIndexRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 10) + s = append(s, "&grpc.QueryIndexRequest{") + s = append(s, "TableName: "+fmt.Sprintf("%#v", this.TableName)+",\n") + s = append(s, "HashValue: "+fmt.Sprintf("%#v", this.HashValue)+",\n") + s = append(s, "RangeValuePrefix: "+fmt.Sprintf("%#v", this.RangeValuePrefix)+",\n") + s = append(s, "RangeValueStart: "+fmt.Sprintf("%#v", this.RangeValueStart)+",\n") + s = append(s, "ValueEqual: "+fmt.Sprintf("%#v", this.ValueEqual)+",\n") + s = append(s, "Immutable: "+fmt.Sprintf("%#v", this.Immutable)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *UpdateTableRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&grpc.UpdateTableRequest{") + if this.Current != nil { + s = append(s, "Current: "+fmt.Sprintf("%#v", this.Current)+",\n") + } + if this.Expected != nil { + s = append(s, "Expected: "+fmt.Sprintf("%#v", this.Expected)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DescribeTableResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&grpc.DescribeTableResponse{") + if this.Desc != nil { + s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") + } + s = append(s, "IsActive: "+fmt.Sprintf("%#v", this.IsActive)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *CreateTableRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.CreateTableRequest{") + if this.Desc != nil { + s = append(s, "Desc: "+fmt.Sprintf("%#v", this.Desc)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *TableDesc) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&grpc.TableDesc{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "UseOnDemandIOMode: "+fmt.Sprintf("%#v", this.UseOnDemandIOMode)+",\n") + s = append(s, "ProvisionedRead: "+fmt.Sprintf("%#v", this.ProvisionedRead)+",\n") + s = append(s, "ProvisionedWrite: "+fmt.Sprintf("%#v", this.ProvisionedWrite)+",\n") + keysForTags := make([]string, 0, len(this.Tags)) + for k, _ := range this.Tags { + keysForTags = append(keysForTags, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTags) + mapStringForTags := "map[string]string{" + for _, k := range keysForTags { + mapStringForTags += fmt.Sprintf("%#v: %#v,", k, this.Tags[k]) + } + mapStringForTags += "}" + if this.Tags != nil { + s = append(s, "Tags: "+mapStringForTags+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ListTablesResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&grpc.ListTablesResponse{") + s = append(s, "TableNames: "+fmt.Sprintf("%#v", this.TableNames)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Labels) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&grpc.Labels{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringGrpc(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// GrpcStoreClient is the client API for GrpcStore service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type GrpcStoreClient interface { + // / WriteIndex writes batch of indexes to the index tables. + WriteIndex(ctx context.Context, in *WriteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) + // / QueryIndex reads the indexes required for given query & sends back the batch of rows + // / in rpc streams + QueryIndex(ctx context.Context, in *QueryIndexRequest, opts ...grpc.CallOption) (GrpcStore_QueryIndexClient, error) + // / DeleteIndex deletes the batch of index entries from the index tables + DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) + // / PutChunks saves the batch of chunks into the chunk tables. + PutChunks(ctx context.Context, in *PutChunksRequest, opts ...grpc.CallOption) (*empty.Empty, error) + // / GetChunks requests for batch of chunks and the batch of chunks are sent back in rpc streams + // / batching needs to be performed at server level as per requirement instead of sending single chunk per stream. + // / In GetChunks rpc request send buf as nil + GetChunks(ctx context.Context, in *GetChunksRequest, opts ...grpc.CallOption) (GrpcStore_GetChunksClient, error) + // / DeleteChunks deletes the chunks based on chunkID. + DeleteChunks(ctx context.Context, in *ChunkID, opts ...grpc.CallOption) (*empty.Empty, error) + // / Lists all the tables that exists in the database. + ListTables(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTablesResponse, error) + // / Creates a table with provided name & attributes. + CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) + // Deletes a table using table name provided. + DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) + // Describes a table information for the provided table. + DescribeTable(ctx context.Context, in *DescribeTableRequest, opts ...grpc.CallOption) (*DescribeTableResponse, error) + // Update a table with newly provided table information. + UpdateTable(ctx context.Context, in *UpdateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) +} + +type grpcStoreClient struct { + cc *grpc.ClientConn +} + +func NewGrpcStoreClient(cc *grpc.ClientConn) GrpcStoreClient { + return &grpcStoreClient{cc} +} + +func (c *grpcStoreClient) WriteIndex(ctx context.Context, in *WriteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/WriteIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) QueryIndex(ctx context.Context, in *QueryIndexRequest, opts ...grpc.CallOption) (GrpcStore_QueryIndexClient, error) { + stream, err := c.cc.NewStream(ctx, &_GrpcStore_serviceDesc.Streams[0], "/grpc.grpc_store/QueryIndex", opts...) + if err != nil { + return nil, err + } + x := &grpcStoreQueryIndexClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type GrpcStore_QueryIndexClient interface { + Recv() (*QueryIndexResponse, error) + grpc.ClientStream +} + +type grpcStoreQueryIndexClient struct { + grpc.ClientStream +} + +func (x *grpcStoreQueryIndexClient) Recv() (*QueryIndexResponse, error) { + m := new(QueryIndexResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcStoreClient) DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) PutChunks(ctx context.Context, in *PutChunksRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/PutChunks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) GetChunks(ctx context.Context, in *GetChunksRequest, opts ...grpc.CallOption) (GrpcStore_GetChunksClient, error) { + stream, err := c.cc.NewStream(ctx, &_GrpcStore_serviceDesc.Streams[1], "/grpc.grpc_store/GetChunks", opts...) + if err != nil { + return nil, err + } + x := &grpcStoreGetChunksClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type GrpcStore_GetChunksClient interface { + Recv() (*GetChunksResponse, error) + grpc.ClientStream +} + +type grpcStoreGetChunksClient struct { + grpc.ClientStream +} + +func (x *grpcStoreGetChunksClient) Recv() (*GetChunksResponse, error) { + m := new(GetChunksResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *grpcStoreClient) DeleteChunks(ctx context.Context, in *ChunkID, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteChunks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) ListTables(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListTablesResponse, error) { + out := new(ListTablesResponse) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/ListTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) CreateTable(ctx context.Context, in *CreateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/CreateTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) DeleteTable(ctx context.Context, in *DeleteTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/DeleteTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) DescribeTable(ctx context.Context, in *DescribeTableRequest, opts ...grpc.CallOption) (*DescribeTableResponse, error) { + out := new(DescribeTableResponse) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/DescribeTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *grpcStoreClient) UpdateTable(ctx context.Context, in *UpdateTableRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/grpc.grpc_store/UpdateTable", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GrpcStoreServer is the server API for GrpcStore service. +type GrpcStoreServer interface { + // / WriteIndex writes batch of indexes to the index tables. + WriteIndex(context.Context, *WriteIndexRequest) (*empty.Empty, error) + // / QueryIndex reads the indexes required for given query & sends back the batch of rows + // / in rpc streams + QueryIndex(*QueryIndexRequest, GrpcStore_QueryIndexServer) error + // / DeleteIndex deletes the batch of index entries from the index tables + DeleteIndex(context.Context, *DeleteIndexRequest) (*empty.Empty, error) + // / PutChunks saves the batch of chunks into the chunk tables. + PutChunks(context.Context, *PutChunksRequest) (*empty.Empty, error) + // / GetChunks requests for batch of chunks and the batch of chunks are sent back in rpc streams + // / batching needs to be performed at server level as per requirement instead of sending single chunk per stream. + // / In GetChunks rpc request send buf as nil + GetChunks(*GetChunksRequest, GrpcStore_GetChunksServer) error + // / DeleteChunks deletes the chunks based on chunkID. + DeleteChunks(context.Context, *ChunkID) (*empty.Empty, error) + // / Lists all the tables that exists in the database. + ListTables(context.Context, *empty.Empty) (*ListTablesResponse, error) + // / Creates a table with provided name & attributes. + CreateTable(context.Context, *CreateTableRequest) (*empty.Empty, error) + // Deletes a table using table name provided. + DeleteTable(context.Context, *DeleteTableRequest) (*empty.Empty, error) + // Describes a table information for the provided table. + DescribeTable(context.Context, *DescribeTableRequest) (*DescribeTableResponse, error) + // Update a table with newly provided table information. + UpdateTable(context.Context, *UpdateTableRequest) (*empty.Empty, error) +} + +// UnimplementedGrpcStoreServer can be embedded to have forward compatible implementations. +type UnimplementedGrpcStoreServer struct { +} + +func (*UnimplementedGrpcStoreServer) WriteIndex(ctx context.Context, req *WriteIndexRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteIndex not implemented") +} +func (*UnimplementedGrpcStoreServer) QueryIndex(req *QueryIndexRequest, srv GrpcStore_QueryIndexServer) error { + return status.Errorf(codes.Unimplemented, "method QueryIndex not implemented") +} +func (*UnimplementedGrpcStoreServer) DeleteIndex(ctx context.Context, req *DeleteIndexRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIndex not implemented") +} +func (*UnimplementedGrpcStoreServer) PutChunks(ctx context.Context, req *PutChunksRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PutChunks not implemented") +} +func (*UnimplementedGrpcStoreServer) GetChunks(req *GetChunksRequest, srv GrpcStore_GetChunksServer) error { + return status.Errorf(codes.Unimplemented, "method GetChunks not implemented") +} +func (*UnimplementedGrpcStoreServer) DeleteChunks(ctx context.Context, req *ChunkID) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteChunks not implemented") +} +func (*UnimplementedGrpcStoreServer) ListTables(ctx context.Context, req *empty.Empty) (*ListTablesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTables not implemented") +} +func (*UnimplementedGrpcStoreServer) CreateTable(ctx context.Context, req *CreateTableRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateTable not implemented") +} +func (*UnimplementedGrpcStoreServer) DeleteTable(ctx context.Context, req *DeleteTableRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteTable not implemented") +} +func (*UnimplementedGrpcStoreServer) DescribeTable(ctx context.Context, req *DescribeTableRequest) (*DescribeTableResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeTable not implemented") +} +func (*UnimplementedGrpcStoreServer) UpdateTable(ctx context.Context, req *UpdateTableRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTable not implemented") +} + +func RegisterGrpcStoreServer(s *grpc.Server, srv GrpcStoreServer) { + s.RegisterService(&_GrpcStore_serviceDesc, srv) +} + +func _GrpcStore_WriteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WriteIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).WriteIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/WriteIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).WriteIndex(ctx, req.(*WriteIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_QueryIndex_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(QueryIndexRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GrpcStoreServer).QueryIndex(m, &grpcStoreQueryIndexServer{stream}) +} + +type GrpcStore_QueryIndexServer interface { + Send(*QueryIndexResponse) error + grpc.ServerStream +} + +type grpcStoreQueryIndexServer struct { + grpc.ServerStream +} + +func (x *grpcStoreQueryIndexServer) Send(m *QueryIndexResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _GrpcStore_DeleteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).DeleteIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/DeleteIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).DeleteIndex(ctx, req.(*DeleteIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_PutChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutChunksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).PutChunks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/PutChunks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).PutChunks(ctx, req.(*PutChunksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_GetChunks_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetChunksRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GrpcStoreServer).GetChunks(m, &grpcStoreGetChunksServer{stream}) +} + +type GrpcStore_GetChunksServer interface { + Send(*GetChunksResponse) error + grpc.ServerStream +} + +type grpcStoreGetChunksServer struct { + grpc.ServerStream +} + +func (x *grpcStoreGetChunksServer) Send(m *GetChunksResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _GrpcStore_DeleteChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChunkID) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).DeleteChunks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/DeleteChunks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).DeleteChunks(ctx, req.(*ChunkID)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_ListTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).ListTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/ListTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).ListTables(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_CreateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).CreateTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/CreateTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).CreateTable(ctx, req.(*CreateTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_DeleteTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).DeleteTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/DeleteTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).DeleteTable(ctx, req.(*DeleteTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_DescribeTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).DescribeTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/DescribeTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).DescribeTable(ctx, req.(*DescribeTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GrpcStore_UpdateTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateTableRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GrpcStoreServer).UpdateTable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/grpc.grpc_store/UpdateTable", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GrpcStoreServer).UpdateTable(ctx, req.(*UpdateTableRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _GrpcStore_serviceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.grpc_store", + HandlerType: (*GrpcStoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "WriteIndex", + Handler: _GrpcStore_WriteIndex_Handler, + }, + { + MethodName: "DeleteIndex", + Handler: _GrpcStore_DeleteIndex_Handler, + }, + { + MethodName: "PutChunks", + Handler: _GrpcStore_PutChunks_Handler, + }, + { + MethodName: "DeleteChunks", + Handler: _GrpcStore_DeleteChunks_Handler, + }, + { + MethodName: "ListTables", + Handler: _GrpcStore_ListTables_Handler, + }, + { + MethodName: "CreateTable", + Handler: _GrpcStore_CreateTable_Handler, + }, + { + MethodName: "DeleteTable", + Handler: _GrpcStore_DeleteTable_Handler, + }, + { + MethodName: "DescribeTable", + Handler: _GrpcStore_DescribeTable_Handler, + }, + { + MethodName: "UpdateTable", + Handler: _GrpcStore_UpdateTable_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "QueryIndex", + Handler: _GrpcStore_QueryIndex_Handler, + ServerStreams: true, + }, + { + StreamName: "GetChunks", + Handler: _GrpcStore_GetChunks_Handler, + ServerStreams: true, + }, + }, + Metadata: "pkg/storage/chunk/client/grpc/grpc.proto", +} + +func (m *PutChunksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PutChunksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PutChunksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetChunksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetChunksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetChunksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetChunksResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetChunksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetChunksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Chunk) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.Encoded) > 0 { + i -= len(m.Encoded) + copy(dAtA[i:], m.Encoded) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Encoded))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChunkID) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChunkID) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChunkID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChunkID) > 0 { + i -= len(m.ChunkID) + copy(dAtA[i:], m.ChunkID) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.ChunkID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeleteTableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteTableRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DescribeTableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DescribeTableRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DescribeTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WriteBatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteBatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deletes) > 0 { + for iNdEx := len(m.Deletes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deletes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Writes) > 0 { + for iNdEx := len(m.Writes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Writes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *WriteIndexRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WriteIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Writes) > 0 { + for iNdEx := len(m.Writes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Writes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DeleteIndexRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeleteIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deletes) > 0 { + for iNdEx := len(m.Deletes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deletes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryIndexResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIndexResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rows) > 0 { + for iNdEx := len(m.Rows) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rows[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Row) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Row) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Row) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.RangeValue) > 0 { + i -= len(m.RangeValue) + copy(dAtA[i:], m.RangeValue) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValue))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IndexEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IndexEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IndexEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x22 + } + if len(m.RangeValue) > 0 { + i -= len(m.RangeValue) + copy(dAtA[i:], m.RangeValue) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValue))) + i-- + dAtA[i] = 0x1a + } + if len(m.HashValue) > 0 { + i -= len(m.HashValue) + copy(dAtA[i:], m.HashValue) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.HashValue))) + i-- + dAtA[i] = 0x12 + } + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIndexRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Immutable { + i-- + if m.Immutable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.ValueEqual) > 0 { + i -= len(m.ValueEqual) + copy(dAtA[i:], m.ValueEqual) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.ValueEqual))) + i-- + dAtA[i] = 0x2a + } + if len(m.RangeValueStart) > 0 { + i -= len(m.RangeValueStart) + copy(dAtA[i:], m.RangeValueStart) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValueStart))) + i-- + dAtA[i] = 0x22 + } + if len(m.RangeValuePrefix) > 0 { + i -= len(m.RangeValuePrefix) + copy(dAtA[i:], m.RangeValuePrefix) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.RangeValuePrefix))) + i-- + dAtA[i] = 0x1a + } + if len(m.HashValue) > 0 { + i -= len(m.HashValue) + copy(dAtA[i:], m.HashValue) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.HashValue))) + i-- + dAtA[i] = 0x12 + } + if len(m.TableName) > 0 { + i -= len(m.TableName) + copy(dAtA[i:], m.TableName) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateTableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateTableRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expected != nil { + { + size, err := m.Expected.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Current != nil { + { + size, err := m.Current.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DescribeTableResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DescribeTableResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DescribeTableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsActive { + i-- + if m.IsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Desc != nil { + { + size, err := m.Desc.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateTableRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateTableRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Desc != nil { + { + size, err := m.Desc.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TableDesc) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TableDesc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TableDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Tags) > 0 { + for k := range m.Tags { + v := m.Tags[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGrpc(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGrpc(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGrpc(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.ProvisionedWrite != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.ProvisionedWrite)) + i-- + dAtA[i] = 0x20 + } + if m.ProvisionedRead != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.ProvisionedRead)) + i-- + dAtA[i] = 0x18 + } + if m.UseOnDemandIOMode { + i-- + if m.UseOnDemandIOMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListTablesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListTablesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListTablesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TableNames) > 0 { + for iNdEx := len(m.TableNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TableNames[iNdEx]) + copy(dAtA[i:], m.TableNames[iNdEx]) + i = encodeVarintGrpc(dAtA, i, uint64(len(m.TableNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Labels) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *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) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGrpc(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 = encodeVarintGrpc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGrpc(dAtA []byte, offset int, v uint64) int { + offset -= sovGrpc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PutChunksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *GetChunksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *GetChunksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Chunks) > 0 { + for _, e := range m.Chunks { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *Chunk) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Encoded) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *ChunkID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChunkID) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *DeleteTableRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *DescribeTableRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *WriteBatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Writes) > 0 { + for _, e := range m.Writes { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + if len(m.Deletes) > 0 { + for _, e := range m.Deletes { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *WriteIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Writes) > 0 { + for _, e := range m.Writes { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *DeleteIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deletes) > 0 { + for _, e := range m.Deletes { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *QueryIndexResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rows) > 0 { + for _, e := range m.Rows { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *Row) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RangeValue) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *IndexEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.HashValue) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.RangeValue) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *QueryIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TableName) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.HashValue) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.RangeValuePrefix) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.RangeValueStart) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.ValueEqual) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + if m.Immutable { + n += 2 + } + return n +} + +func (m *UpdateTableRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Current != nil { + l = m.Current.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if m.Expected != nil { + l = m.Expected.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *DescribeTableResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Desc != nil { + l = m.Desc.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if m.IsActive { + n += 2 + } + return n +} + +func (m *CreateTableRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Desc != nil { + l = m.Desc.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *TableDesc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + if m.UseOnDemandIOMode { + n += 2 + } + if m.ProvisionedRead != 0 { + n += 1 + sovGrpc(uint64(m.ProvisionedRead)) + } + if m.ProvisionedWrite != 0 { + n += 1 + sovGrpc(uint64(m.ProvisionedWrite)) + } + if len(m.Tags) > 0 { + for k, v := range m.Tags { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGrpc(uint64(len(k))) + 1 + len(v) + sovGrpc(uint64(len(v))) + n += mapEntrySize + 1 + sovGrpc(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ListTablesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TableNames) > 0 { + for _, s := range m.TableNames { + l = len(s) + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *Labels) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func sovGrpc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGrpc(x uint64) (n int) { + return sovGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *PutChunksRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForChunks := "[]*Chunk{" + for _, f := range this.Chunks { + repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," + } + repeatedStringForChunks += "}" + s := strings.Join([]string{`&PutChunksRequest{`, + `Chunks:` + repeatedStringForChunks + `,`, + `}`, + }, "") + return s +} +func (this *GetChunksRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForChunks := "[]*Chunk{" + for _, f := range this.Chunks { + repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," + } + repeatedStringForChunks += "}" + s := strings.Join([]string{`&GetChunksRequest{`, + `Chunks:` + repeatedStringForChunks + `,`, + `}`, + }, "") + return s +} +func (this *GetChunksResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForChunks := "[]*Chunk{" + for _, f := range this.Chunks { + repeatedStringForChunks += strings.Replace(f.String(), "Chunk", "Chunk", 1) + "," + } + repeatedStringForChunks += "}" + s := strings.Join([]string{`&GetChunksResponse{`, + `Chunks:` + repeatedStringForChunks + `,`, + `}`, + }, "") + return s +} +func (this *Chunk) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Chunk{`, + `Encoded:` + fmt.Sprintf("%v", this.Encoded) + `,`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `}`, + }, "") + return s +} +func (this *ChunkID) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ChunkID{`, + `ChunkID:` + fmt.Sprintf("%v", this.ChunkID) + `,`, + `}`, + }, "") + return s +} +func (this *DeleteTableRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeleteTableRequest{`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `}`, + }, "") + return s +} +func (this *DescribeTableRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DescribeTableRequest{`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `}`, + }, "") + return s +} +func (this *WriteBatch) String() string { + if this == nil { + return "nil" + } + repeatedStringForWrites := "[]*IndexEntry{" + for _, f := range this.Writes { + repeatedStringForWrites += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," + } + repeatedStringForWrites += "}" + repeatedStringForDeletes := "[]*IndexEntry{" + for _, f := range this.Deletes { + repeatedStringForDeletes += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," + } + repeatedStringForDeletes += "}" + s := strings.Join([]string{`&WriteBatch{`, + `Writes:` + repeatedStringForWrites + `,`, + `Deletes:` + repeatedStringForDeletes + `,`, + `}`, + }, "") + return s +} +func (this *WriteIndexRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForWrites := "[]*IndexEntry{" + for _, f := range this.Writes { + repeatedStringForWrites += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," + } + repeatedStringForWrites += "}" + s := strings.Join([]string{`&WriteIndexRequest{`, + `Writes:` + repeatedStringForWrites + `,`, + `}`, + }, "") + return s +} +func (this *DeleteIndexRequest) String() string { + if this == nil { + return "nil" + } + repeatedStringForDeletes := "[]*IndexEntry{" + for _, f := range this.Deletes { + repeatedStringForDeletes += strings.Replace(f.String(), "IndexEntry", "IndexEntry", 1) + "," + } + repeatedStringForDeletes += "}" + s := strings.Join([]string{`&DeleteIndexRequest{`, + `Deletes:` + repeatedStringForDeletes + `,`, + `}`, + }, "") + return s +} +func (this *QueryIndexResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForRows := "[]*Row{" + for _, f := range this.Rows { + repeatedStringForRows += strings.Replace(f.String(), "Row", "Row", 1) + "," + } + repeatedStringForRows += "}" + s := strings.Join([]string{`&QueryIndexResponse{`, + `Rows:` + repeatedStringForRows + `,`, + `}`, + }, "") + return s +} +func (this *Row) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Row{`, + `RangeValue:` + fmt.Sprintf("%v", this.RangeValue) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *IndexEntry) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IndexEntry{`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `HashValue:` + fmt.Sprintf("%v", this.HashValue) + `,`, + `RangeValue:` + fmt.Sprintf("%v", this.RangeValue) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *QueryIndexRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QueryIndexRequest{`, + `TableName:` + fmt.Sprintf("%v", this.TableName) + `,`, + `HashValue:` + fmt.Sprintf("%v", this.HashValue) + `,`, + `RangeValuePrefix:` + fmt.Sprintf("%v", this.RangeValuePrefix) + `,`, + `RangeValueStart:` + fmt.Sprintf("%v", this.RangeValueStart) + `,`, + `ValueEqual:` + fmt.Sprintf("%v", this.ValueEqual) + `,`, + `Immutable:` + fmt.Sprintf("%v", this.Immutable) + `,`, + `}`, + }, "") + return s +} +func (this *UpdateTableRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdateTableRequest{`, + `Current:` + strings.Replace(this.Current.String(), "TableDesc", "TableDesc", 1) + `,`, + `Expected:` + strings.Replace(this.Expected.String(), "TableDesc", "TableDesc", 1) + `,`, + `}`, + }, "") + return s +} +func (this *DescribeTableResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DescribeTableResponse{`, + `Desc:` + strings.Replace(this.Desc.String(), "TableDesc", "TableDesc", 1) + `,`, + `IsActive:` + fmt.Sprintf("%v", this.IsActive) + `,`, + `}`, + }, "") + return s +} +func (this *CreateTableRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateTableRequest{`, + `Desc:` + strings.Replace(this.Desc.String(), "TableDesc", "TableDesc", 1) + `,`, + `}`, + }, "") + return s +} +func (this *TableDesc) String() string { + if this == nil { + return "nil" + } + keysForTags := make([]string, 0, len(this.Tags)) + for k, _ := range this.Tags { + keysForTags = append(keysForTags, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForTags) + mapStringForTags := "map[string]string{" + for _, k := range keysForTags { + mapStringForTags += fmt.Sprintf("%v: %v,", k, this.Tags[k]) + } + mapStringForTags += "}" + s := strings.Join([]string{`&TableDesc{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `UseOnDemandIOMode:` + fmt.Sprintf("%v", this.UseOnDemandIOMode) + `,`, + `ProvisionedRead:` + fmt.Sprintf("%v", this.ProvisionedRead) + `,`, + `ProvisionedWrite:` + fmt.Sprintf("%v", this.ProvisionedWrite) + `,`, + `Tags:` + mapStringForTags + `,`, + `}`, + }, "") + return s +} +func (this *ListTablesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ListTablesResponse{`, + `TableNames:` + fmt.Sprintf("%v", this.TableNames) + `,`, + `}`, + }, "") + return s +} +func (this *Labels) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Labels{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func valueToStringGrpc(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *PutChunksRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PutChunksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PutChunksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, &Chunk{}) + if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetChunksRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetChunksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetChunksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, &Chunk{}) + if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetChunksResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetChunksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetChunksResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Chunks = append(m.Chunks, &Chunk{}) + if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Chunk) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Chunk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Encoded", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Encoded = append(m.Encoded[:0], dAtA[iNdEx:postIndex]...) + if m.Encoded == nil { + m.Encoded = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChunkID) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChunkID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChunkID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteTableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteTableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DescribeTableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DescribeTableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DescribeTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WriteBatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteBatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteBatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Writes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Writes = append(m.Writes, &IndexEntry{}) + if err := m.Writes[len(m.Writes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deletes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deletes = append(m.Deletes, &IndexEntry{}) + if err := m.Deletes[len(m.Deletes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WriteIndexRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WriteIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WriteIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Writes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Writes = append(m.Writes, &IndexEntry{}) + if err := m.Writes[len(m.Writes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteIndexRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deletes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deletes = append(m.Deletes, &IndexEntry{}) + if err := m.Deletes[len(m.Deletes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIndexResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIndexResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rows = append(m.Rows, &Row{}) + if err := m.Rows[len(m.Rows)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Row) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Row: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Row: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeValue = append(m.RangeValue[:0], dAtA[iNdEx:postIndex]...) + if m.RangeValue == nil { + m.RangeValue = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IndexEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IndexEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IndexEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HashValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeValue = append(m.RangeValue[:0], dAtA[iNdEx:postIndex]...) + if m.RangeValue == nil { + m.RangeValue = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIndexRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIndexRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HashValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeValuePrefix", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeValuePrefix = append(m.RangeValuePrefix[:0], dAtA[iNdEx:postIndex]...) + if m.RangeValuePrefix == nil { + m.RangeValuePrefix = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RangeValueStart", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RangeValueStart = append(m.RangeValueStart[:0], dAtA[iNdEx:postIndex]...) + if m.RangeValueStart == nil { + m.RangeValueStart = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueEqual", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValueEqual = append(m.ValueEqual[:0], dAtA[iNdEx:postIndex]...) + if m.ValueEqual == nil { + m.ValueEqual = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Immutable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Immutable = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateTableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateTableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Current == nil { + m.Current = &TableDesc{} + } + if err := m.Current.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expected", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expected == nil { + m.Expected = &TableDesc{} + } + if err := m.Expected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DescribeTableResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DescribeTableResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DescribeTableResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Desc == nil { + m.Desc = &TableDesc{} + } + if err := m.Desc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsActive = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateTableRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateTableRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateTableRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Desc", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Desc == nil { + m.Desc = &TableDesc{} + } + if err := m.Desc.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TableDesc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TableDesc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TableDesc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseOnDemandIOMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UseOnDemandIOMode = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProvisionedRead", wireType) + } + m.ProvisionedRead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProvisionedRead |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProvisionedWrite", wireType) + } + m.ProvisionedWrite = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProvisionedWrite |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tags == nil { + m.Tags = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGrpc + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGrpc + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGrpc + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGrpc + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Tags[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListTablesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListTablesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListTablesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableNames = append(m.TableNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Labels) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Labels: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Labels: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGrpc(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGrpc + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGrpc + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGrpc + } + 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 := skipGrpc(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGrpc + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGrpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGrpc = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/storage/stores/series/index/caching_index_client.pb.go b/pkg/storage/stores/series/index/caching_index_client.pb.go new file mode 100644 index 0000000000000..c441cdb6442a1 --- /dev/null +++ b/pkg/storage/stores/series/index/caching_index_client.pb.go @@ -0,0 +1,845 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/storage/stores/series/index/caching_index_client.proto + +package index + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type CacheEntry struct { + Column Bytes `protobuf:"bytes,1,opt,name=Column,proto3,customtype=Bytes" json:"Column"` + Value Bytes `protobuf:"bytes,2,opt,name=Value,proto3,customtype=Bytes" json:"Value"` +} + +func (m *CacheEntry) Reset() { *m = CacheEntry{} } +func (*CacheEntry) ProtoMessage() {} +func (*CacheEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_1a3c8533c7598e01, []int{0} +} +func (m *CacheEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CacheEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CacheEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CacheEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheEntry.Merge(m, src) +} +func (m *CacheEntry) XXX_Size() int { + return m.Size() +} +func (m *CacheEntry) XXX_DiscardUnknown() { + xxx_messageInfo_CacheEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_CacheEntry proto.InternalMessageInfo + +type ReadBatch struct { + Entries []CacheEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // The time at which the key expires. + Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` + // The number of entries; used for cardinality limiting. + // entries will be empty when this is set. + Cardinality int32 `protobuf:"varint,4,opt,name=cardinality,proto3" json:"cardinality,omitempty"` +} + +func (m *ReadBatch) Reset() { *m = ReadBatch{} } +func (*ReadBatch) ProtoMessage() {} +func (*ReadBatch) Descriptor() ([]byte, []int) { + return fileDescriptor_1a3c8533c7598e01, []int{1} +} +func (m *ReadBatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ReadBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ReadBatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ReadBatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReadBatch.Merge(m, src) +} +func (m *ReadBatch) XXX_Size() int { + return m.Size() +} +func (m *ReadBatch) XXX_DiscardUnknown() { + xxx_messageInfo_ReadBatch.DiscardUnknown(m) +} + +var xxx_messageInfo_ReadBatch proto.InternalMessageInfo + +func (m *ReadBatch) GetEntries() []CacheEntry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *ReadBatch) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *ReadBatch) GetExpiry() int64 { + if m != nil { + return m.Expiry + } + return 0 +} + +func (m *ReadBatch) GetCardinality() int32 { + if m != nil { + return m.Cardinality + } + return 0 +} + +func init() { + proto.RegisterType((*CacheEntry)(nil), "index.CacheEntry") + proto.RegisterType((*ReadBatch)(nil), "index.ReadBatch") +} + +func init() { + proto.RegisterFile("pkg/storage/stores/series/index/caching_index_client.proto", fileDescriptor_1a3c8533c7598e01) +} + +var fileDescriptor_1a3c8533c7598e01 = []byte{ + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x50, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0xbe, 0xfb, 0xa5, 0xe9, 0x8f, 0x5e, 0x15, 0xf4, 0x10, 0x09, 0x0e, 0x6f, 0x43, 0x45, 0xc8, + 0xd4, 0xe0, 0x9f, 0xc9, 0x31, 0xc5, 0x2f, 0x90, 0x41, 0xdc, 0xca, 0x99, 0xbe, 0xa4, 0x47, 0xe3, + 0xa5, 0x24, 0x57, 0x68, 0x36, 0x67, 0x27, 0x3f, 0x86, 0x1f, 0xa5, 0x63, 0xc7, 0xe2, 0x50, 0xec, + 0x75, 0x71, 0xec, 0x47, 0x90, 0x5c, 0x2b, 0x3a, 0x38, 0xdd, 0xf3, 0x8f, 0x7b, 0x1e, 0x5e, 0x76, + 0x3b, 0x19, 0xa7, 0x61, 0xa9, 0xf3, 0x42, 0xa4, 0x68, 0x5f, 0x2c, 0xc3, 0x12, 0x0b, 0x89, 0x65, + 0x28, 0xd5, 0x10, 0x67, 0x61, 0x22, 0x92, 0x91, 0x54, 0xe9, 0xc0, 0xb2, 0x41, 0x92, 0x49, 0x54, + 0xba, 0x37, 0x29, 0x72, 0x9d, 0x73, 0xd7, 0x6a, 0x67, 0x27, 0x69, 0x9e, 0xe6, 0x56, 0x09, 0x6b, + 0xb4, 0x33, 0xbb, 0x0f, 0x8c, 0xf5, 0x45, 0x32, 0xc2, 0x3b, 0xa5, 0x8b, 0x8a, 0x5f, 0xb0, 0x66, + 0x3f, 0xcf, 0xa6, 0x4f, 0xca, 0xa3, 0x3e, 0x0d, 0x0e, 0xa2, 0xc3, 0xf9, 0xaa, 0x43, 0xde, 0x57, + 0x1d, 0x37, 0xaa, 0x34, 0x96, 0xf1, 0xde, 0xe4, 0xe7, 0xcc, 0xbd, 0x17, 0xd9, 0x14, 0xbd, 0x7f, + 0x7f, 0xa5, 0x76, 0x5e, 0xf7, 0x85, 0xb2, 0x56, 0x8c, 0x62, 0x18, 0x09, 0x9d, 0x8c, 0xf8, 0x25, + 0xfb, 0x8f, 0x4a, 0xd7, 0x83, 0x3d, 0xea, 0x3b, 0x41, 0xfb, 0xea, 0xb8, 0x67, 0x67, 0xf5, 0x7e, + 0xda, 0xa3, 0x46, 0xfd, 0x4f, 0xfc, 0x9d, 0xe3, 0x47, 0xcc, 0x19, 0x63, 0x65, 0x3b, 0x5a, 0x71, + 0x0d, 0xf9, 0x29, 0x6b, 0xe2, 0x6c, 0x22, 0x8b, 0xca, 0x73, 0x7c, 0x1a, 0x38, 0xf1, 0x9e, 0x71, + 0x9f, 0xb5, 0x13, 0x51, 0x0c, 0xa5, 0x12, 0x99, 0xd4, 0x95, 0xd7, 0xf0, 0x69, 0xe0, 0xc6, 0xbf, + 0xa5, 0xe8, 0x66, 0xb1, 0x06, 0xb2, 0x5c, 0x03, 0xd9, 0xae, 0x81, 0x3e, 0x1b, 0xa0, 0x6f, 0x06, + 0xe8, 0xdc, 0x00, 0x5d, 0x18, 0xa0, 0x1f, 0x06, 0xe8, 0xa7, 0x01, 0xb2, 0x35, 0x40, 0x5f, 0x37, + 0x40, 0x16, 0x1b, 0x20, 0xcb, 0x0d, 0x90, 0xc7, 0xa6, 0xbd, 0xd1, 0xf5, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xad, 0xdc, 0x48, 0x36, 0x7e, 0x01, 0x00, 0x00, +} + +func (this *CacheEntry) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CacheEntry) + if !ok { + that2, ok := that.(CacheEntry) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Column.Equal(that1.Column) { + return false + } + if !this.Value.Equal(that1.Value) { + return false + } + return true +} +func (this *ReadBatch) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ReadBatch) + if !ok { + that2, ok := that.(ReadBatch) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Entries) != len(that1.Entries) { + return false + } + for i := range this.Entries { + if !this.Entries[i].Equal(&that1.Entries[i]) { + return false + } + } + if this.Key != that1.Key { + return false + } + if this.Expiry != that1.Expiry { + return false + } + if this.Cardinality != that1.Cardinality { + return false + } + return true +} +func (this *CacheEntry) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&index.CacheEntry{") + s = append(s, "Column: "+fmt.Sprintf("%#v", this.Column)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ReadBatch) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&index.ReadBatch{") + if this.Entries != nil { + vs := make([]*CacheEntry, len(this.Entries)) + for i := range vs { + vs[i] = &this.Entries[i] + } + s = append(s, "Entries: "+fmt.Sprintf("%#v", vs)+",\n") + } + s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") + s = append(s, "Expiry: "+fmt.Sprintf("%#v", this.Expiry)+",\n") + s = append(s, "Cardinality: "+fmt.Sprintf("%#v", this.Cardinality)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringCachingIndexClient(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *CacheEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CacheEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CacheEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Column.Size() + i -= size + if _, err := m.Column.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ReadBatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReadBatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReadBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Cardinality != 0 { + i = encodeVarintCachingIndexClient(dAtA, i, uint64(m.Cardinality)) + i-- + dAtA[i] = 0x20 + } + if m.Expiry != 0 { + i = encodeVarintCachingIndexClient(dAtA, i, uint64(m.Expiry)) + i-- + dAtA[i] = 0x18 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintCachingIndexClient(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCachingIndexClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintCachingIndexClient(dAtA []byte, offset int, v uint64) int { + offset -= sovCachingIndexClient(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CacheEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Column.Size() + n += 1 + l + sovCachingIndexClient(uint64(l)) + l = m.Value.Size() + n += 1 + l + sovCachingIndexClient(uint64(l)) + return n +} + +func (m *ReadBatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovCachingIndexClient(uint64(l)) + } + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovCachingIndexClient(uint64(l)) + } + if m.Expiry != 0 { + n += 1 + sovCachingIndexClient(uint64(m.Expiry)) + } + if m.Cardinality != 0 { + n += 1 + sovCachingIndexClient(uint64(m.Cardinality)) + } + return n +} + +func sovCachingIndexClient(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCachingIndexClient(x uint64) (n int) { + return sovCachingIndexClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *CacheEntry) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CacheEntry{`, + `Column:` + fmt.Sprintf("%v", this.Column) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *ReadBatch) String() string { + if this == nil { + return "nil" + } + repeatedStringForEntries := "[]CacheEntry{" + for _, f := range this.Entries { + repeatedStringForEntries += strings.Replace(strings.Replace(f.String(), "CacheEntry", "CacheEntry", 1), `&`, ``, 1) + "," + } + repeatedStringForEntries += "}" + s := strings.Join([]string{`&ReadBatch{`, + `Entries:` + repeatedStringForEntries + `,`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Expiry:` + fmt.Sprintf("%v", this.Expiry) + `,`, + `Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`, + `}`, + }, "") + return s +} +func valueToStringCachingIndexClient(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *CacheEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CacheEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CacheEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Column", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCachingIndexClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCachingIndexClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Column.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCachingIndexClient + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCachingIndexClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCachingIndexClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCachingIndexClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCachingIndexClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ReadBatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReadBatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReadBatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCachingIndexClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCachingIndexClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, CacheEntry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCachingIndexClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCachingIndexClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) + } + m.Expiry = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Expiry |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cardinality", wireType) + } + m.Cardinality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Cardinality |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCachingIndexClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCachingIndexClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCachingIndexClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCachingIndexClient(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCachingIndexClient + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCachingIndexClient + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthCachingIndexClient + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCachingIndexClient + } + 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 := skipCachingIndexClient(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthCachingIndexClient + } + } + 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) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthCachingIndexClient = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCachingIndexClient = fmt.Errorf("proto: integer overflow") +) From 4f3b9d8397eb81c82d5abaa390f3adcd1af37a17 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 12:12:20 +0100 Subject: [PATCH 03/25] Start fixing tests --- pkg/logcli/client/file.go | 7 +- pkg/logcli/query/query.go | 2 +- pkg/logcli/query/query_test.go | 8 +- pkg/logql/downstream.go | 4 +- pkg/logql/downstream_test.go | 12 +- pkg/logql/engine.go | 2 +- pkg/logql/engine_test.go | 64 +++--- pkg/querier/plan/plan.go | 11 +- pkg/querier/queryrange/queryrange.pb.go | 264 +++++++++++++++--------- pkg/querier/queryrange/queryrange.proto | 2 +- 10 files changed, 228 insertions(+), 148 deletions(-) diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index c94fc4e3e7e61..1c5eade6c3c7e 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -80,7 +80,12 @@ func (f *FileClient) Query(q string, limit int, t time.Time, direction logproto. nil, ) - query := f.engine.Query(params) + parsed, err := syntax.ParseExpr(q) + if err != nil { + return nil, err + } + + query := f.engine.Query(params, parsed) result, err := query.Exec(ctx) if err != nil { diff --git a/pkg/logcli/query/query.go b/pkg/logcli/query/query.go index 5b8ceb8c3081d..b19b38f671286 100644 --- a/pkg/logcli/query/query.go +++ b/pkg/logcli/query/query.go @@ -477,7 +477,7 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string q.resultsDirection(), uint32(q.Limit), nil, - )) + ), parsed) } // execute the query diff --git a/pkg/logcli/query/query_test.go b/pkg/logcli/query/query_test.go index 72886fb84668d..e0de299883dd8 100644 --- a/pkg/logcli/query/query_test.go +++ b/pkg/logcli/query/query_test.go @@ -21,6 +21,7 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/loki" "github.com/grafana/loki/pkg/storage" "github.com/grafana/loki/pkg/storage/chunk/client/local" @@ -427,7 +428,12 @@ func (t *testQueryClient) QueryRange(queryStr string, limit int, from, through t params := logql.NewLiteralParams(queryStr, from, through, step, interval, direction, uint32(limit), nil) - v, err := t.engine.Query(params).Exec(ctx) + parsed, err := syntax.ParseExpr(queryStr) + if err != nil { + return nil, err + } + + v, err := t.engine.Query(params, parsed).Exec(ctx) if err != nil { return nil, err } diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index 26b4249806d72..c1800b56d45bd 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -67,8 +67,8 @@ func (ng *DownstreamEngine) Query(ctx context.Context, p Params, mapped syntax.E logger: ng.logger, params: p, evaluator: NewDownstreamEvaluator(ng.downstreamable.Downstreamer(ctx)), - queryExpr: mapped, - limits: ng.limits, + queryExpr: mapped, + limits: ng.limits, } } diff --git a/pkg/logql/downstream_test.go b/pkg/logql/downstream_test.go index c5f54b9e1c056..cea40a29a7baf 100644 --- a/pkg/logql/downstream_test.go +++ b/pkg/logql/downstream_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logql/syntax" ) var nilShardMetrics = NewShardMapperMetrics(nil) @@ -79,7 +80,11 @@ func TestMappingEquivalence(t *testing.T) { uint32(limit), nil, ) - qry := regular.Query(params) + + parsed, err := syntax.ParseExpr(tc.query) + require.NoError(t, err) + + qry := regular.Query(params, parsed) ctx := user.InjectOrgID(context.Background(), "fake") mapper := NewShardMapper(ConstantShards(shards), nilShardMetrics) @@ -404,8 +409,11 @@ func TestRangeMappingEquivalence(t *testing.T) { nil, ) + parsed, err := syntax.ParseExpr(tc.query) + require.NoError(t, err) + // Regular engine - qry := regularEngine.Query(params) + qry := regularEngine.Query(params, parsed) res, err := qry.Exec(ctx) require.Nil(t, err) diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 2379acdb1a4a5..a1d14d8febd41 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -163,7 +163,7 @@ func (ng *Engine) Query(params Params, parsedQuery syntax.Expr) Query { logger: ng.logger, params: params, evaluator: ng.evaluatorFactory, - queryExpr: parsedQuery, + queryExpr: parsedQuery, record: true, logExecQuery: ng.opts.LogExecutingQuery, limits: ng.limits, diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index ef7d5e0538e3d..c0d04b90a5f3f 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -128,6 +128,9 @@ func TestEngine_LogsRateUnwrap(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(t, err) + eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) q := eng.Query(LiteralParams{ qs: test.qs, @@ -135,7 +138,7 @@ func TestEngine_LogsRateUnwrap(t *testing.T) { end: test.ts, direction: test.direction, limit: test.limit, - }) + }, parsed) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if expectedError, ok := test.expected.(error); ok { assert.Equal(t, expectedError.Error(), err.Error()) @@ -959,6 +962,9 @@ func TestEngine_LogsInstantQuery(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(t, err) + eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) q := eng.Query(LiteralParams{ qs: test.qs, @@ -966,7 +972,7 @@ func TestEngine_LogsInstantQuery(t *testing.T) { end: test.ts, direction: test.direction, limit: test.limit, - }) + }, parsed) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if expectedError, ok := test.expected.(error); ok { assert.Equal(t, expectedError.Error(), err.Error()) @@ -2264,6 +2270,9 @@ func TestEngine_RangeQuery(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(t, err) + eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) q := eng.Query(LiteralParams{ @@ -2274,7 +2283,7 @@ func TestEngine_RangeQuery(t *testing.T) { interval: test.interval, direction: test.direction, limit: test.limit, - }) + }, parsed) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if err != nil { t.Fatal(err) @@ -2301,6 +2310,10 @@ func (statsQuerier) SelectSamples(ctx context.Context, _ SelectSampleParams) (it func TestEngine_Stats(t *testing.T) { eng := NewEngine(EngineOpts{}, &statsQuerier{}, NoLimits, log.NewNopLogger()) + qs := `{foo="bar"}` + parsed, err := syntax.ParseExpr(qs) + require.NoError(t, err) + queueTime := 2 * time.Nanosecond q := eng.Query(LiteralParams{ qs: `{foo="bar"}`, @@ -2308,7 +2321,7 @@ func TestEngine_Stats(t *testing.T) { end: time.Now(), direction: logproto.BACKWARD, limit: 1000, - }) + }, parsed) ctx := context.WithValue(context.Background(), httpreq.QueryQueueTimeHTTPHeader, queueTime) r, err := q.Exec(user.InjectOrgID(ctx, "fake")) require.NoError(t, err) @@ -2338,13 +2351,17 @@ func (metaQuerier) SelectSamples(ctx context.Context, _ SelectSampleParams) (ite func TestEngine_Metadata(t *testing.T) { eng := NewEngine(EngineOpts{}, &metaQuerier{}, NoLimits, log.NewNopLogger()) + qs := `{foo="bar"}` + parsed, err := syntax.ParseExpr(qs) + require.NoError(t, err) + q := eng.Query(LiteralParams{ - qs: `{foo="bar"}`, + qs: qs, start: time.Now(), end: time.Now(), direction: logproto.BACKWARD, limit: 1000, - }) + }, parsed) r, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) require.NoError(t, err) @@ -2353,40 +2370,13 @@ func TestEngine_Metadata(t *testing.T) { }, r.Headers) } -func TestEngine_LogsInstantQuery_IllegalLogql(t *testing.T) { - eng := NewEngine(EngineOpts{}, &statsQuerier{}, NoLimits, log.NewNopLogger()) - - queueTime := 2 * time.Nanosecond - illegalVector := `vector(abc)` - q := eng.Query(LiteralParams{ - qs: illegalVector, - start: time.Now(), - end: time.Now(), - step: time.Second * 30, - interval: time.Second * 30, - direction: logproto.BACKWARD, - limit: 1000, - }) - expectErr := logqlmodel.NewParseError("syntax error: unexpected IDENTIFIER, expecting NUMBER", 1, 8) - ctx := context.WithValue(context.Background(), httpreq.QueryQueueTimeHTTPHeader, queueTime) - _, err := q.Exec(user.InjectOrgID(ctx, "fake")) - - require.EqualError(t, err, expectErr.Error()) - - qry, ok := q.(*query) - require.Equal(t, ok, true) - vectorExpr := syntax.NewVectorExpr(illegalVector) - - _, err = qry.evalSample(ctx, vectorExpr) - expectEvalSampleErr := logqlmodel.NewParseError("unable to parse vectorExpr as a float: strconv.ParseFloat: parsing \"vector(abc)\": invalid syntax", 0, 0) - require.EqualError(t, err, expectEvalSampleErr.Error()) -} - func TestEngine_LogsInstantQuery_Vector(t *testing.T) { eng := NewEngine(EngineOpts{}, &statsQuerier{}, NoLimits, log.NewNopLogger()) now := time.Now() queueTime := 2 * time.Nanosecond logqlVector := `vector(5)` + parsed, err := syntax.ParseExpr(logqlVector) + require.NoError(t, err) q := eng.Query(LiteralParams{ qs: logqlVector, start: now, @@ -2395,9 +2385,9 @@ func TestEngine_LogsInstantQuery_Vector(t *testing.T) { interval: time.Second * 30, direction: logproto.BACKWARD, limit: 1000, - }) + }, parsed) ctx := context.WithValue(context.Background(), httpreq.QueryQueueTimeHTTPHeader, queueTime) - _, err := q.Exec(user.InjectOrgID(ctx, "fake")) + _, err = q.Exec(user.InjectOrgID(ctx, "fake")) require.NoError(t, err) diff --git a/pkg/querier/plan/plan.go b/pkg/querier/plan/plan.go index 43f802d07159d..6954874ea6ebd 100644 --- a/pkg/querier/plan/plan.go +++ b/pkg/querier/plan/plan.go @@ -57,5 +57,14 @@ func (t *QueryPlan) UnmarshalJSON(data []byte) error { } func (t QueryPlan) Equal(other QueryPlan) bool { - return syntax.Equal(t.AST, other.AST) + left, err := t.Marshal() + if err != nil { + return false + } + + right, err := other.Marshal() + if err != nil { + return false + } + return bytes.Equal(left, right) } diff --git a/pkg/querier/queryrange/queryrange.pb.go b/pkg/querier/queryrange/queryrange.pb.go index f113127d7b428..c2cce1dc514fd 100644 --- a/pkg/querier/queryrange/queryrange.pb.go +++ b/pkg/querier/queryrange/queryrange.pb.go @@ -149,12 +149,13 @@ func (m *LokiRequest) GetShards() []string { } type LokiInstantRequest struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - TimeTs time.Time `protobuf:"bytes,3,opt,name=timeTs,proto3,stdtime" json:"timeTs"` - Direction logproto.Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` - Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` - Shards []string `protobuf:"bytes,6,rep,name=shards,proto3" json:"shards"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + TimeTs time.Time `protobuf:"bytes,3,opt,name=timeTs,proto3,stdtime" json:"timeTs"` + Direction logproto.Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"` + Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` + Shards []string `protobuf:"bytes,6,rep,name=shards,proto3" json:"shards"` + Plan *github_com_grafana_loki_pkg_querier_plan.QueryPlan `protobuf:"bytes,7,opt,name=plan,proto3,customtype=github.com/grafana/loki/pkg/querier/plan.QueryPlan" json:"plan,omitempty"` } func (m *LokiInstantRequest) Reset() { *m = LokiInstantRequest{} } @@ -1125,100 +1126,101 @@ func init() { } var fileDescriptor_51b9d53b40d11902 = []byte{ - // 1488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0xfa, 0x33, 0x9e, 0x7c, 0x50, 0x26, 0x51, 0xba, 0xa4, 0x65, 0xd7, 0xb2, 0x44, 0x6b, - 0x10, 0xac, 0x69, 0x52, 0xfa, 0x09, 0x88, 0x2e, 0x6d, 0x95, 0x42, 0x8b, 0xda, 0x4d, 0xc4, 0x81, - 0xdb, 0x24, 0x9e, 0xd8, 0x8b, 0xf7, 0x2b, 0x3b, 0xe3, 0xa8, 0xb9, 0xf1, 0x03, 0x40, 0xea, 0x0f, - 0xe0, 0x8c, 0x90, 0xa8, 0x90, 0xb8, 0x72, 0xe4, 0xd4, 0x63, 0x8f, 0x95, 0x25, 0x16, 0xea, 0x72, - 0x80, 0x9c, 0xfa, 0x13, 0xd0, 0x7c, 0xec, 0x7a, 0xd7, 0x76, 0x5a, 0xa7, 0x5c, 0x5a, 0x89, 0x4b, - 0x32, 0x33, 0xfb, 0x3e, 0xbb, 0x33, 0xcf, 0xf3, 0xbc, 0xef, 0xcc, 0x18, 0x9c, 0x0e, 0xba, 0xed, - 0xe6, 0x6e, 0x0f, 0x87, 0x36, 0x0e, 0xf9, 0xff, 0xfd, 0x10, 0x79, 0x6d, 0x9c, 0x6a, 0x1a, 0x41, - 0xe8, 0x53, 0x1f, 0x82, 0xe1, 0xc8, 0xca, 0x6a, 0xdb, 0xa6, 0x9d, 0xde, 0x96, 0xb1, 0xed, 0xbb, - 0xcd, 0xb6, 0xdf, 0xf6, 0x9b, 0x6d, 0xdf, 0x6f, 0x3b, 0x18, 0x05, 0x36, 0x91, 0xcd, 0x66, 0x18, - 0x6c, 0x37, 0x09, 0x45, 0xb4, 0x47, 0x04, 0x7e, 0x65, 0x89, 0x05, 0xf2, 0x26, 0x87, 0xc8, 0x51, - 0x5d, 0x86, 0xf3, 0xde, 0x56, 0x6f, 0xa7, 0x49, 0x6d, 0x17, 0x13, 0x8a, 0xdc, 0x40, 0x06, 0x9c, - 0x60, 0xf3, 0x73, 0xfc, 0xb6, 0x40, 0xc6, 0x0d, 0xf9, 0xf0, 0x8d, 0xcc, 0x43, 0xd2, 0xc5, 0x74, - 0xbb, 0x23, 0x1f, 0xd5, 0xe4, 0xa3, 0x5d, 0xc7, 0xf5, 0x5b, 0xd8, 0xe1, 0x73, 0x21, 0xe2, 0xaf, - 0x8c, 0x58, 0x64, 0x11, 0x41, 0x8f, 0x74, 0xf8, 0x1f, 0x39, 0xf8, 0xe9, 0x73, 0xe9, 0xd8, 0x42, - 0x04, 0x37, 0x5b, 0x78, 0xc7, 0xf6, 0x6c, 0x6a, 0xfb, 0x1e, 0x49, 0xb7, 0xe5, 0x4b, 0xce, 0x4d, - 0xf7, 0x92, 0x51, 0x8a, 0xeb, 0xdf, 0x17, 0xc0, 0xec, 0x4d, 0xbf, 0x6b, 0x5b, 0x78, 0xb7, 0x87, - 0x09, 0x85, 0x4b, 0xa0, 0xc4, 0x63, 0x54, 0xa5, 0xa6, 0x34, 0xaa, 0x96, 0xe8, 0xb0, 0x51, 0xc7, - 0x76, 0x6d, 0xaa, 0xe6, 0x6b, 0x4a, 0x63, 0xde, 0x12, 0x1d, 0x08, 0x41, 0x91, 0x50, 0x1c, 0xa8, - 0x85, 0x9a, 0xd2, 0x28, 0x58, 0xbc, 0x0d, 0x57, 0xc0, 0x8c, 0xed, 0x51, 0x1c, 0xee, 0x21, 0x47, - 0xad, 0xf2, 0xf1, 0xa4, 0x0f, 0x3f, 0x06, 0x15, 0x42, 0x51, 0x48, 0x37, 0x89, 0x5a, 0xac, 0x29, - 0x8d, 0xd9, 0xd5, 0x15, 0x43, 0x48, 0x61, 0xc4, 0x52, 0x18, 0x9b, 0xb1, 0x14, 0xe6, 0xcc, 0x83, - 0x48, 0xcf, 0xdd, 0xfb, 0x43, 0x57, 0xac, 0x18, 0x04, 0x2f, 0x81, 0x12, 0xf6, 0x5a, 0x9b, 0x44, - 0x2d, 0x1d, 0x01, 0x2d, 0x20, 0xf0, 0x0c, 0xa8, 0xb6, 0xec, 0x10, 0x6f, 0x33, 0xce, 0xd4, 0x72, - 0x4d, 0x69, 0x2c, 0xac, 0x2e, 0x1a, 0x89, 0xb4, 0x57, 0xe3, 0x47, 0xd6, 0x30, 0x8a, 0x2d, 0x2f, - 0x40, 0xb4, 0xa3, 0x56, 0x38, 0x13, 0xbc, 0x0d, 0xeb, 0xa0, 0x4c, 0x3a, 0x28, 0x6c, 0x11, 0x75, - 0xa6, 0x56, 0x68, 0x54, 0x4d, 0x70, 0x10, 0xe9, 0x72, 0xc4, 0x92, 0xff, 0xe1, 0x67, 0xa0, 0x18, - 0x38, 0xc8, 0x53, 0x41, 0x4d, 0x69, 0xcc, 0x99, 0xe7, 0xfa, 0x91, 0x9e, 0xf1, 0x6e, 0x88, 0x76, - 0x90, 0x87, 0x9a, 0x8e, 0xdf, 0xb5, 0x9b, 0x69, 0xd1, 0x18, 0xc6, 0xb8, 0xc3, 0xe8, 0xbe, 0xed, - 0x20, 0xcf, 0xe2, 0xef, 0xa8, 0xff, 0xa3, 0x00, 0xc8, 0xe4, 0xb9, 0xe1, 0x11, 0x8a, 0x3c, 0xfa, - 0x22, 0x2a, 0x7d, 0x08, 0xca, 0xcc, 0xe0, 0x9b, 0x84, 0xeb, 0x34, 0x2d, 0x6d, 0x12, 0x93, 0xe5, - 0xad, 0x78, 0x24, 0xde, 0x4a, 0x13, 0x79, 0x2b, 0x1f, 0xc6, 0x5b, 0xfd, 0xa7, 0x22, 0x98, 0x13, - 0x56, 0x24, 0x81, 0xef, 0x11, 0xcc, 0x40, 0x1b, 0x3c, 0x9d, 0xc5, 0x32, 0x25, 0x88, 0x8f, 0x58, - 0xf2, 0x09, 0xfc, 0x04, 0x14, 0xaf, 0x22, 0x8a, 0xf8, 0x92, 0x67, 0x57, 0x97, 0x8c, 0x94, 0xc1, - 0xd9, 0xbb, 0xd8, 0x33, 0x73, 0x99, 0xad, 0xea, 0x20, 0xd2, 0x17, 0x5a, 0x88, 0xa2, 0x77, 0x7d, - 0xd7, 0xa6, 0xd8, 0x0d, 0xe8, 0xbe, 0xc5, 0x91, 0xf0, 0x03, 0x50, 0xbd, 0x16, 0x86, 0x7e, 0xb8, - 0xb9, 0x1f, 0x60, 0x4e, 0x51, 0xd5, 0x3c, 0x7e, 0x10, 0xe9, 0x8b, 0x38, 0x1e, 0x4c, 0x21, 0x86, - 0x91, 0xf0, 0x6d, 0x50, 0xe2, 0x1d, 0x4e, 0x4a, 0xd5, 0x5c, 0x3c, 0x88, 0xf4, 0xd7, 0x38, 0x24, - 0x15, 0x2e, 0x22, 0xb2, 0x1c, 0x96, 0xa6, 0xe2, 0x30, 0x91, 0xb2, 0x9c, 0x96, 0x52, 0x05, 0x95, - 0x3d, 0x1c, 0x12, 0xf6, 0x9a, 0x0a, 0x1f, 0x8f, 0xbb, 0xf0, 0x0a, 0x00, 0x8c, 0x18, 0x9b, 0x50, - 0x7b, 0x9b, 0x79, 0x93, 0x91, 0x31, 0x6f, 0x88, 0xd2, 0x63, 0x61, 0xd2, 0x73, 0xa8, 0x09, 0x25, - 0x0b, 0xa9, 0x40, 0x2b, 0xd5, 0x86, 0xf7, 0x15, 0x50, 0x59, 0xc7, 0xa8, 0x85, 0x43, 0xa2, 0x56, - 0x6b, 0x85, 0xc6, 0xec, 0xea, 0x5b, 0x46, 0xba, 0xce, 0xdc, 0x0e, 0x7d, 0x17, 0xd3, 0x0e, 0xee, - 0x91, 0x58, 0x20, 0x11, 0x6d, 0x76, 0xfb, 0x91, 0xbe, 0x35, 0x8d, 0xc3, 0xa7, 0xaa, 0x6d, 0x87, - 0x7e, 0xe7, 0x20, 0xd2, 0x95, 0xf7, 0xac, 0x78, 0x8a, 0xf5, 0xdf, 0x15, 0xf0, 0x3a, 0x53, 0x78, - 0x83, 0xbd, 0x9b, 0xa4, 0x12, 0xc3, 0x45, 0x74, 0xbb, 0xa3, 0x2a, 0xcc, 0x66, 0x96, 0xe8, 0xa4, - 0x0b, 0x4f, 0xfe, 0x3f, 0x15, 0x9e, 0xc2, 0xd1, 0x0b, 0x4f, 0x9c, 0x0d, 0xc5, 0x89, 0xd9, 0x50, - 0x3a, 0x34, 0x1b, 0xbe, 0x2d, 0x88, 0xcc, 0x8f, 0xd7, 0x77, 0x84, 0x9c, 0xb8, 0x9e, 0xe4, 0x44, - 0x81, 0xcf, 0x36, 0xb1, 0x9a, 0x78, 0xd7, 0x8d, 0x16, 0xf6, 0xa8, 0xbd, 0x63, 0xe3, 0xf0, 0x39, - 0x99, 0x91, 0xb2, 0x5b, 0x21, 0x6b, 0xb7, 0xb4, 0x57, 0x8a, 0x2f, 0xbd, 0x57, 0x46, 0xb2, 0xa3, - 0xf4, 0x02, 0xd9, 0x51, 0x7f, 0x9a, 0x07, 0xcb, 0x4c, 0x8e, 0x9b, 0x68, 0x0b, 0x3b, 0x5f, 0x20, - 0xf7, 0x88, 0x92, 0x9c, 0x4a, 0x49, 0x52, 0x35, 0xe1, 0xff, 0x94, 0x4f, 0x41, 0xf9, 0x0f, 0x0a, - 0x98, 0x89, 0x6b, 0x38, 0x34, 0x00, 0x10, 0x30, 0x5e, 0xa6, 0x05, 0xd1, 0x0b, 0x0c, 0x1c, 0x26, - 0xa3, 0x56, 0x2a, 0x02, 0x7e, 0x0d, 0xca, 0xa2, 0x27, 0xb3, 0xe0, 0x78, 0x2a, 0x0b, 0x68, 0x88, - 0x91, 0x7b, 0xa5, 0x85, 0x02, 0x8a, 0x43, 0xf3, 0x22, 0x9b, 0x45, 0x3f, 0xd2, 0x4f, 0x3f, 0x8b, - 0x22, 0x7e, 0x5a, 0x13, 0x38, 0x26, 0xae, 0xf8, 0xa6, 0x25, 0xbf, 0x50, 0xff, 0x4e, 0x01, 0xc7, - 0xd8, 0x44, 0x19, 0x35, 0x89, 0x2b, 0xae, 0x82, 0x99, 0x50, 0xb6, 0xf9, 0x74, 0x67, 0x57, 0xeb, - 0x46, 0x96, 0xd6, 0x09, 0x54, 0x9a, 0xc5, 0x07, 0x91, 0xae, 0x58, 0x09, 0x12, 0xae, 0x65, 0x68, - 0xcc, 0x4f, 0xa2, 0x91, 0x41, 0x72, 0x19, 0xe2, 0x7e, 0xcd, 0x03, 0x78, 0xc3, 0x6b, 0xe1, 0xbb, - 0xcc, 0x7c, 0x43, 0x9f, 0xf6, 0xc6, 0x66, 0x74, 0x72, 0x48, 0xca, 0x78, 0xbc, 0x79, 0xb9, 0x1f, - 0xe9, 0xe7, 0x9f, 0xc5, 0xca, 0x33, 0xc0, 0xa9, 0x25, 0xa4, 0x8d, 0x9b, 0x7f, 0xf9, 0xf7, 0x95, - 0x9f, 0xf3, 0x60, 0xe1, 0x4b, 0xdf, 0xe9, 0xb9, 0x38, 0x21, 0xce, 0x1d, 0x23, 0x4e, 0x1d, 0x12, - 0x97, 0x8d, 0x35, 0xcf, 0xf7, 0x23, 0x7d, 0x6d, 0x2a, 0xd2, 0xb2, 0xc0, 0x57, 0x97, 0xb0, 0xfb, - 0x79, 0xb0, 0xb4, 0xe9, 0x07, 0x9f, 0x6f, 0xf0, 0xab, 0x50, 0xaa, 0x2e, 0xe2, 0x31, 0xda, 0x96, - 0x86, 0xb4, 0x31, 0xc4, 0x2d, 0x44, 0x43, 0xfb, 0xae, 0xb9, 0xd6, 0x8f, 0xf4, 0xe6, 0x54, 0x94, - 0x0d, 0x41, 0xaf, 0x2e, 0x5d, 0xbf, 0xe5, 0xc1, 0xf2, 0x9d, 0x1e, 0xf2, 0xa8, 0xed, 0x60, 0x41, - 0x59, 0x42, 0xd8, 0xfe, 0x18, 0x61, 0xda, 0x90, 0xb0, 0x2c, 0x46, 0x52, 0xf7, 0x51, 0x3f, 0xd2, - 0x2f, 0x4e, 0x45, 0xdd, 0x24, 0xf8, 0xab, 0x4b, 0xe2, 0x2f, 0x45, 0x30, 0xcf, 0xaf, 0x4a, 0x09, - 0x77, 0xef, 0x00, 0xb9, 0xe5, 0x4a, 0xe6, 0x60, 0x7c, 0x46, 0x0b, 0x83, 0x6d, 0x63, 0x43, 0x6e, - 0xc6, 0x22, 0x02, 0x5e, 0x00, 0x65, 0xc2, 0x4f, 0x42, 0xb2, 0xa0, 0x6a, 0xa3, 0xb7, 0x86, 0xec, - 0x99, 0x6b, 0x3d, 0x67, 0xc9, 0x78, 0x76, 0x97, 0x72, 0xd8, 0x01, 0x20, 0x3e, 0x09, 0xd6, 0x47, - 0x91, 0xe3, 0xc7, 0x03, 0x86, 0x16, 0x18, 0x78, 0x0e, 0x94, 0x78, 0xe5, 0x96, 0xb7, 0xdf, 0xcc, - 0x67, 0xc7, 0x4b, 0xe8, 0x7a, 0xce, 0x12, 0xe1, 0x70, 0x15, 0x14, 0x83, 0xd0, 0x77, 0xe5, 0x2e, - 0x7a, 0x72, 0xf4, 0x9b, 0xe9, 0x6d, 0x67, 0x3d, 0x67, 0xf1, 0x58, 0x78, 0x96, 0x1d, 0x79, 0xd9, - 0x7e, 0x45, 0xf8, 0x15, 0x82, 0x95, 0xac, 0x11, 0x58, 0x0a, 0x12, 0x87, 0xc2, 0xb3, 0xa0, 0xbc, - 0xc7, 0xcb, 0x12, 0xbf, 0x5f, 0xb0, 0xb3, 0x63, 0x0a, 0x94, 0x2d, 0x58, 0x6c, 0x5d, 0x22, 0x16, - 0x5e, 0x07, 0x73, 0xd4, 0x0f, 0xba, 0x71, 0x01, 0x90, 0xd7, 0x8f, 0x5a, 0x1a, 0x3b, 0xa9, 0x40, - 0xac, 0xe7, 0xac, 0x0c, 0x0e, 0xde, 0x06, 0xc7, 0x76, 0x33, 0x36, 0xc5, 0x84, 0xff, 0x86, 0x30, - 0xc2, 0xf3, 0xe4, 0xec, 0x59, 0xcf, 0x59, 0x63, 0x68, 0x13, 0x0c, 0x33, 0xaa, 0xfe, 0x57, 0x01, - 0xcc, 0x49, 0xcf, 0x88, 0xbb, 0xc2, 0xf9, 0xc4, 0x06, 0xc2, 0x32, 0x6f, 0x1e, 0x66, 0x03, 0x1e, - 0x9e, 0x72, 0xc1, 0xfb, 0x89, 0x0b, 0x84, 0x7f, 0x96, 0x87, 0x59, 0xca, 0xf5, 0x4f, 0x21, 0xa4, - 0xf2, 0x6b, 0xb1, 0xf2, 0xc2, 0x36, 0x27, 0x26, 0xef, 0xbb, 0x31, 0x4a, 0xca, 0x7e, 0x09, 0x54, - 0x6c, 0x71, 0xed, 0x9f, 0x64, 0x98, 0xf1, 0x5f, 0x05, 0x98, 0x90, 0x12, 0x00, 0xd7, 0x86, 0xf2, - 0x0b, 0xd7, 0x1c, 0x1f, 0x97, 0x3f, 0x01, 0xc5, 0xea, 0x9f, 0x49, 0xd4, 0x2f, 0x4b, 0xcc, 0xd8, - 0x66, 0x95, 0x2c, 0x4c, 0x4a, 0xbf, 0x0e, 0x66, 0x5c, 0x4c, 0x11, 0x3b, 0xcb, 0xaa, 0x15, 0x5e, - 0x37, 0x4e, 0x65, 0xa5, 0x1a, 0xf2, 0x6d, 0xdc, 0x92, 0x81, 0xd7, 0x3c, 0x1a, 0xee, 0xcb, 0x63, - 0x4b, 0x82, 0x5e, 0xb9, 0x0c, 0xe6, 0x33, 0x01, 0xf0, 0x18, 0x28, 0x74, 0x71, 0xfc, 0x0b, 0x07, - 0x6b, 0xb2, 0xcb, 0xdd, 0x1e, 0x72, 0x7a, 0x98, 0xd3, 0x5e, 0xb5, 0x44, 0xe7, 0x52, 0xfe, 0x82, - 0x62, 0x56, 0x41, 0x25, 0x14, 0x5f, 0x31, 0x5b, 0x0f, 0x1f, 0x6b, 0xb9, 0x47, 0x8f, 0xb5, 0xdc, - 0xd3, 0xc7, 0x9a, 0xf2, 0xcd, 0x40, 0x53, 0x7e, 0x1c, 0x68, 0xca, 0x83, 0x81, 0xa6, 0x3c, 0x1c, - 0x68, 0xca, 0x9f, 0x03, 0x4d, 0xf9, 0x7b, 0xa0, 0xe5, 0x9e, 0x0e, 0x34, 0xe5, 0xde, 0x13, 0x2d, - 0xf7, 0xf0, 0x89, 0x96, 0x7b, 0xf4, 0x44, 0xcb, 0x7d, 0x65, 0x1c, 0xad, 0x84, 0x6d, 0x95, 0x39, - 0x2d, 0x6b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x2b, 0x59, 0x8b, 0xcb, 0x14, 0x00, 0x00, + // 1498 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4b, 0x6f, 0xdb, 0xc6, + 0x1a, 0x15, 0xf5, 0xb4, 0xc6, 0x8f, 0x9b, 0x3b, 0x36, 0x1c, 0x5e, 0x27, 0x97, 0x14, 0x04, 0xdc, + 0x44, 0xb7, 0x68, 0xa9, 0xc6, 0x4e, 0xf3, 0x6c, 0x8b, 0x86, 0x4d, 0x02, 0xa7, 0x4d, 0x8a, 0x84, + 0x36, 0xba, 0xe8, 0x6e, 0x2c, 0x8d, 0x25, 0x56, 0x7c, 0x99, 0x33, 0x32, 0xe2, 0x5d, 0x7f, 0x40, + 0x0b, 0xe4, 0x07, 0x74, 0x5d, 0x14, 0x68, 0x50, 0xa0, 0x8b, 0x6e, 0xba, 0xec, 0x2a, 0xcb, 0x2c, + 0x03, 0x01, 0x65, 0x1b, 0xa5, 0x8b, 0xc2, 0xab, 0xfc, 0x84, 0x62, 0x1e, 0xa4, 0x48, 0x49, 0x49, + 0xe4, 0xb4, 0x8b, 0x04, 0xe8, 0x46, 0x9a, 0x19, 0x7e, 0x87, 0x1c, 0x9e, 0x73, 0xbe, 0x6f, 0x66, + 0x08, 0x4e, 0x07, 0xbd, 0x4e, 0x73, 0xaf, 0x8f, 0x43, 0x1b, 0x87, 0xfc, 0xff, 0x20, 0x44, 0x5e, + 0x07, 0xa7, 0x9a, 0x46, 0x10, 0xfa, 0xd4, 0x87, 0x60, 0x34, 0xb2, 0xb6, 0xde, 0xb1, 0x69, 0xb7, + 0xbf, 0x63, 0xb4, 0x7c, 0xb7, 0xd9, 0xf1, 0x3b, 0x7e, 0xb3, 0xe3, 0xfb, 0x1d, 0x07, 0xa3, 0xc0, + 0x26, 0xb2, 0xd9, 0x0c, 0x83, 0x56, 0x93, 0x50, 0x44, 0xfb, 0x44, 0xe0, 0xd7, 0x56, 0x58, 0x20, + 0x6f, 0x72, 0x88, 0x1c, 0xd5, 0x65, 0x38, 0xef, 0xed, 0xf4, 0x77, 0x9b, 0xd4, 0x76, 0x31, 0xa1, + 0xc8, 0x0d, 0x64, 0xc0, 0x09, 0x36, 0x3f, 0xc7, 0xef, 0x08, 0x64, 0xdc, 0x90, 0x17, 0xff, 0x93, + 0xb9, 0x48, 0x7a, 0x98, 0xb6, 0xba, 0xf2, 0x52, 0x4d, 0x5e, 0xda, 0x73, 0x5c, 0xbf, 0x8d, 0x1d, + 0x3e, 0x17, 0x22, 0x7e, 0x65, 0xc4, 0x32, 0x8b, 0x08, 0xfa, 0xa4, 0xcb, 0x7f, 0xe4, 0xe0, 0x87, + 0x2f, 0xa4, 0x63, 0x07, 0x11, 0xdc, 0x6c, 0xe3, 0x5d, 0xdb, 0xb3, 0xa9, 0xed, 0x7b, 0x24, 0xdd, + 0x96, 0x37, 0x39, 0x37, 0xdb, 0x4d, 0xc6, 0x29, 0xae, 0x7f, 0x5d, 0x00, 0xf3, 0x37, 0xfd, 0x9e, + 0x6d, 0xe1, 0xbd, 0x3e, 0x26, 0x14, 0xae, 0x80, 0x12, 0x8f, 0x51, 0x95, 0x9a, 0xd2, 0xa8, 0x5a, + 0xa2, 0xc3, 0x46, 0x1d, 0xdb, 0xb5, 0xa9, 0x9a, 0xaf, 0x29, 0x8d, 0x45, 0x4b, 0x74, 0x20, 0x04, + 0x45, 0x42, 0x71, 0xa0, 0x16, 0x6a, 0x4a, 0xa3, 0x60, 0xf1, 0x36, 0x5c, 0x03, 0x73, 0xb6, 0x47, + 0x71, 0xb8, 0x8f, 0x1c, 0xb5, 0xca, 0xc7, 0x93, 0x3e, 0x7c, 0x1f, 0x54, 0x08, 0x45, 0x21, 0xdd, + 0x26, 0x6a, 0xb1, 0xa6, 0x34, 0xe6, 0xd7, 0xd7, 0x0c, 0x21, 0x85, 0x11, 0x4b, 0x61, 0x6c, 0xc7, + 0x52, 0x98, 0x73, 0x0f, 0x22, 0x3d, 0x77, 0xef, 0x57, 0x5d, 0xb1, 0x62, 0x10, 0xbc, 0x04, 0x4a, + 0xd8, 0x6b, 0x6f, 0x13, 0xb5, 0x74, 0x04, 0xb4, 0x80, 0xc0, 0x33, 0xa0, 0xda, 0xb6, 0x43, 0xdc, + 0x62, 0x9c, 0xa9, 0xe5, 0x9a, 0xd2, 0x58, 0x5a, 0x5f, 0x36, 0x12, 0x69, 0xaf, 0xc6, 0x97, 0xac, + 0x51, 0x14, 0x7b, 0xbd, 0x00, 0xd1, 0xae, 0x5a, 0xe1, 0x4c, 0xf0, 0x36, 0xac, 0x83, 0x32, 0xe9, + 0xa2, 0xb0, 0x4d, 0xd4, 0xb9, 0x5a, 0xa1, 0x51, 0x35, 0xc1, 0x61, 0xa4, 0xcb, 0x11, 0x4b, 0xfe, + 0xc3, 0x8f, 0x40, 0x31, 0x70, 0x90, 0xa7, 0x82, 0x9a, 0xd2, 0x58, 0x30, 0xcf, 0x0d, 0x22, 0x3d, + 0xe3, 0xdd, 0x10, 0xed, 0x22, 0x0f, 0x35, 0x1d, 0xbf, 0x67, 0x37, 0xd3, 0xa2, 0x31, 0x8c, 0x71, + 0x87, 0xd1, 0x7d, 0xdb, 0x41, 0x9e, 0xc5, 0xef, 0x51, 0xff, 0x31, 0x0f, 0x20, 0x93, 0xe7, 0x86, + 0x47, 0x28, 0xf2, 0xe8, 0xcb, 0xa8, 0xf4, 0x2e, 0x28, 0x33, 0x83, 0x6f, 0x13, 0xae, 0xd3, 0xac, + 0xb4, 0x49, 0x4c, 0x96, 0xb7, 0xe2, 0x91, 0x78, 0x2b, 0x4d, 0xe5, 0xad, 0xfc, 0x42, 0xde, 0x2a, + 0x7f, 0x03, 0x6f, 0xdf, 0x15, 0xc1, 0x82, 0xb0, 0x35, 0x09, 0x7c, 0x8f, 0x60, 0x36, 0x81, 0x2d, + 0x5e, 0x1a, 0x04, 0x65, 0x72, 0x02, 0x7c, 0xc4, 0x92, 0x57, 0xe0, 0x07, 0xa0, 0x78, 0x15, 0x51, + 0xc4, 0xe9, 0x9b, 0x5f, 0x5f, 0x31, 0x52, 0xc9, 0xc2, 0xee, 0xc5, 0xae, 0x99, 0xab, 0x8c, 0xa1, + 0xc3, 0x48, 0x5f, 0x6a, 0x23, 0x8a, 0xde, 0xf4, 0x5d, 0x9b, 0x62, 0x37, 0xa0, 0x07, 0x16, 0x47, + 0xc2, 0x77, 0x40, 0xf5, 0x5a, 0x18, 0xfa, 0xe1, 0xf6, 0x41, 0x80, 0x39, 0xdd, 0x55, 0xf3, 0xf8, + 0x61, 0xa4, 0x2f, 0xe3, 0x78, 0x30, 0x85, 0x18, 0x45, 0xc2, 0xff, 0x83, 0x12, 0xef, 0x70, 0x82, + 0xab, 0xe6, 0xf2, 0x61, 0xa4, 0xff, 0x8b, 0x43, 0x52, 0xe1, 0x22, 0x22, 0xab, 0x47, 0x69, 0x26, + 0x3d, 0x12, 0x5b, 0x94, 0xd3, 0xb6, 0x50, 0x41, 0x65, 0x1f, 0x87, 0x84, 0xdd, 0xa6, 0xc2, 0xc7, + 0xe3, 0x2e, 0xbc, 0x02, 0x00, 0x23, 0xc6, 0x26, 0xd4, 0x6e, 0x31, 0x9f, 0x33, 0x32, 0x16, 0x0d, + 0x51, 0xc6, 0x2c, 0x4c, 0xfa, 0x0e, 0x35, 0xa1, 0x64, 0x21, 0x15, 0x68, 0xa5, 0xda, 0xf0, 0xbe, + 0x02, 0x2a, 0x9b, 0x18, 0xb5, 0x71, 0x48, 0xd4, 0x6a, 0xad, 0xd0, 0x98, 0x5f, 0xff, 0x9f, 0x91, + 0xae, 0x59, 0xb7, 0x43, 0xdf, 0xc5, 0xb4, 0x8b, 0xfb, 0x24, 0x16, 0x48, 0x44, 0x9b, 0xbd, 0x41, + 0xa4, 0xef, 0xcc, 0xa2, 0xfa, 0x4c, 0x75, 0xf2, 0x99, 0xcf, 0x39, 0x8c, 0x74, 0xe5, 0x2d, 0x2b, + 0x9e, 0x62, 0xfd, 0x17, 0x05, 0xfc, 0x9b, 0x29, 0xbc, 0xc5, 0xee, 0x4d, 0x52, 0x49, 0xe6, 0x22, + 0xda, 0xea, 0xaa, 0x0a, 0xb3, 0xac, 0x25, 0x3a, 0xe9, 0x22, 0x96, 0xff, 0x4b, 0x45, 0xac, 0x70, + 0xf4, 0x22, 0x16, 0x67, 0x56, 0x71, 0x6a, 0x66, 0x95, 0x9e, 0x95, 0x59, 0xf5, 0x2f, 0x0b, 0xa2, + 0x8a, 0xc4, 0xef, 0x77, 0x84, 0x9c, 0xb8, 0x9e, 0xe4, 0x44, 0x81, 0xcf, 0x36, 0xb1, 0x9a, 0xb8, + 0xd7, 0x8d, 0x36, 0xf6, 0xa8, 0xbd, 0x6b, 0xe3, 0xf0, 0x05, 0x99, 0x91, 0xb2, 0x5b, 0x21, 0x6b, + 0xb7, 0xb4, 0x57, 0x8a, 0xaf, 0xbc, 0x57, 0xc6, 0xb2, 0xa3, 0xf4, 0x12, 0xd9, 0x51, 0x7f, 0x9a, + 0x07, 0xab, 0x4c, 0x8e, 0x9b, 0x68, 0x07, 0x3b, 0x9f, 0x20, 0xf7, 0x88, 0x92, 0x9c, 0x4a, 0x49, + 0x52, 0x35, 0xe1, 0x3f, 0x94, 0xcf, 0x40, 0xf9, 0x37, 0x0a, 0x98, 0x8b, 0x6b, 0x38, 0x34, 0x00, + 0x10, 0x30, 0x5e, 0xa6, 0x05, 0xd1, 0x4b, 0x0c, 0x1c, 0x26, 0xa3, 0x56, 0x2a, 0x02, 0x7e, 0x0e, + 0xca, 0xa2, 0x27, 0xb3, 0xe0, 0x78, 0x2a, 0x0b, 0x68, 0x88, 0x91, 0x7b, 0xa5, 0x8d, 0x02, 0x8a, + 0x43, 0xf3, 0x22, 0x9b, 0xc5, 0x20, 0xd2, 0x4f, 0x3f, 0x8f, 0x22, 0xbe, 0xf3, 0x13, 0x38, 0x26, + 0xae, 0x78, 0xa6, 0x25, 0x9f, 0x50, 0xff, 0x4a, 0x01, 0xc7, 0xd8, 0x44, 0x19, 0x35, 0x89, 0x2b, + 0xae, 0x82, 0xb9, 0x50, 0xb6, 0xf9, 0x74, 0xe7, 0xd7, 0xeb, 0x46, 0x96, 0xd6, 0x29, 0x54, 0x9a, + 0xc5, 0x07, 0x91, 0xae, 0x58, 0x09, 0x12, 0x6e, 0x64, 0x68, 0xcc, 0x4f, 0xa3, 0x91, 0x41, 0x72, + 0x19, 0xe2, 0x7e, 0xca, 0x03, 0x78, 0xc3, 0x6b, 0xe3, 0xbb, 0xcc, 0x7c, 0x23, 0x9f, 0xf6, 0x27, + 0x66, 0x74, 0x72, 0x44, 0xca, 0x64, 0xbc, 0x79, 0x79, 0x10, 0xe9, 0xe7, 0x9f, 0xc7, 0xca, 0x73, + 0xc0, 0xa9, 0x57, 0x48, 0x1b, 0x37, 0xff, 0xea, 0xaf, 0x2b, 0xdf, 0xe7, 0xc1, 0xd2, 0xa7, 0xbe, + 0xd3, 0x77, 0x71, 0x42, 0x9c, 0x3b, 0x41, 0x9c, 0x3a, 0x22, 0x2e, 0x1b, 0x6b, 0x9e, 0x1f, 0x44, + 0xfa, 0xc6, 0x4c, 0xa4, 0x65, 0x81, 0xaf, 0x2f, 0x61, 0xf7, 0xf3, 0x60, 0x65, 0xdb, 0x0f, 0x3e, + 0xde, 0xe2, 0xc7, 0xaa, 0x54, 0x5d, 0xc4, 0x13, 0xb4, 0xad, 0x8c, 0x68, 0x63, 0x88, 0x5b, 0x88, + 0x86, 0xf6, 0x5d, 0x73, 0x63, 0x10, 0xe9, 0xcd, 0x99, 0x28, 0x1b, 0x81, 0x5e, 0x5f, 0xba, 0x7e, + 0xce, 0x83, 0xd5, 0x3b, 0x7d, 0xe4, 0x51, 0xdb, 0xc1, 0x82, 0xb2, 0x84, 0xb0, 0x83, 0x09, 0xc2, + 0xb4, 0x11, 0x61, 0x59, 0x8c, 0xa4, 0xee, 0xbd, 0x41, 0xa4, 0x5f, 0x9c, 0x89, 0xba, 0x69, 0xf0, + 0xd7, 0x97, 0xc4, 0x1f, 0x8a, 0x60, 0x91, 0x1f, 0x1f, 0x12, 0xee, 0xde, 0x00, 0x72, 0xc9, 0x95, + 0xcc, 0xc1, 0x78, 0x8f, 0x16, 0x06, 0x2d, 0x63, 0x4b, 0x2e, 0xc6, 0x22, 0x02, 0x5e, 0x00, 0x65, + 0xc2, 0x77, 0x42, 0xb2, 0xa0, 0x6a, 0xe3, 0xa7, 0x86, 0xec, 0x9e, 0x6b, 0x33, 0x67, 0xc9, 0x78, + 0x76, 0x2e, 0x73, 0xd8, 0x06, 0x20, 0xde, 0x09, 0xd6, 0xc7, 0x91, 0x93, 0xdb, 0x03, 0x86, 0x16, + 0x18, 0x78, 0x0e, 0x94, 0x78, 0xe5, 0x96, 0x27, 0xe9, 0xcc, 0x63, 0x27, 0x4b, 0xe8, 0x66, 0xce, + 0x12, 0xe1, 0x70, 0x1d, 0x14, 0x83, 0xd0, 0x77, 0xe5, 0x2a, 0x7a, 0x72, 0xfc, 0x99, 0xe9, 0x65, + 0x67, 0x33, 0x67, 0xf1, 0x58, 0x78, 0x96, 0x6d, 0x79, 0xd9, 0x7a, 0x45, 0xf8, 0x11, 0x82, 0x95, + 0xac, 0x31, 0x58, 0x0a, 0x12, 0x87, 0xc2, 0xb3, 0xa0, 0xbc, 0xcf, 0xcb, 0x12, 0x3f, 0x5f, 0xb0, + 0xbd, 0x63, 0x0a, 0x94, 0x2d, 0x58, 0xec, 0xbd, 0x44, 0x2c, 0xbc, 0x0e, 0x16, 0xa8, 0x1f, 0xf4, + 0xe2, 0x02, 0x20, 0x8f, 0x1f, 0xb5, 0x34, 0x76, 0x5a, 0x81, 0xd8, 0xcc, 0x59, 0x19, 0x1c, 0xbc, + 0x0d, 0x8e, 0xed, 0x65, 0x6c, 0x8a, 0x09, 0xff, 0x1e, 0x31, 0xc6, 0xf3, 0xf4, 0xec, 0xd9, 0xcc, + 0x59, 0x13, 0x68, 0x13, 0x8c, 0x32, 0xaa, 0xfe, 0x7b, 0x01, 0x2c, 0x48, 0xcf, 0x88, 0xb3, 0xc2, + 0xf9, 0xc4, 0x06, 0xc2, 0x32, 0xff, 0x7d, 0x96, 0x0d, 0x78, 0x78, 0xca, 0x05, 0x6f, 0x27, 0x2e, + 0x10, 0xfe, 0x59, 0x1d, 0x65, 0x29, 0xd7, 0x3f, 0x85, 0x90, 0xca, 0x6f, 0xc4, 0xca, 0x0b, 0xdb, + 0x9c, 0x98, 0xbe, 0xee, 0xc6, 0x28, 0x29, 0xfb, 0x25, 0x50, 0xb1, 0xc5, 0x27, 0x84, 0x69, 0x86, + 0x99, 0xfc, 0xc2, 0xc0, 0x84, 0x94, 0x00, 0xb8, 0x31, 0x92, 0x5f, 0xb8, 0xe6, 0xf8, 0xa4, 0xfc, + 0x09, 0x28, 0x56, 0xff, 0x4c, 0xa2, 0x7e, 0x59, 0x62, 0x26, 0x16, 0xab, 0xe4, 0xc5, 0xa4, 0xf4, + 0x9b, 0x60, 0xce, 0xc5, 0x14, 0xb1, 0xbd, 0xac, 0x5a, 0xe1, 0x75, 0xe3, 0x54, 0x56, 0xaa, 0x11, + 0xdf, 0xc6, 0x2d, 0x19, 0x78, 0xcd, 0xa3, 0xe1, 0x81, 0xdc, 0xb6, 0x24, 0xe8, 0xb5, 0xcb, 0x60, + 0x31, 0x13, 0x00, 0x8f, 0x81, 0x42, 0x0f, 0xc7, 0x5f, 0x4b, 0x58, 0x93, 0x1d, 0xee, 0xf6, 0x91, + 0xd3, 0xc7, 0x9c, 0xf6, 0xaa, 0x25, 0x3a, 0x97, 0xf2, 0x17, 0x14, 0xb3, 0x0a, 0x2a, 0xa1, 0x78, + 0x8a, 0xd9, 0x7e, 0xf8, 0x58, 0xcb, 0x3d, 0x7a, 0xac, 0xe5, 0x9e, 0x3e, 0xd6, 0x94, 0x2f, 0x86, + 0x9a, 0xf2, 0xed, 0x50, 0x53, 0x1e, 0x0c, 0x35, 0xe5, 0xe1, 0x50, 0x53, 0x7e, 0x1b, 0x6a, 0xca, + 0x1f, 0x43, 0x2d, 0xf7, 0x74, 0xa8, 0x29, 0xf7, 0x9e, 0x68, 0xb9, 0x87, 0x4f, 0xb4, 0xdc, 0xa3, + 0x27, 0x5a, 0xee, 0x33, 0xe3, 0x68, 0x25, 0x6c, 0xa7, 0xcc, 0x69, 0xd9, 0xf8, 0x33, 0x00, 0x00, + 0xff, 0xff, 0x33, 0xb4, 0xee, 0x07, 0x17, 0x15, 0x00, 0x00, } func (this *LokiRequest) Equal(that interface{}) bool { @@ -1323,6 +1325,13 @@ func (this *LokiInstantRequest) Equal(that interface{}) bool { return false } } + if that1.Plan == nil { + if this.Plan != nil { + return false + } + } else if !this.Plan.Equal(*that1.Plan) { + return false + } return true } func (this *LokiResponse) Equal(that interface{}) bool { @@ -2149,7 +2158,7 @@ func (this *LokiInstantRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 10) + s := make([]string, 0, 11) s = append(s, "&queryrange.LokiInstantRequest{") s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") s = append(s, "Limit: "+fmt.Sprintf("%#v", this.Limit)+",\n") @@ -2157,6 +2166,7 @@ func (this *LokiInstantRequest) GoString() string { s = append(s, "Direction: "+fmt.Sprintf("%#v", this.Direction)+",\n") s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") s = append(s, "Shards: "+fmt.Sprintf("%#v", this.Shards)+",\n") + s = append(s, "Plan: "+fmt.Sprintf("%#v", this.Plan)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -2568,6 +2578,18 @@ func (m *LokiInstantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Plan != nil { + { + size := m.Plan.Size() + i -= size + if _, err := m.Plan.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if len(m.Shards) > 0 { for iNdEx := len(m.Shards) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Shards[iNdEx]) @@ -3652,6 +3674,10 @@ func (m *LokiInstantRequest) Size() (n int) { n += 1 + l + sovQueryrange(uint64(l)) } } + if m.Plan != nil { + l = m.Plan.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } return n } @@ -4135,6 +4161,7 @@ func (this *LokiInstantRequest) String() string { `Direction:` + fmt.Sprintf("%v", this.Direction) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `Shards:` + fmt.Sprintf("%v", this.Shards) + `,`, + `Plan:` + fmt.Sprintf("%v", this.Plan) + `,`, `}`, }, "") return s @@ -4972,6 +4999,41 @@ func (m *LokiInstantRequest) Unmarshal(dAtA []byte) error { } m.Shards = append(m.Shards, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_grafana_loki_pkg_querier_plan.QueryPlan + m.Plan = &v + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQueryrange(dAtA[iNdEx:]) diff --git a/pkg/querier/queryrange/queryrange.proto b/pkg/querier/queryrange/queryrange.proto index 89058eef22fe6..44213f7219cdc 100644 --- a/pkg/querier/queryrange/queryrange.proto +++ b/pkg/querier/queryrange/queryrange.proto @@ -48,7 +48,7 @@ message LokiInstantRequest { logproto.Direction direction = 4; string path = 5; repeated string shards = 6 [(gogoproto.jsontag) = "shards"]; - bytes plan = 6 [ + bytes plan = 7 [ (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" ]; } From 4f4bcc6681e27e35fcf6430bface37c04f4eed9c Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 12:47:28 +0100 Subject: [PATCH 04/25] Parsed AST when not set. --- pkg/logql/blocker_test.go | 8 +++++-- pkg/logql/engine_test.go | 37 +++++++++++++++++++++++-------- pkg/logql/test_utils.go | 2 +- pkg/querier/plan/plan.go | 5 +++++ pkg/querier/queryrange/codec.go | 18 +++++++++++++++ pkg/querier/queryrange/marshal.go | 24 ++++++++++++++++++++ pkg/ruler/evaluator_local.go | 8 ++++++- 7 files changed, 89 insertions(+), 13 deletions(-) diff --git a/pkg/logql/blocker_test.go b/pkg/logql/blocker_test.go index 3dc3b72c81599..98a55a12adc47 100644 --- a/pkg/logql/blocker_test.go +++ b/pkg/logql/blocker_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/util/validation" ) @@ -144,6 +145,9 @@ func TestEngine_ExecWithBlockedQueries(t *testing.T) { t.Run(test.name, func(t *testing.T) { limits.blockedQueries = test.blocked + parsed, err := syntax.ParseExpr(test.q) + require.NoError(t, err) + q := eng.Query(LiteralParams{ qs: test.q, start: time.Unix(0, 0), @@ -151,8 +155,8 @@ func TestEngine_ExecWithBlockedQueries(t *testing.T) { step: 60 * time.Second, direction: logproto.FORWARD, limit: 1000, - }) - _, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) + }, parsed) + _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectedErr == nil { require.NoError(t, err) diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index c0d04b90a5f3f..8cb1236bc401a 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -2462,14 +2462,18 @@ func TestStepEvaluator_Error(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { eng := NewEngine(EngineOpts{}, tc.querier, NoLimits, log.NewNopLogger()) + + parsed, err := syntax.ParseExpr(tc.qs) + require.NoError(t, err) + q := eng.Query(LiteralParams{ qs: tc.qs, start: time.Unix(0, 0), end: time.Unix(180, 0), step: 1 * time.Second, limit: 1, - }) - _, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) + }, parsed) + _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) require.Equal(t, tc.err, err) }) } @@ -2492,6 +2496,9 @@ func TestEngine_MaxSeries(t *testing.T) { {`avg(count_over_time({app=~"foo|bar"} |~".+bar" [1m]))`, logproto.FORWARD, false}, } { t.Run(test.qs, func(t *testing.T) { + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(t, err) + q := eng.Query(LiteralParams{ qs: test.qs, start: time.Unix(0, 0), @@ -2499,8 +2506,8 @@ func TestEngine_MaxSeries(t *testing.T) { step: 60 * time.Second, direction: test.direction, limit: 1000, - }) - _, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) + }, parsed) + _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectLimitErr { require.NotNil(t, err) require.True(t, errors.Is(err, logqlmodel.ErrLimit)) @@ -2524,6 +2531,9 @@ func TestEngine_MaxRangeInterval(t *testing.T) { {`topk(1,rate({app=~"foo|bar"}[12h]) / (rate({app="baz"}[23h]) + rate({app="fiz"}[25h])))`, logproto.FORWARD, true}, } { t.Run(test.qs, func(t *testing.T) { + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(t, err) + q := eng.Query(LiteralParams{ qs: test.qs, start: time.Unix(0, 0), @@ -2531,8 +2541,9 @@ func TestEngine_MaxRangeInterval(t *testing.T) { step: 60 * time.Second, direction: test.direction, limit: 1000, - }) - _, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) + }, parsed) + + _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectLimitErr { require.Error(t, err) require.ErrorIs(t, err, logqlmodel.ErrIntervalLimit) @@ -2595,6 +2606,9 @@ func benchmarkRangeQuery(testsize int64, b *testing.B) { {`bottomk(2,rate(({app=~"foo|bar"} |~".+bar")[1m]))`, logproto.FORWARD}, {`bottomk(3,rate(({app=~"foo|bar"} |~".+bar")[1m])) without (app)`, logproto.FORWARD}, } { + parsed, err := syntax.ParseExpr(test.qs) + require.NoError(b, err) + q := eng.Query(LiteralParams{ qs: test.qs, start: start, @@ -2602,7 +2616,8 @@ func benchmarkRangeQuery(testsize int64, b *testing.B) { step: 60 * time.Second, direction: test.direction, limit: 1000, - }) + }, parsed) + res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if err != nil { b.Fatal(err) @@ -2630,8 +2645,12 @@ func TestHashingStability(t *testing.T) { buf := bytes.NewBufferString("") logger := log.NewLogfmtLogger(buf) eng := NewEngine(EngineOpts{LogExecutingQuery: true}, getLocalQuerier(4), NoLimits, logger) - query := eng.Query(params) - _, err := query.Exec(ctx) + + parsed, err := syntax.ParseExpr(params.Query()) + require.NoError(t, err) + + query := eng.Query(params, parsed) + _, err = query.Exec(ctx) require.NoError(t, err) return buf.String() } diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index 982fa7f5f16d0..2da32ee82785b 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -228,7 +228,7 @@ func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQu query.Params.Limit(), query.Shards.Encode(), ) - res, err := m.Query(params).Exec(ctx) + res, err := m.Query(params, query.Expr).Exec(ctx) if err != nil { return nil, err } diff --git a/pkg/querier/plan/plan.go b/pkg/querier/plan/plan.go index 6954874ea6ebd..b7211a78e446b 100644 --- a/pkg/querier/plan/plan.go +++ b/pkg/querier/plan/plan.go @@ -47,6 +47,11 @@ func (t QueryPlan) MarshalJSON() ([]byte, error) { } func (t *QueryPlan) UnmarshalJSON(data []byte) error { + // An empty query plan is ingored to be backwards compatible. + if len(data) == 0 { + return nil + } + expr, err := syntax.DecodeJSON(string(data)) if err != nil { return err diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index 0cf3c06c22639..fbf11acff91c2 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -29,6 +29,7 @@ import ( "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" indexStats "github.com/grafana/loki/pkg/storage/stores/index/stats" "github.com/grafana/loki/pkg/util" @@ -259,6 +260,11 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) } + parsed, err := syntax.ParseExpr(rangeQuery.Query) + if err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + return &LokiRequest{ Query: rangeQuery.Query, Limit: rangeQuery.Limit, @@ -269,12 +275,21 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer Interval: rangeQuery.Interval.Milliseconds(), Path: r.URL.Path, Shards: rangeQuery.Shards, + Plan: &plan.QueryPlan{ + AST: parsed, + }, }, nil case InstantQueryOp: req, err := loghttp.ParseInstantQuery(r) if err != nil { return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) } + + parsed, err := syntax.ParseExpr(req.Query) + if err != nil { + return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + return &LokiInstantRequest{ Query: req.Query, Limit: req.Limit, @@ -282,6 +297,9 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer TimeTs: req.Ts.UTC(), Path: r.URL.Path, Shards: req.Shards, + Plan: &plan.QueryPlan{ + AST: parsed, + }, }, nil case SeriesOp: req, err := loghttp.ParseAndValidateSeriesQuery(r) diff --git a/pkg/querier/queryrange/marshal.go b/pkg/querier/queryrange/marshal.go index 8b61facf39e4e..0e72b15140e38 100644 --- a/pkg/querier/queryrange/marshal.go +++ b/pkg/querier/queryrange/marshal.go @@ -6,10 +6,12 @@ import ( "context" "fmt" "io" + "net/http" "time" "github.com/gogo/googleapis/google/rpc" "github.com/gogo/status" + "github.com/grafana/dskit/httpgrpc" "github.com/grafana/dskit/user" "github.com/opentracing/opentracing-go" "github.com/prometheus/prometheus/promql" @@ -19,7 +21,9 @@ import ( "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" "github.com/grafana/loki/pkg/logql/sketch" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/pkg/util/httpreq" "github.com/grafana/loki/pkg/util/querylimits" @@ -277,12 +281,32 @@ func (Codec) QueryRequestUnwrap(ctx context.Context, req *QueryRequest) (queryra case *QueryRequest_Series: return concrete.Series, ctx, nil case *QueryRequest_Instant: + if concrete.Instant.Plan == nil { + parsed, err := syntax.ParseExpr(concrete.Instant.GetQuery()) + if err != nil { + return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + concrete.Instant.Plan = &plan.QueryPlan{ + AST: parsed, + } + } + return concrete.Instant, ctx, nil case *QueryRequest_Stats: return concrete.Stats, ctx, nil case *QueryRequest_Volume: return concrete.Volume, ctx, nil case *QueryRequest_Streams: + if concrete.Streams.Plan == nil { + parsed, err := syntax.ParseExpr(concrete.Streams.GetQuery()) + if err != nil { + return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + concrete.Streams.Plan = &plan.QueryPlan{ + AST: parsed, + } + } + return concrete.Streams, ctx, nil case *QueryRequest_Labels: return &LabelRequest{ diff --git a/pkg/ruler/evaluator_local.go b/pkg/ruler/evaluator_local.go index fed0f2f02ef11..467cba36a0e34 100644 --- a/pkg/ruler/evaluator_local.go +++ b/pkg/ruler/evaluator_local.go @@ -9,6 +9,7 @@ import ( "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" ) @@ -39,7 +40,12 @@ func (l *LocalEvaluator) Eval(ctx context.Context, qs string, now time.Time) (*l nil, ) - q := l.engine.Query(params) + parsed, err := syntax.ParseExpr(qs) + if err != nil { + return nil, err + } + + q := l.engine.Query(params, parsed) res, err := q.Exec(ctx) if err != nil { return nil, err From cbf3d1c5dcd56886724e5a2179816a24f0af7ff9 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 13:54:28 +0100 Subject: [PATCH 05/25] Wrap params --- pkg/logcli/client/file.go | 13 +- pkg/logcli/query/query.go | 28 +++-- pkg/logcli/query/query_test.go | 7 +- pkg/logql/blocker_test.go | 13 +- pkg/logql/downstream.go | 20 ++- pkg/logql/downstream_test.go | 25 ++-- pkg/logql/engine.go | 6 +- pkg/logql/engine_test.go | 131 +++++--------------- pkg/logql/evaluator.go | 24 +++- pkg/logql/test_utils.go | 12 +- pkg/querier/http.go | 7 +- pkg/querier/queryrange/codec.go | 24 +++- pkg/querier/queryrange/downstreamer.go | 6 +- pkg/querier/queryrange/downstreamer_test.go | 17 +-- pkg/querier/queryrange/querysharding.go | 2 +- pkg/querier/queryrange/split_by_range.go | 2 +- pkg/ruler/evaluator_local.go | 7 +- 17 files changed, 143 insertions(+), 201 deletions(-) diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index 1c5eade6c3c7e..d32a05c6a29d0 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -17,7 +17,6 @@ import ( "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" logqllog "github.com/grafana/loki/pkg/logql/log" - "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/util/log" "github.com/grafana/loki/pkg/util/marshal" "github.com/grafana/loki/pkg/util/validation" @@ -70,7 +69,7 @@ func (f *FileClient) Query(q string, limit int, t time.Time, direction logproto. ctx = user.InjectOrgID(ctx, f.orgID) - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( q, t, t, 0, @@ -79,13 +78,11 @@ func (f *FileClient) Query(q string, limit int, t time.Time, direction logproto. uint32(limit), nil, ) - - parsed, err := syntax.ParseExpr(q) if err != nil { return nil, err } - query := f.engine.Query(params, parsed) + query := f.engine.Query(params) result, err := query.Exec(ctx) if err != nil { @@ -112,7 +109,7 @@ func (f *FileClient) QueryRange(queryStr string, limit int, start, end time.Time ctx = user.InjectOrgID(ctx, f.orgID) - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( queryStr, start, end, @@ -122,13 +119,11 @@ func (f *FileClient) QueryRange(queryStr string, limit int, start, end time.Time uint32(limit), nil, ) - - parsed, err := syntax.ParseExpr(queryStr) if err != nil { return nil, err } - query := f.engine.Query(params, parsed) + query := f.engine.Query(params) result, err := query.Exec(ctx) if err != nil { diff --git a/pkg/logcli/query/query.go b/pkg/logcli/query/query.go index b19b38f671286..fc5be5f393cb2 100644 --- a/pkg/logcli/query/query.go +++ b/pkg/logcli/query/query.go @@ -22,7 +22,6 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" - "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/loki" "github.com/grafana/loki/pkg/storage" chunk "github.com/grafana/loki/pkg/storage/chunk/client" @@ -448,16 +447,11 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string return err } - parsed, err := syntax.ParseExpr(q.QueryString) - if err != nil { - return err - } - eng := logql.NewEngine(conf.Querier.Engine, querier, limits, util_log.Logger) var query logql.Query if q.isInstant() { - query = eng.Query(logql.NewLiteralParams( + params, err := logql.NewLiteralParams( q.QueryString, q.Start, q.Start, @@ -466,9 +460,14 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string q.resultsDirection(), uint32(q.Limit), nil, - ), parsed) + ) + if err != nil { + return err + } + + query = eng.Query(params) } else { - query = eng.Query(logql.NewLiteralParams( + params, err := logql.NewLiteralParams( q.QueryString, q.Start, q.End, @@ -477,7 +476,16 @@ func (q *Query) DoLocalQuery(out output.LogOutput, statistics bool, orgID string q.resultsDirection(), uint32(q.Limit), nil, - ), parsed) + ) + if err != nil { + return err + } + + query = eng.Query(params) + } + + if err != nil { + return err } // execute the query diff --git a/pkg/logcli/query/query_test.go b/pkg/logcli/query/query_test.go index e0de299883dd8..1b4c18f5265e0 100644 --- a/pkg/logcli/query/query_test.go +++ b/pkg/logcli/query/query_test.go @@ -21,7 +21,6 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" - "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/loki" "github.com/grafana/loki/pkg/storage" "github.com/grafana/loki/pkg/storage/chunk/client/local" @@ -426,14 +425,12 @@ func (t *testQueryClient) Query(_ string, _ int, _ time.Time, _ logproto.Directi func (t *testQueryClient) QueryRange(queryStr string, limit int, from, through time.Time, direction logproto.Direction, step, interval time.Duration, _ bool) (*loghttp.QueryResponse, error) { ctx := user.InjectOrgID(context.Background(), "fake") - params := logql.NewLiteralParams(queryStr, from, through, step, interval, direction, uint32(limit), nil) - - parsed, err := syntax.ParseExpr(queryStr) + params, err := logql.NewLiteralParams(queryStr, from, through, step, interval, direction, uint32(limit), nil) if err != nil { return nil, err } - v, err := t.engine.Query(params, parsed).Exec(ctx) + v, err := t.engine.Query(params).Exec(ctx) if err != nil { return nil, err } diff --git a/pkg/logql/blocker_test.go b/pkg/logql/blocker_test.go index 98a55a12adc47..2a8b489179700 100644 --- a/pkg/logql/blocker_test.go +++ b/pkg/logql/blocker_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logproto" - "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/util/validation" ) @@ -145,17 +144,9 @@ func TestEngine_ExecWithBlockedQueries(t *testing.T) { t.Run(test.name, func(t *testing.T) { limits.blockedQueries = test.blocked - parsed, err := syntax.ParseExpr(test.q) + params, err := NewLiteralParams(test.q, time.Unix(0, 0), time.Unix(100000, 0), 60*time.Second, 0, logproto.FORWARD, 1000, nil) require.NoError(t, err) - - q := eng.Query(LiteralParams{ - qs: test.q, - start: time.Unix(0, 0), - end: time.Unix(100000, 0), - step: 60 * time.Second, - direction: logproto.FORWARD, - limit: 1000, - }, parsed) + q := eng.Query(params) _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectedErr == nil { diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index c1800b56d45bd..18e872c7023a7 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -62,12 +62,11 @@ func NewDownstreamEngine(opts EngineOpts, downstreamable Downstreamable, limits func (ng *DownstreamEngine) Opts() EngineOpts { return ng.opts } // Query constructs a Query -func (ng *DownstreamEngine) Query(ctx context.Context, p Params, mapped syntax.Expr) Query { +func (ng *DownstreamEngine) Query(ctx context.Context, p Params) Query { return &query{ logger: ng.logger, params: p, evaluator: NewDownstreamEvaluator(ng.downstreamable.Downstreamer(ctx)), - queryExpr: mapped, limits: ng.limits, } } @@ -187,7 +186,6 @@ type Downstreamable interface { } type DownstreamQuery struct { - Expr syntax.Expr Params Params Shards Shards } @@ -266,8 +264,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Expr: e.SampleExpr, - Params: params, + Params: ParamsWithMappedExpression{Params: params, Mapped: e.SampleExpr}, Shards: shards, }}) if err != nil { @@ -280,8 +277,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( var queries []DownstreamQuery for cur != nil { qry := DownstreamQuery{ - Expr: cur.DownstreamSampleExpr.SampleExpr, - Params: params, + Params: ParamsWithMappedExpression{Params: params, Mapped: cur.DownstreamSampleExpr.SampleExpr}, } if shard := cur.DownstreamSampleExpr.shard; shard != nil { qry.Shards = Shards{*shard} @@ -302,7 +298,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( level.Warn(util_log.Logger).Log( "msg", "could not extract StepEvaluator", "err", err, - "expr", queries[i].Expr.String(), + "expr", queries[i].Params.GetExpression().String(), ) return nil, err } @@ -330,8 +326,7 @@ func (ev *DownstreamEvaluator) NewIterator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Expr: e.LogSelectorExpr, - Params: params, + Params: ParamsWithMappedExpression{Params: params, Mapped: e.LogSelectorExpr}, Shards: shards, }}) if err != nil { @@ -344,8 +339,7 @@ func (ev *DownstreamEvaluator) NewIterator( var queries []DownstreamQuery for cur != nil { qry := DownstreamQuery{ - Expr: cur.DownstreamLogSelectorExpr.LogSelectorExpr, - Params: params, + Params: ParamsWithMappedExpression{Params: params, Mapped: cur.DownstreamLogSelectorExpr.LogSelectorExpr}, } if shard := cur.DownstreamLogSelectorExpr.shard; shard != nil { qry.Shards = Shards{*shard} @@ -366,7 +360,7 @@ func (ev *DownstreamEvaluator) NewIterator( level.Warn(util_log.Logger).Log( "msg", "could not extract Iterator", "err", err, - "expr", queries[i].Expr.String(), + "expr", queries[i].Params.GetExpression().String(), ) } xs = append(xs, iter) diff --git a/pkg/logql/downstream_test.go b/pkg/logql/downstream_test.go index cea40a29a7baf..e316121a9642d 100644 --- a/pkg/logql/downstream_test.go +++ b/pkg/logql/downstream_test.go @@ -13,7 +13,6 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logproto" - "github.com/grafana/loki/pkg/logql/syntax" ) var nilShardMetrics = NewShardMapperMetrics(nil) @@ -70,7 +69,7 @@ func TestMappingEquivalence(t *testing.T) { sharded := NewDownstreamEngine(opts, MockDownstreamer{regular}, NoLimits, log.NewNopLogger()) t.Run(tc.query, func(t *testing.T) { - params := NewLiteralParams( + params, err := NewLiteralParams( tc.query, start, end, @@ -80,18 +79,16 @@ func TestMappingEquivalence(t *testing.T) { uint32(limit), nil, ) - - parsed, err := syntax.ParseExpr(tc.query) require.NoError(t, err) - qry := regular.Query(params, parsed) + qry := regular.Query(params) ctx := user.InjectOrgID(context.Background(), "fake") mapper := NewShardMapper(ConstantShards(shards), nilShardMetrics) _, _, mapped, err := mapper.Parse(tc.query) require.Nil(t, err) - shardedQry := sharded.Query(ctx, params, mapped) + shardedQry := sharded.Query(ctx, ParamsWithMappedExpression{Params: params, Mapped: mapped}) res, err := qry.Exec(ctx) require.Nil(t, err) @@ -140,7 +137,7 @@ func TestShardCounter(t *testing.T) { sharded := NewDownstreamEngine(opts, MockDownstreamer{regular}, NoLimits, log.NewNopLogger()) t.Run(tc.query, func(t *testing.T) { - params := NewLiteralParams( + params, err := NewLiteralParams( tc.query, start, end, @@ -150,13 +147,14 @@ func TestShardCounter(t *testing.T) { uint32(limit), nil, ) + require.NoError(t, err) ctx := user.InjectOrgID(context.Background(), "fake") mapper := NewShardMapper(ConstantShards(shards), nilShardMetrics) noop, _, mapped, err := mapper.Parse(tc.query) - require.Nil(t, err) + require.NoError(t, err) - shardedQry := sharded.Query(ctx, params, mapped) + shardedQry := sharded.Query(ctx, ParamsWithMappedExpression{Params: params, Mapped: mapped}) shardedRes, err := shardedQry.Exec(ctx) require.Nil(t, err) @@ -398,7 +396,7 @@ func TestRangeMappingEquivalence(t *testing.T) { t.Run(tc.query, func(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "fake") - params := NewLiteralParams( + params, err := NewLiteralParams( tc.query, start, end, @@ -408,12 +406,10 @@ func TestRangeMappingEquivalence(t *testing.T) { uint32(limit), nil, ) - - parsed, err := syntax.ParseExpr(tc.query) require.NoError(t, err) // Regular engine - qry := regularEngine.Query(params, parsed) + qry := regularEngine.Query(params) res, err := qry.Exec(ctx) require.Nil(t, err) @@ -425,7 +421,8 @@ func TestRangeMappingEquivalence(t *testing.T) { require.False(t, noop, "downstream engine cannot execute noop") - rangeQry := downstreamEngine.Query(ctx, params, rangeExpr) + params.queryExpr = rangeExpr + rangeQry := downstreamEngine.Query(ctx, params) rangeRes, err := rangeQry.Exec(ctx) require.Nil(t, err) diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index a1d14d8febd41..0a6e6e6a47fdc 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -158,12 +158,11 @@ func NewEngine(opts EngineOpts, q Querier, l Limits, logger log.Logger) *Engine } // Query creates a new LogQL query. Instant/Range type is derived from the parameters. -func (ng *Engine) Query(params Params, parsedQuery syntax.Expr) Query { +func (ng *Engine) Query(params Params) Query { return &query{ logger: ng.logger, params: params, evaluator: ng.evaluatorFactory, - queryExpr: parsedQuery, record: true, logExecQuery: ng.opts.LogExecutingQuery, limits: ng.limits, @@ -179,7 +178,6 @@ type Query interface { type query struct { logger log.Logger params Params - queryExpr syntax.Expr limits Limits evaluator EvaluatorFactory record bool @@ -265,7 +263,7 @@ func (q *query) Eval(ctx context.Context) (promql_parser.Value, error) { return nil, logqlmodel.ErrBlocked } - switch e := q.queryExpr.(type) { + switch e := q.params.GetExpression().(type) { case syntax.SampleExpr: value, err := q.evalSample(ctx, e) return value, err diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index 8cb1236bc401a..2b5b8e602eca8 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -128,17 +128,10 @@ func TestEngine_LogsRateUnwrap(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() - parsed, err := syntax.ParseExpr(test.qs) - require.NoError(t, err) - eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) - q := eng.Query(LiteralParams{ - qs: test.qs, - start: test.ts, - end: test.ts, - direction: test.direction, - limit: test.limit, - }, parsed) + params, err := NewLiteralParams(test.qs, test.ts, test.ts, 0, 0, test.direction, test.limit, nil) + require.NoError(t, err) + q := eng.Query(params) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if expectedError, ok := test.expected.(error); ok { assert.Equal(t, expectedError.Error(), err.Error()) @@ -962,17 +955,11 @@ func TestEngine_LogsInstantQuery(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() - parsed, err := syntax.ParseExpr(test.qs) - require.NoError(t, err) - eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) - q := eng.Query(LiteralParams{ - qs: test.qs, - start: test.ts, - end: test.ts, - direction: test.direction, - limit: test.limit, - }, parsed) + + params, err := NewLiteralParams(test.qs, test.ts, test.ts, 0, 0, test.direction, test.limit, nil) + require.NoError(t, err) + q := eng.Query(params) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if expectedError, ok := test.expected.(error); ok { assert.Equal(t, expectedError.Error(), err.Error()) @@ -2270,20 +2257,11 @@ func TestEngine_RangeQuery(t *testing.T) { t.Run(fmt.Sprintf("%s %s", test.qs, test.direction), func(t *testing.T) { t.Parallel() - parsed, err := syntax.ParseExpr(test.qs) - require.NoError(t, err) - eng := NewEngine(EngineOpts{}, newQuerierRecorder(t, test.data, test.params), NoLimits, log.NewNopLogger()) - q := eng.Query(LiteralParams{ - qs: test.qs, - start: test.start, - end: test.end, - step: test.step, - interval: test.interval, - direction: test.direction, - limit: test.limit, - }, parsed) + params, err := NewLiteralParams(test.qs, test.start, test.end, test.step, test.interval, test.direction, test.limit, nil) + require.NoError(t, err) + q := eng.Query(params) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if err != nil { t.Fatal(err) @@ -2310,18 +2288,12 @@ func (statsQuerier) SelectSamples(ctx context.Context, _ SelectSampleParams) (it func TestEngine_Stats(t *testing.T) { eng := NewEngine(EngineOpts{}, &statsQuerier{}, NoLimits, log.NewNopLogger()) - qs := `{foo="bar"}` - parsed, err := syntax.ParseExpr(qs) + queueTime := 2 * time.Nanosecond + + params, err := NewLiteralParams(`{foo="bar"}`, time.Now(), time.Now(), 0, 0, logproto.FORWARD, 1000, nil) require.NoError(t, err) + q := eng.Query(params) - queueTime := 2 * time.Nanosecond - q := eng.Query(LiteralParams{ - qs: `{foo="bar"}`, - start: time.Now(), - end: time.Now(), - direction: logproto.BACKWARD, - limit: 1000, - }, parsed) ctx := context.WithValue(context.Background(), httpreq.QueryQueueTimeHTTPHeader, queueTime) r, err := q.Exec(user.InjectOrgID(ctx, "fake")) require.NoError(t, err) @@ -2351,17 +2323,9 @@ func (metaQuerier) SelectSamples(ctx context.Context, _ SelectSampleParams) (ite func TestEngine_Metadata(t *testing.T) { eng := NewEngine(EngineOpts{}, &metaQuerier{}, NoLimits, log.NewNopLogger()) - qs := `{foo="bar"}` - parsed, err := syntax.ParseExpr(qs) + params, err := NewLiteralParams(`{foo="bar"}`, time.Now(), time.Now(), 0, 0, logproto.BACKWARD, 1000, nil) require.NoError(t, err) - - q := eng.Query(LiteralParams{ - qs: qs, - start: time.Now(), - end: time.Now(), - direction: logproto.BACKWARD, - limit: 1000, - }, parsed) + q := eng.Query(params) r, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) require.NoError(t, err) @@ -2375,17 +2339,10 @@ func TestEngine_LogsInstantQuery_Vector(t *testing.T) { now := time.Now() queueTime := 2 * time.Nanosecond logqlVector := `vector(5)` - parsed, err := syntax.ParseExpr(logqlVector) + + params, err := NewLiteralParams(logqlVector, now, now, 0, time.Second*30, logproto.BACKWARD, 1000, nil) require.NoError(t, err) - q := eng.Query(LiteralParams{ - qs: logqlVector, - start: now, - end: now, - step: 0, - interval: time.Second * 30, - direction: logproto.BACKWARD, - limit: 1000, - }, parsed) + q := eng.Query(params) ctx := context.WithValue(context.Background(), httpreq.QueryQueueTimeHTTPHeader, queueTime) _, err = q.Exec(user.InjectOrgID(ctx, "fake")) @@ -2463,16 +2420,9 @@ func TestStepEvaluator_Error(t *testing.T) { t.Run(tc.name, func(t *testing.T) { eng := NewEngine(EngineOpts{}, tc.querier, NoLimits, log.NewNopLogger()) - parsed, err := syntax.ParseExpr(tc.qs) + params, err := NewLiteralParams(tc.qs, time.Unix(0, 0), time.Unix(180, 0), 1*time.Second, 0, logproto.BACKWARD, 1, nil) require.NoError(t, err) - - q := eng.Query(LiteralParams{ - qs: tc.qs, - start: time.Unix(0, 0), - end: time.Unix(180, 0), - step: 1 * time.Second, - limit: 1, - }, parsed) + q := eng.Query(params) _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) require.Equal(t, tc.err, err) }) @@ -2496,17 +2446,9 @@ func TestEngine_MaxSeries(t *testing.T) { {`avg(count_over_time({app=~"foo|bar"} |~".+bar" [1m]))`, logproto.FORWARD, false}, } { t.Run(test.qs, func(t *testing.T) { - parsed, err := syntax.ParseExpr(test.qs) + params, err := NewLiteralParams(test.qs, time.Unix(0, 0), time.Unix(100000, 0), 60*time.Second, 0, test.direction, 1000, nil) require.NoError(t, err) - - q := eng.Query(LiteralParams{ - qs: test.qs, - start: time.Unix(0, 0), - end: time.Unix(100000, 0), - step: 60 * time.Second, - direction: test.direction, - limit: 1000, - }, parsed) + q := eng.Query(params) _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectLimitErr { require.NotNil(t, err) @@ -2531,17 +2473,9 @@ func TestEngine_MaxRangeInterval(t *testing.T) { {`topk(1,rate({app=~"foo|bar"}[12h]) / (rate({app="baz"}[23h]) + rate({app="fiz"}[25h])))`, logproto.FORWARD, true}, } { t.Run(test.qs, func(t *testing.T) { - parsed, err := syntax.ParseExpr(test.qs) + params, err := NewLiteralParams(test.qs, time.Unix(0, 0), time.Unix(100000, 0), 60*time.Second, 0, test.direction, 1000, nil) require.NoError(t, err) - - q := eng.Query(LiteralParams{ - qs: test.qs, - start: time.Unix(0, 0), - end: time.Unix(100000, 0), - step: 60 * time.Second, - direction: test.direction, - limit: 1000, - }, parsed) + q := eng.Query(params) _, err = q.Exec(user.InjectOrgID(context.Background(), "fake")) if test.expectLimitErr { @@ -2606,17 +2540,9 @@ func benchmarkRangeQuery(testsize int64, b *testing.B) { {`bottomk(2,rate(({app=~"foo|bar"} |~".+bar")[1m]))`, logproto.FORWARD}, {`bottomk(3,rate(({app=~"foo|bar"} |~".+bar")[1m])) without (app)`, logproto.FORWARD}, } { - parsed, err := syntax.ParseExpr(test.qs) + params, err := NewLiteralParams(test.qs, start, end, 60*time.Second, 0, logproto.BACKWARD, 1000, nil) require.NoError(b, err) - - q := eng.Query(LiteralParams{ - qs: test.qs, - start: start, - end: end, - step: 60 * time.Second, - direction: test.direction, - limit: 1000, - }, parsed) + q := eng.Query(params) res, err := q.Exec(user.InjectOrgID(context.Background(), "fake")) if err != nil { @@ -2648,8 +2574,9 @@ func TestHashingStability(t *testing.T) { parsed, err := syntax.ParseExpr(params.Query()) require.NoError(t, err) + params.queryExpr = parsed - query := eng.Query(params, parsed) + query := eng.Query(params) _, err = query.Exec(ctx) require.NoError(t, err) return buf.String() diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 0c0dba2cad3d5..0723942942193 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -39,6 +39,7 @@ type Params interface { Limit() uint32 Direction() logproto.Direction Shards() []string + GetExpression() syntax.Expr // TODO: rename to GetPlan } func NewLiteralParams( @@ -48,8 +49,8 @@ func NewLiteralParams( direction logproto.Direction, limit uint32, shards []string, -) LiteralParams { - return LiteralParams{ +) (LiteralParams, error) { + p := LiteralParams{ qs: qs, start: start, end: end, @@ -59,6 +60,10 @@ func NewLiteralParams( limit: limit, shards: shards, } + var err error + p.queryExpr, err = syntax.ParseExpr(qs) + return p, err + } // LiteralParams impls Params @@ -69,6 +74,7 @@ type LiteralParams struct { direction logproto.Direction limit uint32 shards []string + queryExpr syntax.Expr } func (p LiteralParams) Copy() LiteralParams { return p } @@ -76,6 +82,9 @@ func (p LiteralParams) Copy() LiteralParams { return p } // String impls Params func (p LiteralParams) Query() string { return p.qs } +// GetExpression impls Params +func (p LiteralParams) GetExpression() syntax.Expr { return p.queryExpr } + // Start impls Params func (p LiteralParams) Start() time.Time { return p.start } @@ -105,6 +114,17 @@ func GetRangeType(q Params) QueryRangeType { return RangeType } +// ParamsWithMappedExpression overrides the query expression so that the query +// string and the expression can differ. This is useful for sharding etc. +type ParamsWithMappedExpression struct { + Params + Mapped syntax.Expr +} + +func (p ParamsWithMappedExpression) GetExpression() syntax.Expr { + return p.Mapped +} + // Sortable logql contain sort or sort_desc. func Sortable(q Params) (bool, error) { var sortable bool diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index 2da32ee82785b..b979dedb42327 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -218,17 +218,7 @@ func (m MockDownstreamer) Downstreamer(_ context.Context) Downstreamer { return func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQuery) ([]logqlmodel.Result, error) { results := make([]logqlmodel.Result, 0, len(queries)) for _, query := range queries { - params := NewLiteralParams( - query.Expr.String(), - query.Params.Start(), - query.Params.End(), - query.Params.Step(), - query.Params.Interval(), - query.Params.Direction(), - query.Params.Limit(), - query.Shards.Encode(), - ) - res, err := m.Query(params, query.Expr).Exec(ctx) + res, err := m.Query(query.Params).Exec(ctx) if err != nil { return nil, err } diff --git a/pkg/querier/http.go b/pkg/querier/http.go index 970e0be1a6f1e..bec6d6ea5eea1 100644 --- a/pkg/querier/http.go +++ b/pkg/querier/http.go @@ -45,7 +45,7 @@ type QueryResponse struct { } type Engine interface { - Query(logql.Params, syntax.Expr) logql.Query + Query(logql.Params) logql.Query } // nolint // QuerierAPI defines HTTP handler functions for the querier. @@ -73,12 +73,13 @@ func (q *QuerierAPI) RangeQueryHandler(ctx context.Context, req *queryrange.Loki return logqlmodel.Result{}, err } + // TODO: fun fact req should implement params. So no wrapper would be required 🤷 params, err := queryrange.ParamsFromRequest(req) if err != nil { return logqlmodel.Result{}, err } - query := q.engine.Query(params, req.Plan.AST) + query := q.engine.Query(params) return query.Exec(ctx) } @@ -92,7 +93,7 @@ func (q *QuerierAPI) InstantQueryHandler(ctx context.Context, req *queryrange.Lo if err != nil { return logqlmodel.Result{}, err } - query := q.engine.Query(params, req.Plan.AST) + query := q.engine.Query(params) return query.Exec(ctx) } diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index fbf11acff91c2..aa14313e0d20e 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -275,7 +275,7 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer Interval: rangeQuery.Interval.Milliseconds(), Path: r.URL.Path, Shards: rangeQuery.Shards, - Plan: &plan.QueryPlan{ + Plan: &plan.QueryPlan{ AST: parsed, }, }, nil @@ -297,7 +297,7 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer TimeTs: req.Ts.UTC(), Path: r.URL.Path, Shards: req.Shards, - Plan: &plan.QueryPlan{ + Plan: &plan.QueryPlan{ AST: parsed, }, }, nil @@ -1442,6 +1442,10 @@ func (p paramsRangeWrapper) Query() string { return p.GetQuery() } +func (p paramsRangeWrapper) GetExpression() syntax.Expr { + return p.LokiRequest.Plan.AST +} + func (p paramsRangeWrapper) Start() time.Time { return p.GetStartTs() } @@ -1472,6 +1476,10 @@ func (p paramsInstantWrapper) Query() string { return p.GetQuery() } +func (p paramsInstantWrapper) GetExpression() syntax.Expr { + return p.LokiInstantRequest.Plan.AST +} + func (p paramsInstantWrapper) Start() time.Time { return p.LokiInstantRequest.GetTimeTs() } @@ -1500,6 +1508,10 @@ func (p paramsSeriesWrapper) Query() string { return p.GetQuery() } +func (p paramsSeriesWrapper) GetExpression() syntax.Expr { + return nil +} + func (p paramsSeriesWrapper) Start() time.Time { return p.LokiSeriesRequest.GetStartTs() } @@ -1528,6 +1540,10 @@ func (p paramsLabelWrapper) Query() string { return p.GetQuery() } +func (p paramsLabelWrapper) GetExpression() syntax.Expr { + return nil +} + func (p paramsLabelWrapper) Start() time.Time { return p.LabelRequest.GetStartTs() } @@ -1556,6 +1572,10 @@ func (p paramsStatsWrapper) Query() string { return p.GetQuery() } +func (p paramsStatsWrapper) GetExpression() syntax.Expr { + return nil // TODO: use parsed query +} + func (p paramsStatsWrapper) Start() time.Time { return p.From.Time() } diff --git a/pkg/querier/queryrange/downstreamer.go b/pkg/querier/queryrange/downstreamer.go index b7a3d2f57a3ff..95f24752f04eb 100644 --- a/pkg/querier/queryrange/downstreamer.go +++ b/pkg/querier/queryrange/downstreamer.go @@ -20,6 +20,7 @@ import ( "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/metadata" "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" "github.com/grafana/loki/pkg/util/spanlogger" @@ -55,6 +56,9 @@ func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebas Direction: params.Direction(), Path: "/loki/api/v1/query_range", // TODO(owen-d): make this derivable Shards: shards.Encode(), + Plan: &plan.QueryPlan{ + AST: params.GetExpression(), + }, } } @@ -97,7 +101,7 @@ type instance struct { func (in instance) Downstream(ctx context.Context, queries []logql.DownstreamQuery) ([]logqlmodel.Result, error) { return in.For(ctx, queries, func(qry logql.DownstreamQuery) (logqlmodel.Result, error) { - req := ParamsToLokiRequest(qry.Params, qry.Shards).WithQuery(qry.Expr.String()) + req := ParamsToLokiRequest(qry.Params, qry.Shards) sp, ctx := opentracing.StartSpanFromContext(ctx, "DownstreamHandler.instance") defer sp.Finish() logger := spanlogger.FromContext(ctx) diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index 552c0c53aa056..764868a591f92 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -223,7 +223,7 @@ func TestInstanceFor(t *testing.T) { } in := mkIn() newParams := func() logql.Params { - return logql.NewLiteralParams( + params, err := logql.NewLiteralParams( "", time.Now(), time.Now(), @@ -233,6 +233,8 @@ func TestInstanceFor(t *testing.T) { 1000, nil, ) + require.NoError(t, err) + return params } var queries []logql.DownstreamQuery @@ -309,7 +311,7 @@ func TestInstanceFor(t *testing.T) { } func TestInstanceDownstream(t *testing.T) { - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( "", time.Now(), time.Now(), @@ -320,7 +322,7 @@ func TestInstanceDownstream(t *testing.T) { nil, ) expr, err := syntax.ParseExpr(`{foo="bar"}`) - require.Nil(t, err) + require.NoError(t, err) expectedResp := func() *LokiResponse { return &LokiResponse{ @@ -340,8 +342,7 @@ func TestInstanceDownstream(t *testing.T) { queries := []logql.DownstreamQuery{ { - Expr: expr, - Params: params, + Params: logql.ParamsWithMappedExpression{Params: params, Mapped: expr}, Shards: logql.Shards{{Shard: 0, Of: 2}}, }, } @@ -484,9 +485,10 @@ func TestDownstreamAccumulatorSimple(t *testing.T) { x = append(x, *s) } // dummy params. Only need to populate direction & limit - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( "", time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, ) + require.NoError(t, err) acc := newDownstreamAccumulator(params, 1) result := logqlmodel.Result{ @@ -542,9 +544,10 @@ func TestDownstreamAccumulatorMultiMerge(t *testing.T) { } // dummy params. Only need to populate direction & limit - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( "", time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, ) + require.NoError(t, err) acc := newDownstreamAccumulator(params, 1) for i := 0; i < nQueries; i++ { diff --git a/pkg/querier/queryrange/querysharding.go b/pkg/querier/queryrange/querysharding.go index 26ec924ce5c4f..aeeff4a1fed9f 100644 --- a/pkg/querier/queryrange/querysharding.go +++ b/pkg/querier/queryrange/querysharding.go @@ -217,7 +217,7 @@ func (ast *astMapperware) Do(ctx context.Context, r queryrangebase.Request) (que default: return nil, fmt.Errorf("expected *LokiRequest or *LokiInstantRequest, got (%T)", r) } - query := ast.ng.Query(ctx, params, parsed) + query := ast.ng.Query(ctx, logql.ParamsWithMappedExpression{Params: params, Mapped: parsed}) res, err := query.Exec(ctx) if err != nil { diff --git a/pkg/querier/queryrange/split_by_range.go b/pkg/querier/queryrange/split_by_range.go index e3640761d57ec..97e69a18314b1 100644 --- a/pkg/querier/queryrange/split_by_range.go +++ b/pkg/querier/queryrange/split_by_range.go @@ -89,7 +89,7 @@ func (s *splitByRange) Do(ctx context.Context, request queryrangebase.Request) ( return nil, fmt.Errorf("expected *LokiInstantRequest") } - query := s.ng.Query(ctx, params, parsed) + query := s.ng.Query(ctx, logql.ParamsWithMappedExpression{Params: params, Mapped: parsed}) res, err := query.Exec(ctx) if err != nil { diff --git a/pkg/ruler/evaluator_local.go b/pkg/ruler/evaluator_local.go index 467cba36a0e34..91efd5a14d995 100644 --- a/pkg/ruler/evaluator_local.go +++ b/pkg/ruler/evaluator_local.go @@ -9,7 +9,6 @@ import ( "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" - "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" ) @@ -29,7 +28,7 @@ func NewLocalEvaluator(engine *logql.Engine, logger log.Logger) (*LocalEvaluator } func (l *LocalEvaluator) Eval(ctx context.Context, qs string, now time.Time) (*logqlmodel.Result, error) { - params := logql.NewLiteralParams( + params, err := logql.NewLiteralParams( qs, now, now, @@ -39,13 +38,11 @@ func (l *LocalEvaluator) Eval(ctx context.Context, qs string, now time.Time) (*l 0, nil, ) - - parsed, err := syntax.ParseExpr(qs) if err != nil { return nil, err } - q := l.engine.Query(params, parsed) + q := l.engine.Query(params) res, err := q.Exec(ctx) if err != nil { return nil, err From 9bb42ae0c1813a6ea5d0a4595d5d5a13c1d65df6 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 16:10:38 +0100 Subject: [PATCH 06/25] Rename params mapping --- pkg/logql/downstream.go | 8 ++++---- pkg/logql/downstream_test.go | 7 +++---- pkg/logql/evaluator.go | 10 +++++----- pkg/querier/queryrange/downstreamer.go | 3 +++ pkg/querier/queryrange/downstreamer_test.go | 2 +- pkg/querier/queryrange/querysharding.go | 2 +- pkg/querier/queryrange/split_by_range.go | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index 18e872c7023a7..276ca92ca78a6 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -264,7 +264,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Params: ParamsWithMappedExpression{Params: params, Mapped: e.SampleExpr}, + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.SampleExpr}, Shards: shards, }}) if err != nil { @@ -277,7 +277,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( var queries []DownstreamQuery for cur != nil { qry := DownstreamQuery{ - Params: ParamsWithMappedExpression{Params: params, Mapped: cur.DownstreamSampleExpr.SampleExpr}, + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: cur.DownstreamSampleExpr.SampleExpr}, } if shard := cur.DownstreamSampleExpr.shard; shard != nil { qry.Shards = Shards{*shard} @@ -326,7 +326,7 @@ func (ev *DownstreamEvaluator) NewIterator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Params: ParamsWithMappedExpression{Params: params, Mapped: e.LogSelectorExpr}, + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.LogSelectorExpr}, Shards: shards, }}) if err != nil { @@ -339,7 +339,7 @@ func (ev *DownstreamEvaluator) NewIterator( var queries []DownstreamQuery for cur != nil { qry := DownstreamQuery{ - Params: ParamsWithMappedExpression{Params: params, Mapped: cur.DownstreamLogSelectorExpr.LogSelectorExpr}, + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: cur.DownstreamLogSelectorExpr.LogSelectorExpr}, } if shard := cur.DownstreamLogSelectorExpr.shard; shard != nil { qry.Shards = Shards{*shard} diff --git a/pkg/logql/downstream_test.go b/pkg/logql/downstream_test.go index e316121a9642d..950f777eb21b9 100644 --- a/pkg/logql/downstream_test.go +++ b/pkg/logql/downstream_test.go @@ -88,7 +88,7 @@ func TestMappingEquivalence(t *testing.T) { _, _, mapped, err := mapper.Parse(tc.query) require.Nil(t, err) - shardedQry := sharded.Query(ctx, ParamsWithMappedExpression{Params: params, Mapped: mapped}) + shardedQry := sharded.Query(ctx, ParamsWithExpressionOverride{Params: params, ExpressionOverride: mapped}) res, err := qry.Exec(ctx) require.Nil(t, err) @@ -154,7 +154,7 @@ func TestShardCounter(t *testing.T) { noop, _, mapped, err := mapper.Parse(tc.query) require.NoError(t, err) - shardedQry := sharded.Query(ctx, ParamsWithMappedExpression{Params: params, Mapped: mapped}) + shardedQry := sharded.Query(ctx, ParamsWithExpressionOverride{Params: params, ExpressionOverride: mapped}) shardedRes, err := shardedQry.Exec(ctx) require.Nil(t, err) @@ -421,8 +421,7 @@ func TestRangeMappingEquivalence(t *testing.T) { require.False(t, noop, "downstream engine cannot execute noop") - params.queryExpr = rangeExpr - rangeQry := downstreamEngine.Query(ctx, params) + rangeQry := downstreamEngine.Query(ctx, ParamsWithExpressionOverride{Params: params, ExpressionOverride: rangeExpr}) rangeRes, err := rangeQry.Exec(ctx) require.Nil(t, err) diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 0723942942193..2e709265a4d10 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -114,15 +114,15 @@ func GetRangeType(q Params) QueryRangeType { return RangeType } -// ParamsWithMappedExpression overrides the query expression so that the query +// ParamsWithExpressionOverride overrides the query expression so that the query // string and the expression can differ. This is useful for sharding etc. -type ParamsWithMappedExpression struct { +type ParamsWithExpressionOverride struct { Params - Mapped syntax.Expr + ExpressionOverride syntax.Expr } -func (p ParamsWithMappedExpression) GetExpression() syntax.Expr { - return p.Mapped +func (p ParamsWithExpressionOverride) GetExpression() syntax.Expr { + return p.ExpressionOverride } // Sortable logql contain sort or sort_desc. diff --git a/pkg/querier/queryrange/downstreamer.go b/pkg/querier/queryrange/downstreamer.go index 95f24752f04eb..9ba2fb2b0f827 100644 --- a/pkg/querier/queryrange/downstreamer.go +++ b/pkg/querier/queryrange/downstreamer.go @@ -44,6 +44,9 @@ func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebas Direction: params.Direction(), Path: "/loki/api/v1/query", // TODO(owen-d): make this derivable Shards: shards.Encode(), + Plan: &plan.QueryPlan{ + AST: params.GetExpression(), + }, } } return &LokiRequest{ diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index 764868a591f92..039e53c0dd40c 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -342,7 +342,7 @@ func TestInstanceDownstream(t *testing.T) { queries := []logql.DownstreamQuery{ { - Params: logql.ParamsWithMappedExpression{Params: params, Mapped: expr}, + Params: logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: expr}, Shards: logql.Shards{{Shard: 0, Of: 2}}, }, } diff --git a/pkg/querier/queryrange/querysharding.go b/pkg/querier/queryrange/querysharding.go index aeeff4a1fed9f..e904115bf85df 100644 --- a/pkg/querier/queryrange/querysharding.go +++ b/pkg/querier/queryrange/querysharding.go @@ -217,7 +217,7 @@ func (ast *astMapperware) Do(ctx context.Context, r queryrangebase.Request) (que default: return nil, fmt.Errorf("expected *LokiRequest or *LokiInstantRequest, got (%T)", r) } - query := ast.ng.Query(ctx, logql.ParamsWithMappedExpression{Params: params, Mapped: parsed}) + query := ast.ng.Query(ctx, logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: parsed}) res, err := query.Exec(ctx) if err != nil { diff --git a/pkg/querier/queryrange/split_by_range.go b/pkg/querier/queryrange/split_by_range.go index 97e69a18314b1..be97d68b931b8 100644 --- a/pkg/querier/queryrange/split_by_range.go +++ b/pkg/querier/queryrange/split_by_range.go @@ -89,7 +89,7 @@ func (s *splitByRange) Do(ctx context.Context, request queryrangebase.Request) ( return nil, fmt.Errorf("expected *LokiInstantRequest") } - query := s.ng.Query(ctx, logql.ParamsWithMappedExpression{Params: params, Mapped: parsed}) + query := s.ng.Query(ctx, logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: parsed}) res, err := query.Exec(ctx) if err != nil { From 945eceaaf411e16c4559ceebc45f6d94292851f0 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 21:29:16 +0100 Subject: [PATCH 07/25] Embed shards as well --- pkg/logql/downstream.go | 26 +++++++++++++++----------- pkg/logql/evaluator.go | 9 +++++++++ pkg/logql/test_utils.go | 17 +++++++++++++++++ pkg/querier/queryrange/downstreamer.go | 12 ++++++------ 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/pkg/logql/downstream.go b/pkg/logql/downstream.go index 276ca92ca78a6..2cd706c812f6a 100644 --- a/pkg/logql/downstream.go +++ b/pkg/logql/downstream.go @@ -10,6 +10,7 @@ import ( "github.com/prometheus/prometheus/promql" "github.com/grafana/loki/pkg/iter" + "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/metadata" @@ -187,7 +188,6 @@ type Downstreamable interface { type DownstreamQuery struct { Params Params - Shards Shards } // Downstreamer is an interface for deferring responsibility for query execution. @@ -264,8 +264,10 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.SampleExpr}, - Shards: shards, + Params: ParamsWithShardsOverride{ + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.SampleExpr}, + ShardsOverride: Shards(shards).Encode(), + }, }}) if err != nil { return nil, err @@ -280,7 +282,7 @@ func (ev *DownstreamEvaluator) NewStepEvaluator( Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: cur.DownstreamSampleExpr.SampleExpr}, } if shard := cur.DownstreamSampleExpr.shard; shard != nil { - qry.Shards = Shards{*shard} + qry.Params = ParamsWithShardsOverride{Params: qry.Params, ShardsOverride: Shards{*shard}.Encode()} } queries = append(queries, qry) cur = cur.next @@ -326,13 +328,15 @@ func (ev *DownstreamEvaluator) NewIterator( shards = append(shards, *e.shard) } results, err := ev.Downstream(ctx, []DownstreamQuery{{ - Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.LogSelectorExpr}, - Shards: shards, + Params: ParamsWithShardsOverride{ + Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: e.LogSelectorExpr}, + ShardsOverride: shards.Encode(), + }, }}) if err != nil { return nil, err } - return ResultIterator(results[0], params) + return ResultIterator(results[0], params.Direction()) case *ConcatLogSelectorExpr: cur := e @@ -342,7 +346,7 @@ func (ev *DownstreamEvaluator) NewIterator( Params: ParamsWithExpressionOverride{Params: params, ExpressionOverride: cur.DownstreamLogSelectorExpr.LogSelectorExpr}, } if shard := cur.DownstreamLogSelectorExpr.shard; shard != nil { - qry.Shards = Shards{*shard} + qry.Params = ParamsWithShardsOverride{Params: qry.Params, ShardsOverride: Shards{*shard}.Encode()} } queries = append(queries, qry) cur = cur.next @@ -355,7 +359,7 @@ func (ev *DownstreamEvaluator) NewIterator( xs := make([]iter.EntryIterator, 0, len(results)) for i, res := range results { - iter, err := ResultIterator(res, params) + iter, err := ResultIterator(res, params.Direction()) if err != nil { level.Warn(util_log.Logger).Log( "msg", "could not extract Iterator", @@ -444,10 +448,10 @@ func NewResultStepEvaluator(res logqlmodel.Result, params Params) (StepEvaluator } // ResultIterator coerces a downstream streams result into an iter.EntryIterator -func ResultIterator(res logqlmodel.Result, params Params) (iter.EntryIterator, error) { +func ResultIterator(res logqlmodel.Result, direction logproto.Direction) (iter.EntryIterator, error) { streams, ok := res.Data.(logqlmodel.Streams) if !ok { return nil, fmt.Errorf("unexpected type (%s) for ResultIterator; expected %s", res.Data.Type(), logqlmodel.ValueTypeStreams) } - return iter.NewStreamsIterator(streams, params.Direction()), nil + return iter.NewStreamsIterator(streams, direction), nil } diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 2e709265a4d10..be91fef1b1f3f 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -125,6 +125,15 @@ func (p ParamsWithExpressionOverride) GetExpression() syntax.Expr { return p.ExpressionOverride } +type ParamsWithShardsOverride struct { + Params + ShardsOverride []string +} + +func (p ParamsWithShardsOverride) Shards() []string { + return p.ShardsOverride +} + // Sortable logql contain sort or sort_desc. func Sortable(q Params) (bool, error) { var sortable bool diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index b979dedb42327..84c9556e86c94 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -218,6 +218,23 @@ func (m MockDownstreamer) Downstreamer(_ context.Context) Downstreamer { return func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQuery) ([]logqlmodel.Result, error) { results := make([]logqlmodel.Result, 0, len(queries)) for _, query := range queries { + // This should just call m.Query(query.Params).Exec(ctx) TODO: figure out why downstream parses the query. + /* + params, err := NewLiteralParams( + query.Params.GetExpression().String(), + query.Params.Start(), + query.Params.End(), + query.Params.Step(), + query.Params.Interval(), + query.Params.Direction(), + query.Params.Limit(), + query.Shards.Encode(), + ) + if err != nil { + return nil, err + } + */ + res, err := m.Query(query.Params).Exec(ctx) if err != nil { return nil, err diff --git a/pkg/querier/queryrange/downstreamer.go b/pkg/querier/queryrange/downstreamer.go index 9ba2fb2b0f827..13da73483dee8 100644 --- a/pkg/querier/queryrange/downstreamer.go +++ b/pkg/querier/queryrange/downstreamer.go @@ -35,7 +35,7 @@ type DownstreamHandler struct { next queryrangebase.Handler } -func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebase.Request { +func ParamsToLokiRequest(params logql.Params) queryrangebase.Request { if logql.GetRangeType(params) == logql.InstantType { return &LokiInstantRequest{ Query: params.Query(), @@ -43,8 +43,8 @@ func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebas TimeTs: params.Start(), Direction: params.Direction(), Path: "/loki/api/v1/query", // TODO(owen-d): make this derivable - Shards: shards.Encode(), - Plan: &plan.QueryPlan{ + Shards: params.Shards(), + Plan: &plan.QueryPlan{ AST: params.GetExpression(), }, } @@ -58,7 +58,7 @@ func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebas EndTs: params.End(), Direction: params.Direction(), Path: "/loki/api/v1/query_range", // TODO(owen-d): make this derivable - Shards: shards.Encode(), + Shards: params.Shards(), Plan: &plan.QueryPlan{ AST: params.GetExpression(), }, @@ -104,12 +104,12 @@ type instance struct { func (in instance) Downstream(ctx context.Context, queries []logql.DownstreamQuery) ([]logqlmodel.Result, error) { return in.For(ctx, queries, func(qry logql.DownstreamQuery) (logqlmodel.Result, error) { - req := ParamsToLokiRequest(qry.Params, qry.Shards) + req := ParamsToLokiRequest(qry.Params) sp, ctx := opentracing.StartSpanFromContext(ctx, "DownstreamHandler.instance") defer sp.Finish() logger := spanlogger.FromContext(ctx) defer logger.Finish() - level.Debug(logger).Log("shards", fmt.Sprintf("%+v", qry.Shards), "query", req.GetQuery(), "step", req.GetStep(), "handler", reflect.TypeOf(in.handler)) + level.Debug(logger).Log("shards", fmt.Sprintf("%+v", qry.Params.Shards()), "query", req.GetQuery(), "step", req.GetStep(), "handler", reflect.TypeOf(in.handler)) res, err := in.handler.Do(ctx, req) if err != nil { From 80c6594a0179a662ef9317e9acc77f96637109af Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 21:50:05 +0100 Subject: [PATCH 08/25] Pass downstreamer test --- pkg/querier/queryrange/downstreamer.go | 2 +- pkg/querier/queryrange/downstreamer_test.go | 40 ++++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkg/querier/queryrange/downstreamer.go b/pkg/querier/queryrange/downstreamer.go index 13da73483dee8..3f4b9b49a6907 100644 --- a/pkg/querier/queryrange/downstreamer.go +++ b/pkg/querier/queryrange/downstreamer.go @@ -104,7 +104,7 @@ type instance struct { func (in instance) Downstream(ctx context.Context, queries []logql.DownstreamQuery) ([]logqlmodel.Result, error) { return in.For(ctx, queries, func(qry logql.DownstreamQuery) (logqlmodel.Result, error) { - req := ParamsToLokiRequest(qry.Params) + req := ParamsToLokiRequest(qry.Params).WithQuery(qry.Params.GetExpression().String()) sp, ctx := opentracing.StartSpanFromContext(ctx, "DownstreamHandler.instance") defer sp.Finish() logger := spanlogger.FromContext(ctx) diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index 039e53c0dd40c..f581b4d3d99e7 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -4,6 +4,8 @@ import ( "context" "errors" "fmt" + "strconv" + "strings" "sync" "testing" "time" @@ -224,7 +226,7 @@ func TestInstanceFor(t *testing.T) { in := mkIn() newParams := func() logql.Params { params, err := logql.NewLiteralParams( - "", + `{app="foo"}`, time.Now(), time.Now(), 0, @@ -282,22 +284,32 @@ func TestInstanceFor(t *testing.T) { context.TODO(), []logql.DownstreamQuery{ { - Params: newParams(), - Shards: logql.Shards{ - {Shard: 0, Of: 2}, + Params: logql.ParamsWithShardsOverride{ + Params: newParams(), + ShardsOverride: logql.Shards{ + {Shard: 0, Of: 2}, + }.Encode(), }, }, { - Params: newParams(), - Shards: logql.Shards{ - {Shard: 1, Of: 2}, + Params: logql.ParamsWithShardsOverride{ + Params: newParams(), + ShardsOverride: logql.Shards{ + {Shard: 1, Of: 2}, + }.Encode(), }, }, }, func(qry logql.DownstreamQuery) (logqlmodel.Result, error) { + // Decode shard + s := strings.Split(qry.Params.Shards()[0], "_") + shard, err := strconv.Atoi(s[0]) + if err != nil { + return logqlmodel.Result{}, err + } return logqlmodel.Result{ Data: promql.Scalar{ - V: float64(qry.Shards[0].Shard), + V: float64(shard), }, }, nil }, @@ -342,8 +354,10 @@ func TestInstanceDownstream(t *testing.T) { queries := []logql.DownstreamQuery{ { - Params: logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: expr}, - Shards: logql.Shards{{Shard: 0, Of: 2}}, + Params: logql.ParamsWithShardsOverride{ + Params: logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: expr}, + ShardsOverride: logql.Shards{{Shard: 0, Of: 2}}.Encode(), + }, }, } @@ -354,7 +368,7 @@ func TestInstanceDownstream(t *testing.T) { // for some reason these seemingly can't be checked in their own goroutines, // so we assign them to scoped variables for later comparison. got = req - want = ParamsToLokiRequest(params, queries[0].Shards).WithQuery(expr.String()) + want = ParamsToLokiRequest(queries[0].Params).WithQuery(expr.String()) return expectedResp(), nil }, @@ -486,7 +500,7 @@ func TestDownstreamAccumulatorSimple(t *testing.T) { } // dummy params. Only need to populate direction & limit params, err := logql.NewLiteralParams( - "", time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, + `{app="foo"}`, time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, ) require.NoError(t, err) @@ -545,7 +559,7 @@ func TestDownstreamAccumulatorMultiMerge(t *testing.T) { // dummy params. Only need to populate direction & limit params, err := logql.NewLiteralParams( - "", time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, + `{app="foo"}`, time.Time{}, time.Time{}, 0, 0, direction, uint32(lim), nil, ) require.NoError(t, err) From 424788d5bb81e8fc7e7c58c4189239c9e040ff46 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 22:05:08 +0100 Subject: [PATCH 09/25] Pass split by range --- pkg/logql/syntax/parser.go | 8 ++++++ pkg/querier/queryrange/downstreamer_test.go | 2 +- pkg/querier/queryrange/split_by_range_test.go | 26 +++++++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/pkg/logql/syntax/parser.go b/pkg/logql/syntax/parser.go index e1fe5971ff3a2..81874ba6d6c41 100644 --- a/pkg/logql/syntax/parser.go +++ b/pkg/logql/syntax/parser.go @@ -99,6 +99,14 @@ func ParseExprWithoutValidation(input string) (expr Expr, err error) { return p.Parse() } +func MustParseExpr(input string) Expr { + expr, err := ParseExpr(input) + if err != nil { + panic(err) + } + return expr +} + func validateExpr(expr Expr) error { switch e := expr.(type) { case SampleExpr: diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index f581b4d3d99e7..ac2b871c12f5c 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -355,7 +355,7 @@ func TestInstanceDownstream(t *testing.T) { queries := []logql.DownstreamQuery{ { Params: logql.ParamsWithShardsOverride{ - Params: logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: expr}, + Params: logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: expr}, ShardsOverride: logql.Shards{{Shard: 0, Of: 2}}.Encode(), }, }, diff --git a/pkg/querier/queryrange/split_by_range_test.go b/pkg/querier/queryrange/split_by_range_test.go index c3b4587a1dbb1..d01193d72f682 100644 --- a/pkg/querier/queryrange/split_by_range_test.go +++ b/pkg/querier/queryrange/split_by_range_test.go @@ -6,13 +6,14 @@ import ( "testing" "time" - "github.com/grafana/loki/pkg/loghttp" - "github.com/go-kit/log" "github.com/grafana/dskit/user" "github.com/stretchr/testify/require" + "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logql/syntax" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" ) @@ -37,6 +38,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum(bytes_over_time({app="foo"}[3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum(bytes_over_time({app="foo"}[3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum(bytes_over_time({app="foo"}[1m]))`, 1), @@ -50,6 +54,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum by (bar) (bytes_over_time({app="foo"}[3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum(bytes_over_time({app="foo"}[3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum by (bar)(bytes_over_time({app="foo"}[1m]))`, 10), @@ -63,6 +70,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum(count_over_time({app="foo"}[3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum(bytes_over_time({app="foo"}[3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum(count_over_time({app="foo"}[1m]))`, 1), @@ -76,6 +86,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum by (bar) (count_over_time({app="foo"}[3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (bar) (count_over_time({app="foo"}[3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum by (bar)(count_over_time({app="foo"}[1m]))`, 0), @@ -89,6 +102,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum(sum_over_time({app="foo"} | unwrap bar [3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum(sum_over_time({app="foo"} | unwrap bar [3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum(sum_over_time({app="foo"} | unwrap bar[1m]))`, 1), @@ -102,6 +118,9 @@ func Test_RangeVectorSplit(t *testing.T) { Query: `sum by (bar) (sum_over_time({app="foo"} | unwrap bar [3m]))`, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (bar) (sum_over_time({app="foo"} | unwrap bar [3m]))`), + }, }, subQueries: []queryrangebase.RequestResponse{ subQueryRequestResponse(`sum by (bar)(sum_over_time({app="foo"} | unwrap bar[1m]))`, 1), @@ -140,6 +159,9 @@ func subQueryRequestResponse(expectedSubQuery string, sampleValue float64) query Query: expectedSubQuery, TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(expectedSubQuery), + }, }, Response: &LokiPromResponse{ Response: &queryrangebase.PrometheusResponse{ From 648a134d3a7fea6b71daaba17d4b4eb3775874a9 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 22:15:59 +0100 Subject: [PATCH 10/25] Pass query --- pkg/querier/queryrange/codec_test.go | 8 +++++++- pkg/querier/worker/util_test.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/querier/queryrange/codec_test.go b/pkg/querier/queryrange/codec_test.go index 77df78aca6958..de1abbbf69d8d 100644 --- a/pkg/querier/queryrange/codec_test.go +++ b/pkg/querier/queryrange/codec_test.go @@ -559,7 +559,13 @@ func Test_codec_DecodeProtobufResponseParity(t *testing.T) { } codec := RequestProtobufCodec{} for i, queryTest := range queryTests { - u := &url.URL{Path: "/loki/api/v1/query_range"} + params := url.Values{ + "query": []string{`{app="foo"}`}, + } + u := &url.URL{ + Path: "/loki/api/v1/query_range", + RawQuery: params.Encode(), + } httpReq := &http.Request{ Method: "GET", RequestURI: u.String(), diff --git a/pkg/querier/worker/util_test.go b/pkg/querier/worker/util_test.go index a0213e3bb708b..25dd8127a0da4 100644 --- a/pkg/querier/worker/util_test.go +++ b/pkg/querier/worker/util_test.go @@ -61,7 +61,7 @@ func TestHandleQueryRequest(t *testing.T) { } { t.Run(name, func(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "1") - request, err := queryrange.DefaultCodec.QueryRequestWrap(ctx, &queryrange.LokiRequest{}) + request, err := queryrange.DefaultCodec.QueryRequestWrap(ctx, &queryrange.LokiRequest{Query: `{app="foo"}`}) require.NoError(t, err) mockHandler := HandlerFunc(func(context.Context, queryrangebase.Request) (queryrangebase.Response, error) { From 7e7468b0d7b371eea7e5348fda706f1a04255edc Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Thu, 16 Nov 2023 22:19:59 +0100 Subject: [PATCH 11/25] Set plan in encode decode test --- pkg/querier/queryrange/codec_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/querier/queryrange/codec_test.go b/pkg/querier/queryrange/codec_test.go index de1abbbf69d8d..c722b12af78d8 100644 --- a/pkg/querier/queryrange/codec_test.go +++ b/pkg/querier/queryrange/codec_test.go @@ -25,8 +25,10 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/pkg/util" "github.com/grafana/loki/pkg/util/httpreq" @@ -63,6 +65,9 @@ func Test_codec_EncodeDecodeRequest(t *testing.T) { Path: "/query_range", StartTs: start, EndTs: end, + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`{foo="bar"}`), + }, }, false}, {"query_range", func() (*http.Request, error) { return http.NewRequest(http.MethodGet, @@ -76,6 +81,9 @@ func Test_codec_EncodeDecodeRequest(t *testing.T) { Path: "/query_range", StartTs: start, EndTs: end, + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`{foo="bar"}`), + }, }, false}, {"legacy query_range with refexp", func() (*http.Request, error) { return http.NewRequest(http.MethodGet, @@ -89,6 +97,9 @@ func Test_codec_EncodeDecodeRequest(t *testing.T) { Path: "/api/prom/query", StartTs: start, EndTs: end, + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`{foo="bar"} |~ "foo"`), + }, }, false}, {"series", func() (*http.Request, error) { return http.NewRequest(http.MethodGet, @@ -560,10 +571,10 @@ func Test_codec_DecodeProtobufResponseParity(t *testing.T) { codec := RequestProtobufCodec{} for i, queryTest := range queryTests { params := url.Values{ - "query": []string{`{app="foo"}`}, + "query": []string{`{app="foo"}`}, } u := &url.URL{ - Path: "/loki/api/v1/query_range", + Path: "/loki/api/v1/query_range", RawQuery: params.Encode(), } httpReq := &http.Request{ From 55d31690d46b38f526a7c478d55826018f369b10 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Fri, 17 Nov 2023 14:26:04 +0100 Subject: [PATCH 12/25] Format protos --- pkg/querier/queryrange/queryrange.proto | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/querier/queryrange/queryrange.proto b/pkg/querier/queryrange/queryrange.proto index 44213f7219cdc..8eb43e34ca160 100644 --- a/pkg/querier/queryrange/queryrange.proto +++ b/pkg/querier/queryrange/queryrange.proto @@ -33,9 +33,7 @@ message LokiRequest { logproto.Direction direction = 6; string path = 7; repeated string shards = 8 [(gogoproto.jsontag) = "shards"]; - bytes plan = 10 [ - (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" - ]; + bytes plan = 10 [(gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan"]; } message LokiInstantRequest { @@ -48,9 +46,7 @@ message LokiInstantRequest { logproto.Direction direction = 4; string path = 5; repeated string shards = 6 [(gogoproto.jsontag) = "shards"]; - bytes plan = 7 [ - (gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan" - ]; + bytes plan = 7 [(gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/plan.QueryPlan"]; } message LokiResponse { From f6a071500747dce04947128ca32852bc03340258 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 20 Nov 2023 13:39:42 +0100 Subject: [PATCH 13/25] Set plan if it's not set. --- pkg/querier/queryrange/codec.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index aa14313e0d20e..f37dfb4e6db53 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -427,6 +427,12 @@ func (Codec) DecodeHTTPGrpcRequest(ctx context.Context, r *httpgrpc.HTTPRequest) if err != nil { return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) } + + parsed, err := syntax.ParseExpr(req.Query) + if err != nil { + return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + return &LokiRequest{ Query: req.Query, Limit: req.Limit, @@ -437,12 +443,21 @@ func (Codec) DecodeHTTPGrpcRequest(ctx context.Context, r *httpgrpc.HTTPRequest) Interval: req.Interval.Milliseconds(), Path: r.Url, Shards: req.Shards, + Plan: &plan.QueryPlan{ + AST: parsed, + }, }, ctx, nil case InstantQueryOp: req, err := loghttp.ParseInstantQuery(httpReq) if err != nil { return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) } + + parsed, err := syntax.ParseExpr(req.Query) + if err != nil { + return nil, ctx, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) + } + return &LokiInstantRequest{ Query: req.Query, Limit: req.Limit, @@ -450,6 +465,9 @@ func (Codec) DecodeHTTPGrpcRequest(ctx context.Context, r *httpgrpc.HTTPRequest) TimeTs: req.Ts.UTC(), Path: r.Url, Shards: req.Shards, + Plan: &plan.QueryPlan{ + AST: parsed, + }, }, ctx, nil case SeriesOp: req, err := loghttp.ParseAndValidateSeriesQuery(httpReq) From 64d1e2e5974df7a949b02d1bcce3de3910888eab Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 20 Nov 2023 16:31:48 +0100 Subject: [PATCH 14/25] Satisfy linter --- pkg/querier/queryrange/downstreamer_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index ac2b871c12f5c..401567cd983fb 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -333,6 +333,7 @@ func TestInstanceDownstream(t *testing.T) { 1000, nil, ) + require.NoError(t, err) expr, err := syntax.ParseExpr(`{foo="bar"}`) require.NoError(t, err) From 69a5ca2029141933b3a6b7ea9c820a71d5de9def Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 20 Nov 2023 16:33:04 +0100 Subject: [PATCH 15/25] Fix downstreamer test --- pkg/querier/queryrange/downstreamer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/querier/queryrange/downstreamer_test.go b/pkg/querier/queryrange/downstreamer_test.go index 401567cd983fb..e453f03d9a3ee 100644 --- a/pkg/querier/queryrange/downstreamer_test.go +++ b/pkg/querier/queryrange/downstreamer_test.go @@ -324,7 +324,7 @@ func TestInstanceFor(t *testing.T) { func TestInstanceDownstream(t *testing.T) { params, err := logql.NewLiteralParams( - "", + `{foo="bar"}`, time.Now(), time.Now(), 0, From 7eb70569fed505eb2dcd913e6e1dea237b7e9ffd Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 09:12:36 +0100 Subject: [PATCH 16/25] Rename Query to QueryString --- pkg/logql/blocker.go | 2 +- pkg/logql/engine.go | 10 ++++----- pkg/logql/engine_test.go | 4 ++-- pkg/logql/evaluator.go | 28 ++++++++++++++------------ pkg/logql/evaluator_test.go | 4 ++-- pkg/logql/explain_test.go | 8 ++++---- pkg/logql/metrics.go | 6 +++--- pkg/logql/metrics_test.go | 12 +++++------ pkg/querier/queryrange/codec.go | 10 ++++----- pkg/querier/queryrange/downstreamer.go | 4 ++-- pkg/querier/queryrange/stats.go | 6 +++--- pkg/querier/queryrange/stats_test.go | 12 +++++------ 12 files changed, 54 insertions(+), 52 deletions(-) diff --git a/pkg/logql/blocker.go b/pkg/logql/blocker.go index cbfdc6bf49e3b..400c08d8712da 100644 --- a/pkg/logql/blocker.go +++ b/pkg/logql/blocker.go @@ -33,7 +33,7 @@ func (qb *queryBlocker) isBlocked(ctx context.Context, tenant string) bool { return false } - query := qb.q.params.Query() + query := qb.q.params.QueryString() typ, err := QueryType(query) if err != nil { typ = "unknown" diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 43d5721391f7a..e04cf1dcffa71 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -207,7 +207,7 @@ func (q *query) Exec(ctx context.Context) (logqlmodel.Result, error) { sp.LogKV( "type", GetRangeType(q.params), - "query", q.params.Query(), + "query", q.params.QueryString(), "start", q.params.Start(), "end", q.params.End(), "step", q.params.Step(), @@ -215,11 +215,11 @@ func (q *query) Exec(ctx context.Context) (logqlmodel.Result, error) { ) if q.logExecQuery { - queryHash := util.HashedQuery(q.params.Query()) + queryHash := util.HashedQuery(q.params.QueryString()) if GetRangeType(q.params) == InstantType { - level.Info(logutil.WithContext(ctx, q.logger)).Log("msg", "executing query", "type", "instant", "query", q.params.Query(), "query_hash", queryHash) + level.Info(logutil.WithContext(ctx, q.logger)).Log("msg", "executing query", "type", "instant", "query", q.params.QueryString(), "query_hash", queryHash) } else { - level.Info(logutil.WithContext(ctx, q.logger)).Log("msg", "executing query", "type", "range", "query", q.params.Query(), "length", q.params.End().Sub(q.params.Start()), "step", q.params.Step(), "query_hash", queryHash) + level.Info(logutil.WithContext(ctx, q.logger)).Log("msg", "executing query", "type", "range", "query", q.params.QueryString(), "length", q.params.End().Sub(q.params.Start()), "step", q.params.Step(), "query_hash", queryHash) } } @@ -355,7 +355,7 @@ func (q *query) evalSample(ctx context.Context, expr syntax.SampleExpr) (promql_ if GetRangeType(q.params) == InstantType { sortByValue, err := Sortable(q.params) if err != nil { - return nil, fmt.Errorf("fail to check Sortable, logql: %s ,err: %s", q.params.Query(), err) + return nil, fmt.Errorf("fail to check Sortable, logql: %s ,err: %s", q.params.QueryString(), err) } if !sortByValue { sort.Slice(vec, func(i, j int) bool { return labels.Compare(vec[i].Metric, vec[j].Metric) < 0 }) diff --git a/pkg/logql/engine_test.go b/pkg/logql/engine_test.go index 6dbd0e7fa4af7..e0b6ab3dff2ae 100644 --- a/pkg/logql/engine_test.go +++ b/pkg/logql/engine_test.go @@ -2572,7 +2572,7 @@ func TestHashingStability(t *testing.T) { logger := log.NewLogfmtLogger(buf) eng := NewEngine(EngineOpts{LogExecutingQuery: true}, getLocalQuerier(4), NoLimits, logger) - parsed, err := syntax.ParseExpr(params.Query()) + parsed, err := syntax.ParseExpr(params.QueryString()) require.NoError(t, err) params.queryExpr = parsed @@ -2604,7 +2604,7 @@ func TestHashingStability(t *testing.T) { {`sum by(query_hash) (count_over_time({app="myapp",env="myenv"} |= "error" |= "metrics.go" | logfmt [10s]))`}, {`sum (count_over_time({app="myapp",env="myenv"} |= "error" |= "metrics.go" | logfmt [10s])) by(query_hash)`}, } { - params.qs = test.qs + params.queryString = test.qs expectedQueryHash := util.HashedQuery(test.qs) // check that both places will end up having the same query hash, even though they're emitting different log lines. diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index be91fef1b1f3f..7560eb0c3e95f 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -31,7 +31,7 @@ var ( // Params details the parameters associated with a loki request type Params interface { - Query() string + QueryString() string Start() time.Time End() time.Time Step() time.Duration @@ -51,14 +51,14 @@ func NewLiteralParams( shards []string, ) (LiteralParams, error) { p := LiteralParams{ - qs: qs, - start: start, - end: end, - step: step, - interval: interval, - direction: direction, - limit: limit, - shards: shards, + queryString: qs, + start: start, + end: end, + step: step, + interval: interval, + direction: direction, + limit: limit, + shards: shards, } var err error p.queryExpr, err = syntax.ParseExpr(qs) @@ -68,7 +68,7 @@ func NewLiteralParams( // LiteralParams impls Params type LiteralParams struct { - qs string + queryString string start, end time.Time step, interval time.Duration direction logproto.Direction @@ -80,7 +80,7 @@ type LiteralParams struct { func (p LiteralParams) Copy() LiteralParams { return p } // String impls Params -func (p LiteralParams) Query() string { return p.qs } +func (p LiteralParams) QueryString() string { return p.queryString } // GetExpression impls Params func (p LiteralParams) GetExpression() syntax.Expr { return p.queryExpr } @@ -115,12 +115,14 @@ func GetRangeType(q Params) QueryRangeType { } // ParamsWithExpressionOverride overrides the query expression so that the query -// string and the expression can differ. This is useful for sharding etc. +// string and the expression can differ. This is useful for for query planning +// when plan my not match externally available logql syntax type ParamsWithExpressionOverride struct { Params ExpressionOverride syntax.Expr } +// GetExpression returns the parsed expression of the query. func (p ParamsWithExpressionOverride) GetExpression() syntax.Expr { return p.ExpressionOverride } @@ -137,7 +139,7 @@ func (p ParamsWithShardsOverride) Shards() []string { // Sortable logql contain sort or sort_desc. func Sortable(q Params) (bool, error) { var sortable bool - expr, err := syntax.ParseSampleExpr(q.Query()) + expr, err := syntax.ParseSampleExpr(q.QueryString()) if err != nil { return false, err } diff --git a/pkg/logql/evaluator_test.go b/pkg/logql/evaluator_test.go index 1bec3d9c67d68..26ec783992495 100644 --- a/pkg/logql/evaluator_test.go +++ b/pkg/logql/evaluator_test.go @@ -44,14 +44,14 @@ func TestDefaultEvaluator_DivideByZero(t *testing.T) { } func TestDefaultEvaluator_Sortable(t *testing.T) { logqlSort := `sort(rate(({app=~"foo|bar"} |~".+bar")[1m])) ` - sortable, err := Sortable(LiteralParams{qs: logqlSort}) + sortable, err := Sortable(LiteralParams{queryString: logqlSort}) if err != nil { t.Fatal(err) } require.Equal(t, true, sortable) logqlSum := `sum(rate(({app=~"foo|bar"} |~".+bar")[1m])) ` - sortableSum, err := Sortable(LiteralParams{qs: logqlSum}) + sortableSum, err := Sortable(LiteralParams{queryString: logqlSum}) if err != nil { t.Fatal(err) } diff --git a/pkg/logql/explain_test.go b/pkg/logql/explain_test.go index a54ffa5916f2c..fe6a16bf829b8 100644 --- a/pkg/logql/explain_test.go +++ b/pkg/logql/explain_test.go @@ -33,10 +33,10 @@ func TestExplain(t *testing.T) { require.NoError(t, err) params := LiteralParams{ - qs: query, - start: time.Unix(60, 0), - end: time.Unix(60, 0), - limit: 1000, + queryString: query, + start: time.Unix(60, 0), + end: time.Unix(60, 0), + limit: 1000, } ev, err := downEv.NewStepEvaluator(ctx, downEv, expr.(syntax.SampleExpr), params) diff --git a/pkg/logql/metrics.go b/pkg/logql/metrics.go index 94a4c2f9dd408..c8ff13f22c7e2 100644 --- a/pkg/logql/metrics.go +++ b/pkg/logql/metrics.go @@ -98,7 +98,7 @@ func RecordRangeAndInstantQueryMetrics( latencyType = latencyTypeFast returnedLines = 0 ) - queryType, err := QueryType(p.Query()) + queryType, err := QueryType(p.QueryString()) if err != nil { level.Warn(logger).Log("msg", "error parsing query type", "err", err) } @@ -119,8 +119,8 @@ func RecordRangeAndInstantQueryMetrics( logValues = append(logValues, []interface{}{ "latency", latencyType, // this can be used to filter log lines. - "query", p.Query(), - "query_hash", util.HashedQuery(p.Query()), + "query", p.QueryString(), + "query_hash", util.HashedQuery(p.QueryString()), "query_type", queryType, "range_type", rt, "length", p.End().Sub(p.Start()), diff --git a/pkg/logql/metrics_test.go b/pkg/logql/metrics_test.go index 06d4e2699494e..33025f67a87af 100644 --- a/pkg/logql/metrics_test.go +++ b/pkg/logql/metrics_test.go @@ -69,12 +69,12 @@ func TestLogSlowQuery(t *testing.T) { ctx = context.WithValue(ctx, httpreq.QueryTagsHTTPHeader, "Source=logvolhist,Feature=Beta") RecordRangeAndInstantQueryMetrics(ctx, util_log.Logger, LiteralParams{ - qs: `{foo="bar"} |= "buzz"`, - direction: logproto.BACKWARD, - end: now, - start: now.Add(-1 * time.Hour), - limit: 1000, - step: time.Minute, + queryString: `{foo="bar"} |= "buzz"`, + direction: logproto.BACKWARD, + end: now, + start: now.Add(-1 * time.Hour), + limit: 1000, + step: time.Minute, }, "200", stats.Result{ Summary: stats.Summary{ BytesProcessedPerSecond: 100000, diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index f37dfb4e6db53..ca758342ad6d1 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -1456,7 +1456,7 @@ type paramsRangeWrapper struct { *LokiRequest } -func (p paramsRangeWrapper) Query() string { +func (p paramsRangeWrapper) QueryString() string { return p.GetQuery() } @@ -1490,7 +1490,7 @@ type paramsInstantWrapper struct { *LokiInstantRequest } -func (p paramsInstantWrapper) Query() string { +func (p paramsInstantWrapper) QueryString() string { return p.GetQuery() } @@ -1522,7 +1522,7 @@ type paramsSeriesWrapper struct { *LokiSeriesRequest } -func (p paramsSeriesWrapper) Query() string { +func (p paramsSeriesWrapper) QueryString() string { return p.GetQuery() } @@ -1554,7 +1554,7 @@ type paramsLabelWrapper struct { *LabelRequest } -func (p paramsLabelWrapper) Query() string { +func (p paramsLabelWrapper) QueryString() string { return p.GetQuery() } @@ -1586,7 +1586,7 @@ type paramsStatsWrapper struct { *logproto.IndexStatsRequest } -func (p paramsStatsWrapper) Query() string { +func (p paramsStatsWrapper) QueryString() string { return p.GetQuery() } diff --git a/pkg/querier/queryrange/downstreamer.go b/pkg/querier/queryrange/downstreamer.go index 3f4b9b49a6907..860aa980fb30b 100644 --- a/pkg/querier/queryrange/downstreamer.go +++ b/pkg/querier/queryrange/downstreamer.go @@ -38,7 +38,7 @@ type DownstreamHandler struct { func ParamsToLokiRequest(params logql.Params) queryrangebase.Request { if logql.GetRangeType(params) == logql.InstantType { return &LokiInstantRequest{ - Query: params.Query(), + Query: params.QueryString(), Limit: params.Limit(), TimeTs: params.Start(), Direction: params.Direction(), @@ -50,7 +50,7 @@ func ParamsToLokiRequest(params logql.Params) queryrangebase.Request { } } return &LokiRequest{ - Query: params.Query(), + Query: params.QueryString(), Limit: params.Limit(), Step: params.Step().Milliseconds(), Interval: params.Interval().Milliseconds(), diff --git a/pkg/querier/queryrange/stats.go b/pkg/querier/queryrange/stats.go index 0233d886c98f2..71f93959c3b69 100644 --- a/pkg/querier/queryrange/stats.go +++ b/pkg/querier/queryrange/stats.go @@ -53,13 +53,13 @@ func recordQueryMetrics(data *queryData) { case queryTypeLog, queryTypeMetric: logql.RecordRangeAndInstantQueryMetrics(data.ctx, logger, data.params, data.status, *data.statistics, data.result) case queryTypeLabel: - logql.RecordLabelQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.label, data.params.Query(), data.status, *data.statistics) + logql.RecordLabelQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.label, data.params.QueryString(), data.status, *data.statistics) case queryTypeSeries: logql.RecordSeriesQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.match, data.status, []string{}, *data.statistics) case queryTypeStats: - logql.RecordStatsQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.params.Query(), data.status, *data.statistics) + logql.RecordStatsQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.params.QueryString(), data.status, *data.statistics) case queryTypeVolume: - logql.RecordVolumeQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.params.Query(), data.params.Limit(), data.params.Step(), data.status, *data.statistics) + logql.RecordVolumeQueryMetrics(data.ctx, logger, data.params.Start(), data.params.End(), data.params.QueryString(), data.params.Limit(), data.params.Step(), data.status, *data.statistics) default: level.Error(logger).Log("msg", "failed to record query metrics", "err", fmt.Errorf("expected one of the *LokiRequest, *LokiInstantRequest, *LokiSeriesRequest, *LokiLabelNamesRequest, got %s", data.queryType)) } diff --git a/pkg/querier/queryrange/stats_test.go b/pkg/querier/queryrange/stats_test.go index 54c9004d88cec..28f8d12de7f6d 100644 --- a/pkg/querier/queryrange/stats_test.go +++ b/pkg/querier/queryrange/stats_test.go @@ -30,7 +30,7 @@ func TestStatsCollectorMiddleware(t *testing.T) { Query: "foo", StartTs: now, }) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, true, data.recorded) require.Equal(t, now, data.params.Start()) require.Nil(t, data.statistics) @@ -60,7 +60,7 @@ func TestStatsCollectorMiddleware(t *testing.T) { Query: "foo", StartTs: now, }) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, true, data.recorded) require.Equal(t, now, data.params.Start()) require.Equal(t, int32(10), data.statistics.Ingester.TotalReached) @@ -108,7 +108,7 @@ func Test_StatsHTTP(t *testing.T) { }), func(t *testing.T, data *queryData) { require.Equal(t, fmt.Sprintf("%d", http.StatusOK), data.status) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, logproto.BACKWARD, data.params.Direction()) require.Equal(t, uint32(100), data.params.Limit()) require.Equal(t, stats.Result{}, *data.statistics) @@ -129,7 +129,7 @@ func Test_StatsHTTP(t *testing.T) { }), func(t *testing.T, data *queryData) { require.Equal(t, fmt.Sprintf("%d", http.StatusTeapot), data.status) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, logproto.BACKWARD, data.params.Direction()) require.Equal(t, uint32(100), data.params.Limit()) require.Equal(t, statsResult, *data.statistics) @@ -151,7 +151,7 @@ func Test_StatsHTTP(t *testing.T) { }), func(t *testing.T, data *queryData) { require.Equal(t, fmt.Sprintf("%d", http.StatusTeapot), data.status) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, logproto.BACKWARD, data.params.Direction()) require.Equal(t, uint32(100), data.params.Limit()) require.Equal(t, statsResult, *data.statistics) @@ -173,7 +173,7 @@ func Test_StatsHTTP(t *testing.T) { }), func(t *testing.T, data *queryData) { require.Equal(t, fmt.Sprintf("%d", http.StatusTeapot), data.status) - require.Equal(t, "foo", data.params.Query()) + require.Equal(t, "foo", data.params.QueryString()) require.Equal(t, uint32(100), data.params.Limit()) require.Equal(t, statsResult, *data.statistics) require.Equal(t, streams, data.result) From feefd4baa7582834acb3d01db69f4acc2284cab4 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 16:02:11 +0100 Subject: [PATCH 17/25] Use AST to determine type. --- pkg/logcli/client/file.go | 2 +- pkg/logql/metrics.go | 8 ++------ pkg/logql/metrics_test.go | 3 ++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pkg/logcli/client/file.go b/pkg/logcli/client/file.go index d32a05c6a29d0..82274ef79fb8d 100644 --- a/pkg/logcli/client/file.go +++ b/pkg/logcli/client/file.go @@ -79,7 +79,7 @@ func (f *FileClient) Query(q string, limit int, t time.Time, direction logproto. nil, ) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to parse query: %w", err) } query := f.engine.Query(params) diff --git a/pkg/logql/metrics.go b/pkg/logql/metrics.go index c8ff13f22c7e2..9db8ee96e4ed4 100644 --- a/pkg/logql/metrics.go +++ b/pkg/logql/metrics.go @@ -98,7 +98,7 @@ func RecordRangeAndInstantQueryMetrics( latencyType = latencyTypeFast returnedLines = 0 ) - queryType, err := QueryType(p.QueryString()) + queryType, err := QueryType(p.GetExpression()) if err != nil { level.Warn(logger).Log("msg", "error parsing query type", "err", err) } @@ -373,11 +373,7 @@ func recordUsageStats(queryType string, stats logql_stats.Result) { } } -func QueryType(query string) (string, error) { - expr, err := syntax.ParseExpr(query) - if err != nil { - return "", err - } +func QueryType(expr syntax.Expr) (string, error) { switch e := expr.(type) { case syntax.SampleExpr: return QueryTypeMetric, nil diff --git a/pkg/logql/metrics_test.go b/pkg/logql/metrics_test.go index 33025f67a87af..ab68621092f67 100644 --- a/pkg/logql/metrics_test.go +++ b/pkg/logql/metrics_test.go @@ -16,6 +16,7 @@ import ( "github.com/uber/jaeger-client-go" "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/stats" "github.com/grafana/loki/pkg/util" @@ -44,7 +45,7 @@ func TestQueryType(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := QueryType(tt.query) + got, err := QueryType(syntax.MustParseExpr(tt.query)) if (err != nil) != tt.wantErr { t.Errorf("QueryType() error = %v, wantErr %v", err, tt.wantErr) return From 1bb299a96129193def62ebb97039be7a430f8021 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 16:14:29 +0100 Subject: [PATCH 18/25] Remove commented code with TODO --- pkg/logql/evaluator.go | 2 +- pkg/logql/test_utils.go | 17 ----------------- pkg/querier/http.go | 1 - pkg/querier/queryrange/codec.go | 2 +- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 7560eb0c3e95f..207dc8c1e035b 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -39,7 +39,7 @@ type Params interface { Limit() uint32 Direction() logproto.Direction Shards() []string - GetExpression() syntax.Expr // TODO: rename to GetPlan + GetExpression() syntax.Expr } func NewLiteralParams( diff --git a/pkg/logql/test_utils.go b/pkg/logql/test_utils.go index 84c9556e86c94..b979dedb42327 100644 --- a/pkg/logql/test_utils.go +++ b/pkg/logql/test_utils.go @@ -218,23 +218,6 @@ func (m MockDownstreamer) Downstreamer(_ context.Context) Downstreamer { return func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQuery) ([]logqlmodel.Result, error) { results := make([]logqlmodel.Result, 0, len(queries)) for _, query := range queries { - // This should just call m.Query(query.Params).Exec(ctx) TODO: figure out why downstream parses the query. - /* - params, err := NewLiteralParams( - query.Params.GetExpression().String(), - query.Params.Start(), - query.Params.End(), - query.Params.Step(), - query.Params.Interval(), - query.Params.Direction(), - query.Params.Limit(), - query.Shards.Encode(), - ) - if err != nil { - return nil, err - } - */ - res, err := m.Query(query.Params).Exec(ctx) if err != nil { return nil, err diff --git a/pkg/querier/http.go b/pkg/querier/http.go index bec6d6ea5eea1..1ecde15626ecb 100644 --- a/pkg/querier/http.go +++ b/pkg/querier/http.go @@ -73,7 +73,6 @@ func (q *QuerierAPI) RangeQueryHandler(ctx context.Context, req *queryrange.Loki return logqlmodel.Result{}, err } - // TODO: fun fact req should implement params. So no wrapper would be required 🤷 params, err := queryrange.ParamsFromRequest(req) if err != nil { return logqlmodel.Result{}, err diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index 86490607b61a1..b0c56a7439195 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -1600,7 +1600,7 @@ func (p paramsStatsWrapper) QueryString() string { } func (p paramsStatsWrapper) GetExpression() syntax.Expr { - return nil // TODO: use parsed query + return nil } func (p paramsStatsWrapper) Start() time.Time { From 1bacf24775be4d78b2fb73577cdccad7dd7e72ac Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 16:58:37 +0100 Subject: [PATCH 19/25] Do no parse AST in split by range --- pkg/logql/blocker.go | 2 +- pkg/logql/downstream_test.go | 3 +- pkg/logql/evaluator.go | 4 +++ pkg/logql/metrics_test.go | 34 ++++++++----------- pkg/logql/rangemapper.go | 8 ++--- pkg/logql/rangemapper_test.go | 19 ++++++----- pkg/querier/queryrange/roundtrip_test.go | 14 ++++++++ pkg/querier/queryrange/split_by_range.go | 14 ++++---- pkg/querier/queryrange/split_by_range_test.go | 4 +-- 9 files changed, 59 insertions(+), 43 deletions(-) diff --git a/pkg/logql/blocker.go b/pkg/logql/blocker.go index 400c08d8712da..9a07113c40dd3 100644 --- a/pkg/logql/blocker.go +++ b/pkg/logql/blocker.go @@ -34,7 +34,7 @@ func (qb *queryBlocker) isBlocked(ctx context.Context, tenant string) bool { } query := qb.q.params.QueryString() - typ, err := QueryType(query) + typ, err := QueryType(qb.q.params.GetExpression()) if err != nil { typ = "unknown" } diff --git a/pkg/logql/downstream_test.go b/pkg/logql/downstream_test.go index 950f777eb21b9..cb24931b89d1c 100644 --- a/pkg/logql/downstream_test.go +++ b/pkg/logql/downstream_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logproto" + "github.com/grafana/loki/pkg/logql/syntax" ) var nilShardMetrics = NewShardMapperMetrics(nil) @@ -416,7 +417,7 @@ func TestRangeMappingEquivalence(t *testing.T) { // Downstream engine - split by range rangeMapper, err := NewRangeMapper(tc.splitByInterval, nilRangeMetrics, NewMapperStats()) require.Nil(t, err) - noop, rangeExpr, err := rangeMapper.Parse(tc.query) + noop, rangeExpr, err := rangeMapper.Parse(syntax.MustParseExpr(tc.query)) require.Nil(t, err) require.False(t, noop, "downstream engine cannot execute noop") diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index 207dc8c1e035b..ba2b5cee8a978 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -127,11 +127,15 @@ func (p ParamsWithExpressionOverride) GetExpression() syntax.Expr { return p.ExpressionOverride } +// ParamsWithExpressionOverride overrides the shards. Since the backing +// implementation of the Params interface is unknown they are embedded and the +// original shards are shadowed. type ParamsWithShardsOverride struct { Params ShardsOverride []string } +// Shards returns this overwriting shards. func (p ParamsWithShardsOverride) Shards() []string { return p.ShardsOverride } diff --git a/pkg/logql/metrics_test.go b/pkg/logql/metrics_test.go index ab68621092f67..6d07040bb802a 100644 --- a/pkg/logql/metrics_test.go +++ b/pkg/logql/metrics_test.go @@ -26,30 +26,25 @@ import ( func TestQueryType(t *testing.T) { tests := []struct { - name string - query string - want string - wantErr bool + name string + query string + want string }{ - {"bad", "ddd", "", true}, - {"limited", `{app="foo"}`, QueryTypeLimited, false}, - {"limited multi label", `{app="foo" ,fuzz=~"foo"}`, QueryTypeLimited, false}, - {"limited with parser", `{app="foo" ,fuzz=~"foo"} | logfmt`, QueryTypeLimited, false}, - {"filter", `{app="foo"} |= "foo"`, QueryTypeFilter, false}, - {"filter string extracted label", `{app="foo"} | json | foo="a"`, QueryTypeFilter, false}, - {"filter duration", `{app="foo"} | json | duration > 5s`, QueryTypeFilter, false}, - {"metrics", `rate({app="foo"} |= "foo"[5m])`, QueryTypeMetric, false}, - {"metrics binary", `rate({app="foo"} |= "foo"[5m]) + count_over_time({app="foo"} |= "foo"[5m]) / rate({app="foo"} |= "foo"[5m]) `, QueryTypeMetric, false}, - {"filters", `{app="foo"} |= "foo" |= "f" != "b"`, QueryTypeFilter, false}, - {"filters and labels filters", `{app="foo"} |= "foo" |= "f" != "b" | json | a > 5`, QueryTypeFilter, false}, + {"limited", `{app="foo"}`, QueryTypeLimited}, + {"limited multi label", `{app="foo" ,fuzz=~"foo"}`, QueryTypeLimited}, + {"limited with parser", `{app="foo" ,fuzz=~"foo"} | logfmt`, QueryTypeLimited}, + {"filter", `{app="foo"} |= "foo"`, QueryTypeFilter}, + {"filter string extracted label", `{app="foo"} | json | foo="a"`, QueryTypeFilter}, + {"filter duration", `{app="foo"} | json | duration > 5s`, QueryTypeFilter}, + {"metrics", `rate({app="foo"} |= "foo"[5m])`, QueryTypeMetric}, + {"metrics binary", `rate({app="foo"} |= "foo"[5m]) + count_over_time({app="foo"} |= "foo"[5m]) / rate({app="foo"} |= "foo"[5m]) `, QueryTypeMetric}, + {"filters", `{app="foo"} |= "foo" |= "f" != "b"`, QueryTypeFilter}, + {"filters and labels filters", `{app="foo"} |= "foo" |= "f" != "b" | json | a > 5`, QueryTypeFilter}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, err := QueryType(syntax.MustParseExpr(tt.query)) - if (err != nil) != tt.wantErr { - t.Errorf("QueryType() error = %v, wantErr %v", err, tt.wantErr) - return - } + require.NoError(t, err) if got != tt.want { t.Errorf("QueryType() = %v, want %v", got, tt.want) } @@ -76,6 +71,7 @@ func TestLogSlowQuery(t *testing.T) { start: now.Add(-1 * time.Hour), limit: 1000, step: time.Minute, + queryExpr: syntax.MustParseExpr(`{foo="bar"} |= "buzz"`), }, "200", stats.Result{ Summary: stats.Summary{ BytesProcessedPerSecond: 100000, diff --git a/pkg/logql/rangemapper.go b/pkg/logql/rangemapper.go index cc63944bc07e9..250f586603b7e 100644 --- a/pkg/logql/rangemapper.go +++ b/pkg/logql/rangemapper.go @@ -81,10 +81,10 @@ func NewRangeMapperMetrics(registerer prometheus.Registerer) *MapperMetrics { // be executed by the downstream engine. // It returns a boolean indicating whether a rewrite was possible, the // rewritten sample expression, and an error in case the rewrite failed. -func (m RangeMapper) Parse(query string) (bool, syntax.Expr, error) { - origExpr, err := syntax.ParseSampleExpr(query) - if err != nil { - return true, nil, err +func (m RangeMapper) Parse(expr syntax.Expr) (bool, syntax.Expr, error) { + origExpr, ok := expr.(syntax.SampleExpr) + if !ok { + return true, nil, errors.New("only sample expression supported") } recorder := m.metrics.downstreamRecorder() diff --git a/pkg/logql/rangemapper_test.go b/pkg/logql/rangemapper_test.go index 1c2f827867f93..a609e00c9e2f4 100644 --- a/pkg/logql/rangemapper_test.go +++ b/pkg/logql/rangemapper_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" ) @@ -83,7 +84,7 @@ func Test_SplitRangeInterval(t *testing.T) { rvm, err := NewRangeMapper(2*time.Second, nilShardMetrics, mapperStats) require.NoError(t, err) - noop, mappedExpr, err := rvm.Parse(tc.expr) + noop, mappedExpr, err := rvm.Parse(syntax.MustParseExpr(tc.expr)) require.NoError(t, err) require.Equal(t, removeWhiteSpace(tc.expected), removeWhiteSpace(mappedExpr.String())) @@ -1741,7 +1742,7 @@ func Test_SplitRangeVectorMapping(t *testing.T) { rvm, err := NewRangeMapper(time.Minute, nilShardMetrics, mapperStats) require.NoError(t, err) - noop, mappedExpr, err := rvm.Parse(tc.expr) + noop, mappedExpr, err := rvm.Parse(syntax.MustParseExpr(tc.expr)) require.NoError(t, err) require.Equal(t, removeWhiteSpace(tc.expected), removeWhiteSpace(mappedExpr.String())) @@ -1932,7 +1933,7 @@ func Test_SplitRangeVectorMapping_Noop(t *testing.T) { rvm, err := NewRangeMapper(time.Minute, nilShardMetrics, mapperStats) require.NoError(t, err) - noop, mappedExpr, err := rvm.Parse(tc.expr) + noop, mappedExpr, err := rvm.Parse(syntax.MustParseExpr(tc.expr)) require.NoError(t, err) require.Equal(t, removeWhiteSpace(tc.expected), removeWhiteSpace(mappedExpr.String())) @@ -1945,21 +1946,21 @@ func Test_SplitRangeVectorMapping_Noop(t *testing.T) { func Test_FailQuery(t *testing.T) { rvm, err := NewRangeMapper(2*time.Minute, nilShardMetrics, NewMapperStats()) require.NoError(t, err) - _, _, err = rvm.Parse(`{app="foo"} |= "err"`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`{app="foo"} |= "err"`)) require.Error(t, err) - _, _, err = rvm.Parse(`topk(0, sum(count_over_time({app="foo"} | json | __error__="" [15m])))`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(0, sum(count_over_time({app="foo"} | json | __error__="" [15m])))`)) require.Error(t, err) // Check fixes for bug where missing or empty parameters for regexp and pattern parsers threw a panic // Missing parameter to regexp parser - _, _, err = rvm.Parse(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp [1d])))`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp [1d])))`)) require.ErrorIs(t, err, logqlmodel.ErrParse) // Empty parameter to regexp parser - _, _, err = rvm.Parse(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp ` + "``" + ` [1d])))`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp ` + "``" + ` [1d])))`)) require.ErrorIs(t, err, logqlmodel.ErrParse) // Empty parameter to pattern parser - _, _, err = rvm.Parse(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | pattern ` + `""` + ` [1d])))`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | pattern ` + `""` + ` [1d])))`)) require.ErrorIs(t, err, logqlmodel.ErrParse) // Empty parameter to json parser - _, _, err = rvm.Parse(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | json [1d])))`) + _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | json [1d])))`)) require.NoError(t, err) } diff --git a/pkg/querier/queryrange/roundtrip_test.go b/pkg/querier/queryrange/roundtrip_test.go index 4c19a1ffc1202..1959c60732629 100644 --- a/pkg/querier/queryrange/roundtrip_test.go +++ b/pkg/querier/queryrange/roundtrip_test.go @@ -23,8 +23,10 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel" "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/querier/plan" base "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/pkg/storage/chunk/cache" "github.com/grafana/loki/pkg/storage/config" @@ -1101,6 +1103,9 @@ func TestMetricsTripperware_SplitShardStats(t *testing.T) { TimeTs: testTime, Direction: logproto.FORWARD, Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (app) (rate({app="foo"} |= "foo"[2h]))`), + }, }, expectedSplitStats: 2, // [2h] interval split by 1h configured split interval expectedShardStats: 8, // 2 time splits * 4 row shards @@ -1113,6 +1118,9 @@ func TestMetricsTripperware_SplitShardStats(t *testing.T) { TimeTs: testTime, Direction: logproto.FORWARD, Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (app) (rate({app="foo"} |= "foo"[1h]))`), + }, }, expectedSplitStats: 0, // [1h] interval not split expectedShardStats: 4, // 4 row shards @@ -1127,6 +1135,9 @@ func TestMetricsTripperware_SplitShardStats(t *testing.T) { EndTs: testTime, Direction: logproto.FORWARD, Path: "/query_range", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (app) (rate({app="foo"} |= "foo"[1h]))`), + }, }, expectedSplitStats: 3, // 2 hour range interval split based on the base hour + the remainder expectedShardStats: 12, // 3 time splits * 4 row shards @@ -1141,6 +1152,9 @@ func TestMetricsTripperware_SplitShardStats(t *testing.T) { EndTs: testTime, Direction: logproto.FORWARD, Path: "/query_range", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`sum by (app) (rate({app="foo"} |= "foo"[1h]))`), + }, }, expectedSplitStats: 0, // 1 minute range interval not split expectedShardStats: 4, // 4 row shards diff --git a/pkg/querier/queryrange/split_by_range.go b/pkg/querier/queryrange/split_by_range.go index be97d68b931b8..6845846d4deaa 100644 --- a/pkg/querier/queryrange/split_by_range.go +++ b/pkg/querier/queryrange/split_by_range.go @@ -47,6 +47,11 @@ func NewSplitByRangeMiddleware(logger log.Logger, engineOpts logql.EngineOpts, l func (s *splitByRange) Do(ctx context.Context, request queryrangebase.Request) (queryrangebase.Response, error) { logger := util_log.WithContext(ctx, s.logger) + params, err := ParamsFromRequest(request) + if err != nil { + return nil, err + } + tenants, err := tenant.TenantIDs(ctx) if err != nil { return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error()) @@ -64,7 +69,7 @@ func (s *splitByRange) Do(ctx context.Context, request queryrangebase.Request) ( return nil, err } - noop, parsed, err := mapper.Parse(request.GetQuery()) + noop, parsed, err := mapper.Parse(params.GetExpression()) if err != nil { level.Warn(logger).Log("msg", "failed mapping AST", "err", err.Error(), "query", request.GetQuery()) return nil, err @@ -80,13 +85,8 @@ func (s *splitByRange) Do(ctx context.Context, request queryrangebase.Request) ( queryStatsCtx := stats.FromContext(ctx) queryStatsCtx.AddSplitQueries(int64(mapperStats.GetSplitQueries())) - params, err := ParamsFromRequest(request) - if err != nil { - return nil, err - } - if _, ok := request.(*LokiInstantRequest); !ok { - return nil, fmt.Errorf("expected *LokiInstantRequest") + return nil, fmt.Errorf("expected *LokiInstantRequest, got %T", request) } query := s.ng.Query(ctx, logql.ParamsWithExpressionOverride{Params: params, ExpressionOverride: parsed}) diff --git a/pkg/querier/queryrange/split_by_range_test.go b/pkg/querier/queryrange/split_by_range_test.go index d01193d72f682..ef25e3f910fb3 100644 --- a/pkg/querier/queryrange/split_by_range_test.go +++ b/pkg/querier/queryrange/split_by_range_test.go @@ -55,7 +55,7 @@ func Test_RangeVectorSplit(t *testing.T) { TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", Plan: &plan.QueryPlan{ - AST: syntax.MustParseExpr(`sum(bytes_over_time({app="foo"}[3m]))`), + AST: syntax.MustParseExpr(`sum by (bar) (bytes_over_time({app="foo"}[3m]))`), }, }, subQueries: []queryrangebase.RequestResponse{ @@ -71,7 +71,7 @@ func Test_RangeVectorSplit(t *testing.T) { TimeTs: time.Unix(1, 0), Path: "/loki/api/v1/query", Plan: &plan.QueryPlan{ - AST: syntax.MustParseExpr(`sum(bytes_over_time({app="foo"}[3m]))`), + AST: syntax.MustParseExpr(`sum(count_over_time({app="foo"}[3m]))`), }, }, subQueries: []queryrangebase.RequestResponse{ From 25a9b50df38d88871351686ab2cb5d0ae4d3be94 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 17:30:19 +0100 Subject: [PATCH 20/25] Calculate size with empty writer. --- pkg/querier/plan/plan.go | 27 ++++++++++++++++++++------- pkg/querier/plan/plan_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 pkg/querier/plan/plan_test.go diff --git a/pkg/querier/plan/plan.go b/pkg/querier/plan/plan.go index b7211a78e446b..08d3cda4be673 100644 --- a/pkg/querier/plan/plan.go +++ b/pkg/querier/plan/plan.go @@ -14,14 +14,13 @@ func (t QueryPlan) Marshal() ([]byte, error) { return t.MarshalJSON() } -func (t *QueryPlan) MarshalTo(data []byte) (n int, err error) { - // TODO: we probably want to write to data directly +func (t *QueryPlan) MarshalTo(data []byte) (int, error) { src, err := t.Marshal() if err != nil { return 0, err } - return copy(src, data), nil + return copy(data[:], src), nil } func (t *QueryPlan) Unmarshal(data []byte) error { @@ -29,11 +28,13 @@ func (t *QueryPlan) Unmarshal(data []byte) error { } func (t *QueryPlan) Size() int { + counter := &countWriter{} + err := syntax.EncodeJSON(t.AST, counter) + if err != nil { + return 0 + } - // TODO: we probably want to calculate the size directly. - src, _ := t.Marshal() - - return len(src) + return counter.bytes } func (t QueryPlan) MarshalJSON() ([]byte, error) { @@ -73,3 +74,15 @@ func (t QueryPlan) Equal(other QueryPlan) bool { } return bytes.Equal(left, right) } + +// countWriter is not writing any bytes. It just counts the bytes that would be +// written. +type countWriter struct { + bytes int +} + +// Write implements io.Writer. +func (w *countWriter) Write(p []byte) (int, error) { + w.bytes += len(p) + return len(p), nil +} diff --git a/pkg/querier/plan/plan_test.go b/pkg/querier/plan/plan_test.go new file mode 100644 index 0000000000000..60f7d3fad1806 --- /dev/null +++ b/pkg/querier/plan/plan_test.go @@ -0,0 +1,26 @@ +package plan + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/grafana/loki/pkg/logql/syntax" +) + +func TestMarshalTo(t *testing.T) { + plan := QueryPlan{ + AST: syntax.MustParseExpr(`sum by (foo) (bytes_over_time({app="loki"} [1m]))`), + } + + data := make([]byte, plan.Size()) + _, err := plan.MarshalTo(data) + require.NoError(t, err) + + var buf bytes.Buffer + err = syntax.EncodeJSON(plan.AST, &buf) + require.NoError(t, err) + + require.JSONEq(t, buf.String(), string(data)) +} From 01cfc3905d19de7efaa55b822e835a785607c77c Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 17:31:35 +0100 Subject: [PATCH 21/25] Use append writer --- pkg/querier/plan/plan.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkg/querier/plan/plan.go b/pkg/querier/plan/plan.go index 08d3cda4be673..6822932d7b241 100644 --- a/pkg/querier/plan/plan.go +++ b/pkg/querier/plan/plan.go @@ -15,12 +15,15 @@ func (t QueryPlan) Marshal() ([]byte, error) { } func (t *QueryPlan) MarshalTo(data []byte) (int, error) { - src, err := t.Marshal() + appender := &appendWriter{ + slice: data[:0], + } + err := syntax.EncodeJSON(t.AST, appender) if err != nil { return 0, err } - return copy(data[:], src), nil + return len(appender.slice), nil } func (t *QueryPlan) Unmarshal(data []byte) error { @@ -86,3 +89,13 @@ func (w *countWriter) Write(p []byte) (int, error) { w.bytes += len(p) return len(p), nil } + +// appendWriter appends to a slice. +type appendWriter struct { + slice []byte +} + +func (w *appendWriter) Write(p []byte) (int, error) { + w.slice = append(w.slice, p...) + return len(p), nil +} From b371968fdcac9b76dec7b51236140f455623e849 Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 17:42:48 +0100 Subject: [PATCH 22/25] Remove obsolete test cases. --- pkg/logql/rangemapper_test.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pkg/logql/rangemapper_test.go b/pkg/logql/rangemapper_test.go index a609e00c9e2f4..48394d219be1a 100644 --- a/pkg/logql/rangemapper_test.go +++ b/pkg/logql/rangemapper_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/loki/pkg/logql/syntax" - "github.com/grafana/loki/pkg/logqlmodel" ) func Test_SplitRangeInterval(t *testing.T) { @@ -1948,18 +1947,6 @@ func Test_FailQuery(t *testing.T) { require.NoError(t, err) _, _, err = rvm.Parse(syntax.MustParseExpr(`{app="foo"} |= "err"`)) require.Error(t, err) - _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(0, sum(count_over_time({app="foo"} | json | __error__="" [15m])))`)) - require.Error(t, err) - // Check fixes for bug where missing or empty parameters for regexp and pattern parsers threw a panic - // Missing parameter to regexp parser - _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp [1d])))`)) - require.ErrorIs(t, err, logqlmodel.ErrParse) - // Empty parameter to regexp parser - _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | regexp ` + "``" + ` [1d])))`)) - require.ErrorIs(t, err, logqlmodel.ErrParse) - // Empty parameter to pattern parser - _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | pattern ` + `""` + ` [1d])))`)) - require.ErrorIs(t, err, logqlmodel.ErrParse) // Empty parameter to json parser _, _, err = rvm.Parse(syntax.MustParseExpr(`topk(10,sum by(namespace)(count_over_time({application="nginx", site!="eu-west-1-dev"} |= "/artifactory/" != "api" != "binarystore" | json [1d])))`)) require.NoError(t, err) From 16b697a260a5a2eb1798660870a97cff26acf9ad Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Tue, 21 Nov 2023 18:01:58 +0100 Subject: [PATCH 23/25] Use GetExpression where applicable --- pkg/logql/downstream_test.go | 4 +-- pkg/logql/evaluator.go | 6 ++--- pkg/logql/explain_test.go | 2 +- pkg/logql/shardmapper.go | 7 +---- pkg/logql/shardmapper_test.go | 12 ++++----- pkg/querier/queryrange/querysharding.go | 12 ++++----- pkg/querier/queryrange/querysharding_test.go | 27 +++++++++++++++++--- 7 files changed, 43 insertions(+), 27 deletions(-) diff --git a/pkg/logql/downstream_test.go b/pkg/logql/downstream_test.go index cb24931b89d1c..0f4d1cd09984d 100644 --- a/pkg/logql/downstream_test.go +++ b/pkg/logql/downstream_test.go @@ -86,7 +86,7 @@ func TestMappingEquivalence(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "fake") mapper := NewShardMapper(ConstantShards(shards), nilShardMetrics) - _, _, mapped, err := mapper.Parse(tc.query) + _, _, mapped, err := mapper.Parse(params.GetExpression()) require.Nil(t, err) shardedQry := sharded.Query(ctx, ParamsWithExpressionOverride{Params: params, ExpressionOverride: mapped}) @@ -152,7 +152,7 @@ func TestShardCounter(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "fake") mapper := NewShardMapper(ConstantShards(shards), nilShardMetrics) - noop, _, mapped, err := mapper.Parse(tc.query) + noop, _, mapped, err := mapper.Parse(params.GetExpression()) require.NoError(t, err) shardedQry := sharded.Query(ctx, ParamsWithExpressionOverride{Params: params, ExpressionOverride: mapped}) diff --git a/pkg/logql/evaluator.go b/pkg/logql/evaluator.go index ba2b5cee8a978..fdb9190956a5b 100644 --- a/pkg/logql/evaluator.go +++ b/pkg/logql/evaluator.go @@ -143,9 +143,9 @@ func (p ParamsWithShardsOverride) Shards() []string { // Sortable logql contain sort or sort_desc. func Sortable(q Params) (bool, error) { var sortable bool - expr, err := syntax.ParseSampleExpr(q.QueryString()) - if err != nil { - return false, err + expr, ok := q.GetExpression().(syntax.SampleExpr) + if !ok { + return false, errors.New("only sample expression supported") } expr.Walk(func(e syntax.Expr) { rangeExpr, ok := e.(*syntax.VectorAggregationExpr) diff --git a/pkg/logql/explain_test.go b/pkg/logql/explain_test.go index fe6a16bf829b8..5ae2f840e1c88 100644 --- a/pkg/logql/explain_test.go +++ b/pkg/logql/explain_test.go @@ -29,7 +29,7 @@ func TestExplain(t *testing.T) { downEv := &DownstreamEvaluator{Downstreamer: MockDownstreamer{regular}, defaultEvaluator: defaultEv} mapper := NewShardMapper(ConstantShards(4), nilShardMetrics) - _, _, expr, err := mapper.Parse(query) + _, _, expr, err := mapper.Parse(syntax.MustParseExpr(query)) require.NoError(t, err) params := LiteralParams{ diff --git a/pkg/logql/shardmapper.go b/pkg/logql/shardmapper.go index 6409cdbf0860c..f1ee7e4ba6985 100644 --- a/pkg/logql/shardmapper.go +++ b/pkg/logql/shardmapper.go @@ -41,12 +41,7 @@ func NewShardMapperMetrics(registerer prometheus.Registerer) *MapperMetrics { return newMapperMetrics(registerer, "shard") } -func (m ShardMapper) Parse(query string) (noop bool, bytesPerShard uint64, expr syntax.Expr, err error) { - parsed, err := syntax.ParseExpr(query) - if err != nil { - return false, 0, nil, err - } - +func (m ShardMapper) Parse(parsed syntax.Expr) (noop bool, bytesPerShard uint64, expr syntax.Expr, err error) { recorder := m.metrics.downstreamRecorder() mapped, bytesPerShard, err := m.Map(parsed, recorder) diff --git a/pkg/logql/shardmapper_test.go b/pkg/logql/shardmapper_test.go index bdfd8a6c42d41..80b2e68751fee 100644 --- a/pkg/logql/shardmapper_test.go +++ b/pkg/logql/shardmapper_test.go @@ -1361,14 +1361,14 @@ func mustNewMatcher(t labels.MatchType, n, v string) *labels.Matcher { func TestStringTrimming(t *testing.T) { for _, tc := range []struct { - expr string + expr syntax.Expr expected string shards int }{ { // sample expr in entirety for low shard count shards: 2, - expr: `count_over_time({app="foo"}[1m])`, + expr: syntax.MustParseExpr(`count_over_time({app="foo"}[1m])`), expected: ` downstream ++ downstream @@ -1377,7 +1377,7 @@ func TestStringTrimming(t *testing.T) { { // sample expr doesnt display infinite shards shards: 5, - expr: `count_over_time({app="foo"}[1m])`, + expr: syntax.MustParseExpr(`count_over_time({app="foo"}[1m])`), expected: ` downstream ++ downstream ++ @@ -1389,7 +1389,7 @@ func TestStringTrimming(t *testing.T) { { // log selector expr in entirety for low shard count shards: 2, - expr: `{app="foo"}`, + expr: syntax.MustParseExpr(`{app="foo"}`), expected: ` downstream<{app="foo"},shard=0_of_2> ++ downstream<{app="foo"},shard=1_of_2> @@ -1398,7 +1398,7 @@ func TestStringTrimming(t *testing.T) { { // log selector expr doesnt display infinite shards shards: 5, - expr: `{app="foo"}`, + expr: syntax.MustParseExpr(`{app="foo"}`), expected: ` downstream<{app="foo"},shard=0_of_5> ++ downstream<{app="foo"},shard=1_of_5> ++ @@ -1408,7 +1408,7 @@ func TestStringTrimming(t *testing.T) { `, }, } { - t.Run(tc.expr, func(t *testing.T) { + t.Run(tc.expr.String(), func(t *testing.T) { m := NewShardMapper(ConstantShards(tc.shards), nilShardMetrics) _, _, mappedExpr, err := m.Parse(tc.expr) require.Nil(t, err) diff --git a/pkg/querier/queryrange/querysharding.go b/pkg/querier/queryrange/querysharding.go index e904115bf85df..1df7bb4616fb9 100644 --- a/pkg/querier/queryrange/querysharding.go +++ b/pkg/querier/queryrange/querysharding.go @@ -185,7 +185,12 @@ func (ast *astMapperware) Do(ctx context.Context, r queryrangebase.Request) (que mapper := logql.NewShardMapper(resolver, ast.metrics) - noop, bytesPerShard, parsed, err := mapper.Parse(r.GetQuery()) + params, err := ParamsFromRequest(r) + if err != nil { + return nil, err + } + + noop, bytesPerShard, parsed, err := mapper.Parse(params.GetExpression()) if err != nil { level.Warn(logger).Log("msg", "failed mapping AST", "err", err.Error(), "query", r.GetQuery()) return nil, err @@ -203,11 +208,6 @@ func (ast *astMapperware) Do(ctx context.Context, r queryrangebase.Request) (que return ast.next.Do(ctx, r) } - params, err := ParamsFromRequest(r) - if err != nil { - return nil, err - } - var path string switch r := r.(type) { case *LokiRequest: diff --git a/pkg/querier/queryrange/querysharding_test.go b/pkg/querier/queryrange/querysharding_test.go index 8c77afe0410cf..b4c36f7f6cc51 100644 --- a/pkg/querier/queryrange/querysharding_test.go +++ b/pkg/querier/queryrange/querysharding_test.go @@ -19,7 +19,9 @@ import ( "github.com/grafana/loki/pkg/loghttp" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/logql" + "github.com/grafana/loki/pkg/logql/syntax" "github.com/grafana/loki/pkg/logqlmodel/stats" + "github.com/grafana/loki/pkg/querier/plan" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase" "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase/definitions" "github.com/grafana/loki/pkg/storage/config" @@ -172,7 +174,12 @@ func Test_astMapper(t *testing.T) { 0, ) - resp, err := mware.Do(user.InjectOrgID(context.Background(), "1"), defaultReq().WithQuery(`{food="bar"}`)) + req := defaultReq() + req.Query = `{foo="bar"}` + req.Plan = &plan.QueryPlan{ + AST: syntax.MustParseExpr(req.Query), + } + resp, err := mware.Do(user.InjectOrgID(context.Background(), "1"), req) require.Nil(t, err) require.Equal(t, []*definitions.PrometheusResponseHeader{ @@ -311,7 +318,12 @@ func Test_astMapper_QuerySizeLimits(t *testing.T) { 0, ) - _, err := mware.Do(user.InjectOrgID(context.Background(), "1"), defaultReq().WithQuery(tc.query)) + req := defaultReq() + req.Query = tc.query + req.Plan = &plan.QueryPlan{ + AST: syntax.MustParseExpr(tc.query), + } + _, err := mware.Do(user.InjectOrgID(context.Background(), "1"), req) if err != nil { require.ErrorContains(t, err, tc.err) } @@ -344,7 +356,13 @@ func Test_ShardingByPass(t *testing.T) { 0, ) - _, err := mware.Do(user.InjectOrgID(context.Background(), "1"), defaultReq().WithQuery(`1+1`)) + req := defaultReq() + req.Query = `1+1` + req.Plan = &plan.QueryPlan{ + AST: syntax.MustParseExpr(req.Query), + } + + _, err := mware.Do(user.InjectOrgID(context.Background(), "1"), req) require.Nil(t, err) require.Equal(t, called, 1) } @@ -437,6 +455,9 @@ func Test_InstantSharding(t *testing.T) { Query: `rate({app="foo"}[1m])`, TimeTs: util.TimeFromMillis(10), Path: "/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(`rate({app="foo"}[1m])`), + }, }) require.NoError(t, err) require.Equal(t, 3, called, "expected 3 calls but got {}", called) From 353e9c035fb2984e4a32db5d7330c9330dbd5141 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Tue, 21 Nov 2023 17:30:05 -0800 Subject: [PATCH 24/25] fix tests that panic because of missing Plan field Signed-off-by: Callum Styan --- pkg/querier/queryrange/querysharding_test.go | 13 ++++++++++++- pkg/querier/queryrange/roundtrip_test.go | 6 +++++- pkg/querier/queryrange/split_by_interval.go | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pkg/querier/queryrange/querysharding_test.go b/pkg/querier/queryrange/querysharding_test.go index b4c36f7f6cc51..d3d3ce807ac64 100644 --- a/pkg/querier/queryrange/querysharding_test.go +++ b/pkg/querier/queryrange/querysharding_test.go @@ -724,6 +724,13 @@ func TestShardingAcrossConfigs_ASTMapper(t *testing.T) { 0, ) + // currently all the tests call `defaultReq()` which creates an instance of the type LokiRequest + // if in the future that isn't true, we need another way to access the Plan field of an arbitrary query type + // or we should set the Plan in calls to `GetExpression` if the Plan is nil by calling `ParseExpr` or similar + tc.req.(*LokiRequest).Plan = &plan.QueryPlan{ + AST: syntax.MustParseExpr(tc.req.GetQuery()), + } + resp, err := mware.Do(user.InjectOrgID(context.Background(), "1"), tc.req) require.Nil(t, err) @@ -851,12 +858,16 @@ func Test_ASTMapper_MaxLookBackPeriod(t *testing.T) { 0, ) + q := `{cluster="dev-us-central-0"}` lokiReq := &LokiInstantRequest{ - Query: `{cluster="dev-us-central-0"}`, + Query: q, Limit: 1000, TimeTs: testTime, Direction: logproto.FORWARD, Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(q), + }, } ctx := user.InjectOrgID(context.Background(), "foo") diff --git a/pkg/querier/queryrange/roundtrip_test.go b/pkg/querier/queryrange/roundtrip_test.go index 1959c60732629..b91e088041db9 100644 --- a/pkg/querier/queryrange/roundtrip_test.go +++ b/pkg/querier/queryrange/roundtrip_test.go @@ -334,12 +334,16 @@ func TestInstantQueryTripperware(t *testing.T) { } require.NoError(t, err) + q := `sum by (job) (bytes_rate({cluster="dev-us-central-0"}[15m]))` lreq := &LokiInstantRequest{ - Query: `sum by (job) (bytes_rate({cluster="dev-us-central-0"}[15m]))`, + Query: q, Limit: 1000, TimeTs: testTime, Direction: logproto.FORWARD, Path: "/loki/api/v1/query", + Plan: &plan.QueryPlan{ + AST: syntax.MustParseExpr(q), + }, } ctx := user.InjectOrgID(context.Background(), "1") diff --git a/pkg/querier/queryrange/split_by_interval.go b/pkg/querier/queryrange/split_by_interval.go index da8326a678ec5..b4245375bce66 100644 --- a/pkg/querier/queryrange/split_by_interval.go +++ b/pkg/querier/queryrange/split_by_interval.go @@ -383,6 +383,7 @@ func splitMetricByTime(r queryrangebase.Request, interval time.Duration) ([]quer Path: lokiReq.Path, StartTs: start, EndTs: end, + Plan: lokiReq.Plan, }) }) @@ -403,6 +404,7 @@ func splitMetricByTime(r queryrangebase.Request, interval time.Duration) ([]quer Path: lokiReq.Path, StartTs: start, EndTs: end, + Plan: lokiReq.Plan, }) } From 21b7c81f5e51d07bff5bf63f35e93909b35c46ea Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Tue, 21 Nov 2023 18:31:09 -0800 Subject: [PATCH 25/25] fix another test Signed-off-by: Callum Styan --- pkg/logql/evaluator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/logql/evaluator_test.go b/pkg/logql/evaluator_test.go index 26ec783992495..e31d587252066 100644 --- a/pkg/logql/evaluator_test.go +++ b/pkg/logql/evaluator_test.go @@ -44,14 +44,14 @@ func TestDefaultEvaluator_DivideByZero(t *testing.T) { } func TestDefaultEvaluator_Sortable(t *testing.T) { logqlSort := `sort(rate(({app=~"foo|bar"} |~".+bar")[1m])) ` - sortable, err := Sortable(LiteralParams{queryString: logqlSort}) + sortable, err := Sortable(LiteralParams{queryString: logqlSort, queryExpr: syntax.MustParseExpr(logqlSort)}) if err != nil { t.Fatal(err) } require.Equal(t, true, sortable) logqlSum := `sum(rate(({app=~"foo|bar"} |~".+bar")[1m])) ` - sortableSum, err := Sortable(LiteralParams{queryString: logqlSum}) + sortableSum, err := Sortable(LiteralParams{queryString: logqlSum, queryExpr: syntax.MustParseExpr(logqlSum)}) if err != nil { t.Fatal(err) }