diff --git a/docs/developer_guides/chap07_query_service.md b/docs/developer_guides/chap07_query_service.md index 9b0fb086d2..5103bb7ad0 100644 --- a/docs/developer_guides/chap07_query_service.md +++ b/docs/developer_guides/chap07_query_service.md @@ -26,6 +26,7 @@ type QueryService interface { ReleasePartitions(req ReleasePartitionRequest) error CreateQueryChannel() (CreateQueryChannelResponse, error) + GetSegmentInfo(req SegmentInfoRequest) (SegmentInfoResponse, error) } ``` @@ -166,7 +167,28 @@ type CreateQueryChannelResponse struct { } ``` +* *GetSegmentInfo* * +```go +type SegmentInfo struct { + segmentID UniqueID + collectionID UniqueID + partitionID UniqueID + mem_size int64 + num_rows int64 + index_name string + indexID UniqueID +} + +type SegmentInfoRequest struct { + MsgBase + SegmentIDs []UniqueID +} + +type SegmentInfoResponse struct { + infos []SegmentInfo +} +``` #### 8.2 Query Channel diff --git a/internal/distributed/querynode/client/client.go b/internal/distributed/querynode/client/client.go index 463b8c800b..c284bd2c38 100644 --- a/internal/distributed/querynode/client/client.go +++ b/internal/distributed/querynode/client/client.go @@ -96,3 +96,7 @@ func (c *Client) LoadSegments(in *querypb.LoadSegmentRequest) (*commonpb.Status, func (c *Client) ReleaseSegments(in *querypb.ReleaseSegmentRequest) (*commonpb.Status, error) { return c.grpcClient.ReleaseSegments(context.TODO(), in) } + +func (c *Client) GetSegmentInfo(in *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + return c.grpcClient.GetSegmentInfo(context.TODO(), in) +} diff --git a/internal/distributed/querynode/service.go b/internal/distributed/querynode/service.go index 2a6e0c880a..f659e1a9a2 100644 --- a/internal/distributed/querynode/service.go +++ b/internal/distributed/querynode/service.go @@ -156,3 +156,7 @@ func (s *Server) ReleaseSegments(ctx context.Context, in *querypb.ReleaseSegment // ignore ctx return s.node.ReleaseSegments(in) } + +func (s *Server) GetSegmentInfo(ctx context.Context, in *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + return s.node.GetSegmentInfo(in) +} diff --git a/internal/distributed/queryservice/client/client.go b/internal/distributed/queryservice/client/client.go index 5b1eaf09c9..377678c336 100644 --- a/internal/distributed/queryservice/client/client.go +++ b/internal/distributed/queryservice/client/client.go @@ -122,3 +122,7 @@ func (c *Client) CreateQueryChannel() (*querypb.CreateQueryChannelResponse, erro func (c *Client) GetPartitionStates(req *querypb.PartitionStatesRequest) (*querypb.PartitionStatesResponse, error) { return c.grpcClient.GetPartitionStates(context.TODO(), req) } + +func (c *Client) GetSegmentInfo(req *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + return c.grpcClient.GetSegmentInfo(context.TODO(), req) +} diff --git a/internal/distributed/queryservice/service.go b/internal/distributed/queryservice/service.go index f0119cfc3b..b6ddde255d 100644 --- a/internal/distributed/queryservice/service.go +++ b/internal/distributed/queryservice/service.go @@ -166,6 +166,10 @@ func (s *Server) CreateQueryChannel(ctx context.Context, req *commonpb.Empty) (* return s.queryService.CreateQueryChannel() } +func (s *Server) GetSegmentInfo(ctx context.Context, req *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + return s.queryService.GetSegmentInfo(req) +} + func NewServer(ctx context.Context) *Server { ctx1, cancel := context.WithCancel(ctx) service, err := queryservice.NewQueryService(ctx1) diff --git a/internal/proto/query_service.proto b/internal/proto/query_service.proto index 4e1a2056a1..7a8b837b45 100644 --- a/internal/proto/query_service.proto +++ b/internal/proto/query_service.proto @@ -141,6 +141,26 @@ message ComponentStatesResponse { internal.ComponentStates states = 2; } +message SegmentInfo { + int64 segmentID = 1; + int64 collectionID = 2; + int64 partitionID = 3; + int64 mem_size = 4; + int64 num_rows = 5; + string index_name = 6; + int64 indexID = 7; +} + +message SegmentInfoRequest { + common.MsgBase base = 1; + repeated int64 segmentIDs = 2; +} + +message SegmentInfoResponse { + common.Status status = 1; + repeated SegmentInfo infos = 2; +} + service QueryService { rpc RegisterNode(RegisterNodeRequest) returns (RegisterNodeResponse) {} @@ -157,6 +177,7 @@ service QueryService { rpc GetStatisticsChannel(common.Empty) returns (milvus.StringResponse) {} rpc GetPartitionStates(PartitionStatesRequest) returns (PartitionStatesResponse) {} rpc GetComponentStates(common.Empty) returns (internal.ComponentStates) {} + rpc GetSegmentInfo(SegmentInfoRequest) returns (SegmentInfoResponse) {} } service QueryNode { @@ -169,4 +190,5 @@ service QueryNode { rpc WatchDmChannels(WatchDmChannelsRequest) returns (common.Status) {} rpc LoadSegments(LoadSegmentRequest) returns (common.Status) {} rpc ReleaseSegments(ReleaseSegmentRequest) returns (common.Status) {} + rpc GetSegmentInfo(SegmentInfoRequest) returns (SegmentInfoResponse) {} } diff --git a/internal/proto/querypb/query_service.pb.go b/internal/proto/querypb/query_service.pb.go index 21cbccb422..64d1bb5b43 100644 --- a/internal/proto/querypb/query_service.pb.go +++ b/internal/proto/querypb/query_service.pb.go @@ -1184,6 +1184,187 @@ func (m *ComponentStatesResponse) GetStates() *internalpb2.ComponentStates { return nil } +type SegmentInfo struct { + SegmentID int64 `protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"` + CollectionID int64 `protobuf:"varint,2,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + PartitionID int64 `protobuf:"varint,3,opt,name=partitionID,proto3" json:"partitionID,omitempty"` + MemSize int64 `protobuf:"varint,4,opt,name=mem_size,json=memSize,proto3" json:"mem_size,omitempty"` + NumRows int64 `protobuf:"varint,5,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"` + IndexName string `protobuf:"bytes,6,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"` + IndexID int64 `protobuf:"varint,7,opt,name=indexID,proto3" json:"indexID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SegmentInfo) Reset() { *m = SegmentInfo{} } +func (m *SegmentInfo) String() string { return proto.CompactTextString(m) } +func (*SegmentInfo) ProtoMessage() {} +func (*SegmentInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_5fcb6756dc1afb8d, []int{20} +} + +func (m *SegmentInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SegmentInfo.Unmarshal(m, b) +} +func (m *SegmentInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SegmentInfo.Marshal(b, m, deterministic) +} +func (m *SegmentInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SegmentInfo.Merge(m, src) +} +func (m *SegmentInfo) XXX_Size() int { + return xxx_messageInfo_SegmentInfo.Size(m) +} +func (m *SegmentInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SegmentInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SegmentInfo proto.InternalMessageInfo + +func (m *SegmentInfo) GetSegmentID() int64 { + if m != nil { + return m.SegmentID + } + return 0 +} + +func (m *SegmentInfo) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *SegmentInfo) GetPartitionID() int64 { + if m != nil { + return m.PartitionID + } + return 0 +} + +func (m *SegmentInfo) GetMemSize() int64 { + if m != nil { + return m.MemSize + } + return 0 +} + +func (m *SegmentInfo) GetNumRows() int64 { + if m != nil { + return m.NumRows + } + return 0 +} + +func (m *SegmentInfo) GetIndexName() string { + if m != nil { + return m.IndexName + } + return "" +} + +func (m *SegmentInfo) GetIndexID() int64 { + if m != nil { + return m.IndexID + } + return 0 +} + +type SegmentInfoRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + SegmentIDs []int64 `protobuf:"varint,2,rep,packed,name=segmentIDs,proto3" json:"segmentIDs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SegmentInfoRequest) Reset() { *m = SegmentInfoRequest{} } +func (m *SegmentInfoRequest) String() string { return proto.CompactTextString(m) } +func (*SegmentInfoRequest) ProtoMessage() {} +func (*SegmentInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5fcb6756dc1afb8d, []int{21} +} + +func (m *SegmentInfoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SegmentInfoRequest.Unmarshal(m, b) +} +func (m *SegmentInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SegmentInfoRequest.Marshal(b, m, deterministic) +} +func (m *SegmentInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SegmentInfoRequest.Merge(m, src) +} +func (m *SegmentInfoRequest) XXX_Size() int { + return xxx_messageInfo_SegmentInfoRequest.Size(m) +} +func (m *SegmentInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SegmentInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SegmentInfoRequest proto.InternalMessageInfo + +func (m *SegmentInfoRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *SegmentInfoRequest) GetSegmentIDs() []int64 { + if m != nil { + return m.SegmentIDs + } + return nil +} + +type SegmentInfoResponse struct { + Status *commonpb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Infos []*SegmentInfo `protobuf:"bytes,2,rep,name=infos,proto3" json:"infos,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SegmentInfoResponse) Reset() { *m = SegmentInfoResponse{} } +func (m *SegmentInfoResponse) String() string { return proto.CompactTextString(m) } +func (*SegmentInfoResponse) ProtoMessage() {} +func (*SegmentInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5fcb6756dc1afb8d, []int{22} +} + +func (m *SegmentInfoResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SegmentInfoResponse.Unmarshal(m, b) +} +func (m *SegmentInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SegmentInfoResponse.Marshal(b, m, deterministic) +} +func (m *SegmentInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SegmentInfoResponse.Merge(m, src) +} +func (m *SegmentInfoResponse) XXX_Size() int { + return xxx_messageInfo_SegmentInfoResponse.Size(m) +} +func (m *SegmentInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SegmentInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SegmentInfoResponse proto.InternalMessageInfo + +func (m *SegmentInfoResponse) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *SegmentInfoResponse) GetInfos() []*SegmentInfo { + if m != nil { + return m.Infos + } + return nil +} + func init() { proto.RegisterEnum("milvus.proto.query.PartitionState", PartitionState_name, PartitionState_value) proto.RegisterType((*RegisterNodeRequest)(nil), "milvus.proto.query.RegisterNodeRequest") @@ -1206,86 +1387,99 @@ func init() { proto.RegisterType((*LoadSegmentRequest)(nil), "milvus.proto.query.LoadSegmentRequest") proto.RegisterType((*ReleaseSegmentRequest)(nil), "milvus.proto.query.ReleaseSegmentRequest") proto.RegisterType((*ComponentStatesResponse)(nil), "milvus.proto.query.ComponentStatesResponse") + proto.RegisterType((*SegmentInfo)(nil), "milvus.proto.query.SegmentInfo") + proto.RegisterType((*SegmentInfoRequest)(nil), "milvus.proto.query.SegmentInfoRequest") + proto.RegisterType((*SegmentInfoResponse)(nil), "milvus.proto.query.SegmentInfoResponse") } func init() { proto.RegisterFile("query_service.proto", fileDescriptor_5fcb6756dc1afb8d) } var fileDescriptor_5fcb6756dc1afb8d = []byte{ - // 1177 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0xf6, 0xc6, 0x3f, 0xad, 0x4f, 0x5c, 0xdb, 0x9d, 0xe6, 0x4f, 0x0b, 0xaa, 0xca, 0x00, 0x6d, - 0x7e, 0xc0, 0x46, 0xae, 0x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d8, 0x77, 0xf9, 0x81, - 0x47, 0x18, 0x71, 0x78, 0x55, 0x41, 0x00, 0x85, 0x2f, 0x9c, 0x26, 0x65, 0xcf, 0xaa, 0x0b, 0xe8, - 0x46, 0x28, 0x46, 0x74, 0xab, 0xe5, 0xdc, 0x27, 0xb6, 0xeb, 0x9d, 0x54, 0xb3, 0xbe, 0x7b, 0x34, - 0xca, 0xa1, 0x2a, 0x94, 0x22, 0x93, 0xbd, 0x83, 0x87, 0xd5, 0x3c, 0x2a, 0x42, 0x3e, 0xf8, 0x2c, - 0x34, 0x5e, 0x14, 0xa1, 0x24, 0xda, 0x4c, 0x3b, 0x78, 0xca, 0x20, 0x03, 0x4a, 0xf1, 0x27, 0x04, - 0xba, 0x23, 0xbb, 0x64, 0x25, 0xcf, 0x1c, 0x75, 0x7d, 0xba, 0x61, 0x50, 0x64, 0x9c, 0x41, 0x4f, - 0xa1, 0x92, 0xd4, 0xed, 0x0c, 0x6d, 0xc8, 0xdc, 0xa5, 0x6f, 0x07, 0x75, 0x73, 0x16, 0xd3, 0x08, - 0xab, 0x07, 0xe5, 0x84, 0x40, 0x64, 0x68, 0x7d, 0x92, 0x7f, 0xfa, 0x8a, 0x55, 0x37, 0x66, 0xb0, - 0x8c, 0x80, 0xbe, 0x84, 0x72, 0x42, 0x51, 0x4c, 0x00, 0x92, 0xa9, 0x0e, 0xf5, 0xbc, 0x7d, 0x86, - 0x33, 0xa8, 0x03, 0xd7, 0xd3, 0x2a, 0x80, 0xa1, 0x2d, 0x79, 0xc1, 0xa5, 0x62, 0x61, 0x1a, 0xc0, - 0x51, 0xc0, 0xfd, 0xac, 0x80, 0xf2, 0xf5, 0x90, 0x3e, 0x7b, 0xa6, 0xc5, 0xfe, 0x26, 0x22, 0x1f, - 0x0b, 0xff, 0xc1, 0x39, 0xe4, 0x2f, 0x8c, 0xd0, 0x05, 0x34, 0x2e, 0x3d, 0x90, 0x2a, 0x75, 0xba, - 0x67, 0x0f, 0xf8, 0x89, 0x5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0x6a, 0x59, 0xf4, 0x94, 0x13, 0xa3, - 0x5f, 0x0f, 0xbc, 0x3e, 0x34, 0x29, 0xe3, 0x1e, 0xed, 0x0e, 0x39, 0x31, 0xeb, 0xa3, 0xa3, 0x53, - 0x17, 0xa1, 0xea, 0x02, 0x75, 0xd0, 0xed, 0x16, 0xc4, 0xf0, 0xee, 0x7f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x69, 0xea, 0xe4, 0xad, 0x06, 0x15, 0x00, 0x00, + // 1331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x5f, 0x73, 0xdb, 0x44, + 0x10, 0xb7, 0x6c, 0xc7, 0xa9, 0x37, 0xae, 0xed, 0x5e, 0xfe, 0x19, 0x51, 0x4a, 0x39, 0xa0, 0x4d, + 0x13, 0x70, 0x98, 0x74, 0x60, 0x78, 0x82, 0x49, 0xe2, 0x4e, 0xc6, 0x33, 0x34, 0xa4, 0x72, 0x3a, + 0x1d, 0x02, 0x1d, 0x23, 0x4b, 0x17, 0xe7, 0x5a, 0xfd, 0x71, 0x75, 0xe7, 0xa4, 0xc9, 0x0b, 0x30, + 0xc3, 0x23, 0x03, 0x9f, 0x81, 0x81, 0x81, 0x19, 0x5e, 0xf8, 0x36, 0xbc, 0xf0, 0x02, 0xdf, 0x84, + 0xd1, 0x49, 0x56, 0x24, 0x59, 0x8e, 0x9c, 0xba, 0x69, 0x78, 0xd3, 0x9d, 0xf6, 0xf6, 0xb7, 0xfb, + 0xdb, 0xbd, 0xbd, 0x5d, 0x98, 0x7d, 0xd6, 0x27, 0xce, 0x71, 0x9b, 0x11, 0xe7, 0x90, 0x6a, 0xa4, + 0xde, 0x73, 0x6c, 0x6e, 0x23, 0x64, 0x52, 0xe3, 0xb0, 0xcf, 0xbc, 0x55, 0x5d, 0x48, 0xc8, 0x25, + 0xcd, 0x36, 0x4d, 0xdb, 0xf2, 0xf6, 0xe4, 0x52, 0x58, 0x42, 0x2e, 0x53, 0x8b, 0x13, 0xc7, 0x52, + 0x0d, 0x7f, 0x8d, 0x74, 0x95, 0xab, 0x51, 0x9d, 0xf8, 0x1b, 0x98, 0x55, 0x48, 0x97, 0x32, 0x4e, + 0x9c, 0x6d, 0x5b, 0x27, 0x0a, 0x79, 0xd6, 0x27, 0x8c, 0xa3, 0x0f, 0x20, 0xdf, 0x51, 0x19, 0xa9, + 0x49, 0x37, 0xa5, 0xa5, 0x99, 0xb5, 0xeb, 0xf5, 0x08, 0xb2, 0x0f, 0x79, 0x9f, 0x75, 0x37, 0x54, + 0x46, 0x14, 0x21, 0x89, 0x3e, 0x82, 0x69, 0x55, 0xd7, 0x1d, 0xc2, 0x58, 0x2d, 0x7b, 0xc6, 0xa1, + 0x75, 0x4f, 0x46, 0x19, 0x08, 0xe3, 0x9f, 0x24, 0x98, 0x8b, 0x5a, 0xc0, 0x7a, 0xb6, 0xc5, 0x08, + 0xba, 0x0b, 0x05, 0xc6, 0x55, 0xde, 0x67, 0xbe, 0x11, 0xaf, 0x27, 0xea, 0x6b, 0x09, 0x11, 0xc5, + 0x17, 0x45, 0x1b, 0x30, 0x43, 0x2d, 0xca, 0xdb, 0x3d, 0xd5, 0x51, 0xcd, 0x81, 0x25, 0x6f, 0x45, + 0x4f, 0x06, 0xac, 0x34, 0x2d, 0xca, 0x77, 0x84, 0xa0, 0x02, 0x34, 0xf8, 0xc6, 0x8f, 0x61, 0xbe, + 0x75, 0x60, 0x1f, 0x6d, 0xda, 0x86, 0x41, 0x34, 0x4e, 0x6d, 0xeb, 0xc5, 0x49, 0x41, 0x90, 0xd7, + 0x3b, 0xcd, 0x86, 0xb0, 0x23, 0xa7, 0x88, 0x6f, 0xcc, 0x60, 0x21, 0xae, 0x7e, 0x12, 0x8f, 0xdf, + 0x81, 0xab, 0x5a, 0xa0, 0xaa, 0xd9, 0x70, 0x7d, 0xce, 0x2d, 0xe5, 0x94, 0xe8, 0x26, 0xfe, 0x4e, + 0x82, 0xf9, 0xcf, 0x6c, 0x55, 0xbf, 0x20, 0xa7, 0x10, 0x86, 0x52, 0x18, 0xb0, 0x96, 0x13, 0xff, + 0x22, 0x7b, 0xf8, 0x7b, 0x09, 0x6a, 0x0a, 0x31, 0x88, 0xca, 0xc8, 0x65, 0x9a, 0xf1, 0xad, 0x04, + 0x73, 0x6e, 0x00, 0x76, 0x54, 0x87, 0xd3, 0xcb, 0x31, 0xa1, 0xe7, 0x65, 0x58, 0xc8, 0x82, 0x49, + 0x32, 0x00, 0x43, 0xa9, 0x37, 0xd0, 0x74, 0x9a, 0x00, 0x91, 0x3d, 0x6c, 0x42, 0x25, 0x40, 0x73, + 0x8f, 0x13, 0x86, 0x6e, 0xc2, 0x4c, 0x48, 0x44, 0x00, 0xe6, 0x94, 0xf0, 0x16, 0xfa, 0x18, 0xa6, + 0x5c, 0x08, 0x22, 0xfc, 0x2b, 0xaf, 0xe1, 0xfa, 0x70, 0xfd, 0xa9, 0x47, 0xb5, 0x2a, 0xde, 0x01, + 0xfc, 0x9b, 0x04, 0x0b, 0x31, 0xbc, 0x57, 0xce, 0xf2, 0x10, 0x2f, 0xf9, 0x04, 0x5e, 0xfe, 0x90, + 0x60, 0x71, 0xc8, 0xd0, 0x49, 0x82, 0xb1, 0x07, 0x0b, 0x01, 0x40, 0x5b, 0x27, 0x4c, 0x73, 0x68, + 0xcf, 0xfd, 0xf6, 0xc2, 0x32, 0xb3, 0xf6, 0x76, 0x3a, 0x89, 0x4c, 0x99, 0x0f, 0x54, 0x34, 0x42, + 0x1a, 0xf0, 0xaf, 0x12, 0xcc, 0xb9, 0x97, 0xf8, 0xf2, 0x32, 0x77, 0x2c, 0x4e, 0x7f, 0x97, 0x60, + 0xd1, 0xbf, 0xe7, 0xff, 0x73, 0x4b, 0x7f, 0x96, 0x40, 0xde, 0x74, 0x88, 0xca, 0xc9, 0x03, 0x37, + 0x0e, 0x9b, 0x07, 0xaa, 0x65, 0x11, 0x63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50, 0x89, 0x8d, + 0x13, 0xc9, 0x17, 0x22, 0x79, 0xe6, 0x48, 0xd3, 0xfe, 0x10, 0x4a, 0xa1, 0xf9, 0x81, 0x25, 0xa7, + 0xe8, 0xf0, 0x84, 0x91, 0xa6, 0xf6, 0x4b, 0xa8, 0x44, 0x9b, 0xec, 0x11, 0xef, 0x65, 0x62, 0x27, + 0x9e, 0x4e, 0xfb, 0xc5, 0x5f, 0xac, 0x8d, 0xf5, 0xbd, 0x4f, 0xbb, 0x94, 0x1f, 0xf4, 0x3b, 0x2e, + 0xfc, 0xea, 0x09, 0x35, 0x0c, 0x7a, 0xc2, 0x89, 0x76, 0xb0, 0xea, 0x69, 0x78, 0x5f, 0xa7, 0x8c, + 0x3b, 0xb4, 0xd3, 0xe7, 0x44, 0x5f, 0x1d, 0x14, 0x81, 0x55, 0xa1, 0x76, 0x55, 0xa8, 0xed, 0x75, + 0x3a, 0x05, 0xb1, 0xbc, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xdf, 0xec, 0xde, 0x9f, + 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1312,6 +1506,7 @@ type QueryServiceClient interface { GetStatisticsChannel(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*milvuspb.StringResponse, error) GetPartitionStates(ctx context.Context, in *PartitionStatesRequest, opts ...grpc.CallOption) (*PartitionStatesResponse, error) GetComponentStates(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*internalpb2.ComponentStates, error) + GetSegmentInfo(ctx context.Context, in *SegmentInfoRequest, opts ...grpc.CallOption) (*SegmentInfoResponse, error) } type queryServiceClient struct { @@ -1430,6 +1625,15 @@ func (c *queryServiceClient) GetComponentStates(ctx context.Context, in *commonp return out, nil } +func (c *queryServiceClient) GetSegmentInfo(ctx context.Context, in *SegmentInfoRequest, opts ...grpc.CallOption) (*SegmentInfoResponse, error) { + out := new(SegmentInfoResponse) + err := c.cc.Invoke(ctx, "/milvus.proto.query.QueryService/GetSegmentInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServiceServer is the server API for QueryService service. type QueryServiceServer interface { RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) @@ -1444,6 +1648,7 @@ type QueryServiceServer interface { GetStatisticsChannel(context.Context, *commonpb.Empty) (*milvuspb.StringResponse, error) GetPartitionStates(context.Context, *PartitionStatesRequest) (*PartitionStatesResponse, error) GetComponentStates(context.Context, *commonpb.Empty) (*internalpb2.ComponentStates, error) + GetSegmentInfo(context.Context, *SegmentInfoRequest) (*SegmentInfoResponse, error) } // UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. @@ -1486,6 +1691,9 @@ func (*UnimplementedQueryServiceServer) GetPartitionStates(ctx context.Context, func (*UnimplementedQueryServiceServer) GetComponentStates(ctx context.Context, req *commonpb.Empty) (*internalpb2.ComponentStates, error) { return nil, status.Errorf(codes.Unimplemented, "method GetComponentStates not implemented") } +func (*UnimplementedQueryServiceServer) GetSegmentInfo(ctx context.Context, req *SegmentInfoRequest) (*SegmentInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSegmentInfo not implemented") +} func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { s.RegisterService(&_QueryService_serviceDesc, srv) @@ -1707,6 +1915,24 @@ func _QueryService_GetComponentStates_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _QueryService_GetSegmentInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SegmentInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServiceServer).GetSegmentInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/milvus.proto.query.QueryService/GetSegmentInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServiceServer).GetSegmentInfo(ctx, req.(*SegmentInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _QueryService_serviceDesc = grpc.ServiceDesc{ ServiceName: "milvus.proto.query.QueryService", HandlerType: (*QueryServiceServer)(nil), @@ -1759,6 +1985,10 @@ var _QueryService_serviceDesc = grpc.ServiceDesc{ MethodName: "GetComponentStates", Handler: _QueryService_GetComponentStates_Handler, }, + { + MethodName: "GetSegmentInfo", + Handler: _QueryService_GetSegmentInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "query_service.proto", @@ -1776,6 +2006,7 @@ type QueryNodeClient interface { WatchDmChannels(ctx context.Context, in *WatchDmChannelsRequest, opts ...grpc.CallOption) (*commonpb.Status, error) LoadSegments(ctx context.Context, in *LoadSegmentRequest, opts ...grpc.CallOption) (*commonpb.Status, error) ReleaseSegments(ctx context.Context, in *ReleaseSegmentRequest, opts ...grpc.CallOption) (*commonpb.Status, error) + GetSegmentInfo(ctx context.Context, in *SegmentInfoRequest, opts ...grpc.CallOption) (*SegmentInfoResponse, error) } type queryNodeClient struct { @@ -1858,6 +2089,15 @@ func (c *queryNodeClient) ReleaseSegments(ctx context.Context, in *ReleaseSegmen return out, nil } +func (c *queryNodeClient) GetSegmentInfo(ctx context.Context, in *SegmentInfoRequest, opts ...grpc.CallOption) (*SegmentInfoResponse, error) { + out := new(SegmentInfoResponse) + err := c.cc.Invoke(ctx, "/milvus.proto.query.QueryNode/GetSegmentInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryNodeServer is the server API for QueryNode service. type QueryNodeServer interface { GetTimeTickChannel(context.Context, *commonpb.Empty) (*milvuspb.StringResponse, error) @@ -1868,6 +2108,7 @@ type QueryNodeServer interface { WatchDmChannels(context.Context, *WatchDmChannelsRequest) (*commonpb.Status, error) LoadSegments(context.Context, *LoadSegmentRequest) (*commonpb.Status, error) ReleaseSegments(context.Context, *ReleaseSegmentRequest) (*commonpb.Status, error) + GetSegmentInfo(context.Context, *SegmentInfoRequest) (*SegmentInfoResponse, error) } // UnimplementedQueryNodeServer can be embedded to have forward compatible implementations. @@ -1898,6 +2139,9 @@ func (*UnimplementedQueryNodeServer) LoadSegments(ctx context.Context, req *Load func (*UnimplementedQueryNodeServer) ReleaseSegments(ctx context.Context, req *ReleaseSegmentRequest) (*commonpb.Status, error) { return nil, status.Errorf(codes.Unimplemented, "method ReleaseSegments not implemented") } +func (*UnimplementedQueryNodeServer) GetSegmentInfo(ctx context.Context, req *SegmentInfoRequest) (*SegmentInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSegmentInfo not implemented") +} func RegisterQueryNodeServer(s *grpc.Server, srv QueryNodeServer) { s.RegisterService(&_QueryNode_serviceDesc, srv) @@ -2047,6 +2291,24 @@ func _QueryNode_ReleaseSegments_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _QueryNode_GetSegmentInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SegmentInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryNodeServer).GetSegmentInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/milvus.proto.query.QueryNode/GetSegmentInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryNodeServer).GetSegmentInfo(ctx, req.(*SegmentInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _QueryNode_serviceDesc = grpc.ServiceDesc{ ServiceName: "milvus.proto.query.QueryNode", HandlerType: (*QueryNodeServer)(nil), @@ -2083,6 +2345,10 @@ var _QueryNode_serviceDesc = grpc.ServiceDesc{ MethodName: "ReleaseSegments", Handler: _QueryNode_ReleaseSegments_Handler, }, + { + MethodName: "GetSegmentInfo", + Handler: _QueryNode_GetSegmentInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "query_service.proto", diff --git a/internal/querynode/load_service.go b/internal/querynode/load_service.go index 98778c204e..076bd57cbd 100644 --- a/internal/querynode/load_service.go +++ b/internal/querynode/load_service.go @@ -93,8 +93,10 @@ func (s *loadService) execute(l *loadIndex) error { var err error var indexBuffer [][]byte var indexParams indexParam + var indexName string + var indexID UniqueID fn := func() error { - indexBuffer, indexParams, err = s.loadIndex(l.indexPaths) + indexBuffer, indexParams, indexName, indexID, err = s.loadIndex(l.indexPaths) if err != nil { return err } @@ -117,8 +119,8 @@ func (s *loadService) execute(l *loadIndex) error { if err != nil { return err } - //3. update segment index stats - err = s.updateSegmentIndexStats(indexParams, l) + // 3. update segment index stats + err = s.updateSegmentIndexStats(indexParams, indexName, indexID, l) if err != nil { return err } @@ -173,7 +175,7 @@ func (s *loadService) fieldsStatsKey2IDs(key string) (UniqueID, UniqueID, error) return collectionID, fieldID, nil } -func (s *loadService) updateSegmentIndexStats(indexParams indexParam, l *loadIndex) error { +func (s *loadService) updateSegmentIndexStats(indexParams indexParam, indexName string, indexID UniqueID, l *loadIndex) error { targetSegment, err := s.replica.getSegmentByID(l.segmentID) if err != nil { return err @@ -214,30 +216,39 @@ func (s *loadService) updateSegmentIndexStats(indexParams indexParam, l *loadInd }) } } - return targetSegment.setIndexParam(l.fieldID, newIndexParams) + err = targetSegment.setIndexParam(l.fieldID, newIndexParams) + if err != nil { + return err + } + targetSegment.setIndexName(indexName) + targetSegment.setIndexID(indexID) + + return nil } -func (s *loadService) loadIndex(indexPath []string) ([][]byte, indexParam, error) { +func (s *loadService) loadIndex(indexPath []string) ([][]byte, indexParam, string, UniqueID, error) { index := make([][]byte, 0) var indexParams indexParam + var indexName string + var indexID UniqueID for _, p := range indexPath { fmt.Println("load path = ", indexPath) indexPiece, err := s.kv.Load(p) if err != nil { - return nil, nil, err + return nil, nil, "", -1, err } // get index params when detecting indexParamPrefix if path.Base(p) == storage.IndexParamsFile { indexCodec := storage.NewIndexCodec() - _, indexParams, _, _, err = indexCodec.Deserialize([]*storage.Blob{ + _, indexParams, indexName, indexID, err = indexCodec.Deserialize([]*storage.Blob{ { Key: storage.IndexParamsFile, Value: []byte(indexPiece), }, }) if err != nil { - return nil, nil, err + return nil, nil, "", -1, err } } else { index = append(index, []byte(indexPiece)) @@ -245,9 +256,9 @@ func (s *loadService) loadIndex(indexPath []string) ([][]byte, indexParam, error } if len(indexParams) <= 0 { - return nil, nil, errors.New("cannot find index param") + return nil, nil, "", -1, errors.New("cannot find index param") } - return index, indexParams, nil + return index, indexParams, indexName, indexID, nil } func (s *loadService) updateSegmentIndex(indexParams indexParam, bytesIndex [][]byte, l *loadIndex) error { diff --git a/internal/querynode/query_node.go b/internal/querynode/query_node.go index e9affb886e..191dab46e1 100644 --- a/internal/querynode/query_node.go +++ b/internal/querynode/query_node.go @@ -38,6 +38,7 @@ type Node interface { WatchDmChannels(in *queryPb.WatchDmChannelsRequest) (*commonpb.Status, error) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.Status, error) ReleaseSegments(in *queryPb.ReleaseSegmentRequest) (*commonpb.Status, error) + GetSegmentInfo(in *queryPb.SegmentInfoRequest) (*queryPb.SegmentInfoResponse, error) } type QueryService = typeutil.QueryServiceInterface @@ -498,3 +499,29 @@ func (node *QueryNode) ReleaseSegments(in *queryPb.ReleaseSegmentRequest) (*comm ErrorCode: commonpb.ErrorCode_SUCCESS, }, nil } + +func (node *QueryNode) GetSegmentInfo(in *queryPb.SegmentInfoRequest) (*queryPb.SegmentInfoResponse, error) { + infos := make([]*queryPb.SegmentInfo, 0) + for _, id := range in.SegmentIDs { + segment, err := node.replica.getSegmentByID(id) + if err != nil { + continue + } + info := &queryPb.SegmentInfo{ + SegmentID: segment.ID(), + CollectionID: segment.collectionID, + PartitionID: segment.partitionID, + MemSize: segment.getMemSize(), + NumRows: segment.getRowCount(), + IndexName: segment.getIndexName(), + IndexID: segment.getIndexID(), + } + infos = append(infos, info) + } + return &queryPb.SegmentInfoResponse{ + Status: &commonpb.Status{ + ErrorCode: commonpb.ErrorCode_SUCCESS, + }, + Infos: infos, + }, nil +} diff --git a/internal/querynode/segment.go b/internal/querynode/segment.go index 924c66d3e1..17177ade73 100644 --- a/internal/querynode/segment.go +++ b/internal/querynode/segment.go @@ -47,8 +47,10 @@ type Segment struct { typeMu sync.Mutex // guards builtIndex segmentType C.SegmentType - paramMutex sync.RWMutex // guards indexParam + paramMutex sync.RWMutex // guards index indexParam map[int64]indexParam + indexName string + indexID UniqueID } //-------------------------------------------------------------------------------------- common interfaces @@ -68,6 +70,30 @@ func (s *Segment) getRecentlyModified() bool { return s.recentlyModified } +func (s *Segment) setIndexName(name string) { + s.rmMutex.Lock() + defer s.rmMutex.Unlock() + s.indexName = name +} + +func (s *Segment) getIndexName() string { + s.rmMutex.Lock() + defer s.rmMutex.Unlock() + return s.indexName +} + +func (s *Segment) setIndexID(id UniqueID) { + s.rmMutex.Lock() + defer s.rmMutex.Unlock() + s.indexID = id +} + +func (s *Segment) getIndexID() UniqueID { + s.rmMutex.Lock() + defer s.rmMutex.Unlock() + return s.indexID +} + func (s *Segment) setType(segType segmentType) { s.typeMu.Lock() defer s.typeMu.Unlock() diff --git a/internal/queryservice/querynode.go b/internal/queryservice/querynode.go index 1832b2eab2..bc43fa7c03 100644 --- a/internal/queryservice/querynode.go +++ b/internal/queryservice/querynode.go @@ -21,3 +21,7 @@ func (qn *queryNodeInfo) GetComponentStates() (*internalpb2.ComponentStates, err func (qn *queryNodeInfo) LoadSegments(in *querypb.LoadSegmentRequest) (*commonpb.Status, error) { return qn.client.LoadSegments(in) } + +func (qn *queryNodeInfo) GetSegmentInfo(in *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + return qn.client.GetSegmentInfo(in) +} diff --git a/internal/queryservice/queryservice.go b/internal/queryservice/queryservice.go index eacadf6b73..01b60046b1 100644 --- a/internal/queryservice/queryservice.go +++ b/internal/queryservice/queryservice.go @@ -35,6 +35,7 @@ type QueryNodeInterface interface { WatchDmChannels(in *querypb.WatchDmChannelsRequest) (*commonpb.Status, error) LoadSegments(in *querypb.LoadSegmentRequest) (*commonpb.Status, error) ReleaseSegments(in *querypb.ReleaseSegmentRequest) (*commonpb.Status, error) + GetSegmentInfo(req *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) } type QueryService struct { @@ -462,6 +463,28 @@ func (qs *QueryService) GetPartitionStates(req *querypb.PartitionStatesRequest) }, nil } +func (qs *QueryService) GetSegmentInfo(req *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) { + segmentInfos := make([]*querypb.SegmentInfo, 0) + for _, node := range qs.queryNodes { + segmentInfo, err := node.client.GetSegmentInfo(req) + if err != nil { + return &querypb.SegmentInfoResponse{ + Status: &commonpb.Status{ + ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR, + Reason: err.Error(), + }, + }, err + } + segmentInfos = append(segmentInfos, segmentInfo.Infos...) + } + return &querypb.SegmentInfoResponse{ + Status: &commonpb.Status{ + ErrorCode: commonpb.ErrorCode_SUCCESS, + }, + Infos: segmentInfos, + }, nil +} + func NewQueryService(ctx context.Context) (*QueryService, error) { nodes := make([]*queryNodeInfo, 0) ctx1, cancel := context.WithCancel(ctx) diff --git a/internal/util/typeutil/interface.go b/internal/util/typeutil/interface.go index b473f08903..2116a9e09b 100644 --- a/internal/util/typeutil/interface.go +++ b/internal/util/typeutil/interface.go @@ -48,4 +48,5 @@ type QueryServiceInterface interface { ReleasePartitions(req *querypb.ReleasePartitionRequest) (*commonpb.Status, error) CreateQueryChannel() (*querypb.CreateQueryChannelResponse, error) GetPartitionStates(req *querypb.PartitionStatesRequest) (*querypb.PartitionStatesResponse, error) + GetSegmentInfo(req *querypb.SegmentInfoRequest) (*querypb.SegmentInfoResponse, error) }