From 5d10c2a9d140cd3e4be0e18ed11d383b6fa75dcd Mon Sep 17 00:00:00 2001 From: Anton Kolesnikov Date: Mon, 19 Aug 2024 18:09:11 +0800 Subject: [PATCH] chore: refine metastore API (#3502) --- api/gen/proto/go/metastore/v1/metastore.pb.go | 335 +++++++++--------- .../go/metastore/v1/metastore_vtproto.pb.go | 255 +++++++++---- .../metastorev1connect/metastore.connect.go | 52 +-- .../metastore.connect.mux.go | 6 +- api/metastore/v1/metastore.proto | 19 +- api/openapiv2/gen/phlare.swagger.json | 117 +++--- .../index.md | 7 +- pkg/experiment/compactor/compaction_worker.go | 2 +- pkg/experiment/ingester/segment.go | 8 +- pkg/experiment/ingester/segment_test.go | 50 +-- .../metastore_state_query_metadata.go | 148 ++++++++ .../querybackend/block/compaction.go | 92 ++--- .../querybackend/block/constants.go | 2 +- pkg/experiment/querybackend/block/object.go | 4 +- .../querybackend/block/section_profiles.go | 12 +- .../querybackend/block/section_symbols.go | 2 +- .../querybackend/block/section_tsdb.go | 2 +- .../querybackend/block/tenant_service.go | 72 ++-- .../block/testdata/block-metas.json | 20 +- pkg/experiment/querybackend/block/writer.go | 2 +- pkg/experiment/querybackend/block_reader.go | 22 +- pkg/experiment/querybackend/query.go | 12 +- .../querybackend/query_label_names.go | 4 +- .../querybackend/query_label_values.go | 4 +- .../querybackend/query_profile_entry.go | 8 +- .../querybackend/query_series_labels.go | 4 +- .../querybackend/query_time_series.go | 4 +- pkg/experiment/querybackend/query_tree.go | 6 +- pkg/experiment/queryfrontend/frontend_meta.go | 4 +- .../queryfrontend/frontend_profile_types.go | 2 +- 30 files changed, 777 insertions(+), 500 deletions(-) create mode 100644 pkg/experiment/metastore/metastore_state_query_metadata.go diff --git a/api/gen/proto/go/metastore/v1/metastore.pb.go b/api/gen/proto/go/metastore/v1/metastore.pb.go index 90dbbf42d0..0f2e7710d7 100644 --- a/api/gen/proto/go/metastore/v1/metastore.pb.go +++ b/api/gen/proto/go/metastore/v1/metastore.pb.go @@ -7,6 +7,7 @@ package metastorev1 import ( + v1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -117,10 +118,9 @@ type BlockMeta struct { Shard uint32 `protobuf:"varint,5,opt,name=shard,proto3" json:"shard,omitempty"` CompactionLevel uint32 `protobuf:"varint,6,opt,name=compaction_level,json=compactionLevel,proto3" json:"compaction_level,omitempty"` // Optional. Empty if compaction level is 0. - TenantId string `protobuf:"bytes,7,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - // TODO(kolesnikovae): Partitions with labels? - TenantServices []*TenantService `protobuf:"bytes,8,rep,name=tenant_services,json=tenantServices,proto3" json:"tenant_services,omitempty"` - Size uint64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"` + TenantId string `protobuf:"bytes,7,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + Datasets []*Dataset `protobuf:"bytes,8,rep,name=datasets,proto3" json:"datasets,omitempty"` + Size uint64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"` } func (x *BlockMeta) Reset() { @@ -204,9 +204,9 @@ func (x *BlockMeta) GetTenantId() string { return "" } -func (x *BlockMeta) GetTenantServices() []*TenantService { +func (x *BlockMeta) GetDatasets() []*Dataset { if x != nil { - return x.TenantServices + return x.Datasets } return nil } @@ -218,17 +218,16 @@ func (x *BlockMeta) GetSize() uint64 { return 0 } -// TenantService object points to the offset in the block at which -// the tenant service data is located. -type TenantService struct { +type Dataset struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - MinTime int64 `protobuf:"varint,3,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,4,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + Labels []*v1.Labels `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"` + TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + MinTime int64 `protobuf:"varint,3,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,4,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` // Table of contents lists data sections within the tenant // service region. The offsets are absolute. // @@ -240,12 +239,13 @@ type TenantService struct { TableOfContents []uint64 `protobuf:"varint,5,rep,packed,name=table_of_contents,json=tableOfContents,proto3" json:"table_of_contents,omitempty"` // Size of the section in bytes. Size uint64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + // TODO: delete // Profile types present in the tenant service data. ProfileTypes []string `protobuf:"bytes,7,rep,name=profile_types,json=profileTypes,proto3" json:"profile_types,omitempty"` } -func (x *TenantService) Reset() { - *x = TenantService{} +func (x *Dataset) Reset() { + *x = Dataset{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_metastore_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -253,13 +253,13 @@ func (x *TenantService) Reset() { } } -func (x *TenantService) String() string { +func (x *Dataset) String() string { return protoimpl.X.MessageStringOf(x) } -func (*TenantService) ProtoMessage() {} +func (*Dataset) ProtoMessage() {} -func (x *TenantService) ProtoReflect() protoreflect.Message { +func (x *Dataset) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_metastore_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -271,61 +271,68 @@ func (x *TenantService) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use TenantService.ProtoReflect.Descriptor instead. -func (*TenantService) Descriptor() ([]byte, []int) { +// Deprecated: Use Dataset.ProtoReflect.Descriptor instead. +func (*Dataset) Descriptor() ([]byte, []int) { return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{3} } -func (x *TenantService) GetTenantId() string { +func (x *Dataset) GetLabels() []*v1.Labels { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Dataset) GetTenantId() string { if x != nil { return x.TenantId } return "" } -func (x *TenantService) GetName() string { +func (x *Dataset) GetName() string { if x != nil { return x.Name } return "" } -func (x *TenantService) GetMinTime() int64 { +func (x *Dataset) GetMinTime() int64 { if x != nil { return x.MinTime } return 0 } -func (x *TenantService) GetMaxTime() int64 { +func (x *Dataset) GetMaxTime() int64 { if x != nil { return x.MaxTime } return 0 } -func (x *TenantService) GetTableOfContents() []uint64 { +func (x *Dataset) GetTableOfContents() []uint64 { if x != nil { return x.TableOfContents } return nil } -func (x *TenantService) GetSize() uint64 { +func (x *Dataset) GetSize() uint64 { if x != nil { return x.Size } return 0 } -func (x *TenantService) GetProfileTypes() []string { +func (x *Dataset) GetProfileTypes() []string { if x != nil { return x.ProfileTypes } return nil } -type ListBlocksForQueryRequest struct { +type QueryMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -336,8 +343,8 @@ type ListBlocksForQueryRequest struct { Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` } -func (x *ListBlocksForQueryRequest) Reset() { - *x = ListBlocksForQueryRequest{} +func (x *QueryMetadataRequest) Reset() { + *x = QueryMetadataRequest{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_metastore_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -345,13 +352,13 @@ func (x *ListBlocksForQueryRequest) Reset() { } } -func (x *ListBlocksForQueryRequest) String() string { +func (x *QueryMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListBlocksForQueryRequest) ProtoMessage() {} +func (*QueryMetadataRequest) ProtoMessage() {} -func (x *ListBlocksForQueryRequest) ProtoReflect() protoreflect.Message { +func (x *QueryMetadataRequest) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_metastore_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -363,40 +370,40 @@ func (x *ListBlocksForQueryRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListBlocksForQueryRequest.ProtoReflect.Descriptor instead. -func (*ListBlocksForQueryRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryMetadataRequest.ProtoReflect.Descriptor instead. +func (*QueryMetadataRequest) Descriptor() ([]byte, []int) { return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{4} } -func (x *ListBlocksForQueryRequest) GetTenantId() []string { +func (x *QueryMetadataRequest) GetTenantId() []string { if x != nil { return x.TenantId } return nil } -func (x *ListBlocksForQueryRequest) GetStartTime() int64 { +func (x *QueryMetadataRequest) GetStartTime() int64 { if x != nil { return x.StartTime } return 0 } -func (x *ListBlocksForQueryRequest) GetEndTime() int64 { +func (x *QueryMetadataRequest) GetEndTime() int64 { if x != nil { return x.EndTime } return 0 } -func (x *ListBlocksForQueryRequest) GetQuery() string { +func (x *QueryMetadataRequest) GetQuery() string { if x != nil { return x.Query } return "" } -type ListBlocksForQueryResponse struct { +type QueryMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -404,8 +411,8 @@ type ListBlocksForQueryResponse struct { Blocks []*BlockMeta `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` } -func (x *ListBlocksForQueryResponse) Reset() { - *x = ListBlocksForQueryResponse{} +func (x *QueryMetadataResponse) Reset() { + *x = QueryMetadataResponse{} if protoimpl.UnsafeEnabled { mi := &file_metastore_v1_metastore_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -413,13 +420,13 @@ func (x *ListBlocksForQueryResponse) Reset() { } } -func (x *ListBlocksForQueryResponse) String() string { +func (x *QueryMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListBlocksForQueryResponse) ProtoMessage() {} +func (*QueryMetadataResponse) ProtoMessage() {} -func (x *ListBlocksForQueryResponse) ProtoReflect() protoreflect.Message { +func (x *QueryMetadataResponse) ProtoReflect() protoreflect.Message { mi := &file_metastore_v1_metastore_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -431,12 +438,12 @@ func (x *ListBlocksForQueryResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListBlocksForQueryResponse.ProtoReflect.Descriptor instead. -func (*ListBlocksForQueryResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryMetadataResponse.ProtoReflect.Descriptor instead. +func (*QueryMetadataResponse) Descriptor() ([]byte, []int) { return file_metastore_v1_metastore_proto_rawDescGZIP(), []int{5} } -func (x *ListBlocksForQueryResponse) GetBlocks() []*BlockMeta { +func (x *QueryMetadataResponse) GetBlocks() []*BlockMeta { if x != nil { return x.Blocks } @@ -542,97 +549,97 @@ var File_metastore_v1_metastore_proto protoreflect.FileDescriptor var file_metastore_v1_metastore_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, - 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x40, 0x0a, 0x0f, - 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x12, - 0x0a, 0x10, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0xb0, 0x02, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, - 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, - 0x61, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, - 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0f, 0x74, - 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x0e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x0d, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, - 0x0a, 0x11, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x4f, 0x66, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x46, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x4d, - 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x46, 0x6f, 0x72, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, - 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x3c, 0x0a, - 0x10, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x10, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x62, - 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x11, 0x52, - 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x32, - 0x9a, 0x02, 0x0a, 0x10, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x69, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x46, - 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x46, 0x6f, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x46, 0x6f, 0x72, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x09, - 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x74, 0x61, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, - 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x42, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, - 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x18, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4d, 0x65, 0x74, - 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x12, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x09, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x31, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x07, 0x44, 0x61, 0x74, + 0x61, 0x73, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1b, + 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, + 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, + 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, + 0x66, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, + 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x66, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x14, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x48, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, + 0x74, 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x3c, 0x0a, 0x10, 0x52, 0x65, + 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, + 0x0a, 0x10, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x32, 0x8b, 0x02, 0x0a, + 0x10, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, + 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x22, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x09, 0x52, 0x65, + 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xbb, 0x01, 0x0a, 0x10, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, + 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, + 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, + 0x02, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, + 0x4d, 0x65, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -649,30 +656,32 @@ func file_metastore_v1_metastore_proto_rawDescGZIP() []byte { var file_metastore_v1_metastore_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_metastore_v1_metastore_proto_goTypes = []any{ - (*AddBlockRequest)(nil), // 0: metastore.v1.AddBlockRequest - (*AddBlockResponse)(nil), // 1: metastore.v1.AddBlockResponse - (*BlockMeta)(nil), // 2: metastore.v1.BlockMeta - (*TenantService)(nil), // 3: metastore.v1.TenantService - (*ListBlocksForQueryRequest)(nil), // 4: metastore.v1.ListBlocksForQueryRequest - (*ListBlocksForQueryResponse)(nil), // 5: metastore.v1.ListBlocksForQueryResponse - (*ReadIndexRequest)(nil), // 6: metastore.v1.ReadIndexRequest - (*ReadIndexResponse)(nil), // 7: metastore.v1.ReadIndexResponse + (*AddBlockRequest)(nil), // 0: metastore.v1.AddBlockRequest + (*AddBlockResponse)(nil), // 1: metastore.v1.AddBlockResponse + (*BlockMeta)(nil), // 2: metastore.v1.BlockMeta + (*Dataset)(nil), // 3: metastore.v1.Dataset + (*QueryMetadataRequest)(nil), // 4: metastore.v1.QueryMetadataRequest + (*QueryMetadataResponse)(nil), // 5: metastore.v1.QueryMetadataResponse + (*ReadIndexRequest)(nil), // 6: metastore.v1.ReadIndexRequest + (*ReadIndexResponse)(nil), // 7: metastore.v1.ReadIndexResponse + (*v1.Labels)(nil), // 8: types.v1.Labels } var file_metastore_v1_metastore_proto_depIdxs = []int32{ 2, // 0: metastore.v1.AddBlockRequest.block:type_name -> metastore.v1.BlockMeta - 3, // 1: metastore.v1.BlockMeta.tenant_services:type_name -> metastore.v1.TenantService - 2, // 2: metastore.v1.ListBlocksForQueryResponse.blocks:type_name -> metastore.v1.BlockMeta - 0, // 3: metastore.v1.MetastoreService.AddBlock:input_type -> metastore.v1.AddBlockRequest - 4, // 4: metastore.v1.MetastoreService.ListBlocksForQuery:input_type -> metastore.v1.ListBlocksForQueryRequest - 6, // 5: metastore.v1.MetastoreService.ReadIndex:input_type -> metastore.v1.ReadIndexRequest - 1, // 6: metastore.v1.MetastoreService.AddBlock:output_type -> metastore.v1.AddBlockResponse - 5, // 7: metastore.v1.MetastoreService.ListBlocksForQuery:output_type -> metastore.v1.ListBlocksForQueryResponse - 7, // 8: metastore.v1.MetastoreService.ReadIndex:output_type -> metastore.v1.ReadIndexResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 3, // 1: metastore.v1.BlockMeta.datasets:type_name -> metastore.v1.Dataset + 8, // 2: metastore.v1.Dataset.labels:type_name -> types.v1.Labels + 2, // 3: metastore.v1.QueryMetadataResponse.blocks:type_name -> metastore.v1.BlockMeta + 0, // 4: metastore.v1.MetastoreService.AddBlock:input_type -> metastore.v1.AddBlockRequest + 4, // 5: metastore.v1.MetastoreService.QueryMetadata:input_type -> metastore.v1.QueryMetadataRequest + 6, // 6: metastore.v1.MetastoreService.ReadIndex:input_type -> metastore.v1.ReadIndexRequest + 1, // 7: metastore.v1.MetastoreService.AddBlock:output_type -> metastore.v1.AddBlockResponse + 5, // 8: metastore.v1.MetastoreService.QueryMetadata:output_type -> metastore.v1.QueryMetadataResponse + 7, // 9: metastore.v1.MetastoreService.ReadIndex:output_type -> metastore.v1.ReadIndexResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_metastore_v1_metastore_proto_init() } @@ -718,7 +727,7 @@ func file_metastore_v1_metastore_proto_init() { } } file_metastore_v1_metastore_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TenantService); i { + switch v := v.(*Dataset); i { case 0: return &v.state case 1: @@ -730,7 +739,7 @@ func file_metastore_v1_metastore_proto_init() { } } file_metastore_v1_metastore_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*ListBlocksForQueryRequest); i { + switch v := v.(*QueryMetadataRequest); i { case 0: return &v.state case 1: @@ -742,7 +751,7 @@ func file_metastore_v1_metastore_proto_init() { } } file_metastore_v1_metastore_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*ListBlocksForQueryResponse); i { + switch v := v.(*QueryMetadataResponse); i { case 0: return &v.state case 1: diff --git a/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go b/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go index 809156debf..fca443b263 100644 --- a/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go +++ b/api/gen/proto/go/metastore/v1/metastore_vtproto.pb.go @@ -7,6 +7,7 @@ package metastorev1 import ( context "context" fmt "fmt" + v1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -69,12 +70,12 @@ func (m *BlockMeta) CloneVT() *BlockMeta { r.CompactionLevel = m.CompactionLevel r.TenantId = m.TenantId r.Size = m.Size - if rhs := m.TenantServices; rhs != nil { - tmpContainer := make([]*TenantService, len(rhs)) + if rhs := m.Datasets; rhs != nil { + tmpContainer := make([]*Dataset, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.TenantServices = tmpContainer + r.Datasets = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -87,16 +88,27 @@ func (m *BlockMeta) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *TenantService) CloneVT() *TenantService { +func (m *Dataset) CloneVT() *Dataset { if m == nil { - return (*TenantService)(nil) + return (*Dataset)(nil) } - r := new(TenantService) + r := new(Dataset) r.TenantId = m.TenantId r.Name = m.Name r.MinTime = m.MinTime r.MaxTime = m.MaxTime r.Size = m.Size + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]*v1.Labels, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface{ CloneVT() *v1.Labels }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*v1.Labels) + } + } + r.Labels = tmpContainer + } if rhs := m.TableOfContents; rhs != nil { tmpContainer := make([]uint64, len(rhs)) copy(tmpContainer, rhs) @@ -114,15 +126,15 @@ func (m *TenantService) CloneVT() *TenantService { return r } -func (m *TenantService) CloneMessageVT() proto.Message { +func (m *Dataset) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ListBlocksForQueryRequest) CloneVT() *ListBlocksForQueryRequest { +func (m *QueryMetadataRequest) CloneVT() *QueryMetadataRequest { if m == nil { - return (*ListBlocksForQueryRequest)(nil) + return (*QueryMetadataRequest)(nil) } - r := new(ListBlocksForQueryRequest) + r := new(QueryMetadataRequest) r.StartTime = m.StartTime r.EndTime = m.EndTime r.Query = m.Query @@ -138,15 +150,15 @@ func (m *ListBlocksForQueryRequest) CloneVT() *ListBlocksForQueryRequest { return r } -func (m *ListBlocksForQueryRequest) CloneMessageVT() proto.Message { +func (m *QueryMetadataRequest) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ListBlocksForQueryResponse) CloneVT() *ListBlocksForQueryResponse { +func (m *QueryMetadataResponse) CloneVT() *QueryMetadataResponse { if m == nil { - return (*ListBlocksForQueryResponse)(nil) + return (*QueryMetadataResponse)(nil) } - r := new(ListBlocksForQueryResponse) + r := new(QueryMetadataResponse) if rhs := m.Blocks; rhs != nil { tmpContainer := make([]*BlockMeta, len(rhs)) for k, v := range rhs { @@ -161,7 +173,7 @@ func (m *ListBlocksForQueryResponse) CloneVT() *ListBlocksForQueryResponse { return r } -func (m *ListBlocksForQueryResponse) CloneMessageVT() proto.Message { +func (m *QueryMetadataResponse) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -261,17 +273,17 @@ func (this *BlockMeta) EqualVT(that *BlockMeta) bool { if this.TenantId != that.TenantId { return false } - if len(this.TenantServices) != len(that.TenantServices) { + if len(this.Datasets) != len(that.Datasets) { return false } - for i, vx := range this.TenantServices { - vy := that.TenantServices[i] + for i, vx := range this.Datasets { + vy := that.Datasets[i] if p, q := vx, vy; p != q { if p == nil { - p = &TenantService{} + p = &Dataset{} } if q == nil { - q = &TenantService{} + q = &Dataset{} } if !p.EqualVT(q) { return false @@ -291,7 +303,7 @@ func (this *BlockMeta) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *TenantService) EqualVT(that *TenantService) bool { +func (this *Dataset) EqualVT(that *Dataset) bool { if this == that { return true } else if this == nil || that == nil { @@ -330,17 +342,38 @@ func (this *TenantService) EqualVT(that *TenantService) bool { return false } } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &v1.Labels{} + } + if q == nil { + q = &v1.Labels{} + } + if equal, ok := interface{}(p).(interface{ EqualVT(*v1.Labels) bool }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } return string(this.unknownFields) == string(that.unknownFields) } -func (this *TenantService) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*TenantService) +func (this *Dataset) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Dataset) if !ok { return false } return this.EqualVT(that) } -func (this *ListBlocksForQueryRequest) EqualVT(that *ListBlocksForQueryRequest) bool { +func (this *QueryMetadataRequest) EqualVT(that *QueryMetadataRequest) bool { if this == that { return true } else if this == nil || that == nil { @@ -367,14 +400,14 @@ func (this *ListBlocksForQueryRequest) EqualVT(that *ListBlocksForQueryRequest) return string(this.unknownFields) == string(that.unknownFields) } -func (this *ListBlocksForQueryRequest) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*ListBlocksForQueryRequest) +func (this *QueryMetadataRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryMetadataRequest) if !ok { return false } return this.EqualVT(that) } -func (this *ListBlocksForQueryResponse) EqualVT(that *ListBlocksForQueryResponse) bool { +func (this *QueryMetadataResponse) EqualVT(that *QueryMetadataResponse) bool { if this == that { return true } else if this == nil || that == nil { @@ -400,8 +433,8 @@ func (this *ListBlocksForQueryResponse) EqualVT(that *ListBlocksForQueryResponse return string(this.unknownFields) == string(that.unknownFields) } -func (this *ListBlocksForQueryResponse) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*ListBlocksForQueryResponse) +func (this *QueryMetadataResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*QueryMetadataResponse) if !ok { return false } @@ -456,7 +489,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MetastoreServiceClient interface { AddBlock(ctx context.Context, in *AddBlockRequest, opts ...grpc.CallOption) (*AddBlockResponse, error) - ListBlocksForQuery(ctx context.Context, in *ListBlocksForQueryRequest, opts ...grpc.CallOption) (*ListBlocksForQueryResponse, error) + QueryMetadata(ctx context.Context, in *QueryMetadataRequest, opts ...grpc.CallOption) (*QueryMetadataResponse, error) ReadIndex(ctx context.Context, in *ReadIndexRequest, opts ...grpc.CallOption) (*ReadIndexResponse, error) } @@ -477,9 +510,9 @@ func (c *metastoreServiceClient) AddBlock(ctx context.Context, in *AddBlockReque return out, nil } -func (c *metastoreServiceClient) ListBlocksForQuery(ctx context.Context, in *ListBlocksForQueryRequest, opts ...grpc.CallOption) (*ListBlocksForQueryResponse, error) { - out := new(ListBlocksForQueryResponse) - err := c.cc.Invoke(ctx, "/metastore.v1.MetastoreService/ListBlocksForQuery", in, out, opts...) +func (c *metastoreServiceClient) QueryMetadata(ctx context.Context, in *QueryMetadataRequest, opts ...grpc.CallOption) (*QueryMetadataResponse, error) { + out := new(QueryMetadataResponse) + err := c.cc.Invoke(ctx, "/metastore.v1.MetastoreService/QueryMetadata", in, out, opts...) if err != nil { return nil, err } @@ -500,7 +533,7 @@ func (c *metastoreServiceClient) ReadIndex(ctx context.Context, in *ReadIndexReq // for forward compatibility type MetastoreServiceServer interface { AddBlock(context.Context, *AddBlockRequest) (*AddBlockResponse, error) - ListBlocksForQuery(context.Context, *ListBlocksForQueryRequest) (*ListBlocksForQueryResponse, error) + QueryMetadata(context.Context, *QueryMetadataRequest) (*QueryMetadataResponse, error) ReadIndex(context.Context, *ReadIndexRequest) (*ReadIndexResponse, error) mustEmbedUnimplementedMetastoreServiceServer() } @@ -512,8 +545,8 @@ type UnimplementedMetastoreServiceServer struct { func (UnimplementedMetastoreServiceServer) AddBlock(context.Context, *AddBlockRequest) (*AddBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddBlock not implemented") } -func (UnimplementedMetastoreServiceServer) ListBlocksForQuery(context.Context, *ListBlocksForQueryRequest) (*ListBlocksForQueryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListBlocksForQuery not implemented") +func (UnimplementedMetastoreServiceServer) QueryMetadata(context.Context, *QueryMetadataRequest) (*QueryMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryMetadata not implemented") } func (UnimplementedMetastoreServiceServer) ReadIndex(context.Context, *ReadIndexRequest) (*ReadIndexResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ReadIndex not implemented") @@ -549,20 +582,20 @@ func _MetastoreService_AddBlock_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } -func _MetastoreService_ListBlocksForQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBlocksForQueryRequest) +func _MetastoreService_QueryMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMetadataRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MetastoreServiceServer).ListBlocksForQuery(ctx, in) + return srv.(MetastoreServiceServer).QueryMetadata(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/metastore.v1.MetastoreService/ListBlocksForQuery", + FullMethod: "/metastore.v1.MetastoreService/QueryMetadata", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetastoreServiceServer).ListBlocksForQuery(ctx, req.(*ListBlocksForQueryRequest)) + return srv.(MetastoreServiceServer).QueryMetadata(ctx, req.(*QueryMetadataRequest)) } return interceptor(ctx, in, info, handler) } @@ -597,8 +630,8 @@ var MetastoreService_ServiceDesc = grpc.ServiceDesc{ Handler: _MetastoreService_AddBlock_Handler, }, { - MethodName: "ListBlocksForQuery", - Handler: _MetastoreService_ListBlocksForQuery_Handler, + MethodName: "QueryMetadata", + Handler: _MetastoreService_QueryMetadata_Handler, }, { MethodName: "ReadIndex", @@ -720,9 +753,9 @@ func (m *BlockMeta) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x48 } - if len(m.TenantServices) > 0 { - for iNdEx := len(m.TenantServices) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.TenantServices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Datasets) > 0 { + for iNdEx := len(m.Datasets) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Datasets[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -774,7 +807,7 @@ func (m *BlockMeta) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TenantService) MarshalVT() (dAtA []byte, err error) { +func (m *Dataset) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -787,12 +820,12 @@ func (m *TenantService) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TenantService) MarshalToVT(dAtA []byte) (int, error) { +func (m *Dataset) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *TenantService) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Dataset) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -804,6 +837,30 @@ func (m *TenantService) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.Labels[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Labels[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x42 + } + } if len(m.ProfileTypes) > 0 { for iNdEx := len(m.ProfileTypes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ProfileTypes[iNdEx]) @@ -865,7 +922,7 @@ func (m *TenantService) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ListBlocksForQueryRequest) MarshalVT() (dAtA []byte, err error) { +func (m *QueryMetadataRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -878,12 +935,12 @@ func (m *ListBlocksForQueryRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListBlocksForQueryRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *QueryMetadataRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ListBlocksForQueryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *QueryMetadataRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -924,7 +981,7 @@ func (m *ListBlocksForQueryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *ListBlocksForQueryResponse) MarshalVT() (dAtA []byte, err error) { +func (m *QueryMetadataResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -937,12 +994,12 @@ func (m *ListBlocksForQueryResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListBlocksForQueryResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *QueryMetadataResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ListBlocksForQueryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *QueryMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -1100,8 +1157,8 @@ func (m *BlockMeta) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if len(m.TenantServices) > 0 { - for _, e := range m.TenantServices { + if len(m.Datasets) > 0 { + for _, e := range m.Datasets { l = e.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } @@ -1113,7 +1170,7 @@ func (m *BlockMeta) SizeVT() (n int) { return n } -func (m *TenantService) SizeVT() (n int) { +func (m *Dataset) SizeVT() (n int) { if m == nil { return 0 } @@ -1149,11 +1206,23 @@ func (m *TenantService) SizeVT() (n int) { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } + if len(m.Labels) > 0 { + for _, e := range m.Labels { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n } -func (m *ListBlocksForQueryRequest) SizeVT() (n int) { +func (m *QueryMetadataRequest) SizeVT() (n int) { if m == nil { return 0 } @@ -1179,7 +1248,7 @@ func (m *ListBlocksForQueryRequest) SizeVT() (n int) { return n } -func (m *ListBlocksForQueryResponse) SizeVT() (n int) { +func (m *QueryMetadataResponse) SizeVT() (n int) { if m == nil { return 0 } @@ -1550,7 +1619,7 @@ func (m *BlockMeta) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TenantServices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Datasets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1577,8 +1646,8 @@ func (m *BlockMeta) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TenantServices = append(m.TenantServices, &TenantService{}) - if err := m.TenantServices[len(m.TenantServices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Datasets = append(m.Datasets, &Dataset{}) + if err := m.Datasets[len(m.Datasets)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1623,7 +1692,7 @@ func (m *BlockMeta) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *TenantService) UnmarshalVT(dAtA []byte) error { +func (m *Dataset) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1646,10 +1715,10 @@ func (m *TenantService) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TenantService: wiretype end group for non-group") + return fmt.Errorf("proto: Dataset: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TenantService: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Dataset: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1881,6 +1950,48 @@ func (m *TenantService) UnmarshalVT(dAtA []byte) error { } m.ProfileTypes = append(m.ProfileTypes, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 8: + 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 protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, &v1.Labels{}) + if unmarshal, ok := interface{}(m.Labels[len(m.Labels)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Labels[len(m.Labels)-1]); err != nil { + return err + } + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -1903,7 +2014,7 @@ func (m *TenantService) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ListBlocksForQueryRequest) UnmarshalVT(dAtA []byte) error { +func (m *QueryMetadataRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1926,10 +2037,10 @@ func (m *ListBlocksForQueryRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListBlocksForQueryRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMetadataRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListBlocksForQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2056,7 +2167,7 @@ func (m *ListBlocksForQueryRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ListBlocksForQueryResponse) UnmarshalVT(dAtA []byte) error { +func (m *QueryMetadataResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2079,10 +2190,10 @@ func (m *ListBlocksForQueryResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListBlocksForQueryResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMetadataResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListBlocksForQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go index 8a55af7551..9fd81df27d 100644 --- a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go +++ b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.go @@ -36,9 +36,9 @@ const ( // MetastoreServiceAddBlockProcedure is the fully-qualified name of the MetastoreService's AddBlock // RPC. MetastoreServiceAddBlockProcedure = "/metastore.v1.MetastoreService/AddBlock" - // MetastoreServiceListBlocksForQueryProcedure is the fully-qualified name of the MetastoreService's - // ListBlocksForQuery RPC. - MetastoreServiceListBlocksForQueryProcedure = "/metastore.v1.MetastoreService/ListBlocksForQuery" + // MetastoreServiceQueryMetadataProcedure is the fully-qualified name of the MetastoreService's + // QueryMetadata RPC. + MetastoreServiceQueryMetadataProcedure = "/metastore.v1.MetastoreService/QueryMetadata" // MetastoreServiceReadIndexProcedure is the fully-qualified name of the MetastoreService's // ReadIndex RPC. MetastoreServiceReadIndexProcedure = "/metastore.v1.MetastoreService/ReadIndex" @@ -46,16 +46,16 @@ const ( // These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. var ( - metastoreServiceServiceDescriptor = v1.File_metastore_v1_metastore_proto.Services().ByName("MetastoreService") - metastoreServiceAddBlockMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("AddBlock") - metastoreServiceListBlocksForQueryMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("ListBlocksForQuery") - metastoreServiceReadIndexMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("ReadIndex") + metastoreServiceServiceDescriptor = v1.File_metastore_v1_metastore_proto.Services().ByName("MetastoreService") + metastoreServiceAddBlockMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("AddBlock") + metastoreServiceQueryMetadataMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("QueryMetadata") + metastoreServiceReadIndexMethodDescriptor = metastoreServiceServiceDescriptor.Methods().ByName("ReadIndex") ) // MetastoreServiceClient is a client for the metastore.v1.MetastoreService service. type MetastoreServiceClient interface { AddBlock(context.Context, *connect.Request[v1.AddBlockRequest]) (*connect.Response[v1.AddBlockResponse], error) - ListBlocksForQuery(context.Context, *connect.Request[v1.ListBlocksForQueryRequest]) (*connect.Response[v1.ListBlocksForQueryResponse], error) + QueryMetadata(context.Context, *connect.Request[v1.QueryMetadataRequest]) (*connect.Response[v1.QueryMetadataResponse], error) ReadIndex(context.Context, *connect.Request[v1.ReadIndexRequest]) (*connect.Response[v1.ReadIndexResponse], error) } @@ -75,10 +75,10 @@ func NewMetastoreServiceClient(httpClient connect.HTTPClient, baseURL string, op connect.WithSchema(metastoreServiceAddBlockMethodDescriptor), connect.WithClientOptions(opts...), ), - listBlocksForQuery: connect.NewClient[v1.ListBlocksForQueryRequest, v1.ListBlocksForQueryResponse]( + queryMetadata: connect.NewClient[v1.QueryMetadataRequest, v1.QueryMetadataResponse]( httpClient, - baseURL+MetastoreServiceListBlocksForQueryProcedure, - connect.WithSchema(metastoreServiceListBlocksForQueryMethodDescriptor), + baseURL+MetastoreServiceQueryMetadataProcedure, + connect.WithSchema(metastoreServiceQueryMetadataMethodDescriptor), connect.WithClientOptions(opts...), ), readIndex: connect.NewClient[v1.ReadIndexRequest, v1.ReadIndexResponse]( @@ -92,9 +92,9 @@ func NewMetastoreServiceClient(httpClient connect.HTTPClient, baseURL string, op // metastoreServiceClient implements MetastoreServiceClient. type metastoreServiceClient struct { - addBlock *connect.Client[v1.AddBlockRequest, v1.AddBlockResponse] - listBlocksForQuery *connect.Client[v1.ListBlocksForQueryRequest, v1.ListBlocksForQueryResponse] - readIndex *connect.Client[v1.ReadIndexRequest, v1.ReadIndexResponse] + addBlock *connect.Client[v1.AddBlockRequest, v1.AddBlockResponse] + queryMetadata *connect.Client[v1.QueryMetadataRequest, v1.QueryMetadataResponse] + readIndex *connect.Client[v1.ReadIndexRequest, v1.ReadIndexResponse] } // AddBlock calls metastore.v1.MetastoreService.AddBlock. @@ -102,9 +102,9 @@ func (c *metastoreServiceClient) AddBlock(ctx context.Context, req *connect.Requ return c.addBlock.CallUnary(ctx, req) } -// ListBlocksForQuery calls metastore.v1.MetastoreService.ListBlocksForQuery. -func (c *metastoreServiceClient) ListBlocksForQuery(ctx context.Context, req *connect.Request[v1.ListBlocksForQueryRequest]) (*connect.Response[v1.ListBlocksForQueryResponse], error) { - return c.listBlocksForQuery.CallUnary(ctx, req) +// QueryMetadata calls metastore.v1.MetastoreService.QueryMetadata. +func (c *metastoreServiceClient) QueryMetadata(ctx context.Context, req *connect.Request[v1.QueryMetadataRequest]) (*connect.Response[v1.QueryMetadataResponse], error) { + return c.queryMetadata.CallUnary(ctx, req) } // ReadIndex calls metastore.v1.MetastoreService.ReadIndex. @@ -115,7 +115,7 @@ func (c *metastoreServiceClient) ReadIndex(ctx context.Context, req *connect.Req // MetastoreServiceHandler is an implementation of the metastore.v1.MetastoreService service. type MetastoreServiceHandler interface { AddBlock(context.Context, *connect.Request[v1.AddBlockRequest]) (*connect.Response[v1.AddBlockResponse], error) - ListBlocksForQuery(context.Context, *connect.Request[v1.ListBlocksForQueryRequest]) (*connect.Response[v1.ListBlocksForQueryResponse], error) + QueryMetadata(context.Context, *connect.Request[v1.QueryMetadataRequest]) (*connect.Response[v1.QueryMetadataResponse], error) ReadIndex(context.Context, *connect.Request[v1.ReadIndexRequest]) (*connect.Response[v1.ReadIndexResponse], error) } @@ -131,10 +131,10 @@ func NewMetastoreServiceHandler(svc MetastoreServiceHandler, opts ...connect.Han connect.WithSchema(metastoreServiceAddBlockMethodDescriptor), connect.WithHandlerOptions(opts...), ) - metastoreServiceListBlocksForQueryHandler := connect.NewUnaryHandler( - MetastoreServiceListBlocksForQueryProcedure, - svc.ListBlocksForQuery, - connect.WithSchema(metastoreServiceListBlocksForQueryMethodDescriptor), + metastoreServiceQueryMetadataHandler := connect.NewUnaryHandler( + MetastoreServiceQueryMetadataProcedure, + svc.QueryMetadata, + connect.WithSchema(metastoreServiceQueryMetadataMethodDescriptor), connect.WithHandlerOptions(opts...), ) metastoreServiceReadIndexHandler := connect.NewUnaryHandler( @@ -147,8 +147,8 @@ func NewMetastoreServiceHandler(svc MetastoreServiceHandler, opts ...connect.Han switch r.URL.Path { case MetastoreServiceAddBlockProcedure: metastoreServiceAddBlockHandler.ServeHTTP(w, r) - case MetastoreServiceListBlocksForQueryProcedure: - metastoreServiceListBlocksForQueryHandler.ServeHTTP(w, r) + case MetastoreServiceQueryMetadataProcedure: + metastoreServiceQueryMetadataHandler.ServeHTTP(w, r) case MetastoreServiceReadIndexProcedure: metastoreServiceReadIndexHandler.ServeHTTP(w, r) default: @@ -164,8 +164,8 @@ func (UnimplementedMetastoreServiceHandler) AddBlock(context.Context, *connect.R return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metastore.v1.MetastoreService.AddBlock is not implemented")) } -func (UnimplementedMetastoreServiceHandler) ListBlocksForQuery(context.Context, *connect.Request[v1.ListBlocksForQueryRequest]) (*connect.Response[v1.ListBlocksForQueryResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metastore.v1.MetastoreService.ListBlocksForQuery is not implemented")) +func (UnimplementedMetastoreServiceHandler) QueryMetadata(context.Context, *connect.Request[v1.QueryMetadataRequest]) (*connect.Response[v1.QueryMetadataResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metastore.v1.MetastoreService.QueryMetadata is not implemented")) } func (UnimplementedMetastoreServiceHandler) ReadIndex(context.Context, *connect.Request[v1.ReadIndexRequest]) (*connect.Response[v1.ReadIndexResponse], error) { diff --git a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go index 9d0c507a55..bde9d0a43b 100644 --- a/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go +++ b/api/gen/proto/go/metastore/v1/metastorev1connect/metastore.connect.mux.go @@ -24,9 +24,9 @@ func RegisterMetastoreServiceHandler(mux *mux.Router, svc MetastoreServiceHandle svc.AddBlock, opts..., )) - mux.Handle("/metastore.v1.MetastoreService/ListBlocksForQuery", connect.NewUnaryHandler( - "/metastore.v1.MetastoreService/ListBlocksForQuery", - svc.ListBlocksForQuery, + mux.Handle("/metastore.v1.MetastoreService/QueryMetadata", connect.NewUnaryHandler( + "/metastore.v1.MetastoreService/QueryMetadata", + svc.QueryMetadata, opts..., )) mux.Handle("/metastore.v1.MetastoreService/ReadIndex", connect.NewUnaryHandler( diff --git a/api/metastore/v1/metastore.proto b/api/metastore/v1/metastore.proto index db7cbf7276..4574016a37 100644 --- a/api/metastore/v1/metastore.proto +++ b/api/metastore/v1/metastore.proto @@ -2,9 +2,11 @@ syntax = "proto3"; package metastore.v1; +import "types/v1/types.proto"; + service MetastoreService { rpc AddBlock(AddBlockRequest) returns (AddBlockResponse) {} - rpc ListBlocksForQuery(ListBlocksForQueryRequest) returns (ListBlocksForQueryResponse) {} + rpc QueryMetadata(QueryMetadataRequest) returns (QueryMetadataResponse) {} rpc ReadIndex(ReadIndexRequest) returns (ReadIndexResponse) {} } @@ -23,14 +25,13 @@ message BlockMeta { uint32 compaction_level = 6; // Optional. Empty if compaction level is 0. string tenant_id = 7; - // TODO(kolesnikovae): Partitions with labels? - repeated TenantService tenant_services = 8; + repeated Dataset datasets = 8; uint64 size = 9; } -// TenantService object points to the offset in the block at which -// the tenant service data is located. -message TenantService { +message Dataset { + repeated types.v1.Labels labels = 8; + string tenant_id = 1; string name = 2; int64 min_time = 3; @@ -47,18 +48,20 @@ message TenantService { repeated uint64 table_of_contents = 5; // Size of the section in bytes. uint64 size = 6; + + // TODO: delete // Profile types present in the tenant service data. repeated string profile_types = 7; } -message ListBlocksForQueryRequest { +message QueryMetadataRequest { repeated string tenant_id = 1; int64 start_time = 2; int64 end_time = 3; string query = 4; } -message ListBlocksForQueryResponse { +message QueryMetadataResponse { repeated BlockMeta blocks = 1; } diff --git a/api/openapiv2/gen/phlare.swagger.json b/api/openapiv2/gen/phlare.swagger.json index 9331e5dd42..5e3391dede 100644 --- a/api/openapiv2/gen/phlare.swagger.json +++ b/api/openapiv2/gen/phlare.swagger.json @@ -656,13 +656,12 @@ "type": "string", "description": "Optional. Empty if compaction level is 0." }, - "tenantServices": { + "datasets": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1TenantService" - }, - "title": "TODO(kolesnikovae): Partitions with labels?" + "$ref": "#/definitions/v1Dataset" + } }, "size": { "type": "string", @@ -829,6 +828,52 @@ } } }, + "v1Dataset": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Labels" + } + }, + "tenantId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "minTime": { + "type": "string", + "format": "int64" + }, + "maxTime": { + "type": "string", + "format": "int64" + }, + "tableOfContents": { + "type": "array", + "items": { + "type": "string", + "format": "uint64" + }, + "description": "Table of contents lists data sections within the tenant\nservice region. The offsets are absolute.\n\nThe interpretation of the table of contents is specific\nto the metadata format version. By default, the sections are:\n - 0: profiles.parquet\n - 1: index.tsdb\n - 2: symbols.symdb" + }, + "size": { + "type": "string", + "format": "uint64", + "description": "Size of the section in bytes." + }, + "profileTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "TODO: delete\nProfile types present in the tenant service data." + } + } + }, "v1Diagnostics": { "type": "object", "description": "Diagnostic messages, events, statistics, analytics, etc." @@ -1240,18 +1285,6 @@ } } }, - "v1ListBlocksForQueryResponse": { - "type": "object", - "properties": { - "blocks": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1BlockMeta" - } - } - } - }, "v1Mapping": { "type": "object", "properties": { @@ -1519,6 +1552,18 @@ } } }, + "v1QueryMetadataResponse": { + "type": "object", + "properties": { + "blocks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BlockMeta" + } + } + } + }, "v1QueryPlan": { "type": "object", "properties": { @@ -1925,46 +1970,6 @@ ], "default": "MERGE_FORMAT_UNSPECIFIED" }, - "v1TenantService": { - "type": "object", - "properties": { - "tenantId": { - "type": "string" - }, - "name": { - "type": "string" - }, - "minTime": { - "type": "string", - "format": "int64" - }, - "maxTime": { - "type": "string", - "format": "int64" - }, - "tableOfContents": { - "type": "array", - "items": { - "type": "string", - "format": "uint64" - }, - "description": "Table of contents lists data sections within the tenant\nservice region. The offsets are absolute.\n\nThe interpretation of the table of contents is specific\nto the metadata format version. By default, the sections are:\n - 0: profiles.parquet\n - 1: index.tsdb\n - 2: symbols.symdb" - }, - "size": { - "type": "string", - "format": "uint64", - "description": "Size of the section in bytes." - }, - "profileTypes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Profile types present in the tenant service data." - } - }, - "description": "TenantService object points to the offset in the block at which\nthe tenant service data is located." - }, "v1TimeSeriesAggregationType": { "type": "string", "enum": [ diff --git a/docs/sources/configure-server/reference-configuration-parameters/index.md b/docs/sources/configure-server/reference-configuration-parameters/index.md index 62a9830105..f24d239132 100644 --- a/docs/sources/configure-server/reference-configuration-parameters/index.md +++ b/docs/sources/configure-server/reference-configuration-parameters/index.md @@ -37,9 +37,9 @@ brackets indicate that a parameter is optional. - ``: a CLI flag prefix based on the context (look at the parent configuration block to see which CLI flags prefix should be used) - ``: a [Prometheus relabeling configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) - `