diff --git a/pkg/querier/base/querier.go b/pkg/querier/base/querier.go index b4d3547920..6a90fbcb10 100644 --- a/pkg/querier/base/querier.go +++ b/pkg/querier/base/querier.go @@ -5,7 +5,6 @@ import ( "errors" "flag" "fmt" - "strings" "sync" "time" @@ -62,10 +61,6 @@ type Config struct { // series is considered stale. LookbackDelta time.Duration `yaml:"lookback_delta"` - // Blocks storage only. - StoreGatewayAddresses string `yaml:"store_gateway_addresses"` - StoreGatewayClient ClientConfig `yaml:"store_gateway_client"` - SecondStoreEngine string `yaml:"second_store_engine"` UseSecondStoreBeforeTime flagext.Time `yaml:"use_second_store_before_time"` @@ -80,7 +75,6 @@ var ( // RegisterFlags adds the flags required to config this to the given FlagSet. func (cfg *Config) RegisterFlags(f *flag.FlagSet) { - cfg.StoreGatewayClient.RegisterFlagsWithPrefix("querier.store-gateway-client", f) f.IntVar(&cfg.MaxConcurrent, "querier.max-concurrent", 20, "The maximum number of concurrent queries.") f.DurationVar(&cfg.Timeout, "querier.timeout", 2*time.Minute, "The timeout for a query.") f.BoolVar(&cfg.Iterators, "querier.iterators", false, "Use iterators to execute query, as opposed to fully materialising the series in memory.") @@ -94,7 +88,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { f.DurationVar(&cfg.DefaultEvaluationInterval, "querier.default-evaluation-interval", time.Minute, "The default evaluation interval or step size for subqueries.") f.DurationVar(&cfg.QueryStoreAfter, "querier.query-store-after", 0, "The time after which a metric should be queried from storage and not just ingesters. 0 means all queries are sent to store. When running the blocks storage, if this option is enabled, the time range of the query sent to the store will be manipulated to ensure the query end is not more recent than 'now - query-store-after'.") f.StringVar(&cfg.ActiveQueryTrackerDir, "querier.active-query-tracker-dir", "./active-query-tracker", "Active query tracker monitors active queries, and writes them to the file in given directory. If Cortex discovers any queries in this log during startup, it will log them to the log file. Setting to empty value disables active query tracker, which also disables -querier.max-concurrent option.") - f.StringVar(&cfg.StoreGatewayAddresses, "querier.store-gateway-addresses", "", "Comma separated list of store-gateway addresses in DNS Service Discovery format. This option should be set when using the blocks storage and the store-gateway sharding is disabled (when enabled, the store-gateway instances form a ring and addresses are picked from the ring).") f.DurationVar(&cfg.LookbackDelta, "querier.lookback-delta", 5*time.Minute, "Time since the last sample after which a time series is considered stale and ignored by expression evaluations.") f.StringVar(&cfg.SecondStoreEngine, "querier.second-store-engine", "", "Second store engine to use for querying. Empty = disabled.") f.Var(&cfg.UseSecondStoreBeforeTime, "querier.use-second-store-before-time", "If specified, second store is only used for queries before this timestamp. Default value 0 means secondary store is always queried.") @@ -119,14 +112,6 @@ func (cfg *Config) Validate() error { return nil } -func (cfg *Config) GetStoreGatewayAddresses() []string { - if cfg.StoreGatewayAddresses == "" { - return nil - } - - return strings.Split(cfg.StoreGatewayAddresses, ",") -} - func getChunksIteratorFunction(cfg Config) chunkIteratorFunc { if cfg.BatchIterators { return batch.NewChunkMergeIterator diff --git a/pkg/querier/base/store_gateway_client.go b/pkg/querier/base/store_gateway_client.go index 547501d523..a3d74e42b4 100644 --- a/pkg/querier/base/store_gateway_client.go +++ b/pkg/querier/base/store_gateway_client.go @@ -4,67 +4,8 @@ import ( "flag" "github.com/grafana/dskit/crypto/tls" - "github.com/grafana/dskit/grpcclient" - "github.com/grafana/dskit/ring/client" - "github.com/pkg/errors" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" - "google.golang.org/grpc" - "google.golang.org/grpc/health/grpc_health_v1" - - "github.com/grafana/loki/pkg/storegateway/storegatewaypb" ) -func newStoreGatewayClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer) client.PoolFactory { - requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{ - Namespace: "cortex", - Name: "storegateway_client_request_duration_seconds", - Help: "Time spent executing requests to the store-gateway.", - Buckets: prometheus.ExponentialBuckets(0.008, 4, 7), - ConstLabels: prometheus.Labels{"client": "querier"}, - }, []string{"operation", "status_code"}) - - return func(addr string) (client.PoolClient, error) { - return dialStoreGatewayClient(clientCfg, addr, requestDuration) - } -} - -func dialStoreGatewayClient(clientCfg grpcclient.Config, addr string, requestDuration *prometheus.HistogramVec) (*storeGatewayClient, error) { - opts, err := clientCfg.DialOption(grpcclient.Instrument(requestDuration)) - if err != nil { - return nil, err - } - - conn, err := grpc.Dial(addr, opts...) - if err != nil { - return nil, errors.Wrapf(err, "failed to dial store-gateway %s", addr) - } - - return &storeGatewayClient{ - StoreGatewayClient: storegatewaypb.NewStoreGatewayClient(conn), - HealthClient: grpc_health_v1.NewHealthClient(conn), - conn: conn, - }, nil -} - -type storeGatewayClient struct { - storegatewaypb.StoreGatewayClient - grpc_health_v1.HealthClient - conn *grpc.ClientConn -} - -func (c *storeGatewayClient) Close() error { - return c.conn.Close() -} - -func (c *storeGatewayClient) String() string { - return c.RemoteAddress() -} - -func (c *storeGatewayClient) RemoteAddress() string { - return c.conn.Target() -} - type ClientConfig struct { TLSEnabled bool `yaml:"tls_enabled"` TLS tls.ClientConfig `yaml:",inline"` diff --git a/pkg/querier/base/store_gateway_client_test.go b/pkg/querier/base/store_gateway_client_test.go index 2512aad5e7..22f1111448 100644 --- a/pkg/querier/base/store_gateway_client_test.go +++ b/pkg/querier/base/store_gateway_client_test.go @@ -1,82 +1 @@ package base - -import ( - "context" - "net" - "testing" - - "github.com/grafana/dskit/flagext" - "github.com/grafana/dskit/grpcclient" - "github.com/prometheus/client_golang/prometheus" - dto "github.com/prometheus/client_model/go" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/thanos-io/thanos/pkg/store/storepb" - "github.com/weaveworks/common/user" - "google.golang.org/grpc" - - "github.com/grafana/loki/pkg/storegateway/storegatewaypb" -) - -func Test_newStoreGatewayClientFactory(t *testing.T) { - // Create a GRPC server used to query the mocked service. - grpcServer := grpc.NewServer() - defer grpcServer.GracefulStop() - - srv := &mockStoreGatewayServer{} - storegatewaypb.RegisterStoreGatewayServer(grpcServer, srv) - - listener, err := net.Listen("tcp", "localhost:0") - require.NoError(t, err) - - go func() { - require.NoError(t, grpcServer.Serve(listener)) - }() - - // Create a client factory and query back the mocked service - // with different clients. - cfg := grpcclient.Config{} - flagext.DefaultValues(&cfg) - - reg := prometheus.NewPedanticRegistry() - factory := newStoreGatewayClientFactory(cfg, reg) - - for i := 0; i < 2; i++ { - client, err := factory(listener.Addr().String()) - require.NoError(t, err) - defer client.Close() //nolint:errcheck - - ctx := user.InjectOrgID(context.Background(), "test") - stream, err := client.(*storeGatewayClient).Series(ctx, &storepb.SeriesRequest{}) - assert.NoError(t, err) - - // Read the entire response from the stream. - for _, err = stream.Recv(); err == nil; { - } - } - - // Assert on the request duration metric, but since it's a duration histogram and - // we can't predict the exact time it took, we need to workaround it. - metrics, err := reg.Gather() - require.NoError(t, err) - - assert.Len(t, metrics, 1) - assert.Equal(t, "cortex_storegateway_client_request_duration_seconds", metrics[0].GetName()) - assert.Equal(t, dto.MetricType_HISTOGRAM, metrics[0].GetType()) - assert.Len(t, metrics[0].GetMetric(), 1) - assert.Equal(t, uint64(2), metrics[0].GetMetric()[0].GetHistogram().GetSampleCount()) -} - -type mockStoreGatewayServer struct{} - -func (m *mockStoreGatewayServer) Series(_ *storepb.SeriesRequest, srv storegatewaypb.StoreGateway_SeriesServer) error { - return nil -} - -func (m *mockStoreGatewayServer) LabelNames(context.Context, *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { - return nil, nil -} - -func (m *mockStoreGatewayServer) LabelValues(context.Context, *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) { - return nil, nil -} diff --git a/pkg/storegateway/storegatewaypb/gateway.pb.go b/pkg/storegateway/storegatewaypb/gateway.pb.go deleted file mode 100644 index 9eb8eb60fc..0000000000 --- a/pkg/storegateway/storegatewaypb/gateway.pb.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/storegateway/storegatewaypb/gateway.proto - -package storegatewaypb - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - storepb "github.com/thanos-io/thanos/pkg/store/storepb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// 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 - -func init() { - proto.RegisterFile("pkg/storegateway/storegatewaypb/gateway.proto", fileDescriptor_3b0b40cab91a425a) -} - -var fileDescriptor_3b0b40cab91a425a = []byte{ - // 262 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2d, 0xc8, 0x4e, 0xd7, - 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0x4d, 0x4f, 0x2c, 0x49, 0x2d, 0x4f, 0xac, 0x44, 0xe1, 0x14, 0x24, - 0xe9, 0x43, 0x59, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x70, 0x09, 0x29, 0xf3, 0xf4, - 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0x92, 0x8c, 0xc4, 0xbc, 0xfc, 0x62, - 0xdd, 0xcc, 0x7c, 0x28, 0x4b, 0x1f, 0x6e, 0x2a, 0x84, 0x2c, 0x48, 0xd2, 0x2f, 0x2a, 0x48, 0x86, - 0x98, 0x61, 0x74, 0x8d, 0x91, 0x8b, 0x27, 0x18, 0x24, 0xea, 0x0e, 0x31, 0x4b, 0xc8, 0x92, 0x8b, - 0x2d, 0x38, 0xb5, 0x28, 0x33, 0xb5, 0x58, 0x48, 0x54, 0x0f, 0xa2, 0x5f, 0x0f, 0xc2, 0x0f, 0x4a, - 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x91, 0x12, 0x43, 0x17, 0x2e, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, - 0x60, 0x14, 0x72, 0xe6, 0xe2, 0xf2, 0x49, 0x4c, 0x4a, 0xcd, 0xf1, 0x4b, 0xcc, 0x4d, 0x2d, 0x16, - 0x92, 0x84, 0xa9, 0x43, 0x88, 0xc1, 0x8c, 0x90, 0xc2, 0x26, 0x05, 0x31, 0x46, 0xc8, 0x8d, 0x8b, - 0x1b, 0x2c, 0x1a, 0x96, 0x98, 0x53, 0x9a, 0x5a, 0x2c, 0x84, 0xaa, 0x14, 0x22, 0x08, 0x33, 0x46, - 0x1a, 0xab, 0x1c, 0xc4, 0x1c, 0x27, 0x97, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, - 0xf0, 0x50, 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, - 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c, 0x1f, 0x1e, 0xc9, - 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x7c, - 0xa8, 0x01, 0x9e, 0xc4, 0x06, 0x0e, 0x25, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xed, - 0xb4, 0x59, 0x9a, 0x01, 0x00, 0x00, -} - -// 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 - -// StoreGatewayClient is the client API for StoreGateway service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StoreGatewayClient interface { - // Series streams each Series for given label matchers and time range. - // - // Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - // partition of the single series, but once a new series is started to be streamed it means that no more data will - // be sent for previous one. - // - // Series are sorted. - Series(ctx context.Context, in *storepb.SeriesRequest, opts ...grpc.CallOption) (StoreGateway_SeriesClient, error) - // LabelNames returns all label names that is available. - LabelNames(ctx context.Context, in *storepb.LabelNamesRequest, opts ...grpc.CallOption) (*storepb.LabelNamesResponse, error) - // LabelValues returns all label values for given label name. - LabelValues(ctx context.Context, in *storepb.LabelValuesRequest, opts ...grpc.CallOption) (*storepb.LabelValuesResponse, error) -} - -type storeGatewayClient struct { - cc *grpc.ClientConn -} - -func NewStoreGatewayClient(cc *grpc.ClientConn) StoreGatewayClient { - return &storeGatewayClient{cc} -} - -func (c *storeGatewayClient) Series(ctx context.Context, in *storepb.SeriesRequest, opts ...grpc.CallOption) (StoreGateway_SeriesClient, error) { - stream, err := c.cc.NewStream(ctx, &_StoreGateway_serviceDesc.Streams[0], "/gatewaypb.StoreGateway/Series", opts...) - if err != nil { - return nil, err - } - x := &storeGatewaySeriesClient{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 StoreGateway_SeriesClient interface { - Recv() (*storepb.SeriesResponse, error) - grpc.ClientStream -} - -type storeGatewaySeriesClient struct { - grpc.ClientStream -} - -func (x *storeGatewaySeriesClient) Recv() (*storepb.SeriesResponse, error) { - m := new(storepb.SeriesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storeGatewayClient) LabelNames(ctx context.Context, in *storepb.LabelNamesRequest, opts ...grpc.CallOption) (*storepb.LabelNamesResponse, error) { - out := new(storepb.LabelNamesResponse) - err := c.cc.Invoke(ctx, "/gatewaypb.StoreGateway/LabelNames", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeGatewayClient) LabelValues(ctx context.Context, in *storepb.LabelValuesRequest, opts ...grpc.CallOption) (*storepb.LabelValuesResponse, error) { - out := new(storepb.LabelValuesResponse) - err := c.cc.Invoke(ctx, "/gatewaypb.StoreGateway/LabelValues", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreGatewayServer is the server API for StoreGateway service. -type StoreGatewayServer interface { - // Series streams each Series for given label matchers and time range. - // - // Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - // partition of the single series, but once a new series is started to be streamed it means that no more data will - // be sent for previous one. - // - // Series are sorted. - Series(*storepb.SeriesRequest, StoreGateway_SeriesServer) error - // LabelNames returns all label names that is available. - LabelNames(context.Context, *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) - // LabelValues returns all label values for given label name. - LabelValues(context.Context, *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) -} - -// UnimplementedStoreGatewayServer can be embedded to have forward compatible implementations. -type UnimplementedStoreGatewayServer struct { -} - -func (*UnimplementedStoreGatewayServer) Series(req *storepb.SeriesRequest, srv StoreGateway_SeriesServer) error { - return status.Errorf(codes.Unimplemented, "method Series not implemented") -} -func (*UnimplementedStoreGatewayServer) LabelNames(ctx context.Context, req *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") -} -func (*UnimplementedStoreGatewayServer) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") -} - -func RegisterStoreGatewayServer(s *grpc.Server, srv StoreGatewayServer) { - s.RegisterService(&_StoreGateway_serviceDesc, srv) -} - -func _StoreGateway_Series_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(storepb.SeriesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StoreGatewayServer).Series(m, &storeGatewaySeriesServer{stream}) -} - -type StoreGateway_SeriesServer interface { - Send(*storepb.SeriesResponse) error - grpc.ServerStream -} - -type storeGatewaySeriesServer struct { - grpc.ServerStream -} - -func (x *storeGatewaySeriesServer) Send(m *storepb.SeriesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _StoreGateway_LabelNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(storepb.LabelNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreGatewayServer).LabelNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gatewaypb.StoreGateway/LabelNames", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreGatewayServer).LabelNames(ctx, req.(*storepb.LabelNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _StoreGateway_LabelValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(storepb.LabelValuesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreGatewayServer).LabelValues(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gatewaypb.StoreGateway/LabelValues", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreGatewayServer).LabelValues(ctx, req.(*storepb.LabelValuesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _StoreGateway_serviceDesc = grpc.ServiceDesc{ - ServiceName: "gatewaypb.StoreGateway", - HandlerType: (*StoreGatewayServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LabelNames", - Handler: _StoreGateway_LabelNames_Handler, - }, - { - MethodName: "LabelValues", - Handler: _StoreGateway_LabelValues_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Series", - Handler: _StoreGateway_Series_Handler, - ServerStreams: true, - }, - }, - Metadata: "pkg/storegateway/storegatewaypb/gateway.proto", -} diff --git a/pkg/storegateway/storegatewaypb/gateway.proto b/pkg/storegateway/storegatewaypb/gateway.proto deleted file mode 100644 index 14e65859c2..0000000000 --- a/pkg/storegateway/storegatewaypb/gateway.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package gatewaypb; - -import "github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto"; - -option go_package = "storegatewaypb"; - -service StoreGateway { - // Series streams each Series for given label matchers and time range. - // - // Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - // partition of the single series, but once a new series is started to be streamed it means that no more data will - // be sent for previous one. - // - // Series are sorted. - rpc Series(thanos.SeriesRequest) returns (stream thanos.SeriesResponse); - - // LabelNames returns all label names that is available. - rpc LabelNames(thanos.LabelNamesRequest) returns (thanos.LabelNamesResponse); - - // LabelValues returns all label values for given label name. - rpc LabelValues(thanos.LabelValuesRequest) returns (thanos.LabelValuesResponse); -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go deleted file mode 100644 index 69a69f029b..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -// Package containing proto and JSON serializable Labels and ZLabels (no copy) structs used to -// identify series. This package expose no-copy converters to Prometheus labels.Labels. - -package labelpb - -import ( - "encoding/json" - "fmt" - "io" - "sort" - "strings" - "unsafe" - - "github.com/cespare/xxhash/v2" - "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" -) - -var sep = []byte{'\xff'} - -func noAllocString(buf []byte) string { - return *(*string)(unsafe.Pointer(&buf)) -} - -func noAllocBytes(buf string) []byte { - return *(*[]byte)(unsafe.Pointer(&buf)) -} - -// ZLabelsFromPromLabels converts Prometheus labels to slice of labelpb.ZLabel in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -func ZLabelsFromPromLabels(lset labels.Labels) []ZLabel { - return *(*[]ZLabel)(unsafe.Pointer(&lset)) -} - -// ZLabelsToPromLabels convert slice of labelpb.ZLabel to Prometheus labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed []ZLabel. -// NOTE: Use with care. ZLabels holds memory from the whole protobuf unmarshal, so the returned -// Prometheus Labels will hold this memory as well. -func ZLabelsToPromLabels(lset []ZLabel) labels.Labels { - return *(*labels.Labels)(unsafe.Pointer(&lset)) -} - -// ReAllocZLabelsStrings re-allocates all underlying bytes for string, detaching it from bigger memory pool. -func ReAllocZLabelsStrings(lset *[]ZLabel) { - for j, l := range *lset { - // NOTE: This trick converts from string to byte without copy, but copy when creating string. - (*lset)[j].Name = string(noAllocBytes(l.Name)) - (*lset)[j].Value = string(noAllocBytes(l.Value)) - } -} - -// LabelsFromPromLabels converts Prometheus labels to slice of labelpb.ZLabel in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -func LabelsFromPromLabels(lset labels.Labels) []Label { - return *(*[]Label)(unsafe.Pointer(&lset)) -} - -// LabelsToPromLabels convert slice of labelpb.ZLabel to Prometheus labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed []Label. -func LabelsToPromLabels(lset []Label) labels.Labels { - return *(*labels.Labels)(unsafe.Pointer(&lset)) -} - -// ZLabelSetsToPromLabelSets converts slice of labelpb.ZLabelSet to slice of Prometheus labels. -func ZLabelSetsToPromLabelSets(lss ...ZLabelSet) []labels.Labels { - res := make([]labels.Labels, 0, len(lss)) - for _, ls := range lss { - res = append(res, ls.PromLabels()) - } - return res -} - -// ZLabel is a Label (also easily transformable to Prometheus labels.Labels) that can be unmarshalled from protobuf -// reusing the same memory address for string bytes. -// NOTE: While unmarshalling it uses exactly same bytes that were allocated for protobuf. This mean that *whole* protobuf -// bytes will be not GC-ed as long as ZLabels are referenced somewhere. Use it carefully, only for short living -// protobuf message processing. -type ZLabel Label - -func (m *ZLabel) MarshalTo(data []byte) (int, error) { - f := Label(*m) - return f.MarshalTo(data) -} - -func (m *ZLabel) MarshalToSizedBuffer(data []byte) (int, error) { - f := Label(*m) - return f.MarshalToSizedBuffer(data) -} - -// Unmarshal unmarshalls gRPC protobuf into ZLabel struct. ZLabel string is directly using bytes passed in `data`. -// To use it add (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" to proto field tag. -// NOTE: This exists in internal Google protobuf implementation, but not in open source one: https://news.ycombinator.com/item?id=23588882 -func (m *ZLabel) 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 ErrIntOverflowTypes - } - 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: ZLabel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabel: 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = noAllocString(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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = noAllocString(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ZLabel) UnmarshalJSON(entry []byte) error { - f := Label(*m) - if err := json.Unmarshal(entry, &f); err != nil { - return errors.Wrapf(err, "labels: label field unmarshal: %v", string(entry)) - } - *m = ZLabel(f) - return nil -} - -func (m *ZLabel) Marshal() ([]byte, error) { - f := Label(*m) - return f.Marshal() -} - -func (m *ZLabel) MarshalJSON() ([]byte, error) { - return json.Marshal(Label(*m)) -} - -// Size implements proto.Sizer. -func (m *ZLabel) Size() (n int) { - f := Label(*m) - return f.Size() -} - -// Equal implements proto.Equaler. -func (m *ZLabel) Equal(other ZLabel) bool { - return m.Name == other.Name && m.Value == other.Value -} - -// Compare implements proto.Comparer. -func (m *ZLabel) Compare(other ZLabel) int { - if c := strings.Compare(m.Name, other.Name); c != 0 { - return c - } - return strings.Compare(m.Value, other.Value) -} - -// ExtendSortedLabels extend given labels by extend in labels format. -// The type conversion is done safely, which means we don't modify extend labels underlying array. -// -// In case of existing labels already present in given label set, it will be overwritten by external one. -// NOTE: Labels and extend has to be sorted. -func ExtendSortedLabels(lset, extend labels.Labels) labels.Labels { - ret := make(labels.Labels, 0, len(lset)+len(extend)) - - // Inject external labels in place. - for len(lset) > 0 && len(extend) > 0 { - d := strings.Compare(lset[0].Name, extend[0].Name) - if d == 0 { - // Duplicate, prefer external labels. - // NOTE(fabxc): Maybe move it to a prefixed version to still ensure uniqueness of series? - ret = append(ret, extend[0]) - lset, extend = lset[1:], extend[1:] - } else if d < 0 { - ret = append(ret, lset[0]) - lset = lset[1:] - } else if d > 0 { - ret = append(ret, extend[0]) - extend = extend[1:] - } - } - - // Append all remaining elements. - ret = append(ret, lset...) - ret = append(ret, extend...) - return ret -} - -func PromLabelSetsToString(lsets []labels.Labels) string { - s := []string{} - for _, ls := range lsets { - s = append(s, ls.String()) - } - sort.Strings(s) - return strings.Join(s, ",") -} - -func (m *ZLabelSet) UnmarshalJSON(entry []byte) error { - lbls := labels.Labels{} - if err := lbls.UnmarshalJSON(entry); err != nil { - return errors.Wrapf(err, "labels: labels field unmarshal: %v", string(entry)) - } - sort.Sort(lbls) - m.Labels = ZLabelsFromPromLabels(lbls) - return nil -} - -func (m *ZLabelSet) MarshalJSON() ([]byte, error) { - return m.PromLabels().MarshalJSON() -} - -// PromLabels return Prometheus labels.Labels without extra allocation. -func (m *ZLabelSet) PromLabels() labels.Labels { - return ZLabelsToPromLabels(m.Labels) -} - -// DeepCopy copies labels and each label's string to separate bytes. -func DeepCopy(lbls []ZLabel) []ZLabel { - ret := make([]ZLabel, len(lbls)) - for i := range lbls { - ret[i].Name = string(noAllocBytes(lbls[i].Name)) - ret[i].Value = string(noAllocBytes(lbls[i].Value)) - } - return ret -} - -// HashWithPrefix returns a hash for the given prefix and labels. -func HashWithPrefix(prefix string, lbls []ZLabel) uint64 { - // Use xxhash.Sum64(b) for fast path as it's faster. - b := make([]byte, 0, 1024) - b = append(b, prefix...) - b = append(b, sep[0]) - - for i, v := range lbls { - if len(b)+len(v.Name)+len(v.Value)+2 >= cap(b) { - // If labels entry is 1KB allocate do not allocate whole entry. - h := xxhash.New() - _, _ = h.Write(b) - for _, v := range lbls[i:] { - _, _ = h.WriteString(v.Name) - _, _ = h.Write(sep) - _, _ = h.WriteString(v.Value) - _, _ = h.Write(sep) - } - return h.Sum64() - } - b = append(b, v.Name...) - b = append(b, sep[0]) - b = append(b, v.Value...) - b = append(b, sep[0]) - } - return xxhash.Sum64(b) -} - -// ZLabelSets is a sortable list of ZLabelSet. It assumes the label pairs in each ZLabelSet element are already sorted. -type ZLabelSets []ZLabelSet - -func (z ZLabelSets) Len() int { return len(z) } - -func (z ZLabelSets) Swap(i, j int) { z[i], z[j] = z[j], z[i] } - -func (z ZLabelSets) Less(i, j int) bool { - l := 0 - r := 0 - var result int - lenI, lenJ := len(z[i].Labels), len(z[j].Labels) - for l < lenI && r < lenJ { - result = z[i].Labels[l].Compare(z[j].Labels[r]) - if result == 0 { - l++ - r++ - continue - } - return result < 0 - } - - return l == lenI -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go deleted file mode 100644 index 3dd6d97299..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: store/labelpb/types.proto - -package labelpb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// 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 Label 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 *Label) Reset() { *m = Label{} } -func (m *Label) String() string { return proto.CompactTextString(m) } -func (*Label) ProtoMessage() {} -func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{0} -} -func (m *Label) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Label.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 *Label) XXX_Merge(src proto.Message) { - xxx_messageInfo_Label.Merge(m, src) -} -func (m *Label) XXX_Size() int { - return m.Size() -} -func (m *Label) XXX_DiscardUnknown() { - xxx_messageInfo_Label.DiscardUnknown(m) -} - -var xxx_messageInfo_Label proto.InternalMessageInfo - -type LabelSet struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` -} - -func (m *LabelSet) Reset() { *m = LabelSet{} } -func (m *LabelSet) String() string { return proto.CompactTextString(m) } -func (*LabelSet) ProtoMessage() {} -func (*LabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{1} -} -func (m *LabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelSet.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 *LabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelSet.Merge(m, src) -} -func (m *LabelSet) XXX_Size() int { - return m.Size() -} -func (m *LabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_LabelSet.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelSet proto.InternalMessageInfo - -type ZLabelSet struct { - Labels []ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=ZLabel" json:"labels"` -} - -func (m *ZLabelSet) Reset() { *m = ZLabelSet{} } -func (m *ZLabelSet) String() string { return proto.CompactTextString(m) } -func (*ZLabelSet) ProtoMessage() {} -func (*ZLabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_cdcc9e7dae4870e8, []int{2} -} -func (m *ZLabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ZLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ZLabelSet.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 *ZLabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ZLabelSet.Merge(m, src) -} -func (m *ZLabelSet) XXX_Size() int { - return m.Size() -} -func (m *ZLabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_ZLabelSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ZLabelSet proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Label)(nil), "thanos.Label") - proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") - proto.RegisterType((*ZLabelSet)(nil), "thanos.ZLabelSet") -} - -func init() { proto.RegisterFile("store/labelpb/types.proto", fileDescriptor_cdcc9e7dae4870e8) } - -var fileDescriptor_cdcc9e7dae4870e8 = []byte{ - // 212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x2e, 0xc9, 0x2f, - 0x4a, 0xd5, 0xcf, 0x49, 0x4c, 0x4a, 0xcd, 0x29, 0x48, 0xd2, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2b, 0xc9, 0x48, 0xcc, 0xcb, 0x2f, 0x96, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xe9, 0x83, 0x58, 0x10, 0x59, 0x25, 0x43, 0x2e, 0x56, 0x1f, 0x90, - 0x26, 0x21, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, - 0x30, 0x5b, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c, 0x08, 0xe1, - 0x28, 0x99, 0x73, 0x71, 0x80, 0xb5, 0x04, 0xa7, 0x96, 0x08, 0x69, 0x73, 0xb1, 0x81, 0xed, 0x2c, - 0x96, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0xe2, 0xd5, 0x83, 0xd8, 0xa6, 0x07, 0x56, 0xe1, 0xc4, - 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x89, 0x92, 0x13, 0x17, 0x67, 0x14, 0x5c, 0xa7, 0x29, - 0x7e, 0x9d, 0x7c, 0x20, 0x9d, 0xb7, 0xee, 0xc9, 0xb3, 0x41, 0x74, 0xc0, 0xcc, 0x70, 0x52, 0x3d, - 0xf1, 0x50, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, - 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd8, 0xa1, - 0x01, 0x90, 0xc4, 0x06, 0xf6, 0x9d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x80, 0xe8, 0x16, - 0x18, 0x01, 0x00, 0x00, -} - -func (m *Label) 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 *Label) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LabelSet) 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 *LabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ZLabelSet) 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 *ZLabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ZLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Label) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *LabelSet) 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 + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ZLabelSet) 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 + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Label) 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 ErrIntOverflowTypes - } - 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: Label: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Label: 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelSet) 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 ErrIntOverflowTypes - } - 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: LabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelSet: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ZLabelSet) 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 ErrIntOverflowTypes - } - 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: ZLabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabelSet: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto deleted file mode 100644 index 65aa195ec1..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -syntax = "proto3"; -package thanos; - -option go_package = "labelpb"; - -import "gogoproto/gogo.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message Label { - string name = 1; - string value = 2; -} - -message LabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false]; -} - -message ZLabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "ZLabel"]; -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go deleted file mode 100644 index d62b82dc3f..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package storepb - -import ( - "bytes" - "encoding/binary" - "fmt" - "sort" - "strconv" - "strings" - - "github.com/gogo/protobuf/types" - "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" - - "github.com/thanos-io/thanos/pkg/store/labelpb" -) - -var PartialResponseStrategyValues = func() []string { - var s []string - for k := range PartialResponseStrategy_value { - s = append(s, k) - } - sort.Strings(s) - return s -}() - -func NewWarnSeriesResponse(err error) *SeriesResponse { - return &SeriesResponse{ - Result: &SeriesResponse_Warning{ - Warning: err.Error(), - }, - } -} - -func NewSeriesResponse(series *Series) *SeriesResponse { - return &SeriesResponse{ - Result: &SeriesResponse_Series{ - Series: series, - }, - } -} - -func NewHintsSeriesResponse(hints *types.Any) *SeriesResponse { - return &SeriesResponse{ - Result: &SeriesResponse_Hints{ - Hints: hints, - }, - } -} - -type emptySeriesSet struct{} - -func (emptySeriesSet) Next() bool { return false } -func (emptySeriesSet) At() (labels.Labels, []AggrChunk) { return nil, nil } -func (emptySeriesSet) Err() error { return nil } - -// EmptySeriesSet returns a new series set that contains no series. -func EmptySeriesSet() SeriesSet { - return emptySeriesSet{} -} - -// MergeSeriesSets takes all series sets and returns as a union single series set. -// It assumes series are sorted by labels within single SeriesSet, similar to remote read guarantees. -// However, they can be partial: in such case, if the single SeriesSet returns the same series within many iterations, -// MergeSeriesSets will merge those into one. -// -// It also assumes in a "best effort" way that chunks are sorted by min time. It's done as an optimization only, so if input -// series' chunks are NOT sorted, the only consequence is that the duplicates might be not correctly removed. This is double checked -// which on just-before PromQL level as well, so the only consequence is increased network bandwidth. -// If all chunks were sorted, MergeSeriesSet ALSO returns sorted chunks by min time. -// -// Chunks within the same series can also overlap (within all SeriesSet -// as well as single SeriesSet alone). If the chunk ranges overlap, the *exact* chunk duplicates will be removed -// (except one), and any other overlaps will be appended into on chunks slice. -func MergeSeriesSets(all ...SeriesSet) SeriesSet { - switch len(all) { - case 0: - return emptySeriesSet{} - case 1: - return newUniqueSeriesSet(all[0]) - } - h := len(all) / 2 - - return newMergedSeriesSet( - MergeSeriesSets(all[:h]...), - MergeSeriesSets(all[h:]...), - ) -} - -// SeriesSet is a set of series and their corresponding chunks. -// The set is sorted by the label sets. Chunks may be overlapping or expected of order. -type SeriesSet interface { - Next() bool - At() (labels.Labels, []AggrChunk) - Err() error -} - -// mergedSeriesSet takes two series sets as a single series set. -type mergedSeriesSet struct { - a, b SeriesSet - - lset labels.Labels - chunks []AggrChunk - adone, bdone bool -} - -func newMergedSeriesSet(a, b SeriesSet) *mergedSeriesSet { - s := &mergedSeriesSet{a: a, b: b} - // Initialize first elements of both sets as Next() needs - // one element look-ahead. - s.adone = !s.a.Next() - s.bdone = !s.b.Next() - - return s -} - -func (s *mergedSeriesSet) At() (labels.Labels, []AggrChunk) { - return s.lset, s.chunks -} - -func (s *mergedSeriesSet) Err() error { - if s.a.Err() != nil { - return s.a.Err() - } - return s.b.Err() -} - -func (s *mergedSeriesSet) compare() int { - if s.adone { - return 1 - } - if s.bdone { - return -1 - } - lsetA, _ := s.a.At() - lsetB, _ := s.b.At() - return labels.Compare(lsetA, lsetB) -} - -func (s *mergedSeriesSet) Next() bool { - if s.adone && s.bdone || s.Err() != nil { - return false - } - - d := s.compare() - if d > 0 { - s.lset, s.chunks = s.b.At() - s.bdone = !s.b.Next() - return true - } - if d < 0 { - s.lset, s.chunks = s.a.At() - s.adone = !s.a.Next() - return true - } - - // Both a and b contains the same series. Go through all chunks, remove duplicates and concatenate chunks from both - // series sets. We best effortly assume chunks are sorted by min time. If not, we will not detect all deduplicate which will - // be account on select layer anyway. We do it still for early optimization. - lset, chksA := s.a.At() - _, chksB := s.b.At() - s.lset = lset - - // Slice reuse is not generally safe with nested merge iterators. - // We err on the safe side an create a new slice. - s.chunks = make([]AggrChunk, 0, len(chksA)+len(chksB)) - - b := 0 -Outer: - for a := range chksA { - for { - if b >= len(chksB) { - // No more b chunks. - s.chunks = append(s.chunks, chksA[a:]...) - break Outer - } - - cmp := chksA[a].Compare(chksB[b]) - if cmp > 0 { - s.chunks = append(s.chunks, chksA[a]) - break - } - if cmp < 0 { - s.chunks = append(s.chunks, chksB[b]) - b++ - continue - } - - // Exact duplicated chunks, discard one from b. - b++ - } - } - - if b < len(chksB) { - s.chunks = append(s.chunks, chksB[b:]...) - } - - s.adone = !s.a.Next() - s.bdone = !s.b.Next() - return true -} - -// uniqueSeriesSet takes one series set and ensures each iteration contains single, full series. -type uniqueSeriesSet struct { - SeriesSet - done bool - - peek *Series - - lset labels.Labels - chunks []AggrChunk -} - -func newUniqueSeriesSet(wrapped SeriesSet) *uniqueSeriesSet { - return &uniqueSeriesSet{SeriesSet: wrapped} -} - -func (s *uniqueSeriesSet) At() (labels.Labels, []AggrChunk) { - return s.lset, s.chunks -} - -func (s *uniqueSeriesSet) Next() bool { - if s.Err() != nil { - return false - } - - for !s.done { - if s.done = !s.SeriesSet.Next(); s.done { - break - } - lset, chks := s.SeriesSet.At() - if s.peek == nil { - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} - continue - } - - if labels.Compare(lset, s.peek.PromLabels()) != 0 { - s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} - return true - } - - // We assume non-overlapping, sorted chunks. This is best effort only, if it's otherwise it - // will just be duplicated, but well handled by StoreAPI consumers. - s.peek.Chunks = append(s.peek.Chunks, chks...) - } - - if s.peek == nil { - return false - } - - s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks - s.peek = nil - return true -} - -// Compare returns positive 1 if chunk is smaller -1 if larger than b by min time, then max time. -// It returns 0 if chunks are exactly the same. -func (m AggrChunk) Compare(b AggrChunk) int { - if m.MinTime < b.MinTime { - return 1 - } - if m.MinTime > b.MinTime { - return -1 - } - - // Same min time. - if m.MaxTime < b.MaxTime { - return 1 - } - if m.MaxTime > b.MaxTime { - return -1 - } - - // We could use proto.Equal, but we need ordering as well. - for _, cmp := range []func() int{ - func() int { return m.Raw.Compare(b.Raw) }, - func() int { return m.Count.Compare(b.Count) }, - func() int { return m.Sum.Compare(b.Sum) }, - func() int { return m.Min.Compare(b.Min) }, - func() int { return m.Max.Compare(b.Max) }, - func() int { return m.Counter.Compare(b.Counter) }, - } { - if c := cmp(); c == 0 { - continue - } else { - return c - } - } - return 0 -} - -// Compare returns positive 1 if chunk is smaller -1 if larger. -// It returns 0 if chunks are exactly the same. -func (m *Chunk) Compare(b *Chunk) int { - if m == nil && b == nil { - return 0 - } - if b == nil { - return 1 - } - if m == nil { - return -1 - } - - if m.Type < b.Type { - return 1 - } - if m.Type > b.Type { - return -1 - } - return bytes.Compare(m.Data, b.Data) -} - -func (x *PartialResponseStrategy) UnmarshalJSON(entry []byte) error { - fieldStr, err := strconv.Unquote(string(entry)) - if err != nil { - return errors.Wrapf(err, fmt.Sprintf("failed to unqote %v, in order to unmarshal as 'partial_response_strategy'. Possible values are %s", string(entry), strings.Join(PartialResponseStrategyValues, ","))) - } - - if fieldStr == "" { - // NOTE: For Rule default is abort as this is recommended for alerting. - *x = PartialResponseStrategy_ABORT - return nil - } - - strategy, ok := PartialResponseStrategy_value[strings.ToUpper(fieldStr)] - if !ok { - return errors.Errorf(fmt.Sprintf("failed to unmarshal %v as 'partial_response_strategy'. Possible values are %s", string(entry), strings.Join(PartialResponseStrategyValues, ","))) - } - *x = PartialResponseStrategy(strategy) - return nil -} - -func (x *PartialResponseStrategy) MarshalJSON() ([]byte, error) { - return []byte(strconv.Quote(x.String())), nil -} - -// PromMatchersToMatchers returns proto matchers from Prometheus matchers. -// NOTE: It allocates memory. -func PromMatchersToMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) { - res := make([]LabelMatcher, 0, len(ms)) - for _, m := range ms { - var t LabelMatcher_Type - - switch m.Type { - case labels.MatchEqual: - t = LabelMatcher_EQ - case labels.MatchNotEqual: - t = LabelMatcher_NEQ - case labels.MatchRegexp: - t = LabelMatcher_RE - case labels.MatchNotRegexp: - t = LabelMatcher_NRE - default: - return nil, errors.Errorf("unrecognized matcher type %d", m.Type) - } - res = append(res, LabelMatcher{Type: t, Name: m.Name, Value: m.Value}) - } - return res, nil -} - -// MatchersToPromMatchers returns Prometheus matchers from proto matchers. -// NOTE: It allocates memory. -func MatchersToPromMatchers(ms ...LabelMatcher) ([]*labels.Matcher, error) { - res := make([]*labels.Matcher, 0, len(ms)) - for _, m := range ms { - var t labels.MatchType - - switch m.Type { - case LabelMatcher_EQ: - t = labels.MatchEqual - case LabelMatcher_NEQ: - t = labels.MatchNotEqual - case LabelMatcher_RE: - t = labels.MatchRegexp - case LabelMatcher_NRE: - t = labels.MatchNotRegexp - default: - return nil, errors.Errorf("unrecognized label matcher type %d", m.Type) - } - m, err := labels.NewMatcher(t, m.Name, m.Value) - if err != nil { - return nil, err - } - res = append(res, m) - } - return res, nil -} - -// MatchersToString converts label matchers to string format. -// String should be parsable as a valid PromQL query metric selector. -func MatchersToString(ms ...LabelMatcher) string { - var res string - for i, m := range ms { - res += m.PromString() - if i < len(ms)-1 { - res += ", " - } - } - return "{" + res + "}" -} - -// PromMatchersToString converts prometheus label matchers to string format. -// String should be parsable as a valid PromQL query metric selector. -func PromMatchersToString(ms ...*labels.Matcher) string { - var res string - for i, m := range ms { - res += m.String() - if i < len(ms)-1 { - res += ", " - } - } - return "{" + res + "}" -} - -func (m *LabelMatcher) PromString() string { - return fmt.Sprintf("%s%s%q", m.Name, m.Type.PromString(), m.Value) -} - -func (x LabelMatcher_Type) PromString() string { - typeToStr := map[LabelMatcher_Type]string{ - LabelMatcher_EQ: "=", - LabelMatcher_NEQ: "!=", - LabelMatcher_RE: "=~", - LabelMatcher_NRE: "!~", - } - if str, ok := typeToStr[x]; ok { - return str - } - panic("unknown match type") -} - -// PromLabels return Prometheus labels.Labels without extra allocation. -func (m *Series) PromLabels() labels.Labels { - return labelpb.ZLabelsToPromLabels(m.Labels) -} - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -type Label = labelpb.ZLabel - -// Deprecated. -// TODO(bwplotka): Remove this in next PR. Done to reduce diff only. -type LabelSet = labelpb.ZLabelSet - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -func CompareLabels(a, b []Label) int { - return labels.Compare(labelpb.ZLabelsToPromLabels(a), labelpb.ZLabelsToPromLabels(b)) -} - -// Deprecated. -// TODO(bwplotka): Remove this once Cortex dep will stop using it. -func LabelsToPromLabelsUnsafe(lset []Label) labels.Labels { - return labelpb.ZLabelsToPromLabels(lset) -} - -// XORNumSamples return number of samples. Returns 0 if it's not XOR chunk. -func (m *Chunk) XORNumSamples() int { - if m.Type == Chunk_XOR { - return int(binary.BigEndian.Uint16(m.Data)) - } - return 0 -} - -type SeriesStatsCounter struct { - lastSeriesHash uint64 - - Series int - Chunks int - Samples int -} - -func (c *SeriesStatsCounter) CountSeries(seriesLabels []labelpb.ZLabel) { - seriesHash := labelpb.HashWithPrefix("", seriesLabels) - if c.lastSeriesHash != 0 || seriesHash != c.lastSeriesHash { - c.lastSeriesHash = seriesHash - c.Series++ - } -} - -func (c *SeriesStatsCounter) Count(series *Series) { - c.CountSeries(series.Labels) - for _, chk := range series.Chunks { - if chk.Raw != nil { - c.Chunks++ - c.Samples += chk.Raw.XORNumSamples() - } - - if chk.Count != nil { - c.Chunks++ - c.Samples += chk.Count.XORNumSamples() - } - - if chk.Counter != nil { - c.Chunks++ - c.Samples += chk.Counter.XORNumSamples() - } - - if chk.Max != nil { - c.Chunks++ - c.Samples += chk.Max.XORNumSamples() - } - - if chk.Min != nil { - c.Chunks++ - c.Samples += chk.Min.XORNumSamples() - } - - if chk.Sum != nil { - c.Chunks++ - c.Samples += chk.Sum.XORNumSamples() - } - } -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/inprocess.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/inprocess.go deleted file mode 100644 index aeb4a25aef..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/inprocess.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package storepb - -import ( - "context" - "io" - - "google.golang.org/grpc" -) - -func ServerAsClient(srv StoreServer, clientReceiveBufferSize int) StoreClient { - return &serverAsClient{srv: srv, clientReceiveBufferSize: clientReceiveBufferSize} -} - -// serverAsClient allows to use servers as clients. -// NOTE: Passing CallOptions does not work - it would be needed to be implemented in grpc itself (before, after are private). -type serverAsClient struct { - clientReceiveBufferSize int - srv StoreServer -} - -func (s serverAsClient) Info(ctx context.Context, in *InfoRequest, _ ...grpc.CallOption) (*InfoResponse, error) { - return s.srv.Info(ctx, in) -} - -func (s serverAsClient) LabelNames(ctx context.Context, in *LabelNamesRequest, _ ...grpc.CallOption) (*LabelNamesResponse, error) { - return s.srv.LabelNames(ctx, in) -} - -func (s serverAsClient) LabelValues(ctx context.Context, in *LabelValuesRequest, _ ...grpc.CallOption) (*LabelValuesResponse, error) { - return s.srv.LabelValues(ctx, in) -} - -func (s serverAsClient) Series(ctx context.Context, in *SeriesRequest, _ ...grpc.CallOption) (Store_SeriesClient, error) { - inSrv := &inProcessStream{recv: make(chan *SeriesResponse, s.clientReceiveBufferSize), err: make(chan error)} - inSrv.ctx, inSrv.cancel = context.WithCancel(ctx) - go func() { - inSrv.err <- s.srv.Series(in, inSrv) - close(inSrv.err) - close(inSrv.recv) - }() - return &inProcessClientStream{srv: inSrv}, nil -} - -// TODO(bwplotka): Add streaming attributes, metadata etc. Currently those are disconnected. Follow up on https://github.com/grpc/grpc-go/issues/906. -// TODO(bwplotka): Use this in proxy.go and receiver multi tenant proxy. -type inProcessStream struct { - grpc.ServerStream - - ctx context.Context - cancel context.CancelFunc - recv chan *SeriesResponse - err chan error -} - -func (s *inProcessStream) Context() context.Context { return s.ctx } - -func (s *inProcessStream) Send(r *SeriesResponse) error { - select { - case <-s.ctx.Done(): - return s.ctx.Err() - case s.recv <- r: - return nil - } -} - -type inProcessClientStream struct { - grpc.ClientStream - - srv *inProcessStream -} - -func (s *inProcessClientStream) Context() context.Context { return s.srv.ctx } - -func (s *inProcessClientStream) CloseSend() error { - s.srv.cancel() - return nil -} - -func (s *inProcessClientStream) Recv() (*SeriesResponse, error) { - select { - case <-s.srv.ctx.Done(): - return nil, s.srv.ctx.Err() - case r, ok := <-s.srv.recv: - if !ok { - return nil, io.EOF - } - return r, nil - case err := <-s.srv.err: - if err == nil { - return nil, io.EOF - } - return nil, err - } -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/README.md b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/README.md deleted file mode 100644 index 3442f7510e..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/README.md +++ /dev/null @@ -1,3 +0,0 @@ -NOTE(bwplotka): This excerpt of "github.com/prometheus/prometheus/prompb" reconstructed to avoid XXX fields for unsafe conversion to safe allocs. - -Controlled by `make proto` diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.pb.go deleted file mode 100644 index 6d7538d1bc..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.pb.go +++ /dev/null @@ -1,1637 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: store/storepb/prompb/remote.proto - -package prompb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// 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 ReadRequest_ResponseType int32 - -const ( - // Server will return a single ReadResponse message with matched series that includes list of raw samples. - // It's recommended to use streamed response types instead. - // - // Response headers: - // Content-Type: "application/x-protobuf" - // Content-Encoding: "snappy" - ReadRequest_SAMPLES ReadRequest_ResponseType = 0 - // Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series. - // Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum. - // - // Response headers: - // Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse" - // Content-Encoding: "" - ReadRequest_STREAMED_XOR_CHUNKS ReadRequest_ResponseType = 1 -) - -var ReadRequest_ResponseType_name = map[int32]string{ - 0: "SAMPLES", - 1: "STREAMED_XOR_CHUNKS", -} - -var ReadRequest_ResponseType_value = map[string]int32{ - "SAMPLES": 0, - "STREAMED_XOR_CHUNKS": 1, -} - -func (x ReadRequest_ResponseType) String() string { - return proto.EnumName(ReadRequest_ResponseType_name, int32(x)) -} - -func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{1, 0} -} - -type WriteRequest struct { - Timeseries []TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` - Metadata []MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata"` -} - -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} -func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{0} -} -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequest.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 *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) -} -func (m *WriteRequest) XXX_Size() int { - return m.Size() -} -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo - -func (m *WriteRequest) GetTimeseries() []TimeSeries { - if m != nil { - return m.Timeseries - } - return nil -} - -func (m *WriteRequest) GetMetadata() []MetricMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -// ReadRequest represents a remote read request. -type ReadRequest struct { - Queries []*Query `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries,omitempty"` - // accepted_response_types allows negotiating the content type of the response. - // - // Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is - // implemented by server, error is returned. - // For request that do not contain `accepted_response_types` field the SAMPLES response type will be used. - AcceptedResponseTypes []ReadRequest_ResponseType `protobuf:"varint,2,rep,packed,name=accepted_response_types,json=acceptedResponseTypes,proto3,enum=prometheus_copy.ReadRequest_ResponseType" json:"accepted_response_types,omitempty"` -} - -func (m *ReadRequest) Reset() { *m = ReadRequest{} } -func (m *ReadRequest) String() string { return proto.CompactTextString(m) } -func (*ReadRequest) ProtoMessage() {} -func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{1} -} -func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadRequest.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 *ReadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRequest.Merge(m, src) -} -func (m *ReadRequest) XXX_Size() int { - return m.Size() -} -func (m *ReadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadRequest proto.InternalMessageInfo - -func (m *ReadRequest) GetQueries() []*Query { - if m != nil { - return m.Queries - } - return nil -} - -func (m *ReadRequest) GetAcceptedResponseTypes() []ReadRequest_ResponseType { - if m != nil { - return m.AcceptedResponseTypes - } - return nil -} - -// ReadResponse is a response when response_type equals SAMPLES. -type ReadResponse struct { - // In same order as the request's queries. - Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (m *ReadResponse) Reset() { *m = ReadResponse{} } -func (m *ReadResponse) String() string { return proto.CompactTextString(m) } -func (*ReadResponse) ProtoMessage() {} -func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{2} -} -func (m *ReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadResponse.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 *ReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadResponse.Merge(m, src) -} -func (m *ReadResponse) XXX_Size() int { - return m.Size() -} -func (m *ReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadResponse proto.InternalMessageInfo - -func (m *ReadResponse) GetResults() []*QueryResult { - if m != nil { - return m.Results - } - return nil -} - -type Query struct { - StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` - EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` - Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers,omitempty"` - Hints *ReadHints `protobuf:"bytes,4,opt,name=hints,proto3" json:"hints,omitempty"` -} - -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} -func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{3} -} -func (m *Query) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Query.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 *Query) XXX_Merge(src proto.Message) { - xxx_messageInfo_Query.Merge(m, src) -} -func (m *Query) XXX_Size() int { - return m.Size() -} -func (m *Query) XXX_DiscardUnknown() { - xxx_messageInfo_Query.DiscardUnknown(m) -} - -var xxx_messageInfo_Query proto.InternalMessageInfo - -func (m *Query) GetStartTimestampMs() int64 { - if m != nil { - return m.StartTimestampMs - } - return 0 -} - -func (m *Query) GetEndTimestampMs() int64 { - if m != nil { - return m.EndTimestampMs - } - return 0 -} - -func (m *Query) GetMatchers() []*LabelMatcher { - if m != nil { - return m.Matchers - } - return nil -} - -func (m *Query) GetHints() *ReadHints { - if m != nil { - return m.Hints - } - return nil -} - -type QueryResult struct { - // Samples within a time series must be ordered by time. - Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries,omitempty"` -} - -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{4} -} -func (m *QueryResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryResult.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 *QueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResult.Merge(m, src) -} -func (m *QueryResult) XXX_Size() int { - return m.Size() -} -func (m *QueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResult proto.InternalMessageInfo - -func (m *QueryResult) GetTimeseries() []*TimeSeries { - if m != nil { - return m.Timeseries - } - return nil -} - -// ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS. -// We strictly stream full series after series, optionally split by time. This means that a single frame can contain -// partition of the single series, but once a new series is started to be streamed it means that no more chunks will -// be sent for previous one. -type ChunkedReadResponse struct { - ChunkedSeries []*ChunkedSeries `protobuf:"bytes,1,rep,name=chunked_series,json=chunkedSeries,proto3" json:"chunked_series,omitempty"` - // query_index represents an index of the query from ReadRequest.queries these chunks relates to. - QueryIndex int64 `protobuf:"varint,2,opt,name=query_index,json=queryIndex,proto3" json:"query_index,omitempty"` -} - -func (m *ChunkedReadResponse) Reset() { *m = ChunkedReadResponse{} } -func (m *ChunkedReadResponse) String() string { return proto.CompactTextString(m) } -func (*ChunkedReadResponse) ProtoMessage() {} -func (*ChunkedReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3df75c58e6767bb, []int{5} -} -func (m *ChunkedReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkedReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkedReadResponse.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 *ChunkedReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkedReadResponse.Merge(m, src) -} -func (m *ChunkedReadResponse) XXX_Size() int { - return m.Size() -} -func (m *ChunkedReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkedReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkedReadResponse proto.InternalMessageInfo - -func (m *ChunkedReadResponse) GetChunkedSeries() []*ChunkedSeries { - if m != nil { - return m.ChunkedSeries - } - return nil -} - -func (m *ChunkedReadResponse) GetQueryIndex() int64 { - if m != nil { - return m.QueryIndex - } - return 0 -} - -func init() { - proto.RegisterEnum("prometheus_copy.ReadRequest_ResponseType", ReadRequest_ResponseType_name, ReadRequest_ResponseType_value) - proto.RegisterType((*WriteRequest)(nil), "prometheus_copy.WriteRequest") - proto.RegisterType((*ReadRequest)(nil), "prometheus_copy.ReadRequest") - proto.RegisterType((*ReadResponse)(nil), "prometheus_copy.ReadResponse") - proto.RegisterType((*Query)(nil), "prometheus_copy.Query") - proto.RegisterType((*QueryResult)(nil), "prometheus_copy.QueryResult") - proto.RegisterType((*ChunkedReadResponse)(nil), "prometheus_copy.ChunkedReadResponse") -} - -func init() { proto.RegisterFile("store/storepb/prompb/remote.proto", fileDescriptor_b3df75c58e6767bb) } - -var fileDescriptor_b3df75c58e6767bb = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0x9b, 0xb5, 0x5b, 0xab, 0x37, 0xa3, 0x54, 0x1e, 0xb0, 0xaa, 0x40, 0x5a, 0x72, 0x2a, - 0x12, 0x6a, 0xa7, 0x82, 0x90, 0x10, 0xa7, 0x6e, 0x14, 0x8d, 0xb1, 0xf0, 0xc7, 0x2d, 0x02, 0x71, - 0x89, 0xdc, 0xe4, 0xd5, 0x1a, 0xb1, 0xfc, 0x99, 0xed, 0x48, 0xf4, 0xc0, 0x77, 0xe0, 0xcc, 0x27, - 0xda, 0x81, 0xc3, 0x8e, 0x3b, 0x21, 0xd4, 0x7e, 0x11, 0x14, 0x27, 0xa9, 0x32, 0x3a, 0x0e, 0x5c, - 0x22, 0xe7, 0xf1, 0xef, 0x79, 0x6c, 0xbf, 0x7e, 0x0d, 0x0f, 0x84, 0x0c, 0x39, 0xf6, 0xd5, 0x37, - 0x9a, 0xf6, 0x23, 0x1e, 0xfa, 0xd1, 0xb4, 0xcf, 0xd1, 0x0f, 0x25, 0xf6, 0x22, 0x1e, 0xca, 0x90, - 0xdc, 0x4c, 0x44, 0x94, 0x33, 0x8c, 0x85, 0xed, 0x84, 0xd1, 0xbc, 0xd5, 0xb9, 0xd6, 0x23, 0xe7, - 0x11, 0x8a, 0xd4, 0xd2, 0xba, 0x75, 0x12, 0x9e, 0x84, 0x6a, 0xd8, 0x4f, 0x46, 0xa9, 0x6a, 0xfe, - 0xd0, 0x60, 0xfb, 0x23, 0xf7, 0x24, 0x52, 0x3c, 0x8b, 0x51, 0x48, 0x32, 0x04, 0x90, 0x9e, 0x8f, - 0x02, 0xb9, 0x87, 0xa2, 0xa9, 0x75, 0xca, 0x5d, 0x7d, 0x70, 0xb7, 0xf7, 0xd7, 0x72, 0xbd, 0x89, - 0xe7, 0xe3, 0x58, 0x21, 0xfb, 0x95, 0xf3, 0x5f, 0xed, 0x12, 0x2d, 0x98, 0xc8, 0x10, 0x6a, 0x3e, - 0x4a, 0xe6, 0x32, 0xc9, 0x9a, 0x65, 0x15, 0xd0, 0x5e, 0x0b, 0xb0, 0x50, 0x72, 0xcf, 0xb1, 0x32, - 0x2c, 0x0b, 0x59, 0xd9, 0x8e, 0x2a, 0xb5, 0x8d, 0x46, 0xd9, 0xbc, 0xd4, 0x40, 0xa7, 0xc8, 0xdc, - 0x7c, 0x6f, 0x7b, 0x50, 0x3d, 0x8b, 0x8b, 0x1b, 0xbb, 0xb3, 0x96, 0xfb, 0x3e, 0x46, 0x3e, 0xa7, - 0x39, 0x46, 0x18, 0xec, 0x32, 0xc7, 0xc1, 0x48, 0xa2, 0x6b, 0x73, 0x14, 0x51, 0x18, 0x08, 0xb4, - 0x55, 0x55, 0x9a, 0x1b, 0x9d, 0x72, 0xb7, 0x3e, 0x78, 0xb8, 0x96, 0x50, 0x58, 0xb0, 0x47, 0x33, - 0xcb, 0x64, 0x1e, 0x21, 0xbd, 0x9d, 0x27, 0x15, 0x55, 0x61, 0x3e, 0x81, 0xed, 0xa2, 0x40, 0x74, - 0xa8, 0x8e, 0x87, 0xd6, 0xbb, 0xe3, 0xd1, 0xb8, 0x51, 0x22, 0xbb, 0xb0, 0x33, 0x9e, 0xd0, 0xd1, - 0xd0, 0x1a, 0xbd, 0xb0, 0x3f, 0xbd, 0xa5, 0xf6, 0xc1, 0xe1, 0x87, 0x37, 0xaf, 0xc7, 0x0d, 0xcd, - 0x7c, 0x99, 0xb8, 0xd8, 0x2a, 0x8a, 0x3c, 0x85, 0x2a, 0x47, 0x11, 0x9f, 0xca, 0xfc, 0x68, 0xf7, - 0xfe, 0x71, 0x34, 0x05, 0xd1, 0x1c, 0x36, 0x7f, 0x6a, 0xb0, 0xa9, 0x26, 0xc8, 0x23, 0x20, 0x42, - 0x32, 0x2e, 0x6d, 0x75, 0x13, 0x92, 0xf9, 0x91, 0xed, 0x27, 0x61, 0x5a, 0xb7, 0x4c, 0x1b, 0x6a, - 0x66, 0x92, 0x4f, 0x58, 0x82, 0x74, 0xa1, 0x81, 0x81, 0x7b, 0x95, 0xdd, 0x50, 0x6c, 0x1d, 0x03, - 0xb7, 0x48, 0x3e, 0x83, 0x9a, 0xcf, 0xa4, 0x33, 0x43, 0x2e, 0xb2, 0xdb, 0xbc, 0xbf, 0xb6, 0xb5, - 0x63, 0x36, 0xc5, 0x53, 0x2b, 0xa5, 0xe8, 0x0a, 0x27, 0x7b, 0xb0, 0x39, 0xf3, 0x02, 0x29, 0x9a, - 0x95, 0x8e, 0xd6, 0xd5, 0x07, 0xad, 0x6b, 0x6b, 0x7d, 0x98, 0x10, 0x34, 0x05, 0xcd, 0x23, 0xd0, - 0x0b, 0xc7, 0x24, 0xcf, 0xff, 0xb3, 0x19, 0x8b, 0x6d, 0x68, 0x7e, 0x83, 0x9d, 0x83, 0x59, 0x1c, - 0x7c, 0x49, 0x2e, 0xac, 0x50, 0xe9, 0x11, 0xd4, 0x9d, 0x54, 0xb6, 0xaf, 0xe4, 0x1a, 0x6b, 0xb9, - 0x99, 0x3b, 0x8b, 0xbe, 0xe1, 0x14, 0x7f, 0x49, 0x1b, 0xf4, 0xa4, 0xc9, 0xe6, 0xb6, 0x17, 0xb8, - 0xf8, 0x35, 0xab, 0x1d, 0x28, 0xe9, 0x55, 0xa2, 0xec, 0x77, 0xce, 0x17, 0x86, 0x76, 0xb1, 0x30, - 0xb4, 0xdf, 0x0b, 0x43, 0xfb, 0xbe, 0x34, 0x4a, 0x17, 0x4b, 0xa3, 0x74, 0xb9, 0x34, 0x4a, 0x9f, - 0xb7, 0xd2, 0xd7, 0x39, 0xdd, 0x52, 0x4f, 0xf0, 0xf1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, - 0xa1, 0xf6, 0xc4, 0xf0, 0x03, 0x00, 0x00, -} - -func (m *WriteRequest) 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 *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - for iNdEx := len(m.Metadata) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Metadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ReadRequest) 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 *ReadRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AcceptedResponseTypes) > 0 { - dAtA2 := make([]byte, len(m.AcceptedResponseTypes)*10) - var j1 int - for _, num := range m.AcceptedResponseTypes { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintRemote(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x12 - } - if len(m.Queries) > 0 { - for iNdEx := len(m.Queries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Queries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ReadResponse) 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 *ReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Query) 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 *Query) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Query) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EndTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.EndTimestampMs)) - i-- - dAtA[i] = 0x10 - } - if m.StartTimestampMs != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.StartTimestampMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryResult) 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 *QueryResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChunkedReadResponse) 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 *ChunkedReadResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.QueryIndex != 0 { - i = encodeVarintRemote(dAtA, i, uint64(m.QueryIndex)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChunkedSeries) > 0 { - for iNdEx := len(m.ChunkedSeries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChunkedSeries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintRemote(dAtA []byte, offset int, v uint64) int { - offset -= sovRemote(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WriteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if len(m.Metadata) > 0 { - for _, e := range m.Metadata { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - return n -} - -func (m *ReadRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Queries) > 0 { - for _, e := range m.Queries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if len(m.AcceptedResponseTypes) > 0 { - l = 0 - for _, e := range m.AcceptedResponseTypes { - l += sovRemote(uint64(e)) - } - n += 1 + sovRemote(uint64(l)) + l - } - return n -} - -func (m *ReadResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - return n -} - -func (m *Query) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartTimestampMs != 0 { - n += 1 + sovRemote(uint64(m.StartTimestampMs)) - } - if m.EndTimestampMs != 0 { - n += 1 + sovRemote(uint64(m.EndTimestampMs)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRemote(uint64(l)) - } - return n -} - -func (m *QueryResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - return n -} - -func (m *ChunkedReadResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChunkedSeries) > 0 { - for _, e := range m.ChunkedSeries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if m.QueryIndex != 0 { - n += 1 + sovRemote(uint64(m.QueryIndex)) - } - return n -} - -func sovRemote(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRemote(x uint64) (n int) { - return sovRemote(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WriteRequest) 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 ErrIntOverflowRemote - } - 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: WriteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-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 Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata, MetricMetadata{}) - if err := m.Metadata[len(m.Metadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadRequest) 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 ErrIntOverflowRemote - } - 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: ReadRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Queries = append(m.Queries, &Query{}) - if err := m.Queries[len(m.Queries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.AcceptedResponseTypes) == 0 { - m.AcceptedResponseTypes = make([]ReadRequest_ResponseType, 0, elementCount) - } - for iNdEx < postIndex { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptedResponseTypes", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadResponse) 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 ErrIntOverflowRemote - } - 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: ReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Results = append(m.Results, &QueryResult{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Query) 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 ErrIntOverflowRemote - } - 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: Query: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Query: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimestampMs", wireType) - } - m.StartTimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimestampMs", wireType) - } - m.EndTimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, &LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-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 Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &ReadHints{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryResult) 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 ErrIntOverflowRemote - } - 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: QueryResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, &TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkedReadResponse) 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 ErrIntOverflowRemote - } - 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: ChunkedReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkedReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkedSeries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkedSeries = append(m.ChunkedSeries, &ChunkedSeries{}) - if err := m.ChunkedSeries[len(m.ChunkedSeries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryIndex", wireType) - } - m.QueryIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRemote(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRemote - } - 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, ErrIntOverflowRemote - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRemote - } - 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, ErrInvalidLengthRemote - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRemote - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRemote - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRemote = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRemote = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRemote = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.proto deleted file mode 100644 index b765bb7906..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/remote.proto +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -// Copyright 2016 Prometheus Team -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; -package prometheus_copy; - -option go_package = "prompb"; - -import "store/storepb/prompb/types.proto"; -import "gogoproto/gogo.proto"; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message WriteRequest { - repeated TimeSeries timeseries = 1 [(gogoproto.nullable) = false]; - // Cortex uses this field to determine the source of the write request. - // We reserve it to avoid any compatibility issues. - reserved 2; - repeated MetricMetadata metadata = 3 [(gogoproto.nullable) = false]; -} - -// ReadRequest represents a remote read request. -message ReadRequest { - repeated Query queries = 1; - - enum ResponseType { - // Server will return a single ReadResponse message with matched series that includes list of raw samples. - // It's recommended to use streamed response types instead. - // - // Response headers: - // Content-Type: "application/x-protobuf" - // Content-Encoding: "snappy" - SAMPLES = 0; - // Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series. - // Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum. - // - // Response headers: - // Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse" - // Content-Encoding: "" - STREAMED_XOR_CHUNKS = 1; - } - - // accepted_response_types allows negotiating the content type of the response. - // - // Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is - // implemented by server, error is returned. - // For request that do not contain `accepted_response_types` field the SAMPLES response type will be used. - repeated ResponseType accepted_response_types = 2; -} - -// ReadResponse is a response when response_type equals SAMPLES. -message ReadResponse { - // In same order as the request's queries. - repeated QueryResult results = 1; -} - -message Query { - int64 start_timestamp_ms = 1; - int64 end_timestamp_ms = 2; - repeated LabelMatcher matchers = 3; - ReadHints hints = 4; -} - -message QueryResult { - // Samples within a time series must be ordered by time. - repeated TimeSeries timeseries = 1; -} - -// ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS. -// We strictly stream full series after series, optionally split by time. This means that a single frame can contain -// partition of the single series, but once a new series is started to be streamed it means that no more chunks will -// be sent for previous one. -message ChunkedReadResponse { - repeated ChunkedSeries chunked_series = 1; - - // query_index represents an index of the query from ReadRequest.queries these chunks relates to. - int64 query_index = 2; -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go deleted file mode 100644 index d8ef292dcf..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go +++ /dev/null @@ -1,2505 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: store/storepb/prompb/types.proto - -package prompb - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/thanos-io/thanos/pkg/store/labelpb" - github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" -) - -// 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 MetricMetadata_MetricType int32 - -const ( - MetricMetadata_UNKNOWN MetricMetadata_MetricType = 0 - MetricMetadata_COUNTER MetricMetadata_MetricType = 1 - MetricMetadata_GAUGE MetricMetadata_MetricType = 2 - MetricMetadata_HISTOGRAM MetricMetadata_MetricType = 3 - MetricMetadata_GAUGEHISTOGRAM MetricMetadata_MetricType = 4 - MetricMetadata_SUMMARY MetricMetadata_MetricType = 5 - MetricMetadata_INFO MetricMetadata_MetricType = 6 - MetricMetadata_STATESET MetricMetadata_MetricType = 7 -) - -var MetricMetadata_MetricType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "COUNTER", - 2: "GAUGE", - 3: "HISTOGRAM", - 4: "GAUGEHISTOGRAM", - 5: "SUMMARY", - 6: "INFO", - 7: "STATESET", -} - -var MetricMetadata_MetricType_value = map[string]int32{ - "UNKNOWN": 0, - "COUNTER": 1, - "GAUGE": 2, - "HISTOGRAM": 3, - "GAUGEHISTOGRAM": 4, - "SUMMARY": 5, - "INFO": 6, - "STATESET": 7, -} - -func (x MetricMetadata_MetricType) String() string { - return proto.EnumName(MetricMetadata_MetricType_name, int32(x)) -} - -func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{0, 0} -} - -type LabelMatcher_Type int32 - -const ( - LabelMatcher_EQ LabelMatcher_Type = 0 - LabelMatcher_NEQ LabelMatcher_Type = 1 - LabelMatcher_RE LabelMatcher_Type = 2 - LabelMatcher_NRE LabelMatcher_Type = 3 -) - -var LabelMatcher_Type_name = map[int32]string{ - 0: "EQ", - 1: "NEQ", - 2: "RE", - 3: "NRE", -} - -var LabelMatcher_Type_value = map[string]int32{ - "EQ": 0, - "NEQ": 1, - "RE": 2, - "NRE": 3, -} - -func (x LabelMatcher_Type) String() string { - return proto.EnumName(LabelMatcher_Type_name, int32(x)) -} - -func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{4, 0} -} - -// We require this to match chunkenc.Encoding. -type Chunk_Encoding int32 - -const ( - Chunk_UNKNOWN Chunk_Encoding = 0 - Chunk_XOR Chunk_Encoding = 1 -) - -var Chunk_Encoding_name = map[int32]string{ - 0: "UNKNOWN", - 1: "XOR", -} - -var Chunk_Encoding_value = map[string]int32{ - "UNKNOWN": 0, - "XOR": 1, -} - -func (x Chunk_Encoding) String() string { - return proto.EnumName(Chunk_Encoding_name, int32(x)) -} - -func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{6, 0} -} - -type MetricMetadata struct { - // Represents the metric type, these match the set from Prometheus. - // Refer to pkg/textparse/interface.go for details. - Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.MetricMetadata_MetricType" json:"type,omitempty"` - MetricFamilyName string `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"` - Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"` - Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` -} - -func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } -func (m *MetricMetadata) String() string { return proto.CompactTextString(m) } -func (*MetricMetadata) ProtoMessage() {} -func (*MetricMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{0} -} -func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadata.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 *MetricMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadata.Merge(m, src) -} -func (m *MetricMetadata) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo - -func (m *MetricMetadata) GetType() MetricMetadata_MetricType { - if m != nil { - return m.Type - } - return MetricMetadata_UNKNOWN -} - -func (m *MetricMetadata) GetMetricFamilyName() string { - if m != nil { - return m.MetricFamilyName - } - return "" -} - -func (m *MetricMetadata) GetHelp() string { - if m != nil { - return m.Help - } - return "" -} - -func (m *MetricMetadata) GetUnit() string { - if m != nil { - return m.Unit - } - return "" -} - -type Sample struct { - Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *Sample) Reset() { *m = Sample{} } -func (m *Sample) String() string { return proto.CompactTextString(m) } -func (*Sample) ProtoMessage() {} -func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{1} -} -func (m *Sample) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Sample.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 *Sample) XXX_Merge(src proto.Message) { - xxx_messageInfo_Sample.Merge(m, src) -} -func (m *Sample) XXX_Size() int { - return m.Size() -} -func (m *Sample) XXX_DiscardUnknown() { - xxx_messageInfo_Sample.DiscardUnknown(m) -} - -var xxx_messageInfo_Sample proto.InternalMessageInfo - -func (m *Sample) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *Sample) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -type Exemplar struct { - // Optional, can be empty. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` - // timestamp is in ms format, see pkg/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *Exemplar) Reset() { *m = Exemplar{} } -func (m *Exemplar) String() string { return proto.CompactTextString(m) } -func (*Exemplar) ProtoMessage() {} -func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{2} -} -func (m *Exemplar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Exemplar.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 *Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Exemplar.Merge(m, src) -} -func (m *Exemplar) XXX_Size() int { - return m.Size() -} -func (m *Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_Exemplar.DiscardUnknown(m) -} - -var xxx_messageInfo_Exemplar proto.InternalMessageInfo - -func (m *Exemplar) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *Exemplar) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -// TimeSeries represents samples and labels for a single time series. -type TimeSeries struct { - // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` - Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` -} - -func (m *TimeSeries) Reset() { *m = TimeSeries{} } -func (m *TimeSeries) String() string { return proto.CompactTextString(m) } -func (*TimeSeries) ProtoMessage() {} -func (*TimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{3} -} -func (m *TimeSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeSeries.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 *TimeSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeSeries.Merge(m, src) -} -func (m *TimeSeries) XXX_Size() int { - return m.Size() -} -func (m *TimeSeries) XXX_DiscardUnknown() { - xxx_messageInfo_TimeSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeSeries proto.InternalMessageInfo - -func (m *TimeSeries) GetSamples() []Sample { - if m != nil { - return m.Samples - } - return nil -} - -func (m *TimeSeries) GetExemplars() []Exemplar { - if m != nil { - return m.Exemplars - } - return nil -} - -// Matcher specifies a rule, which can match or set of labels or not. -type LabelMatcher struct { - Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.LabelMatcher_Type" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } -func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } -func (*LabelMatcher) ProtoMessage() {} -func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{4} -} -func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelMatcher.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 *LabelMatcher) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelMatcher.Merge(m, src) -} -func (m *LabelMatcher) XXX_Size() int { - return m.Size() -} -func (m *LabelMatcher) XXX_DiscardUnknown() { - xxx_messageInfo_LabelMatcher.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelMatcher proto.InternalMessageInfo - -func (m *LabelMatcher) GetType() LabelMatcher_Type { - if m != nil { - return m.Type - } - return LabelMatcher_EQ -} - -func (m *LabelMatcher) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *LabelMatcher) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -type ReadHints struct { - StepMs int64 `protobuf:"varint,1,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"` - Func string `protobuf:"bytes,2,opt,name=func,proto3" json:"func,omitempty"` - StartMs int64 `protobuf:"varint,3,opt,name=start_ms,json=startMs,proto3" json:"start_ms,omitempty"` - EndMs int64 `protobuf:"varint,4,opt,name=end_ms,json=endMs,proto3" json:"end_ms,omitempty"` - Grouping []string `protobuf:"bytes,5,rep,name=grouping,proto3" json:"grouping,omitempty"` - By bool `protobuf:"varint,6,opt,name=by,proto3" json:"by,omitempty"` - RangeMs int64 `protobuf:"varint,7,opt,name=range_ms,json=rangeMs,proto3" json:"range_ms,omitempty"` -} - -func (m *ReadHints) Reset() { *m = ReadHints{} } -func (m *ReadHints) String() string { return proto.CompactTextString(m) } -func (*ReadHints) ProtoMessage() {} -func (*ReadHints) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{5} -} -func (m *ReadHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadHints.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 *ReadHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadHints.Merge(m, src) -} -func (m *ReadHints) XXX_Size() int { - return m.Size() -} -func (m *ReadHints) XXX_DiscardUnknown() { - xxx_messageInfo_ReadHints.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadHints proto.InternalMessageInfo - -func (m *ReadHints) GetStepMs() int64 { - if m != nil { - return m.StepMs - } - return 0 -} - -func (m *ReadHints) GetFunc() string { - if m != nil { - return m.Func - } - return "" -} - -func (m *ReadHints) GetStartMs() int64 { - if m != nil { - return m.StartMs - } - return 0 -} - -func (m *ReadHints) GetEndMs() int64 { - if m != nil { - return m.EndMs - } - return 0 -} - -func (m *ReadHints) GetGrouping() []string { - if m != nil { - return m.Grouping - } - return nil -} - -func (m *ReadHints) GetBy() bool { - if m != nil { - return m.By - } - return false -} - -func (m *ReadHints) GetRangeMs() int64 { - if m != nil { - return m.RangeMs - } - return 0 -} - -// Chunk represents a TSDB chunk. -// Time range [min, max] is inclusive. -type Chunk struct { - MinTimeMs int64 `protobuf:"varint,1,opt,name=min_time_ms,json=minTimeMs,proto3" json:"min_time_ms,omitempty"` - MaxTimeMs int64 `protobuf:"varint,2,opt,name=max_time_ms,json=maxTimeMs,proto3" json:"max_time_ms,omitempty"` - Type Chunk_Encoding `protobuf:"varint,3,opt,name=type,proto3,enum=prometheus_copy.Chunk_Encoding" json:"type,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (m *Chunk) String() string { return proto.CompactTextString(m) } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []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) GetMinTimeMs() int64 { - if m != nil { - return m.MinTimeMs - } - return 0 -} - -func (m *Chunk) GetMaxTimeMs() int64 { - if m != nil { - return m.MaxTimeMs - } - return 0 -} - -func (m *Chunk) GetType() Chunk_Encoding { - if m != nil { - return m.Type - } - return Chunk_UNKNOWN -} - -func (m *Chunk) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// ChunkedSeries represents single, encoded time series. -type ChunkedSeries struct { - // Labels should be sorted. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - // Chunks will be in start time order and may overlap. - Chunks []Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` -} - -func (m *ChunkedSeries) Reset() { *m = ChunkedSeries{} } -func (m *ChunkedSeries) String() string { return proto.CompactTextString(m) } -func (*ChunkedSeries) ProtoMessage() {} -func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{7} -} -func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkedSeries.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 *ChunkedSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkedSeries.Merge(m, src) -} -func (m *ChunkedSeries) XXX_Size() int { - return m.Size() -} -func (m *ChunkedSeries) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkedSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkedSeries proto.InternalMessageInfo - -func (m *ChunkedSeries) GetChunks() []Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -func init() { - proto.RegisterEnum("prometheus_copy.MetricMetadata_MetricType", MetricMetadata_MetricType_name, MetricMetadata_MetricType_value) - proto.RegisterEnum("prometheus_copy.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterEnum("prometheus_copy.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) - proto.RegisterType((*MetricMetadata)(nil), "prometheus_copy.MetricMetadata") - proto.RegisterType((*Sample)(nil), "prometheus_copy.Sample") - proto.RegisterType((*Exemplar)(nil), "prometheus_copy.Exemplar") - proto.RegisterType((*TimeSeries)(nil), "prometheus_copy.TimeSeries") - proto.RegisterType((*LabelMatcher)(nil), "prometheus_copy.LabelMatcher") - proto.RegisterType((*ReadHints)(nil), "prometheus_copy.ReadHints") - proto.RegisterType((*Chunk)(nil), "prometheus_copy.Chunk") - proto.RegisterType((*ChunkedSeries)(nil), "prometheus_copy.ChunkedSeries") -} - -func init() { proto.RegisterFile("store/storepb/prompb/types.proto", fileDescriptor_166e07899dab7c14) } - -var fileDescriptor_166e07899dab7c14 = []byte{ - // 796 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0xcf, 0xd8, 0x8e, 0x1d, 0xbf, 0xfd, 0x83, 0x35, 0x2a, 0xd4, 0xbb, 0x42, 0x59, 0xcb, 0xa7, - 0x08, 0x81, 0x23, 0xb5, 0x15, 0x5c, 0x0a, 0xd2, 0x6e, 0xe5, 0x6e, 0x2b, 0x70, 0xa2, 0x4e, 0xb2, - 0x02, 0x7a, 0x89, 0x26, 0xce, 0xd4, 0xb1, 0x1a, 0xff, 0x91, 0x67, 0x82, 0x36, 0xdf, 0x82, 0x33, - 0x37, 0xc4, 0x8d, 0x1b, 0x7c, 0x8a, 0x1e, 0x7b, 0x44, 0x1c, 0x2a, 0xb4, 0x7b, 0xe2, 0x5b, 0xa0, - 0x19, 0x3b, 0xf5, 0xa6, 0x4b, 0xaf, 0xbd, 0xac, 0xde, 0xfb, 0xfd, 0xde, 0x3f, 0xbf, 0xf7, 0xdb, - 0x09, 0x78, 0x5c, 0x14, 0x15, 0x1b, 0xaa, 0xbf, 0xe5, 0x7c, 0x58, 0x56, 0x45, 0x56, 0xce, 0x87, - 0x62, 0x53, 0x32, 0x1e, 0x94, 0x55, 0x21, 0x0a, 0xfc, 0x91, 0xc4, 0x98, 0x58, 0xb2, 0x35, 0x9f, - 0xc5, 0x45, 0xb9, 0x39, 0xbe, 0x93, 0x14, 0x49, 0xa1, 0xb8, 0xa1, 0xb4, 0xea, 0xb0, 0xe3, 0xa3, - 0xba, 0xd0, 0x8a, 0xce, 0xd9, 0x6a, 0xb7, 0x82, 0xff, 0xab, 0x06, 0x87, 0x11, 0x13, 0x55, 0x1a, - 0x47, 0x4c, 0xd0, 0x05, 0x15, 0x14, 0x7f, 0x03, 0x86, 0x8c, 0x70, 0x91, 0x87, 0x06, 0x87, 0xf7, - 0x3e, 0x0b, 0xde, 0xe9, 0x11, 0xec, 0x86, 0x37, 0xee, 0x74, 0x53, 0x32, 0xa2, 0xf2, 0xf0, 0xe7, - 0x80, 0x33, 0x85, 0xcd, 0x5e, 0xd0, 0x2c, 0x5d, 0x6d, 0x66, 0x39, 0xcd, 0x98, 0xab, 0x79, 0x68, - 0x60, 0x13, 0xa7, 0x66, 0x1e, 0x2b, 0x62, 0x44, 0x33, 0x86, 0x31, 0x18, 0x4b, 0xb6, 0x2a, 0x5d, - 0x43, 0xf1, 0xca, 0x96, 0xd8, 0x3a, 0x4f, 0x85, 0xdb, 0xad, 0x31, 0x69, 0xfb, 0x1b, 0x80, 0xb6, - 0x13, 0xde, 0x03, 0xeb, 0x62, 0xf4, 0xed, 0x68, 0xfc, 0xfd, 0xc8, 0xe9, 0x48, 0xe7, 0xd1, 0xf8, - 0x62, 0x34, 0x0d, 0x89, 0x83, 0xb0, 0x0d, 0xdd, 0xf3, 0xd3, 0x8b, 0xf3, 0xd0, 0xd1, 0xf0, 0x01, - 0xd8, 0x4f, 0x9e, 0x4e, 0xa6, 0xe3, 0x73, 0x72, 0x1a, 0x39, 0x3a, 0xc6, 0x70, 0xa8, 0x98, 0x16, - 0x33, 0x64, 0xea, 0xe4, 0x22, 0x8a, 0x4e, 0xc9, 0x8f, 0x4e, 0x17, 0xf7, 0xc0, 0x78, 0x3a, 0x7a, - 0x3c, 0x76, 0x4c, 0xbc, 0x0f, 0xbd, 0xc9, 0xf4, 0x74, 0x1a, 0x4e, 0xc2, 0xa9, 0x63, 0xf9, 0x0f, - 0xc1, 0x9c, 0xd0, 0xac, 0x5c, 0x31, 0x7c, 0x07, 0xba, 0x3f, 0xd1, 0xd5, 0xba, 0xde, 0x0d, 0x22, - 0xb5, 0x83, 0x3f, 0x05, 0x5b, 0xa4, 0x19, 0xe3, 0x82, 0x66, 0xa5, 0xfa, 0x4e, 0x9d, 0xb4, 0x80, - 0xff, 0x1b, 0x82, 0x5e, 0x78, 0xc9, 0xb2, 0x72, 0x45, 0x2b, 0x1c, 0x83, 0xa9, 0xae, 0xc0, 0x5d, - 0xe4, 0xe9, 0x83, 0xbd, 0x7b, 0x07, 0x81, 0x58, 0xd2, 0xbc, 0xe0, 0xc1, 0x77, 0x12, 0x3d, 0x7b, - 0xf8, 0xea, 0xcd, 0x49, 0xe7, 0xef, 0x37, 0x27, 0x0f, 0x92, 0x54, 0x2c, 0xd7, 0xf3, 0x20, 0x2e, - 0xb2, 0x61, 0x1d, 0xf0, 0x45, 0x5a, 0x34, 0xd6, 0xb0, 0x7c, 0x99, 0x0c, 0x77, 0x0e, 0x1a, 0x3c, - 0x57, 0xd9, 0xa4, 0x29, 0xdd, 0x4e, 0xa9, 0xbd, 0x77, 0x4a, 0xfd, 0xdd, 0x29, 0xff, 0x45, 0x00, - 0xd3, 0x34, 0x63, 0x13, 0x56, 0xa5, 0x8c, 0x7f, 0x98, 0x39, 0xbf, 0x02, 0x8b, 0xab, 0xbd, 0x72, - 0x57, 0x53, 0x5d, 0xee, 0xde, 0xd2, 0x5a, 0xbd, 0xf7, 0x33, 0x43, 0xf6, 0x23, 0xdb, 0x68, 0xfc, - 0x35, 0xd8, 0xac, 0xd9, 0x28, 0x77, 0x75, 0x95, 0x7a, 0x74, 0x2b, 0x75, 0xbb, 0xf3, 0x26, 0xb9, - 0xcd, 0xf0, 0x7f, 0x41, 0xb0, 0xaf, 0x26, 0x89, 0xa8, 0x88, 0x97, 0xac, 0xc2, 0x5f, 0xee, 0x28, - 0xde, 0xbf, 0x55, 0xea, 0x66, 0x70, 0x70, 0x43, 0xe9, 0x18, 0x8c, 0x1b, 0xda, 0x56, 0x76, 0xbb, - 0x7c, 0x5d, 0x81, 0xb5, 0xe3, 0x0f, 0xc0, 0x50, 0xba, 0x35, 0x41, 0x0b, 0x9f, 0x39, 0x1d, 0x6c, - 0x81, 0x3e, 0x0a, 0x9f, 0x39, 0x48, 0x02, 0x44, 0x6a, 0x55, 0x02, 0x24, 0x74, 0x74, 0xff, 0x0f, - 0x04, 0x36, 0x61, 0x74, 0xf1, 0x24, 0xcd, 0x05, 0xc7, 0x77, 0xc1, 0xe2, 0x82, 0x95, 0xb3, 0x8c, - 0xab, 0xe1, 0x74, 0x62, 0x4a, 0x37, 0xe2, 0xb2, 0xf5, 0x8b, 0x75, 0x1e, 0x6f, 0x5b, 0x4b, 0x1b, - 0x1f, 0x41, 0x8f, 0x0b, 0x5a, 0x09, 0x19, 0x5d, 0x1f, 0xd8, 0x52, 0x7e, 0xc4, 0xf1, 0xc7, 0x60, - 0xb2, 0x7c, 0x21, 0x09, 0x43, 0x11, 0x5d, 0x96, 0x2f, 0x22, 0x8e, 0x8f, 0xa1, 0x97, 0x54, 0xc5, - 0xba, 0x4c, 0xf3, 0xc4, 0xed, 0x7a, 0xfa, 0xc0, 0x26, 0x6f, 0x7d, 0x7c, 0x08, 0xda, 0x7c, 0xe3, - 0x9a, 0x1e, 0x1a, 0xf4, 0x88, 0x36, 0xdf, 0xc8, 0xea, 0x15, 0xcd, 0x13, 0x26, 0x8b, 0x58, 0x75, - 0x75, 0xe5, 0x47, 0xdc, 0xff, 0x13, 0x41, 0xf7, 0xd1, 0x72, 0x9d, 0xbf, 0xc4, 0x7d, 0xd8, 0xcb, - 0xd2, 0x7c, 0x26, 0x75, 0xd5, 0xce, 0x6c, 0x67, 0x69, 0x2e, 0xb5, 0x15, 0x71, 0xc5, 0xd3, 0xcb, - 0xb7, 0x7c, 0xf3, 0xcf, 0x92, 0xd1, 0xcb, 0x86, 0xbf, 0xdf, 0x5c, 0x42, 0x57, 0x97, 0x38, 0xb9, - 0x75, 0x09, 0xd5, 0x25, 0x08, 0xf3, 0xb8, 0x58, 0xa4, 0x79, 0xd2, 0x9e, 0x41, 0xbe, 0x44, 0xea, - 0xd3, 0xf6, 0x89, 0xb2, 0x7d, 0x0f, 0x7a, 0xdb, 0xa8, 0xdd, 0xc7, 0xc2, 0x02, 0xfd, 0x87, 0x31, - 0x71, 0x90, 0xff, 0x3b, 0x82, 0x03, 0x55, 0x8e, 0x2d, 0x3e, 0xa4, 0xe8, 0x1f, 0x80, 0x19, 0xcb, - 0xae, 0x5b, 0xcd, 0x7f, 0xf2, 0xff, 0xdf, 0xd8, 0xa8, 0xb6, 0x89, 0x3d, 0xf3, 0x5e, 0x5d, 0xf5, - 0xd1, 0xeb, 0xab, 0x3e, 0xfa, 0xe7, 0xaa, 0x8f, 0x7e, 0xbe, 0xee, 0x77, 0x5e, 0x5f, 0xf7, 0x3b, - 0x7f, 0x5d, 0xf7, 0x3b, 0xcf, 0xcd, 0xfa, 0x67, 0x61, 0x6e, 0xaa, 0xf7, 0xfc, 0xfe, 0x7f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x98, 0xc8, 0x2e, 0xfd, 0x35, 0x06, 0x00, 0x00, -} - -func (m *MetricMetadata) 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 *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unit) > 0 { - i -= len(m.Unit) - copy(dAtA[i:], m.Unit) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Unit))) - i-- - dAtA[i] = 0x2a - } - if len(m.Help) > 0 { - i -= len(m.Help) - copy(dAtA[i:], m.Help) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Help))) - i-- - dAtA[i] = 0x22 - } - if len(m.MetricFamilyName) > 0 { - i -= len(m.MetricFamilyName) - copy(dAtA[i:], m.MetricFamilyName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MetricFamilyName))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Sample) 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 *Sample) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x10 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *Exemplar) 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 *Exemplar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x18 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x11 - } - 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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TimeSeries) 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 *TimeSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Exemplars) > 0 { - for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - 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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LabelMatcher) 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 *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ReadHints) 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 *ReadHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RangeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RangeMs)) - i-- - dAtA[i] = 0x38 - } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Grouping) > 0 { - for iNdEx := len(m.Grouping) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Grouping[iNdEx]) - copy(dAtA[i:], m.Grouping[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Grouping[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.EndMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.EndMs)) - i-- - dAtA[i] = 0x20 - } - if m.StartMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StartMs)) - i-- - dAtA[i] = 0x18 - } - if len(m.Func) > 0 { - i -= len(m.Func) - copy(dAtA[i:], m.Func) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Func))) - i-- - dAtA[i] = 0x12 - } - if m.StepMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StepMs)) - 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 len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.MaxTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTimeMs)) - i-- - dAtA[i] = 0x10 - } - if m.MinTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTimeMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkedSeries) 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 *ChunkedSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - 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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.MetricFamilyName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Help) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Unit) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Sample) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *Exemplar) 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 + sovTypes(uint64(l)) - } - } - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *TimeSeries) 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 + sovTypes(uint64(l)) - } - } - if len(m.Samples) > 0 { - for _, e := range m.Samples { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Exemplars) > 0 { - for _, e := range m.Exemplars { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *LabelMatcher) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ReadHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StepMs != 0 { - n += 1 + sovTypes(uint64(m.StepMs)) - } - l = len(m.Func) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.StartMs != 0 { - n += 1 + sovTypes(uint64(m.StartMs)) - } - if m.EndMs != 0 { - n += 1 + sovTypes(uint64(m.EndMs)) - } - if len(m.Grouping) > 0 { - for _, s := range m.Grouping { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.By { - n += 2 - } - if m.RangeMs != 0 { - n += 1 + sovTypes(uint64(m.RangeMs)) - } - return n -} - -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MinTimeMs)) - } - if m.MaxTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MaxTimeMs)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ChunkedSeries) 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 + sovTypes(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MetricMetadata) 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 ErrIntOverflowTypes - } - 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: MetricMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadata: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= MetricMetadata_MetricType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricFamilyName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricFamilyName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Help = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Sample) 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 ErrIntOverflowTypes - } - 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: Sample: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Exemplar) 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 ErrIntOverflowTypes - } - 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: Exemplar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Exemplar: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - 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 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimeSeries) 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 ErrIntOverflowTypes - } - 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: TimeSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeSeries: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Samples = append(m.Samples, Sample{}) - if err := m.Samples[len(m.Samples)-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 Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exemplars = append(m.Exemplars, Exemplar{}) - if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelMatcher) 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 ErrIntOverflowTypes - } - 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: LabelMatcher: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelMatcher: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= LabelMatcher_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadHints) 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 ErrIntOverflowTypes - } - 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: ReadHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StepMs", wireType) - } - m.StepMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StepMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Func = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartMs", wireType) - } - m.StartMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndMs", wireType) - } - m.EndMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grouping = append(m.Grouping, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeMs", wireType) - } - m.RangeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RangeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTimeMs", wireType) - } - m.MinTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTimeMs", wireType) - } - m.MaxTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Chunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkedSeries) 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 ErrIntOverflowTypes - } - 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: ChunkedSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkedSeries: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - 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 Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto deleted file mode 100644 index f62ff7552b..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -// Copyright 2017 Prometheus Team -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; -package prometheus_copy; - -option go_package = "prompb"; - -import "gogoproto/gogo.proto"; -import "store/labelpb/types.proto"; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message MetricMetadata { - enum MetricType { - UNKNOWN = 0; - COUNTER = 1; - GAUGE = 2; - HISTOGRAM = 3; - GAUGEHISTOGRAM = 4; - SUMMARY = 5; - INFO = 6; - STATESET = 7; - } - - // Represents the metric type, these match the set from Prometheus. - // Refer to pkg/textparse/interface.go for details. - MetricType type = 1; - string metric_family_name = 2; - string help = 4; - string unit = 5; -} - -message Sample { - double value = 1; - int64 timestamp = 2; -} - -message Exemplar { - // Optional, can be empty. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - double value = 2; - // timestamp is in ms format, see pkg/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - int64 timestamp = 3; -} - -// TimeSeries represents samples and labels for a single time series. -message TimeSeries { - // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; - repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false]; -} - -// Matcher specifies a rule, which can match or set of labels or not. -message LabelMatcher { - enum Type { - EQ = 0; - NEQ = 1; - RE = 2; - NRE = 3; - } - Type type = 1; - string name = 2; - string value = 3; -} - -message ReadHints { - int64 step_ms = 1; // Query step size in milliseconds. - string func = 2; // String representation of surrounding function or aggregation. - int64 start_ms = 3; // Start time in milliseconds. - int64 end_ms = 4; // End time in milliseconds. - repeated string grouping = 5; // List of label names used in aggregation. - bool by = 6; // Indicate whether it is without or by. - int64 range_ms = 7; // Range vector selector range in milliseconds. -} - -// Chunk represents a TSDB chunk. -// Time range [min, max] is inclusive. -message Chunk { - int64 min_time_ms = 1; - int64 max_time_ms = 2; - - // We require this to match chunkenc.Encoding. - enum Encoding { - UNKNOWN = 0; - XOR = 1; - } - Encoding type = 3; - bytes data = 4; -} - -// ChunkedSeries represents single, encoded time series. -message ChunkedSeries { - // Labels should be sorted. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - // Chunks will be in start time order and may overlap. - repeated Chunk chunks = 2 [(gogoproto.nullable) = false]; -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go deleted file mode 100644 index 745686a208..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go +++ /dev/null @@ -1,3642 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: store/storepb/rpc.proto - -package storepb - -import ( - context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" - labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" - prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// Reference imports to suppress errors if they are not otherwise used. -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 StoreType int32 - -const ( - StoreType_UNKNOWN StoreType = 0 - StoreType_QUERY StoreType = 1 - StoreType_RULE StoreType = 2 - StoreType_SIDECAR StoreType = 3 - StoreType_STORE StoreType = 4 - StoreType_RECEIVE StoreType = 5 - // DEBUG represents some debug StoreAPI components e.g. thanos tools store-api-serve. - StoreType_DEBUG StoreType = 6 -) - -var StoreType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "QUERY", - 2: "RULE", - 3: "SIDECAR", - 4: "STORE", - 5: "RECEIVE", - 6: "DEBUG", -} - -var StoreType_value = map[string]int32{ - "UNKNOWN": 0, - "QUERY": 1, - "RULE": 2, - "SIDECAR": 3, - "STORE": 4, - "RECEIVE": 5, - "DEBUG": 6, -} - -func (x StoreType) String() string { - return proto.EnumName(StoreType_name, int32(x)) -} - -func (StoreType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{0} -} - -type Aggr int32 - -const ( - Aggr_RAW Aggr = 0 - Aggr_COUNT Aggr = 1 - Aggr_SUM Aggr = 2 - Aggr_MIN Aggr = 3 - Aggr_MAX Aggr = 4 - Aggr_COUNTER Aggr = 5 -) - -var Aggr_name = map[int32]string{ - 0: "RAW", - 1: "COUNT", - 2: "SUM", - 3: "MIN", - 4: "MAX", - 5: "COUNTER", -} - -var Aggr_value = map[string]int32{ - "RAW": 0, - "COUNT": 1, - "SUM": 2, - "MIN": 3, - "MAX": 4, - "COUNTER": 5, -} - -func (x Aggr) String() string { - return proto.EnumName(Aggr_name, int32(x)) -} - -func (Aggr) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{1} -} - -type WriteResponse struct { -} - -func (m *WriteResponse) Reset() { *m = WriteResponse{} } -func (m *WriteResponse) String() string { return proto.CompactTextString(m) } -func (*WriteResponse) ProtoMessage() {} -func (*WriteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{0} -} -func (m *WriteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteResponse.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 *WriteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteResponse.Merge(m, src) -} -func (m *WriteResponse) XXX_Size() int { - return m.Size() -} -func (m *WriteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteResponse proto.InternalMessageInfo - -type WriteRequest struct { - Timeseries []prompb.TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` - Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` - Replica int64 `protobuf:"varint,3,opt,name=replica,proto3" json:"replica,omitempty"` -} - -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} -func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{1} -} -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequest.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 *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) -} -func (m *WriteRequest) XXX_Size() int { - return m.Size() -} -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo - -type InfoRequest struct { -} - -func (m *InfoRequest) Reset() { *m = InfoRequest{} } -func (m *InfoRequest) String() string { return proto.CompactTextString(m) } -func (*InfoRequest) ProtoMessage() {} -func (*InfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{2} -} -func (m *InfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoRequest.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 *InfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoRequest.Merge(m, src) -} -func (m *InfoRequest) XXX_Size() int { - return m.Size() -} -func (m *InfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoRequest proto.InternalMessageInfo - -type InfoResponse struct { - // Deprecated. Use label_sets instead. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` - // label_sets is an unsorted list of `ZLabelSet`s. - LabelSets []labelpb.ZLabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` -} - -func (m *InfoResponse) Reset() { *m = InfoResponse{} } -func (m *InfoResponse) String() string { return proto.CompactTextString(m) } -func (*InfoResponse) ProtoMessage() {} -func (*InfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{3} -} -func (m *InfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InfoResponse.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 *InfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InfoResponse.Merge(m, src) -} -func (m *InfoResponse) XXX_Size() int { - return m.Size() -} -func (m *InfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_InfoResponse proto.InternalMessageInfo - -type SeriesRequest struct { - MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers"` - MaxResolutionWindow int64 `protobuf:"varint,4,opt,name=max_resolution_window,json=maxResolutionWindow,proto3" json:"max_resolution_window,omitempty"` - Aggregates []Aggr `protobuf:"varint,5,rep,packed,name=aggregates,proto3,enum=thanos.Aggr" json:"aggregates,omitempty"` - // Deprecated. Use partial_response_strategy instead. - PartialResponseDisabled bool `protobuf:"varint,6,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,7,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` - // skip_chunks controls whether sending chunks or not in series responses. - SkipChunks bool `protobuf:"varint,8,opt,name=skip_chunks,json=skipChunks,proto3" json:"skip_chunks,omitempty"` - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,9,opt,name=hints,proto3" json:"hints,omitempty"` - // Query step size in milliseconds. - Step int64 `protobuf:"varint,10,opt,name=step,proto3" json:"step,omitempty"` - // Range vector selector range in milliseconds. - Range int64 `protobuf:"varint,11,opt,name=range,proto3" json:"range,omitempty"` -} - -func (m *SeriesRequest) Reset() { *m = SeriesRequest{} } -func (m *SeriesRequest) String() string { return proto.CompactTextString(m) } -func (*SeriesRequest) ProtoMessage() {} -func (*SeriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{4} -} -func (m *SeriesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesRequest.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 *SeriesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesRequest.Merge(m, src) -} -func (m *SeriesRequest) XXX_Size() int { - return m.Size() -} -func (m *SeriesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SeriesRequest proto.InternalMessageInfo - -type SeriesResponse struct { - // Types that are valid to be assigned to Result: - // *SeriesResponse_Series - // *SeriesResponse_Warning - // *SeriesResponse_Hints - Result isSeriesResponse_Result `protobuf_oneof:"result"` -} - -func (m *SeriesResponse) Reset() { *m = SeriesResponse{} } -func (m *SeriesResponse) String() string { return proto.CompactTextString(m) } -func (*SeriesResponse) ProtoMessage() {} -func (*SeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{5} -} -func (m *SeriesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SeriesResponse.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 *SeriesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeriesResponse.Merge(m, src) -} -func (m *SeriesResponse) XXX_Size() int { - return m.Size() -} -func (m *SeriesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SeriesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SeriesResponse proto.InternalMessageInfo - -type isSeriesResponse_Result interface { - isSeriesResponse_Result() - MarshalTo([]byte) (int, error) - Size() int -} - -type SeriesResponse_Series struct { - Series *Series `protobuf:"bytes,1,opt,name=series,proto3,oneof" json:"series,omitempty"` -} -type SeriesResponse_Warning struct { - Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` -} -type SeriesResponse_Hints struct { - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3,oneof" json:"hints,omitempty"` -} - -func (*SeriesResponse_Series) isSeriesResponse_Result() {} -func (*SeriesResponse_Warning) isSeriesResponse_Result() {} -func (*SeriesResponse_Hints) isSeriesResponse_Result() {} - -func (m *SeriesResponse) GetResult() isSeriesResponse_Result { - if m != nil { - return m.Result - } - return nil -} - -func (m *SeriesResponse) GetSeries() *Series { - if x, ok := m.GetResult().(*SeriesResponse_Series); ok { - return x.Series - } - return nil -} - -func (m *SeriesResponse) GetWarning() string { - if x, ok := m.GetResult().(*SeriesResponse_Warning); ok { - return x.Warning - } - return "" -} - -func (m *SeriesResponse) GetHints() *types.Any { - if x, ok := m.GetResult().(*SeriesResponse_Hints); ok { - return x.Hints - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SeriesResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SeriesResponse_Series)(nil), - (*SeriesResponse_Warning)(nil), - (*SeriesResponse_Hints)(nil), - } -} - -type LabelNamesRequest struct { - PartialResponseDisabled bool `protobuf:"varint,1,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,2,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` - Start int64 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - End int64 `protobuf:"varint,4,opt,name=end,proto3" json:"end,omitempty"` - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,5,opt,name=hints,proto3" json:"hints,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,6,rep,name=matchers,proto3" json:"matchers"` -} - -func (m *LabelNamesRequest) Reset() { *m = LabelNamesRequest{} } -func (m *LabelNamesRequest) String() string { return proto.CompactTextString(m) } -func (*LabelNamesRequest) ProtoMessage() {} -func (*LabelNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{6} -} -func (m *LabelNamesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesRequest.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 *LabelNamesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesRequest.Merge(m, src) -} -func (m *LabelNamesRequest) XXX_Size() int { - return m.Size() -} -func (m *LabelNamesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelNamesRequest proto.InternalMessageInfo - -type LabelNamesResponse struct { - Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` - Warnings []string `protobuf:"bytes,2,rep,name=warnings,proto3" json:"warnings,omitempty"` - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` -} - -func (m *LabelNamesResponse) Reset() { *m = LabelNamesResponse{} } -func (m *LabelNamesResponse) String() string { return proto.CompactTextString(m) } -func (*LabelNamesResponse) ProtoMessage() {} -func (*LabelNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{7} -} -func (m *LabelNamesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelNamesResponse.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 *LabelNamesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelNamesResponse.Merge(m, src) -} -func (m *LabelNamesResponse) XXX_Size() int { - return m.Size() -} -func (m *LabelNamesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LabelNamesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelNamesResponse proto.InternalMessageInfo - -type LabelValuesRequest struct { - Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` - PartialResponseDisabled bool `protobuf:"varint,2,opt,name=partial_response_disabled,json=partialResponseDisabled,proto3" json:"partial_response_disabled,omitempty"` - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy PartialResponseStrategy `protobuf:"varint,3,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` - Start int64 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - End int64 `protobuf:"varint,5,opt,name=end,proto3" json:"end,omitempty"` - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - Hints *types.Any `protobuf:"bytes,6,opt,name=hints,proto3" json:"hints,omitempty"` - Matchers []LabelMatcher `protobuf:"bytes,7,rep,name=matchers,proto3" json:"matchers"` -} - -func (m *LabelValuesRequest) Reset() { *m = LabelValuesRequest{} } -func (m *LabelValuesRequest) String() string { return proto.CompactTextString(m) } -func (*LabelValuesRequest) ProtoMessage() {} -func (*LabelValuesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{8} -} -func (m *LabelValuesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesRequest.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 *LabelValuesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesRequest.Merge(m, src) -} -func (m *LabelValuesRequest) XXX_Size() int { - return m.Size() -} -func (m *LabelValuesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelValuesRequest proto.InternalMessageInfo - -type LabelValuesResponse struct { - Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - Warnings []string `protobuf:"bytes,2,rep,name=warnings,proto3" json:"warnings,omitempty"` - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - Hints *types.Any `protobuf:"bytes,3,opt,name=hints,proto3" json:"hints,omitempty"` -} - -func (m *LabelValuesResponse) Reset() { *m = LabelValuesResponse{} } -func (m *LabelValuesResponse) String() string { return proto.CompactTextString(m) } -func (*LabelValuesResponse) ProtoMessage() {} -func (*LabelValuesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{9} -} -func (m *LabelValuesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelValuesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelValuesResponse.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 *LabelValuesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelValuesResponse.Merge(m, src) -} -func (m *LabelValuesResponse) XXX_Size() int { - return m.Size() -} -func (m *LabelValuesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LabelValuesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelValuesResponse proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("thanos.StoreType", StoreType_name, StoreType_value) - proto.RegisterEnum("thanos.Aggr", Aggr_name, Aggr_value) - proto.RegisterType((*WriteResponse)(nil), "thanos.WriteResponse") - proto.RegisterType((*WriteRequest)(nil), "thanos.WriteRequest") - proto.RegisterType((*InfoRequest)(nil), "thanos.InfoRequest") - proto.RegisterType((*InfoResponse)(nil), "thanos.InfoResponse") - proto.RegisterType((*SeriesRequest)(nil), "thanos.SeriesRequest") - proto.RegisterType((*SeriesResponse)(nil), "thanos.SeriesResponse") - proto.RegisterType((*LabelNamesRequest)(nil), "thanos.LabelNamesRequest") - proto.RegisterType((*LabelNamesResponse)(nil), "thanos.LabelNamesResponse") - proto.RegisterType((*LabelValuesRequest)(nil), "thanos.LabelValuesRequest") - proto.RegisterType((*LabelValuesResponse)(nil), "thanos.LabelValuesResponse") -} - -func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } - -var fileDescriptor_a938d55a388af629 = []byte{ - // 1083 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdf, 0x6e, 0x1a, 0xc7, - 0x17, 0x66, 0x59, 0x76, 0x81, 0x83, 0xed, 0xdf, 0x66, 0x8c, 0x9d, 0x35, 0x91, 0x30, 0x42, 0xfa, - 0x49, 0xc8, 0x4a, 0xa1, 0xa5, 0x55, 0xa4, 0x56, 0xb9, 0x01, 0x9b, 0xd6, 0x56, 0x63, 0xdc, 0x0e, - 0x26, 0x6e, 0x53, 0x55, 0x68, 0xc1, 0x93, 0x65, 0x65, 0xf6, 0x4f, 0x77, 0x86, 0xda, 0xdc, 0xb6, - 0xf7, 0x55, 0xd5, 0xa7, 0xe9, 0x23, 0xf8, 0xae, 0xb9, 0xac, 0x7a, 0x11, 0xb5, 0xf6, 0x03, 0xf4, - 0x15, 0xaa, 0x9d, 0x99, 0x05, 0xd6, 0x75, 0x92, 0x46, 0xce, 0x0d, 0x9a, 0x73, 0xbe, 0x73, 0xce, - 0x7c, 0x73, 0xbe, 0x39, 0xc3, 0xc2, 0x7d, 0xca, 0xfc, 0x90, 0x34, 0xf8, 0x6f, 0x30, 0x6c, 0x84, - 0xc1, 0xa8, 0x1e, 0x84, 0x3e, 0xf3, 0x91, 0xce, 0xc6, 0x96, 0xe7, 0xd3, 0xd2, 0x56, 0x32, 0x80, - 0xcd, 0x02, 0x42, 0x45, 0x48, 0xa9, 0x68, 0xfb, 0xb6, 0xcf, 0x97, 0x8d, 0x68, 0x25, 0xbd, 0x95, - 0x64, 0x42, 0x10, 0xfa, 0xee, 0x8d, 0x3c, 0x59, 0x72, 0x62, 0x0d, 0xc9, 0xe4, 0x26, 0x64, 0xfb, - 0xbe, 0x3d, 0x21, 0x0d, 0x6e, 0x0d, 0xa7, 0xcf, 0x1b, 0x96, 0x37, 0x13, 0x50, 0xf5, 0x7f, 0xb0, - 0x7a, 0x12, 0x3a, 0x8c, 0x60, 0x42, 0x03, 0xdf, 0xa3, 0xa4, 0xfa, 0xa3, 0x02, 0x2b, 0xd2, 0xf3, - 0xdd, 0x94, 0x50, 0x86, 0x5a, 0x00, 0xcc, 0x71, 0x09, 0x25, 0xa1, 0x43, 0xa8, 0xa9, 0x54, 0xd4, - 0x5a, 0xa1, 0xf9, 0x20, 0xca, 0x76, 0x09, 0x1b, 0x93, 0x29, 0x1d, 0x8c, 0xfc, 0x60, 0x56, 0x3f, - 0x76, 0x5c, 0xd2, 0xe3, 0x21, 0xed, 0xcc, 0xe5, 0xcb, 0xed, 0x14, 0x5e, 0x4a, 0x42, 0x9b, 0xa0, - 0x33, 0xe2, 0x59, 0x1e, 0x33, 0xd3, 0x15, 0xa5, 0x96, 0xc7, 0xd2, 0x42, 0x26, 0x64, 0x43, 0x12, - 0x4c, 0x9c, 0x91, 0x65, 0xaa, 0x15, 0xa5, 0xa6, 0xe2, 0xd8, 0xac, 0xae, 0x42, 0xe1, 0xc0, 0x7b, - 0xee, 0x4b, 0x0e, 0xd5, 0x5f, 0xd2, 0xb0, 0x22, 0x6c, 0xc1, 0x12, 0x8d, 0x40, 0xe7, 0x07, 0x8d, - 0x09, 0xad, 0xd6, 0x45, 0x63, 0xeb, 0x4f, 0x22, 0x6f, 0xfb, 0x71, 0x44, 0xe1, 0x8f, 0x97, 0xdb, - 0x1f, 0xd9, 0x0e, 0x1b, 0x4f, 0x87, 0xf5, 0x91, 0xef, 0x36, 0x44, 0xc0, 0x7b, 0x8e, 0x2f, 0x57, - 0x8d, 0xe0, 0xcc, 0x6e, 0x24, 0x7a, 0x56, 0x7f, 0xc6, 0xb3, 0xb1, 0x2c, 0x8d, 0xb6, 0x20, 0xe7, - 0x3a, 0xde, 0x20, 0x3a, 0x08, 0x27, 0xae, 0xe2, 0xac, 0xeb, 0x78, 0xd1, 0x49, 0x39, 0x64, 0x5d, - 0x08, 0x48, 0x52, 0x77, 0xad, 0x0b, 0x0e, 0x35, 0x20, 0xcf, 0xab, 0x1e, 0xcf, 0x02, 0x62, 0x66, - 0x2a, 0x4a, 0x6d, 0xad, 0x79, 0x2f, 0x66, 0xd7, 0x8b, 0x01, 0xbc, 0x88, 0x41, 0x8f, 0x00, 0xf8, - 0x86, 0x03, 0x4a, 0x18, 0x35, 0x35, 0x7e, 0x9e, 0x79, 0x86, 0xa0, 0xd4, 0x23, 0x4c, 0xb6, 0x35, - 0x3f, 0x91, 0x36, 0xad, 0xfe, 0xad, 0xc2, 0xaa, 0x68, 0x79, 0x2c, 0xd5, 0x32, 0x61, 0xe5, 0xd5, - 0x84, 0xd3, 0x49, 0xc2, 0x8f, 0x22, 0x88, 0x8d, 0xc6, 0x24, 0xa4, 0xa6, 0xca, 0x77, 0x2f, 0x26, - 0xba, 0x79, 0x28, 0x40, 0x49, 0x60, 0x1e, 0x8b, 0x9a, 0xb0, 0x11, 0x95, 0x0c, 0x09, 0xf5, 0x27, - 0x53, 0xe6, 0xf8, 0xde, 0xe0, 0xdc, 0xf1, 0x4e, 0xfd, 0x73, 0x7e, 0x68, 0x15, 0xaf, 0xbb, 0xd6, - 0x05, 0x9e, 0x63, 0x27, 0x1c, 0x42, 0x0f, 0x01, 0x2c, 0xdb, 0x0e, 0x89, 0x6d, 0x31, 0x22, 0xce, - 0xba, 0xd6, 0x5c, 0x89, 0x77, 0x6b, 0xd9, 0x76, 0x88, 0x97, 0x70, 0xf4, 0x09, 0x6c, 0x05, 0x56, - 0xc8, 0x1c, 0x6b, 0x12, 0xed, 0xc2, 0x95, 0x1f, 0x9c, 0x3a, 0xd4, 0x1a, 0x4e, 0xc8, 0xa9, 0xa9, - 0x57, 0x94, 0x5a, 0x0e, 0xdf, 0x97, 0x01, 0xf1, 0xcd, 0xd8, 0x93, 0x30, 0xfa, 0xe6, 0x96, 0x5c, - 0xca, 0x42, 0x8b, 0x11, 0x7b, 0x66, 0x66, 0xb9, 0x2c, 0xdb, 0xf1, 0xc6, 0x5f, 0x24, 0x6b, 0xf4, - 0x64, 0xd8, 0xbf, 0x8a, 0xc7, 0x00, 0xda, 0x86, 0x02, 0x3d, 0x73, 0x82, 0xc1, 0x68, 0x3c, 0xf5, - 0xce, 0xa8, 0x99, 0xe3, 0x54, 0x20, 0x72, 0xed, 0x72, 0x0f, 0xda, 0x01, 0x6d, 0xec, 0x78, 0x8c, - 0x9a, 0xf9, 0x8a, 0xc2, 0x1b, 0x2a, 0x26, 0xb0, 0x1e, 0x4f, 0x60, 0xbd, 0xe5, 0xcd, 0xb0, 0x08, - 0x41, 0x08, 0x32, 0x94, 0x91, 0xc0, 0x04, 0xde, 0x36, 0xbe, 0x46, 0x45, 0xd0, 0x42, 0xcb, 0xb3, - 0x89, 0x59, 0xe0, 0x4e, 0x61, 0x54, 0x7f, 0x52, 0x60, 0x2d, 0x56, 0x5c, 0x0e, 0x42, 0x0d, 0xf4, - 0xf9, 0x64, 0x46, 0x3b, 0xad, 0xcd, 0xaf, 0x1a, 0xf7, 0xee, 0xa7, 0xb0, 0xc4, 0x51, 0x09, 0xb2, - 0xe7, 0x56, 0xe8, 0x39, 0x9e, 0x2d, 0xa6, 0x70, 0x3f, 0x85, 0x63, 0x07, 0x7a, 0x18, 0xd3, 0x55, - 0x5f, 0x4d, 0x77, 0x3f, 0x25, 0x09, 0xb7, 0x73, 0xa0, 0x87, 0x84, 0x4e, 0x27, 0xac, 0xfa, 0x6b, - 0x1a, 0xee, 0xf1, 0x3b, 0xd2, 0xb5, 0xdc, 0xc5, 0x35, 0x7c, 0xad, 0x6c, 0xca, 0x1d, 0x64, 0x4b, - 0xdf, 0x51, 0xb6, 0x22, 0x68, 0x94, 0x59, 0x21, 0x93, 0x23, 0x2b, 0x0c, 0x64, 0x80, 0x4a, 0xbc, - 0x53, 0x79, 0x6b, 0xa3, 0xe5, 0x42, 0x3d, 0xed, 0xcd, 0xea, 0x2d, 0x4f, 0x8f, 0xfe, 0xdf, 0xa7, - 0xa7, 0x1a, 0x02, 0x5a, 0xee, 0x9c, 0x94, 0xb3, 0x08, 0x9a, 0x17, 0x39, 0xf8, 0xb3, 0x96, 0xc7, - 0xc2, 0x40, 0x25, 0xc8, 0x49, 0xa5, 0xa8, 0x99, 0xe6, 0xc0, 0xdc, 0x5e, 0x70, 0x55, 0xdf, 0xc8, - 0xb5, 0xfa, 0x5b, 0x5a, 0x6e, 0xfa, 0xd4, 0x9a, 0x4c, 0x17, 0x7a, 0x15, 0x41, 0xe3, 0xaf, 0x0a, - 0xd7, 0x26, 0x8f, 0x85, 0xf1, 0x7a, 0x15, 0xd3, 0x77, 0x50, 0x51, 0x7d, 0x57, 0x2a, 0x66, 0x6e, - 0x51, 0x51, 0xbb, 0x45, 0x45, 0xfd, 0xed, 0x54, 0xcc, 0xbe, 0x85, 0x8a, 0x53, 0x58, 0x4f, 0x34, - 0x54, 0xca, 0xb8, 0x09, 0xfa, 0xf7, 0xdc, 0x23, 0x75, 0x94, 0xd6, 0xbb, 0x12, 0x72, 0xe7, 0x5b, - 0xc8, 0xcf, 0xff, 0x4a, 0x50, 0x01, 0xb2, 0xfd, 0xee, 0xe7, 0xdd, 0xa3, 0x93, 0xae, 0x91, 0x42, - 0x79, 0xd0, 0xbe, 0xec, 0x77, 0xf0, 0xd7, 0x86, 0x82, 0x72, 0x90, 0xc1, 0xfd, 0x27, 0x1d, 0x23, - 0x1d, 0x45, 0xf4, 0x0e, 0xf6, 0x3a, 0xbb, 0x2d, 0x6c, 0xa8, 0x51, 0x44, 0xef, 0xf8, 0x08, 0x77, - 0x8c, 0x4c, 0xe4, 0xc7, 0x9d, 0xdd, 0xce, 0xc1, 0xd3, 0x8e, 0xa1, 0x45, 0xfe, 0xbd, 0x4e, 0xbb, - 0xff, 0x99, 0xa1, 0xef, 0xb4, 0x21, 0x13, 0xbd, 0xc5, 0x28, 0x0b, 0x2a, 0x6e, 0x9d, 0x88, 0xaa, - 0xbb, 0x47, 0xfd, 0xee, 0xb1, 0xa1, 0x44, 0xbe, 0x5e, 0xff, 0xd0, 0x48, 0x47, 0x8b, 0xc3, 0x83, - 0xae, 0xa1, 0xf2, 0x45, 0xeb, 0x2b, 0x51, 0x8e, 0x47, 0x75, 0xb0, 0xa1, 0x35, 0x7f, 0x48, 0x83, - 0xc6, 0x39, 0xa2, 0x0f, 0x20, 0x13, 0xfd, 0x77, 0xa3, 0xf5, 0xb8, 0xa3, 0x4b, 0xff, 0xec, 0xa5, - 0x62, 0xd2, 0x29, 0xfb, 0xf7, 0x31, 0xe8, 0xe2, 0xfd, 0x42, 0x1b, 0xc9, 0xf7, 0x2c, 0x4e, 0xdb, - 0xbc, 0xe9, 0x16, 0x89, 0xef, 0x2b, 0x68, 0x17, 0x60, 0x31, 0x57, 0x68, 0x2b, 0xa1, 0xe2, 0xf2, - 0x2b, 0x55, 0x2a, 0xdd, 0x06, 0xc9, 0xfd, 0x3f, 0x85, 0xc2, 0x92, 0xac, 0x28, 0x19, 0x9a, 0x18, - 0x9e, 0xd2, 0x83, 0x5b, 0x31, 0x51, 0xa7, 0xd9, 0x85, 0x35, 0xfe, 0x2d, 0x15, 0x4d, 0x85, 0x68, - 0xc6, 0x63, 0x28, 0x60, 0xe2, 0xfa, 0x8c, 0x70, 0x3f, 0x9a, 0x1f, 0x7f, 0xf9, 0x93, 0xab, 0xb4, - 0x71, 0xc3, 0x2b, 0x3f, 0xcd, 0x52, 0xed, 0xff, 0x5f, 0xfe, 0x55, 0x4e, 0x5d, 0x5e, 0x95, 0x95, - 0x17, 0x57, 0x65, 0xe5, 0xcf, 0xab, 0xb2, 0xf2, 0xf3, 0x75, 0x39, 0xf5, 0xe2, 0xba, 0x9c, 0xfa, - 0xfd, 0xba, 0x9c, 0x7a, 0x96, 0x95, 0x5f, 0x87, 0x43, 0x9d, 0xdf, 0x99, 0x0f, 0xff, 0x09, 0x00, - 0x00, 0xff, 0xff, 0xa4, 0xea, 0x02, 0x9d, 0x87, 0x0a, 0x00, 0x00, -} - -// 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 - -// StoreClient is the client API for Store service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StoreClient interface { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) -} - -type storeClient struct { - cc *grpc.ClientConn -} - -func NewStoreClient(cc *grpc.ClientConn) StoreClient { - return &storeClient{cc} -} - -func (c *storeClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - out := new(InfoResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/Info", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) Series(ctx context.Context, in *SeriesRequest, opts ...grpc.CallOption) (Store_SeriesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Store_serviceDesc.Streams[0], "/thanos.Store/Series", opts...) - if err != nil { - return nil, err - } - x := &storeSeriesClient{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 Store_SeriesClient interface { - Recv() (*SeriesResponse, error) - grpc.ClientStream -} - -type storeSeriesClient struct { - grpc.ClientStream -} - -func (x *storeSeriesClient) Recv() (*SeriesResponse, error) { - m := new(SeriesResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storeClient) LabelNames(ctx context.Context, in *LabelNamesRequest, opts ...grpc.CallOption) (*LabelNamesResponse, error) { - out := new(LabelNamesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelNames", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storeClient) LabelValues(ctx context.Context, in *LabelValuesRequest, opts ...grpc.CallOption) (*LabelValuesResponse, error) { - out := new(LabelValuesResponse) - err := c.cc.Invoke(ctx, "/thanos.Store/LabelValues", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StoreServer is the server API for Store service. -type StoreServer interface { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - Info(context.Context, *InfoRequest) (*InfoResponse, error) - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - Series(*SeriesRequest, Store_SeriesServer) error - /// LabelNames returns all label names constrained by the given matchers. - LabelNames(context.Context, *LabelNamesRequest) (*LabelNamesResponse, error) - /// LabelValues returns all label values for given label name. - LabelValues(context.Context, *LabelValuesRequest) (*LabelValuesResponse, error) -} - -// UnimplementedStoreServer can be embedded to have forward compatible implementations. -type UnimplementedStoreServer struct { -} - -func (*UnimplementedStoreServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} -func (*UnimplementedStoreServer) Series(req *SeriesRequest, srv Store_SeriesServer) error { - return status.Errorf(codes.Unimplemented, "method Series not implemented") -} -func (*UnimplementedStoreServer) LabelNames(ctx context.Context, req *LabelNamesRequest) (*LabelNamesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelNames not implemented") -} -func (*UnimplementedStoreServer) LabelValues(ctx context.Context, req *LabelValuesRequest) (*LabelValuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LabelValues not implemented") -} - -func RegisterStoreServer(s *grpc.Server, srv StoreServer) { - s.RegisterService(&_Store_serviceDesc, srv) -} - -func _Store_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/Info", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).Info(ctx, req.(*InfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_Series_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SeriesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StoreServer).Series(m, &storeSeriesServer{stream}) -} - -type Store_SeriesServer interface { - Send(*SeriesResponse) error - grpc.ServerStream -} - -type storeSeriesServer struct { - grpc.ServerStream -} - -func (x *storeSeriesServer) Send(m *SeriesResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Store_LabelNames_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelNamesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelNames(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelNames", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelNames(ctx, req.(*LabelNamesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Store_LabelValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LabelValuesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StoreServer).LabelValues(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.Store/LabelValues", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StoreServer).LabelValues(ctx, req.(*LabelValuesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Store_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.Store", - HandlerType: (*StoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Info", - Handler: _Store_Info_Handler, - }, - { - MethodName: "LabelNames", - Handler: _Store_LabelNames_Handler, - }, - { - MethodName: "LabelValues", - Handler: _Store_LabelValues_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Series", - Handler: _Store_Series_Handler, - ServerStreams: true, - }, - }, - Metadata: "store/storepb/rpc.proto", -} - -// WriteableStoreClient is the client API for WriteableStore service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WriteableStoreClient interface { - // WriteRequest allows you to write metrics to this store via remote write - RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) -} - -type writeableStoreClient struct { - cc *grpc.ClientConn -} - -func NewWriteableStoreClient(cc *grpc.ClientConn) WriteableStoreClient { - return &writeableStoreClient{cc} -} - -func (c *writeableStoreClient) RemoteWrite(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { - out := new(WriteResponse) - err := c.cc.Invoke(ctx, "/thanos.WriteableStore/RemoteWrite", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// WriteableStoreServer is the server API for WriteableStore service. -type WriteableStoreServer interface { - // WriteRequest allows you to write metrics to this store via remote write - RemoteWrite(context.Context, *WriteRequest) (*WriteResponse, error) -} - -// UnimplementedWriteableStoreServer can be embedded to have forward compatible implementations. -type UnimplementedWriteableStoreServer struct { -} - -func (*UnimplementedWriteableStoreServer) RemoteWrite(ctx context.Context, req *WriteRequest) (*WriteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoteWrite not implemented") -} - -func RegisterWriteableStoreServer(s *grpc.Server, srv WriteableStoreServer) { - s.RegisterService(&_WriteableStore_serviceDesc, srv) -} - -func _WriteableStore_RemoteWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WriteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WriteableStoreServer).RemoteWrite(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/thanos.WriteableStore/RemoteWrite", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WriteableStoreServer).RemoteWrite(ctx, req.(*WriteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _WriteableStore_serviceDesc = grpc.ServiceDesc{ - ServiceName: "thanos.WriteableStore", - HandlerType: (*WriteableStoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RemoteWrite", - Handler: _WriteableStore_RemoteWrite_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "store/storepb/rpc.proto", -} - -func (m *WriteResponse) 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 *WriteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *WriteRequest) 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 *WriteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Replica != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Replica)) - i-- - dAtA[i] = 0x18 - } - if len(m.Tenant) > 0 { - i -= len(m.Tenant) - copy(dAtA[i:], m.Tenant) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Tenant))) - i-- - dAtA[i] = 0x12 - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *InfoRequest) 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 *InfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *InfoResponse) 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 *InfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LabelSets) > 0 { - for iNdEx := len(m.LabelSets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.LabelSets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.StoreType != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.StoreType)) - i-- - dAtA[i] = 0x20 - } - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x18 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x10 - } - 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 = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SeriesRequest) 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 *SeriesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Range != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Range)) - i-- - dAtA[i] = 0x58 - } - if m.Step != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x50 - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - if m.SkipChunks { - i-- - if m.SkipChunks { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x38 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Aggregates) > 0 { - dAtA3 := make([]byte, len(m.Aggregates)*10) - var j2 int - for _, num := range m.Aggregates { - for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j2++ - } - dAtA3[j2] = uint8(num) - j2++ - } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintRpc(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x2a - } - if m.MaxResolutionWindow != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxResolutionWindow)) - i-- - dAtA[i] = 0x20 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.MaxTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SeriesResponse) 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 *SeriesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size := m.Result.Size() - i -= size - if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *SeriesResponse_Series) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Series != nil { - { - size, err := m.Series.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *SeriesResponse_Warning) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.Warning) - copy(dAtA[i:], m.Warning) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) - i-- - dAtA[i] = 0x12 - return len(dAtA) - i, nil -} -func (m *SeriesResponse_Hints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SeriesResponse_Hints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *LabelNamesRequest) 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 *LabelNamesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.End != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x20 - } - if m.Start != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x18 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x10 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LabelNamesResponse) 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 *LabelNamesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Names) > 0 { - for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Names[iNdEx]) - copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Names[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LabelValuesRequest) 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 *LabelValuesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.End != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.End)) - i-- - dAtA[i] = 0x28 - } - if m.Start != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.Start)) - i-- - dAtA[i] = 0x20 - } - if m.PartialResponseStrategy != 0 { - i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) - i-- - dAtA[i] = 0x18 - } - if m.PartialResponseDisabled { - i-- - if m.PartialResponseDisabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Label) > 0 { - i -= len(m.Label) - copy(dAtA[i:], m.Label) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LabelValuesResponse) 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 *LabelValuesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelValuesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Hints != nil { - { - size, err := m.Hints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Values[iNdEx]) - copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarintRpc(dAtA, i, uint64(len(m.Values[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - offset -= sovRpc(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WriteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *WriteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - l = len(m.Tenant) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Replica != 0 { - n += 1 + sovRpc(uint64(m.Replica)) - } - return n -} - -func (m *InfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *InfoResponse) 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 + sovRpc(uint64(l)) - } - } - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - if m.StoreType != 0 { - n += 1 + sovRpc(uint64(m.StoreType)) - } - if len(m.LabelSets) > 0 { - for _, e := range m.LabelSets { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *SeriesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovRpc(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovRpc(uint64(m.MaxTime)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.MaxResolutionWindow != 0 { - n += 1 + sovRpc(uint64(m.MaxResolutionWindow)) - } - if len(m.Aggregates) > 0 { - l = 0 - for _, e := range m.Aggregates { - l += sovRpc(uint64(e)) - } - n += 1 + sovRpc(uint64(l)) + l - } - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.SkipChunks { - n += 2 - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Step != 0 { - n += 1 + sovRpc(uint64(m.Step)) - } - if m.Range != 0 { - n += 1 + sovRpc(uint64(m.Range)) - } - return n -} - -func (m *SeriesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - n += m.Result.Size() - } - return n -} - -func (m *SeriesResponse_Series) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Series != nil { - l = m.Series.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *SeriesResponse_Warning) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Warning) - n += 1 + l + sovRpc(uint64(l)) - return n -} -func (m *SeriesResponse_Hints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *LabelNamesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.Start != 0 { - n += 1 + sovRpc(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovRpc(uint64(m.End)) - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *LabelNamesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Names) > 0 { - for _, s := range m.Names { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *LabelValuesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Label) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.PartialResponseDisabled { - n += 2 - } - if m.PartialResponseStrategy != 0 { - n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) - } - if m.Start != 0 { - n += 1 + sovRpc(uint64(m.Start)) - } - if m.End != 0 { - n += 1 + sovRpc(uint64(m.End)) - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *LabelValuesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.Hints != nil { - l = m.Hints.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func sovRpc(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WriteResponse) 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 ErrIntOverflowRpc - } - 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: WriteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WriteRequest) 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 ErrIntOverflowRpc - } - 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: WriteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, prompb.TimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-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 Tenant", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tenant = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Replica", wireType) - } - m.Replica = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Replica |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InfoRequest) 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 ErrIntOverflowRpc - } - 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: InfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InfoResponse) 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 ErrIntOverflowRpc - } - 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: InfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InfoResponse: 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreType", wireType) - } - m.StoreType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StoreType |= StoreType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelSets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LabelSets = append(m.LabelSets, labelpb.ZLabelSet{}) - if err := m.LabelSets[len(m.LabelSets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SeriesRequest) 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 ErrIntOverflowRpc - } - 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: SeriesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxResolutionWindow", wireType) - } - m.MaxResolutionWindow = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxResolutionWindow |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType == 0 { - var v Aggr - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= Aggr(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Aggregates = append(m.Aggregates, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Aggregates) == 0 { - m.Aggregates = make([]Aggr, 0, elementCount) - } - for iNdEx < postIndex { - var v Aggr - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= Aggr(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Aggregates = append(m.Aggregates, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Aggregates", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipChunks", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SkipChunks = bool(v != 0) - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - m.Range = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Range |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SeriesResponse) 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 ErrIntOverflowRpc - } - 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: SeriesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SeriesResponse: 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Series{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &SeriesResponse_Series{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Result = &SeriesResponse_Warning{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.Any{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Result = &SeriesResponse_Hints{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelNamesRequest) 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 ErrIntOverflowRpc - } - 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: LabelNamesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelNamesResponse) 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 ErrIntOverflowRpc - } - 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: LabelNamesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelValuesRequest) 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 ErrIntOverflowRpc - } - 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: LabelValuesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseDisabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PartialResponseDisabled = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) - } - m.PartialResponseStrategy = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PartialResponseStrategy |= PartialResponseStrategy(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Start |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.End |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Matchers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Matchers = append(m.Matchers, LabelMatcher{}) - if err := m.Matchers[len(m.Matchers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelValuesResponse) 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 ErrIntOverflowRpc - } - 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: LabelValuesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelValuesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - 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 ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Hints == nil { - m.Hints = &types.Any{} - } - if err := m.Hints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - 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, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - 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, ErrInvalidLengthRpc - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRpc - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRpc - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto deleted file mode 100644 index 4a9240620d..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -syntax = "proto3"; -package thanos; - -import "store/storepb/types.proto"; -import "gogoproto/gogo.proto"; -import "store/storepb/prompb/types.proto"; -import "store/labelpb/types.proto"; -import "google/protobuf/any.proto"; - -option go_package = "storepb"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -/// Store represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). -service Store { - /// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is - /// available. - rpc Info(InfoRequest) returns (InfoResponse); - - /// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range. - /// - /// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain - /// partition of the single series, but once a new series is started to be streamed it means that no more data will - /// be sent for previous one. - /// Series has to be sorted. - /// - /// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time. - /// This heavily optimizes the resource usage on Querier / Federated Queries. - rpc Series(SeriesRequest) returns (stream SeriesResponse); - - /// LabelNames returns all label names constrained by the given matchers. - rpc LabelNames(LabelNamesRequest) returns (LabelNamesResponse); - - /// LabelValues returns all label values for given label name. - rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse); -} - -/// WriteableStore represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics). -service WriteableStore { - // WriteRequest allows you to write metrics to this store via remote write - rpc RemoteWrite(WriteRequest) returns (WriteResponse) {} -} - -message WriteResponse { -} - -message WriteRequest { - repeated prometheus_copy.TimeSeries timeseries = 1 [(gogoproto.nullable) = false]; - string tenant = 2; - int64 replica = 3; -} - -message InfoRequest {} - -enum StoreType { - UNKNOWN = 0; - QUERY = 1; - RULE = 2; - SIDECAR = 3; - STORE = 4; - RECEIVE = 5; - // DEBUG represents some debug StoreAPI components e.g. thanos tools store-api-serve. - DEBUG = 6; -} - -message InfoResponse { - // Deprecated. Use label_sets instead. - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - int64 min_time = 2; - int64 max_time = 3; - StoreType storeType = 4; - // label_sets is an unsorted list of `ZLabelSet`s. - repeated ZLabelSet label_sets = 5 [(gogoproto.nullable) = false]; -} - -message SeriesRequest { - int64 min_time = 1; - int64 max_time = 2; - repeated LabelMatcher matchers = 3 [(gogoproto.nullable) = false]; - - int64 max_resolution_window = 4; - repeated Aggr aggregates = 5; - - // Deprecated. Use partial_response_strategy instead. - bool partial_response_disabled = 6; - - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy partial_response_strategy = 7; - - // skip_chunks controls whether sending chunks or not in series responses. - bool skip_chunks = 8; - - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - google.protobuf.Any hints = 9; - - // Query step size in milliseconds. - int64 step = 10; - - // Range vector selector range in milliseconds. - int64 range = 11; -} - -enum Aggr { - RAW = 0; - COUNT = 1; - SUM = 2; - MIN = 3; - MAX = 4; - COUNTER = 5; -} - -message SeriesResponse { - oneof result { - /// series contains 1 response series. The series labels are sorted by name. - Series series = 1; - - /// warning is considered an information piece in place of series for warning purposes. - /// It is used to warn store API user about suspicious cases or partial response (if enabled). - string warning = 2; - - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. It's also implementation specific if it's allowed that - /// multiple SeriesResponse frames contain hints for a single Series() request and how should they - /// be handled in such case (ie. merged vs keep the first/last one). - google.protobuf.Any hints = 3; - } -} - -message LabelNamesRequest { - bool partial_response_disabled = 1; - - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy partial_response_strategy = 2; - - int64 start = 3; - - int64 end = 4; - - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - google.protobuf.Any hints = 5; - - repeated LabelMatcher matchers = 6 [(gogoproto.nullable) = false]; -} - -message LabelNamesResponse { - repeated string names = 1; - repeated string warnings = 2; - - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - google.protobuf.Any hints = 3; -} - -message LabelValuesRequest { - string label = 1; - - bool partial_response_disabled = 2; - - // TODO(bwplotka): Move Thanos components to use strategy instead. Including QueryAPI. - PartialResponseStrategy partial_response_strategy = 3; - - int64 start = 4; - - int64 end = 5; - - // hints is an opaque data structure that can be used to carry additional information. - // The content of this field and whether it's supported depends on the - // implementation of a specific store. - google.protobuf.Any hints = 6; - - repeated LabelMatcher matchers = 7 [(gogoproto.nullable) = false]; -} - -message LabelValuesResponse { - repeated string values = 1; - repeated string warnings = 2; - - /// hints is an opaque data structure that can be used to carry additional information from - /// the store. The content of this field and whether it's supported depends on the - /// implementation of a specific store. - google.protobuf.Any hints = 3; -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go deleted file mode 100644 index 3dbc940ab1..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go +++ /dev/null @@ -1,1412 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: store/storepb/types.proto - -package storepb - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/thanos-io/thanos/pkg/store/labelpb" - github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" -) - -// 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 - -/// PartialResponseStrategy controls partial response handling. -type PartialResponseStrategy int32 - -const ( - /// WARN strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as warning which will not fail the whole query (still OK response). - /// Server should produce those as a warnings field in response. - PartialResponseStrategy_WARN PartialResponseStrategy = 0 - /// ABORT strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as the gRPC error that aborts the query. - /// - /// This is especially useful for any rule/alert evaluations on top of StoreAPI which usually does not tolerate partial - /// errors. - PartialResponseStrategy_ABORT PartialResponseStrategy = 1 -) - -var PartialResponseStrategy_name = map[int32]string{ - 0: "WARN", - 1: "ABORT", -} - -var PartialResponseStrategy_value = map[string]int32{ - "WARN": 0, - "ABORT": 1, -} - -func (x PartialResponseStrategy) String() string { - return proto.EnumName(PartialResponseStrategy_name, int32(x)) -} - -func (PartialResponseStrategy) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{0} -} - -type Chunk_Encoding int32 - -const ( - Chunk_XOR Chunk_Encoding = 0 -) - -var Chunk_Encoding_name = map[int32]string{ - 0: "XOR", -} - -var Chunk_Encoding_value = map[string]int32{ - "XOR": 0, -} - -func (x Chunk_Encoding) String() string { - return proto.EnumName(Chunk_Encoding_name, int32(x)) -} - -func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{0, 0} -} - -type LabelMatcher_Type int32 - -const ( - LabelMatcher_EQ LabelMatcher_Type = 0 - LabelMatcher_NEQ LabelMatcher_Type = 1 - LabelMatcher_RE LabelMatcher_Type = 2 - LabelMatcher_NRE LabelMatcher_Type = 3 -) - -var LabelMatcher_Type_name = map[int32]string{ - 0: "EQ", - 1: "NEQ", - 2: "RE", - 3: "NRE", -} - -var LabelMatcher_Type_value = map[string]int32{ - "EQ": 0, - "NEQ": 1, - "RE": 2, - "NRE": 3, -} - -func (x LabelMatcher_Type) String() string { - return proto.EnumName(LabelMatcher_Type_name, int32(x)) -} - -func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{3, 0} -} - -type Chunk struct { - Type Chunk_Encoding `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.Chunk_Encoding" json:"type,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (m *Chunk) String() string { return proto.CompactTextString(m) } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []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 - -type Series struct { - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` -} - -func (m *Series) Reset() { *m = Series{} } -func (m *Series) String() string { return proto.CompactTextString(m) } -func (*Series) ProtoMessage() {} -func (*Series) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []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 - -type AggrChunk struct { - MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - Raw *Chunk `protobuf:"bytes,3,opt,name=raw,proto3" json:"raw,omitempty"` - Count *Chunk `protobuf:"bytes,4,opt,name=count,proto3" json:"count,omitempty"` - Sum *Chunk `protobuf:"bytes,5,opt,name=sum,proto3" json:"sum,omitempty"` - Min *Chunk `protobuf:"bytes,6,opt,name=min,proto3" json:"min,omitempty"` - Max *Chunk `protobuf:"bytes,7,opt,name=max,proto3" json:"max,omitempty"` - Counter *Chunk `protobuf:"bytes,8,opt,name=counter,proto3" json:"counter,omitempty"` -} - -func (m *AggrChunk) Reset() { *m = AggrChunk{} } -func (m *AggrChunk) String() string { return proto.CompactTextString(m) } -func (*AggrChunk) ProtoMessage() {} -func (*AggrChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{2} -} -func (m *AggrChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AggrChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AggrChunk.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 *AggrChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_AggrChunk.Merge(m, src) -} -func (m *AggrChunk) XXX_Size() int { - return m.Size() -} -func (m *AggrChunk) XXX_DiscardUnknown() { - xxx_messageInfo_AggrChunk.DiscardUnknown(m) -} - -var xxx_messageInfo_AggrChunk proto.InternalMessageInfo - -// Matcher specifies a rule, which can match or set of labels or not. -type LabelMatcher struct { - Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.LabelMatcher_Type" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } -func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } -func (*LabelMatcher) ProtoMessage() {} -func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{3} -} -func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelMatcher.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 *LabelMatcher) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelMatcher.Merge(m, src) -} -func (m *LabelMatcher) XXX_Size() int { - return m.Size() -} -func (m *LabelMatcher) XXX_DiscardUnknown() { - xxx_messageInfo_LabelMatcher.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelMatcher proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("thanos.PartialResponseStrategy", PartialResponseStrategy_name, PartialResponseStrategy_value) - proto.RegisterEnum("thanos.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) - proto.RegisterEnum("thanos.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterType((*Chunk)(nil), "thanos.Chunk") - proto.RegisterType((*Series)(nil), "thanos.Series") - proto.RegisterType((*AggrChunk)(nil), "thanos.AggrChunk") - proto.RegisterType((*LabelMatcher)(nil), "thanos.LabelMatcher") -} - -func init() { proto.RegisterFile("store/storepb/types.proto", fileDescriptor_121fba57de02d8e0) } - -var fileDescriptor_121fba57de02d8e0 = []byte{ - // 522 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xc1, 0x6f, 0xd3, 0x3e, - 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0x5b, 0xff, 0xf6, 0x43, 0xc1, 0x4c, 0x90, 0xee, 0x90, 0x56, 0x41, - 0x88, 0x6a, 0xd2, 0x12, 0x69, 0x70, 0xe4, 0xd2, 0xa2, 0xde, 0x60, 0x63, 0x5e, 0x25, 0xd0, 0x84, - 0x84, 0xdc, 0xcc, 0x4a, 0xad, 0x35, 0x76, 0x94, 0x38, 0xd0, 0xfe, 0x17, 0x20, 0xee, 0xfc, 0x3d, - 0x3d, 0xee, 0x88, 0x38, 0x4c, 0xd0, 0xfe, 0x23, 0xc8, 0x4e, 0x0a, 0x54, 0xca, 0x25, 0x7a, 0x79, - 0xdf, 0xcf, 0x7b, 0xdf, 0xf8, 0xe5, 0x19, 0xf6, 0x0a, 0x29, 0x72, 0x1a, 0xe9, 0x67, 0x36, 0x8b, - 0xe4, 0x2a, 0xa3, 0x45, 0x98, 0xe5, 0x42, 0x0a, 0xe4, 0xc8, 0x39, 0xe1, 0xa2, 0x38, 0x3a, 0x4c, - 0x44, 0x22, 0x74, 0x2a, 0x52, 0x51, 0xa5, 0x1e, 0xd5, 0x85, 0x0b, 0x32, 0xa3, 0x8b, 0xfd, 0xc2, - 0xe0, 0x3d, 0x6c, 0xbd, 0x9c, 0x97, 0xfc, 0x06, 0x1d, 0x43, 0x5b, 0xe5, 0x3d, 0x30, 0x00, 0xc3, - 0x7b, 0xa7, 0x0f, 0xc3, 0xaa, 0x61, 0xa8, 0xc5, 0x70, 0xc2, 0x63, 0x71, 0xcd, 0x78, 0x82, 0x35, - 0x83, 0x10, 0xb4, 0xaf, 0x89, 0x24, 0x9e, 0x39, 0x00, 0xc3, 0x03, 0xac, 0xe3, 0xe0, 0x01, 0xec, - 0xec, 0x28, 0xd4, 0x86, 0xd6, 0xbb, 0x73, 0xec, 0x1a, 0xc1, 0x37, 0x00, 0x9d, 0x4b, 0x9a, 0x33, - 0x5a, 0xa0, 0x18, 0x3a, 0xda, 0xbf, 0xf0, 0xc0, 0xc0, 0x1a, 0xfe, 0x77, 0xfa, 0xff, 0xce, 0xe1, - 0x95, 0xca, 0x8e, 0x5f, 0xac, 0xef, 0xfa, 0xc6, 0x8f, 0xbb, 0xfe, 0xf3, 0x84, 0xc9, 0x79, 0x39, - 0x0b, 0x63, 0x91, 0x46, 0x15, 0x70, 0xc2, 0x44, 0x1d, 0x45, 0xd9, 0x4d, 0x12, 0xed, 0x1d, 0x25, - 0xbc, 0xd2, 0xd5, 0xb8, 0x6e, 0x8d, 0x22, 0xe8, 0xc4, 0xea, 0x83, 0x0b, 0xcf, 0xd4, 0x26, 0xf7, - 0x77, 0x26, 0xa3, 0x24, 0xc9, 0xf5, 0x51, 0xc6, 0xb6, 0x32, 0xc2, 0x35, 0x16, 0x7c, 0x35, 0x61, - 0xf7, 0x8f, 0x86, 0x7a, 0xb0, 0x93, 0x32, 0xfe, 0x41, 0xb2, 0xb4, 0x9a, 0x83, 0x85, 0xdb, 0x29, - 0xe3, 0x53, 0x96, 0x52, 0x2d, 0x91, 0x65, 0x25, 0x99, 0xb5, 0x44, 0x96, 0x5a, 0xea, 0x43, 0x2b, - 0x27, 0x9f, 0x3c, 0x6b, 0x00, 0xfe, 0x3d, 0x96, 0xee, 0x88, 0x95, 0x82, 0x1e, 0xc3, 0x56, 0x2c, - 0x4a, 0x2e, 0x3d, 0xbb, 0x09, 0xa9, 0x34, 0xd5, 0xa5, 0x28, 0x53, 0xaf, 0xd5, 0xd8, 0xa5, 0x28, - 0x53, 0x05, 0xa4, 0x8c, 0x7b, 0x4e, 0x23, 0x90, 0x32, 0xae, 0x01, 0xb2, 0xf4, 0xda, 0xcd, 0x00, - 0x59, 0xa2, 0xa7, 0xb0, 0xad, 0xbd, 0x68, 0xee, 0x75, 0x9a, 0xa0, 0x9d, 0x1a, 0x7c, 0x01, 0xf0, - 0x40, 0x0f, 0xf6, 0x35, 0x91, 0xf1, 0x9c, 0xe6, 0xe8, 0x64, 0x6f, 0x39, 0x7a, 0x7b, 0xbf, 0xae, - 0x66, 0xc2, 0xe9, 0x2a, 0xa3, 0x7f, 0xf7, 0x83, 0x93, 0x7a, 0x50, 0x5d, 0xac, 0x63, 0x74, 0x08, - 0x5b, 0x1f, 0xc9, 0xa2, 0xa4, 0x7a, 0x4e, 0x5d, 0x5c, 0xbd, 0x04, 0x43, 0x68, 0xab, 0x3a, 0xe4, - 0x40, 0x73, 0x72, 0xe1, 0x1a, 0x6a, 0x73, 0xce, 0x26, 0x17, 0x2e, 0x50, 0x09, 0x3c, 0x71, 0x4d, - 0x9d, 0xc0, 0x13, 0xd7, 0x3a, 0x0e, 0xe1, 0xa3, 0x37, 0x24, 0x97, 0x8c, 0x2c, 0x30, 0x2d, 0x32, - 0xc1, 0x0b, 0x7a, 0x29, 0x73, 0x22, 0x69, 0xb2, 0x42, 0x1d, 0x68, 0xbf, 0x1d, 0xe1, 0x33, 0xd7, - 0x40, 0x5d, 0xd8, 0x1a, 0x8d, 0xcf, 0xf1, 0xd4, 0x05, 0xe3, 0x27, 0xeb, 0x5f, 0xbe, 0xb1, 0xde, - 0xf8, 0xe0, 0x76, 0xe3, 0x83, 0x9f, 0x1b, 0x1f, 0x7c, 0xde, 0xfa, 0xc6, 0xed, 0xd6, 0x37, 0xbe, - 0x6f, 0x7d, 0xe3, 0xaa, 0x5d, 0x5f, 0xa2, 0x99, 0xa3, 0xaf, 0xc1, 0xb3, 0xdf, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xd5, 0x63, 0x3a, 0x23, 0x5c, 0x03, 0x00, 0x00, -} - -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.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - 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 - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - 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 = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *AggrChunk) 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 *AggrChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AggrChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Counter != nil { - { - size, err := m.Counter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Max != nil { - { - size, err := m.Max.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Min != nil { - { - size, err := m.Min.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.Sum != nil { - { - size, err := m.Sum.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Count != nil { - { - size, err := m.Count.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Raw != nil { - { - size, err := m.Raw.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.MaxTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTime)) - i-- - dAtA[i] = 0x10 - } - if m.MinTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTime)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LabelMatcher) 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 *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Series) 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 + sovTypes(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *AggrChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTime != 0 { - n += 1 + sovTypes(uint64(m.MinTime)) - } - if m.MaxTime != 0 { - n += 1 + sovTypes(uint64(m.MaxTime)) - } - if m.Raw != nil { - l = m.Raw.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Count != nil { - l = m.Count.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Sum != nil { - l = m.Sum.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Min != nil { - l = m.Min.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Max != nil { - l = m.Max.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Counter != nil { - l = m.Counter.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *LabelMatcher) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 ErrIntOverflowTypes - } - 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 != 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Chunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - 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 Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) - 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 Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, AggrChunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AggrChunk) 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 ErrIntOverflowTypes - } - 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: AggrChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AggrChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTime", wireType) - } - m.MinTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTime", wireType) - } - m.MaxTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Raw == nil { - m.Raw = &Chunk{} - } - if err := m.Raw.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Count == nil { - m.Count = &Chunk{} - } - if err := m.Count.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Sum == nil { - m.Sum = &Chunk{} - } - if err := m.Sum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Min == nil { - m.Min = &Chunk{} - } - if err := m.Min.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Max == nil { - m.Max = &Chunk{} - } - if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Counter == nil { - m.Counter = &Chunk{} - } - if err := m.Counter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelMatcher) 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 ErrIntOverflowTypes - } - 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: LabelMatcher: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelMatcher: 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= LabelMatcher_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto deleted file mode 100644 index 2cf255713b..0000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -syntax = "proto3"; -package thanos; - -option go_package = "storepb"; - -import "gogoproto/gogo.proto"; -import "store/labelpb/types.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message Chunk { - enum Encoding { - XOR = 0; - } - Encoding type = 1; - bytes data = 2; -} - -message Series { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; - repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; -} - -message AggrChunk { - int64 min_time = 1; - int64 max_time = 2; - - Chunk raw = 3; - Chunk count = 4; - Chunk sum = 5; - Chunk min = 6; - Chunk max = 7; - Chunk counter = 8; -} - -// Matcher specifies a rule, which can match or set of labels or not. -message LabelMatcher { - enum Type { - EQ = 0; // = - NEQ = 1; // != - RE = 2; // =~ - NRE = 3; // !~ - } - Type type = 1; - string name = 2; - string value = 3; -} - -/// PartialResponseStrategy controls partial response handling. -enum PartialResponseStrategy { - /// WARN strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as warning which will not fail the whole query (still OK response). - /// Server should produce those as a warnings field in response. - WARN = 0; - /// ABORT strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying - /// storeAPI is temporarily not available) as the gRPC error that aborts the query. - /// - /// This is especially useful for any rule/alert evaluations on top of StoreAPI which usually does not tolerate partial - /// errors. - ABORT = 1; -} \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index ae435f619c..c87a2dbac4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -986,9 +986,6 @@ github.com/thanos-io/thanos/pkg/objstore/gcs github.com/thanos-io/thanos/pkg/objstore/s3 github.com/thanos-io/thanos/pkg/objstore/swift github.com/thanos-io/thanos/pkg/runutil -github.com/thanos-io/thanos/pkg/store/labelpb -github.com/thanos-io/thanos/pkg/store/storepb -github.com/thanos-io/thanos/pkg/store/storepb/prompb github.com/thanos-io/thanos/pkg/strutil github.com/thanos-io/thanos/pkg/testutil github.com/thanos-io/thanos/pkg/tracing