diff --git a/docs/developer_guides/chap01_system_overview.md b/docs/developer_guides/chap01_system_overview.md index e0e2923a16c3915e408f32051c6134c4b9776dcc..e5d648253821576cf03ac9dada6040c6568c6970 100644 --- a/docs/developer_guides/chap01_system_overview.md +++ b/docs/developer_guides/chap01_system_overview.md @@ -78,9 +78,9 @@ In order to boost throughput, we model Milvus as a stream-driven system. ```go type Component interface { - Init() - Start() - Stop() + Init() error + Start() error + Stop() error GetComponentStates() (ComponentStates, error) GetTimeTickChannel() (string, error) GetStatisticsChannel() (string, error) diff --git a/internal/distributed/datanode/client.go b/internal/distributed/datanode/client.go index a8480b6cbe93771a573e81429d785afdc469f73a..1bdfcc492c5699e4e674f0f1f58fcd95ad4f0a8e 100644 --- a/internal/distributed/datanode/client.go +++ b/internal/distributed/datanode/client.go @@ -11,15 +11,15 @@ type Client struct { // GOOSE TODO: add DataNodeClient } -func (c *Client) Init() { +func (c *Client) Init() error { panic("implement me") } -func (c *Client) Start() { +func (c *Client) Start() error { panic("implement me") } -func (c *Client) Stop() { +func (c *Client) Stop() error { panic("implement me") } diff --git a/internal/distributed/indexservice/client/client.go b/internal/distributed/indexservice/client/client.go index 816887c0a2497125bd7b50173ed9f67f4f305352..e245ecd330a1e07efa6e412790f709c456502803 100644 --- a/internal/distributed/indexservice/client/client.go +++ b/internal/distributed/indexservice/client/client.go @@ -34,7 +34,7 @@ func (g Client) GetIndexStates(req *indexpb.IndexStatesRequest) (*indexpb.IndexS return g.grpcClient.GetIndexStates(ctx, req) } -func (g Client) GetIndexFilePaths(req *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error) { +func (g Client) GetIndexFilePaths(req *indexpb.IndexFilePathRequest) (*indexpb.IndexFilePathsResponse, error) { ctx := context.TODO() diff --git a/internal/distributed/indexservice/service.go b/internal/distributed/indexservice/service.go index 37f9f2646cdce9ae362eb605625dbbec9192d77d..5451595a380eda6dea4e538b2f71dcf7c9e227c6 100644 --- a/internal/distributed/indexservice/service.go +++ b/internal/distributed/indexservice/service.go @@ -28,8 +28,9 @@ type Server struct { loopWg sync.WaitGroup } -func (s *Server) Init() { +func (s *Server) Init() error { indexservice.Params.Init() + return nil } func (s *Server) Start() error { @@ -37,8 +38,9 @@ func (s *Server) Start() error { return s.startIndexServer() } -func (s *Server) Stop() { +func (s *Server) Stop() error { s.loopWg.Wait() + return nil } func (s *Server) GetComponentStates() (*internalpb2.ComponentStates, error) { @@ -69,7 +71,7 @@ func (s *Server) GetIndexStates(ctx context.Context, req *indexpb.IndexStatesReq return s.server.GetIndexStates(req) } -func (s *Server) GetIndexFilePaths(ctx context.Context, req *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error) { +func (s *Server) GetIndexFilePaths(ctx context.Context, req *indexpb.IndexFilePathRequest) (*indexpb.IndexFilePathsResponse, error) { return s.server.GetIndexFilePaths(req) } diff --git a/internal/distributed/querynode/client.go b/internal/distributed/querynode/client.go index 6a0672f8a35ace09a15f1c58c0491f597280e60c..0b0e0bb13ee2b10b9680b97828537ee613ae5309 100644 --- a/internal/distributed/querynode/client.go +++ b/internal/distributed/querynode/client.go @@ -13,15 +13,15 @@ type Client struct { grpcClient querypb.QueryNodeClient } -func (c *Client) Init() { +func (c *Client) Init() error { panic("implement me") } -func (c *Client) Start() { +func (c *Client) Start() error { panic("implement me") } -func (c *Client) Stop() { +func (c *Client) Stop() error { panic("implement me") } diff --git a/internal/distributed/queryservice/client.go b/internal/distributed/queryservice/client.go index 3609e5670ada7269046cada1ccfa031fd50ca2b6..64238f4bf649cab6d49a85beba468734aa0fb236 100644 --- a/internal/distributed/queryservice/client.go +++ b/internal/distributed/queryservice/client.go @@ -9,15 +9,15 @@ type Client struct { grpcClient querypb.QueryServiceClient } -func (c *Client) Init() { +func (c *Client) Init() error { panic("implement me") } -func (c *Client) Start() { +func (c *Client) Start() error { panic("implement me") } -func (c *Client) Stop() { +func (c *Client) Stop() error { panic("implement me") } diff --git a/internal/distributed/queryservice/service.go b/internal/distributed/queryservice/service.go index 9551886bfc5ac4891367e37193c1bac0e6171837..0c3c258061ced46359a8dfb06d37701d35d6ad2a 100644 --- a/internal/distributed/queryservice/service.go +++ b/internal/distributed/queryservice/service.go @@ -13,15 +13,15 @@ type Server struct { queryService queryServiceImpl.Interface } -func (s *Server) Init() { +func (s *Server) Init() error { panic("implement me") } -func (s *Server) Start() { +func (s *Server) Start() error { panic("implement me") } -func (s *Server) Stop() { +func (s *Server) Stop() error { panic("implement me") } diff --git a/internal/indexnode/client/client.go b/internal/indexnode/client/client.go index 6cd98e9abc219a9509ba3566977b363191258d90..09c35ac0c2e0015c26bf00aa362861b259350a89 100644 --- a/internal/indexnode/client/client.go +++ b/internal/indexnode/client/client.go @@ -133,13 +133,13 @@ func (c *Client) GetIndexStates(indexIDs []UniqueID) (*indexpb.IndexStatesRespon return response, err } -func (c *Client) GetIndexFilePaths(indexIDs []UniqueID) ([][]string, error) { +func (c *Client) GetIndexFilePaths(indexID UniqueID) ([]string, error) { if c.tryConnect() != nil { panic("GetIndexFilePaths: failed to connect index builder") } ctx := context.TODO() - request := &indexpb.IndexFilePathsRequest{ - IndexIDs: indexIDs, + request := &indexpb.IndexFilePathRequest{ + IndexID: indexID, } response, err := c.client.GetIndexFilePaths(ctx, request) @@ -147,15 +147,5 @@ func (c *Client) GetIndexFilePaths(indexIDs []UniqueID) ([][]string, error) { return nil, err } - var filePaths [][]string - for _, indexID := range indexIDs { - for _, filePathInfo := range response.FilePaths { - if indexID == filePathInfo.IndexID { - filePaths = append(filePaths, filePathInfo.IndexFilePaths) - break - } - } - } - - return filePaths, nil + return response.IndexFilePaths, nil } diff --git a/internal/indexnode/grpc_service.go b/internal/indexnode/grpc_service.go index abd54d4eb07c3302a0a88ce948b532f8e9a022ab..e5753be9f67811ae8cca6a07bfb00c56a1b05feb 100644 --- a/internal/indexnode/grpc_service.go +++ b/internal/indexnode/grpc_service.go @@ -74,25 +74,16 @@ func (b *Builder) GetIndexStates(ctx context.Context, request *indexpb.IndexStat return ret, nil } -func (b *Builder) GetIndexFilePaths(ctx context.Context, request *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error) { +func (b *Builder) GetIndexFilePaths(ctx context.Context, request *indexpb.IndexFilePathRequest) (*indexpb.IndexFilePathsResponse, error) { ret := &indexpb.IndexFilePathsResponse{ - Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, + Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, + IndexID: request.IndexID, } - var filePathInfos []*indexpb.IndexFilePathInfo - for _, indexID := range request.IndexIDs { - filePathInfo := &indexpb.IndexFilePathInfo{ - Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, - IndexID: indexID, - } - - filePaths, err := b.metaTable.GetIndexFilePaths(indexID) - if err != nil { - filePathInfo.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR - filePathInfo.Status.Reason = err.Error() - } - filePathInfo.IndexFilePaths = filePaths - filePathInfos = append(filePathInfos, filePathInfo) + filePaths, err := b.metaTable.GetIndexFilePaths(request.IndexID) + if err != nil { + ret.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR + ret.Status.Reason = err.Error() } - ret.FilePaths = filePathInfos + ret.IndexFilePaths = filePaths return ret, nil } diff --git a/internal/indexnode/indexnode.go b/internal/indexnode/indexnode.go index 01644c8cad64abfb7226bc8f1a918a711fc3427c..b3e9a189961f17722fec47e56a5059c6682e4862 100644 --- a/internal/indexnode/indexnode.go +++ b/internal/indexnode/indexnode.go @@ -45,15 +45,15 @@ type IndexNode struct { //serviceClient indexservice.Interface // method factory } -func (i *IndexNode) Init() { +func (i *IndexNode) Init() error { panic("implement me") } -func (i *IndexNode) Start() { +func (i *IndexNode) Start() error { panic("implement me") } -func (i *IndexNode) Stop() { +func (i *IndexNode) Stop() error { panic("implement me") } diff --git a/internal/indexnode/indexnode_test.go b/internal/indexnode/indexnode_test.go index 5ffc5a533c52b8fcad0052de3108e32fdda6767b..5a8d5b8bd8e6633434680ca5c983ca1f3f10802a 100644 --- a/internal/indexnode/indexnode_test.go +++ b/internal/indexnode/indexnode_test.go @@ -124,7 +124,8 @@ func TestBuilder_GRPC(t *testing.T) { assert.Equal(t, commonpb.IndexState_INPROGRESS, description.States[0].State) assert.Equal(t, indexID, description.States[0].IndexID) - indexDataPaths, err := buildClient.GetIndexFilePaths([]UniqueID{indexID}) + indexDataPaths, err := buildClient.GetIndexFilePaths(indexID) assert.Nil(t, err) - assert.Nil(t, indexDataPaths[0]) + assert.Nil(t, indexDataPaths) + } diff --git a/internal/indexservice/indexservice.go b/internal/indexservice/indexservice.go index 2a15ffe02294a6259a9bc8da4d88373b13387d67..7c0f8363671ec5c33b89c45403b1ca68755fc6a6 100644 --- a/internal/indexservice/indexservice.go +++ b/internal/indexservice/indexservice.go @@ -46,15 +46,15 @@ type IndexService struct { type UniqueID = typeutil.UniqueID type Timestamp = typeutil.Timestamp -func (i *IndexService) Init() { +func (i *IndexService) Init() error { panic("implement me") } -func (i *IndexService) Start() { +func (i *IndexService) Start() error { panic("implement me") } -func (i *IndexService) Stop() { +func (i *IndexService) Stop() error { panic("implement me") } @@ -149,7 +149,7 @@ func (i *IndexService) GetIndexStates(req *indexpb.IndexStatesRequest) (*indexpb return ret, nil } -func (i *IndexService) GetIndexFilePaths(req *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error) { +func (i *IndexService) GetIndexFilePaths(req *indexpb.IndexFilePathRequest) (*indexpb.IndexFilePathsResponse, error) { panic("implement me") } diff --git a/internal/indexservice/interface.go b/internal/indexservice/interface.go index 9f6ec2cbccf75619c4599dfbf898dcb3797a5b29..ba62d22e35924c44f8af5d001cab3477c5c6505f 100644 --- a/internal/indexservice/interface.go +++ b/internal/indexservice/interface.go @@ -13,6 +13,6 @@ type Interface interface { RegisterNode(req *indexpb.RegisterNodeRequest) (*indexpb.RegisterNodeResponse, error) BuildIndex(req *indexpb.BuildIndexRequest) (*indexpb.BuildIndexResponse, error) GetIndexStates(req *indexpb.IndexStatesRequest) (*indexpb.IndexStatesResponse, error) - GetIndexFilePaths(req *indexpb.IndexFilePathsRequest) (*indexpb.IndexFilePathsResponse, error) + GetIndexFilePaths(req *indexpb.IndexFilePathRequest) (*indexpb.IndexFilePathsResponse, error) NotifyBuildIndex(nty *indexpb.BuildIndexNotification) (*commonpb.Status, error) } diff --git a/internal/master/client.go b/internal/master/client.go index 169145302ce97636d4043e513a2c2b3bc586dcdc..9851210405c02d86ca867fe132d5b5fe98aa683f 100644 --- a/internal/master/client.go +++ b/internal/master/client.go @@ -65,7 +65,7 @@ func (m *MockWriteNodeClient) GetInsertBinlogPaths(segmentID UniqueID) (map[Uniq type BuildIndexClient interface { BuildIndex(columnDataPaths []string, typeParams map[string]string, indexParams map[string]string) (UniqueID, error) GetIndexStates(indexIDs []UniqueID) (*indexpb.IndexStatesResponse, error) - GetIndexFilePaths(indexID []UniqueID) ([][]string, error) + GetIndexFilePaths(indexID UniqueID) ([]string, error) } type MockBuildIndexClient struct { @@ -107,8 +107,8 @@ func (m *MockBuildIndexClient) GetIndexStates(indexIDs []UniqueID) (*indexpb.Ind return ret, nil } -func (m *MockBuildIndexClient) GetIndexFilePaths(indexIDs []UniqueID) ([][]string, error) { - return [][]string{{"/binlog/index/file_1", "/binlog/index/file_2", "/binlog/index/file_3"}}, nil +func (m *MockBuildIndexClient) GetIndexFilePaths(indexID UniqueID) ([]string, error) { + return []string{"/binlog/index/file_1", "/binlog/index/file_2", "/binlog/index/file_3"}, nil } type LoadIndexClient interface { diff --git a/internal/master/index_builder_scheduler.go b/internal/master/index_builder_scheduler.go index 450821d46adc1249909c3e763d9b60c7384973e4..9a067c070f0d90dffd2898915dd0708955566746 100644 --- a/internal/master/index_builder_scheduler.go +++ b/internal/master/index_builder_scheduler.go @@ -116,11 +116,10 @@ func (scheduler *IndexBuildScheduler) describe() error { } if description.States[0].State == commonpb.IndexState_FINISHED { log.Printf("build index for segment %d field %d is finished", indexBuildInfo.segmentID, indexBuildInfo.fieldID) - filesPaths, err := scheduler.client.GetIndexFilePaths([]UniqueID{indexID}) + filePaths, err := scheduler.client.GetIndexFilePaths(indexID) if err != nil { return err } - filePaths := filesPaths[0] //TODO: remove fileName var fieldName string diff --git a/internal/proto/index_service.proto b/internal/proto/index_service.proto index 7710f018eb8e1a9677cc13501635a4bba60780fd..b95d738b1d258542a292030eef50415f5f70c3e9 100644 --- a/internal/proto/index_service.proto +++ b/internal/proto/index_service.proto @@ -34,9 +34,9 @@ message IndexStatesResponse { } message BuildIndexRequest { - repeated string data_paths = 1; - repeated common.KeyValuePair type_params = 2; - repeated common.KeyValuePair index_params = 3; + repeated string data_paths = 2; + repeated common.KeyValuePair type_params = 3; + repeated common.KeyValuePair index_params = 4; } message BuildIndexResponse { @@ -56,21 +56,16 @@ message BuildIndexNotification { repeated string index_file_paths = 3; } -message IndexFilePathsRequest { - repeated int64 indexIDs = 1; +message IndexFilePathRequest { + int64 indexID = 1; } -message IndexFilePathInfo { +message IndexFilePathsResponse { common.Status status = 1; int64 indexID = 2; repeated string index_file_paths = 3; } -message IndexFilePathsResponse { - common.Status status = 1; - repeated IndexFilePathInfo file_paths = 2; -} - message IndexMeta { common.IndexState state = 1; int64 indexID = 2; @@ -93,7 +88,7 @@ service IndexService { rpc RegisterNode(RegisterNodeRequest) returns (RegisterNodeResponse) {} rpc BuildIndex(BuildIndexRequest) returns (BuildIndexResponse){} rpc GetIndexStates(IndexStatesRequest) returns (IndexStatesResponse) {} - rpc GetIndexFilePaths(IndexFilePathsRequest) returns (IndexFilePathsResponse){} + rpc GetIndexFilePaths(IndexFilePathRequest) returns (IndexFilePathsResponse){} rpc NotifyBuildIndex(BuildIndexNotification) returns (common.Status) {} } diff --git a/internal/proto/indexpb/index_service.pb.go b/internal/proto/indexpb/index_service.pb.go index aeb4c820b196ef1f50a67f11a5e518c80a3dbe0e..af51c4608fe78f42a450d351d626f69976583b44 100644 --- a/internal/proto/indexpb/index_service.pb.go +++ b/internal/proto/indexpb/index_service.pb.go @@ -262,9 +262,9 @@ func (m *IndexStatesResponse) GetStates() []*IndexInfo { } type BuildIndexRequest struct { - DataPaths []string `protobuf:"bytes,1,rep,name=data_paths,json=dataPaths,proto3" json:"data_paths,omitempty"` - TypeParams []*commonpb.KeyValuePair `protobuf:"bytes,2,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"` - IndexParams []*commonpb.KeyValuePair `protobuf:"bytes,3,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` + DataPaths []string `protobuf:"bytes,2,rep,name=data_paths,json=dataPaths,proto3" json:"data_paths,omitempty"` + TypeParams []*commonpb.KeyValuePair `protobuf:"bytes,3,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"` + IndexParams []*commonpb.KeyValuePair `protobuf:"bytes,4,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -465,46 +465,46 @@ func (m *BuildIndexNotification) GetIndexFilePaths() []string { return nil } -type IndexFilePathsRequest struct { - IndexIDs []int64 `protobuf:"varint,1,rep,packed,name=indexIDs,proto3" json:"indexIDs,omitempty"` +type IndexFilePathRequest struct { + IndexID int64 `protobuf:"varint,1,opt,name=indexID,proto3" json:"indexID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *IndexFilePathsRequest) Reset() { *m = IndexFilePathsRequest{} } -func (m *IndexFilePathsRequest) String() string { return proto.CompactTextString(m) } -func (*IndexFilePathsRequest) ProtoMessage() {} -func (*IndexFilePathsRequest) Descriptor() ([]byte, []int) { +func (m *IndexFilePathRequest) Reset() { *m = IndexFilePathRequest{} } +func (m *IndexFilePathRequest) String() string { return proto.CompactTextString(m) } +func (*IndexFilePathRequest) ProtoMessage() {} +func (*IndexFilePathRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a5d2036b4df73e0a, []int{9} } -func (m *IndexFilePathsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexFilePathsRequest.Unmarshal(m, b) +func (m *IndexFilePathRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IndexFilePathRequest.Unmarshal(m, b) } -func (m *IndexFilePathsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexFilePathsRequest.Marshal(b, m, deterministic) +func (m *IndexFilePathRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IndexFilePathRequest.Marshal(b, m, deterministic) } -func (m *IndexFilePathsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexFilePathsRequest.Merge(m, src) +func (m *IndexFilePathRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexFilePathRequest.Merge(m, src) } -func (m *IndexFilePathsRequest) XXX_Size() int { - return xxx_messageInfo_IndexFilePathsRequest.Size(m) +func (m *IndexFilePathRequest) XXX_Size() int { + return xxx_messageInfo_IndexFilePathRequest.Size(m) } -func (m *IndexFilePathsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IndexFilePathsRequest.DiscardUnknown(m) +func (m *IndexFilePathRequest) XXX_DiscardUnknown() { + xxx_messageInfo_IndexFilePathRequest.DiscardUnknown(m) } -var xxx_messageInfo_IndexFilePathsRequest proto.InternalMessageInfo +var xxx_messageInfo_IndexFilePathRequest proto.InternalMessageInfo -func (m *IndexFilePathsRequest) GetIndexIDs() []int64 { +func (m *IndexFilePathRequest) GetIndexID() int64 { if m != nil { - return m.IndexIDs + return m.IndexID } - return nil + return 0 } -type IndexFilePathInfo struct { +type IndexFilePathsResponse struct { Status *commonpb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` IndexID int64 `protobuf:"varint,2,opt,name=indexID,proto3" json:"indexID,omitempty"` IndexFilePaths []string `protobuf:"bytes,3,rep,name=index_file_paths,json=indexFilePaths,proto3" json:"index_file_paths,omitempty"` @@ -513,65 +513,11 @@ type IndexFilePathInfo struct { XXX_sizecache int32 `json:"-"` } -func (m *IndexFilePathInfo) Reset() { *m = IndexFilePathInfo{} } -func (m *IndexFilePathInfo) String() string { return proto.CompactTextString(m) } -func (*IndexFilePathInfo) ProtoMessage() {} -func (*IndexFilePathInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d2036b4df73e0a, []int{10} -} - -func (m *IndexFilePathInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IndexFilePathInfo.Unmarshal(m, b) -} -func (m *IndexFilePathInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IndexFilePathInfo.Marshal(b, m, deterministic) -} -func (m *IndexFilePathInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_IndexFilePathInfo.Merge(m, src) -} -func (m *IndexFilePathInfo) XXX_Size() int { - return xxx_messageInfo_IndexFilePathInfo.Size(m) -} -func (m *IndexFilePathInfo) XXX_DiscardUnknown() { - xxx_messageInfo_IndexFilePathInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_IndexFilePathInfo proto.InternalMessageInfo - -func (m *IndexFilePathInfo) GetStatus() *commonpb.Status { - if m != nil { - return m.Status - } - return nil -} - -func (m *IndexFilePathInfo) GetIndexID() int64 { - if m != nil { - return m.IndexID - } - return 0 -} - -func (m *IndexFilePathInfo) GetIndexFilePaths() []string { - if m != nil { - return m.IndexFilePaths - } - return nil -} - -type IndexFilePathsResponse struct { - Status *commonpb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - FilePaths []*IndexFilePathInfo `protobuf:"bytes,2,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - func (m *IndexFilePathsResponse) Reset() { *m = IndexFilePathsResponse{} } func (m *IndexFilePathsResponse) String() string { return proto.CompactTextString(m) } func (*IndexFilePathsResponse) ProtoMessage() {} func (*IndexFilePathsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d2036b4df73e0a, []int{11} + return fileDescriptor_a5d2036b4df73e0a, []int{10} } func (m *IndexFilePathsResponse) XXX_Unmarshal(b []byte) error { @@ -599,9 +545,16 @@ func (m *IndexFilePathsResponse) GetStatus() *commonpb.Status { return nil } -func (m *IndexFilePathsResponse) GetFilePaths() []*IndexFilePathInfo { +func (m *IndexFilePathsResponse) GetIndexID() int64 { if m != nil { - return m.FilePaths + return m.IndexID + } + return 0 +} + +func (m *IndexFilePathsResponse) GetIndexFilePaths() []string { + if m != nil { + return m.IndexFilePaths } return nil } @@ -623,7 +576,7 @@ func (m *IndexMeta) Reset() { *m = IndexMeta{} } func (m *IndexMeta) String() string { return proto.CompactTextString(m) } func (*IndexMeta) ProtoMessage() {} func (*IndexMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d2036b4df73e0a, []int{12} + return fileDescriptor_a5d2036b4df73e0a, []int{11} } func (m *IndexMeta) XXX_Unmarshal(b []byte) error { @@ -703,8 +656,7 @@ func init() { proto.RegisterType((*BuildIndexResponse)(nil), "milvus.proto.index.BuildIndexResponse") proto.RegisterType((*BuildIndexCmd)(nil), "milvus.proto.index.BuildIndexCmd") proto.RegisterType((*BuildIndexNotification)(nil), "milvus.proto.index.BuildIndexNotification") - proto.RegisterType((*IndexFilePathsRequest)(nil), "milvus.proto.index.IndexFilePathsRequest") - proto.RegisterType((*IndexFilePathInfo)(nil), "milvus.proto.index.IndexFilePathInfo") + proto.RegisterType((*IndexFilePathRequest)(nil), "milvus.proto.index.IndexFilePathRequest") proto.RegisterType((*IndexFilePathsResponse)(nil), "milvus.proto.index.IndexFilePathsResponse") proto.RegisterType((*IndexMeta)(nil), "milvus.proto.index.IndexMeta") } @@ -712,57 +664,55 @@ func init() { func init() { proto.RegisterFile("index_service.proto", fileDescriptor_a5d2036b4df73e0a) } var fileDescriptor_a5d2036b4df73e0a = []byte{ - // 793 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x5d, 0x4f, 0xe3, 0x46, - 0x14, 0xc5, 0x18, 0x42, 0x73, 0x13, 0x22, 0x32, 0x69, 0x51, 0x94, 0x16, 0x15, 0x5c, 0x01, 0x29, - 0x52, 0x9d, 0x2a, 0x88, 0xf6, 0xb1, 0x22, 0xa0, 0x56, 0x51, 0x05, 0x42, 0xd3, 0xaa, 0x0f, 0xad, - 0xaa, 0xc8, 0xb1, 0x6f, 0xc8, 0x48, 0xfe, 0x08, 0x9e, 0x31, 0x5a, 0x78, 0x59, 0xad, 0xb4, 0x8f, - 0x2b, 0xad, 0x56, 0xfb, 0x53, 0xf6, 0x75, 0x7f, 0xdc, 0xca, 0xe3, 0xb1, 0x63, 0x43, 0x48, 0x58, - 0x81, 0xb4, 0x6f, 0x99, 0xeb, 0x73, 0x3f, 0xe6, 0x9c, 0x33, 0x33, 0x81, 0x06, 0xf3, 0x1d, 0x7c, - 0x31, 0xe0, 0x18, 0x5e, 0x33, 0x1b, 0xcd, 0x49, 0x18, 0x88, 0x80, 0x10, 0x8f, 0xb9, 0xd7, 0x11, - 0x4f, 0x56, 0xa6, 0x44, 0xb4, 0xaa, 0x76, 0xe0, 0x79, 0x81, 0x9f, 0xc4, 0x5a, 0x35, 0xe6, 0x0b, - 0x0c, 0x7d, 0xcb, 0x4d, 0xd6, 0xc6, 0x4b, 0x68, 0x50, 0xbc, 0x64, 0x5c, 0x60, 0x78, 0x1e, 0x38, - 0x48, 0xf1, 0x2a, 0x42, 0x2e, 0xc8, 0xcf, 0xb0, 0x32, 0xb4, 0x38, 0x36, 0xb5, 0x6d, 0xad, 0x5d, - 0xe9, 0x7e, 0x67, 0x16, 0xea, 0xaa, 0x82, 0x67, 0xfc, 0xb2, 0x67, 0x71, 0xa4, 0x12, 0x49, 0x7e, - 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, 0x76, 0xe6, 0x77, 0x39, 0xf1, 0x9c, 0x05, 0xc5, 0x7b, 0xc7, 0xff, - 0xfe, 0x76, 0xc9, 0xc4, 0x38, 0x1a, 0xc6, 0x5f, 0x3a, 0xb7, 0xcc, 0x75, 0xd9, 0xad, 0x40, 0x7b, - 0xdc, 0x49, 0xb2, 0x7e, 0x72, 0x18, 0x17, 0x21, 0x1b, 0x46, 0x02, 0x9d, 0x4e, 0xfa, 0x2f, 0xa4, - 0x23, 0x4b, 0x75, 0x64, 0xb7, 0xc9, 0x70, 0x58, 0x92, 0xcb, 0xc3, 0x4f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x10, 0x1a, 0x0a, 0xe9, 0xdf, 0x09, 0x00, 0x00, + // 757 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x5d, 0x4f, 0xdb, 0x4a, + 0x10, 0xc5, 0x38, 0x04, 0x65, 0x12, 0x22, 0xd8, 0x20, 0x14, 0xe5, 0x5e, 0x74, 0xc1, 0x57, 0x17, + 0x22, 0xa4, 0xeb, 0xa0, 0x20, 0xda, 0xc7, 0x8a, 0x80, 0x5a, 0x45, 0x15, 0x08, 0xb9, 0x55, 0x1f, + 0x5a, 0x55, 0x91, 0x63, 0x0f, 0x64, 0x55, 0x7f, 0x04, 0xef, 0x1a, 0x15, 0x5e, 0xaa, 0xaa, 0x3f, + 0xa0, 0xea, 0x6f, 0xe9, 0x6b, 0x7f, 0x5c, 0xe5, 0xdd, 0x75, 0x12, 0x83, 0x49, 0x40, 0xd0, 0x37, + 0xef, 0xee, 0x99, 0x33, 0xb3, 0xe7, 0xcc, 0xac, 0xa1, 0x46, 0x03, 0x17, 0x3f, 0xf7, 0x18, 0x46, + 0x97, 0xd4, 0x41, 0x73, 0x18, 0x85, 0x3c, 0x24, 0xc4, 0xa7, 0xde, 0x65, 0xcc, 0xe4, 0xca, 0x14, + 0x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0x46, 0xb0, 0x65, 0xf1, 0x56, 0x5c, 0x4d, 0xc8, 0xb6, 0x33, 0x5d, + 0x8f, 0xc9, 0xb7, 0xa5, 0x31, 0x6d, 0x0a, 0x8d, 0xb9, 0xf6, 0x07, 0x35, 0x3a, 0xc2, 0xf1, 0x93, + 0x8c, 0x39, 0x9b, 0xd3, 0xb3, 0x1c, 0xfa, 0xee, 0x0c, 0xf2, 0xce, 0xc1, 0xfb, 0x17, 0xe7, 0x94, + 0x0f, 0xe2, 0x7e, 0x72, 0xd2, 0xba, 0xa6, 0x9e, 0x47, 0xaf, 0x39, 0x3a, 0x83, 0x96, 0x8c, 0xfa, + 0xdf, 0xa5, 0x8c, 0x47, 0xb4, 0x1f, 0x73, 0x74, 0x5b, 0xe9, 0x0f, 0xbf, 0x25, 0xa8, 0x5a, 0x22, + 0xdb, 0xb0, 0xdf, 0x2f, 0x8a, 0xe5, 0xde, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x32, 0xc8, + 0x07, 0x4a, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -786,7 +736,7 @@ type IndexServiceClient interface { RegisterNode(ctx context.Context, in *RegisterNodeRequest, opts ...grpc.CallOption) (*RegisterNodeResponse, error) BuildIndex(ctx context.Context, in *BuildIndexRequest, opts ...grpc.CallOption) (*BuildIndexResponse, error) GetIndexStates(ctx context.Context, in *IndexStatesRequest, opts ...grpc.CallOption) (*IndexStatesResponse, error) - GetIndexFilePaths(ctx context.Context, in *IndexFilePathsRequest, opts ...grpc.CallOption) (*IndexFilePathsResponse, error) + GetIndexFilePaths(ctx context.Context, in *IndexFilePathRequest, opts ...grpc.CallOption) (*IndexFilePathsResponse, error) NotifyBuildIndex(ctx context.Context, in *BuildIndexNotification, opts ...grpc.CallOption) (*commonpb.Status, error) } @@ -825,7 +775,7 @@ func (c *indexServiceClient) GetIndexStates(ctx context.Context, in *IndexStates return out, nil } -func (c *indexServiceClient) GetIndexFilePaths(ctx context.Context, in *IndexFilePathsRequest, opts ...grpc.CallOption) (*IndexFilePathsResponse, error) { +func (c *indexServiceClient) GetIndexFilePaths(ctx context.Context, in *IndexFilePathRequest, opts ...grpc.CallOption) (*IndexFilePathsResponse, error) { out := new(IndexFilePathsResponse) err := c.cc.Invoke(ctx, "/milvus.proto.index.IndexService/GetIndexFilePaths", in, out, opts...) if err != nil { @@ -854,7 +804,7 @@ type IndexServiceServer interface { RegisterNode(context.Context, *RegisterNodeRequest) (*RegisterNodeResponse, error) BuildIndex(context.Context, *BuildIndexRequest) (*BuildIndexResponse, error) GetIndexStates(context.Context, *IndexStatesRequest) (*IndexStatesResponse, error) - GetIndexFilePaths(context.Context, *IndexFilePathsRequest) (*IndexFilePathsResponse, error) + GetIndexFilePaths(context.Context, *IndexFilePathRequest) (*IndexFilePathsResponse, error) NotifyBuildIndex(context.Context, *BuildIndexNotification) (*commonpb.Status, error) } @@ -871,7 +821,7 @@ func (*UnimplementedIndexServiceServer) BuildIndex(ctx context.Context, req *Bui func (*UnimplementedIndexServiceServer) GetIndexStates(ctx context.Context, req *IndexStatesRequest) (*IndexStatesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetIndexStates not implemented") } -func (*UnimplementedIndexServiceServer) GetIndexFilePaths(ctx context.Context, req *IndexFilePathsRequest) (*IndexFilePathsResponse, error) { +func (*UnimplementedIndexServiceServer) GetIndexFilePaths(ctx context.Context, req *IndexFilePathRequest) (*IndexFilePathsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetIndexFilePaths not implemented") } func (*UnimplementedIndexServiceServer) NotifyBuildIndex(ctx context.Context, req *BuildIndexNotification) (*commonpb.Status, error) { @@ -937,7 +887,7 @@ func _IndexService_GetIndexStates_Handler(srv interface{}, ctx context.Context, } func _IndexService_GetIndexFilePaths_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IndexFilePathsRequest) + in := new(IndexFilePathRequest) if err := dec(in); err != nil { return nil, err } @@ -949,7 +899,7 @@ func _IndexService_GetIndexFilePaths_Handler(srv interface{}, ctx context.Contex FullMethod: "/milvus.proto.index.IndexService/GetIndexFilePaths", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(IndexServiceServer).GetIndexFilePaths(ctx, req.(*IndexFilePathsRequest)) + return srv.(IndexServiceServer).GetIndexFilePaths(ctx, req.(*IndexFilePathRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/internal/proxyservice/proxyservice.go b/internal/proxyservice/proxyservice.go index 3dfb349964cdc2ecd78f0f226138f3a3d0e980bf..50890e47e41effaf76742c8c8bf389c67626e0ac 100644 --- a/internal/proxyservice/proxyservice.go +++ b/internal/proxyservice/proxyservice.go @@ -13,15 +13,15 @@ type ProxyService struct { } -func (s ProxyService) Init() { +func (s ProxyService) Init() error { panic("implement me") } -func (s ProxyService) Start() { +func (s ProxyService) Start() error { panic("implement me") } -func (s ProxyService) Stop() { +func (s ProxyService) Stop() error { panic("implement me") } diff --git a/internal/querynode/query_node.go b/internal/querynode/query_node.go index 6b0fbfb9de46d6676fe48c4011bb1014a8e599c9..d30699359d2c4dc785b2825f7229bd045829f9bc 100644 --- a/internal/querynode/query_node.go +++ b/internal/querynode/query_node.go @@ -16,10 +16,13 @@ import ( "context" "errors" "fmt" - queryserviceimpl "github.com/zilliztech/milvus-distributed/internal/queryservice" "io" "sync/atomic" + "github.com/zilliztech/milvus-distributed/internal/util/typeutil" + + queryserviceimpl "github.com/zilliztech/milvus-distributed/internal/queryservice" + "github.com/opentracing/opentracing-go" "github.com/uber/jaeger-client-go/config" @@ -31,9 +34,7 @@ import ( ) type Node interface { - Init() - Start() - Stop() + typeutil.Service GetComponentStates() (*internalpb2.ComponentStates, error) GetTimeTickChannel() (string, error) @@ -123,7 +124,7 @@ func Init() { Params.Init() } -func (node *QueryNode) Init() { +func (node *QueryNode) Init() error { registerReq := queryPb.RegisterNodeRequest{ Address: &commonpb.Address{ Ip: Params.QueryNodeIP, @@ -141,9 +142,10 @@ func (node *QueryNode) Init() { // TODO: use response.initParams Params.Init() + return nil } -func (node *QueryNode) Start() { +func (node *QueryNode) Start() error { // todo add connectMaster logic // init services and manager node.dataSyncService = newDataSyncService(node.queryNodeLoopCtx, node.replica) @@ -162,9 +164,10 @@ func (node *QueryNode) Start() { node.stateCode.Store(internalpb2.StateCode_HEALTHY) <-node.queryNodeLoopCtx.Done() + return nil } -func (node *QueryNode) Stop() { +func (node *QueryNode) Stop() error { node.stateCode.Store(internalpb2.StateCode_ABNORMAL) node.queryNodeLoopCancel() @@ -187,6 +190,7 @@ func (node *QueryNode) Stop() { if node.closer != nil { node.closer.Close() } + return nil } func (node *QueryNode) GetComponentStates() (*internalpb2.ComponentStates, error) { diff --git a/internal/querynode/segment_manager.go b/internal/querynode/segment_manager.go index 019a84ad38a4526182500f45e2f7707d85cff96d..f72ede87ebc7e1d48922bbc2069f088b0981ef9f 100644 --- a/internal/querynode/segment_manager.go +++ b/internal/querynode/segment_manager.go @@ -227,15 +227,15 @@ func (s *segmentManager) loadSegmentFieldsData(segmentID UniqueID, targetFields } func (s *segmentManager) getIndexPaths(indexID UniqueID) ([]string, error) { - indexFilePathRequest := &indexpb.IndexFilePathsRequest{ - IndexIDs: []UniqueID{indexID}, + indexFilePathRequest := &indexpb.IndexFilePathRequest{ + IndexID: indexID, } pathResponse, err := s.indexBuilderClient.GetIndexFilePaths(context.TODO(), indexFilePathRequest) if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_SUCCESS { return nil, err } - return pathResponse.FilePaths[0].IndexFilePaths, nil + return pathResponse.IndexFilePaths, nil } func (s *segmentManager) getIndexParam() (indexParam, error) { diff --git a/internal/queryservice/queryservice.go b/internal/queryservice/queryservice.go index fe904da260412204a1d92c800a492abecbbf387c..5edf64c37c17e12bdf514640cab6f038f3e89406 100644 --- a/internal/queryservice/queryservice.go +++ b/internal/queryservice/queryservice.go @@ -9,15 +9,15 @@ type QueryService struct { } //serverBase interface -func (qs *QueryService) Init() { +func (qs *QueryService) Init() error { panic("implement me") } -func (qs *QueryService) Start() { +func (qs *QueryService) Start() error { panic("implement me") } -func (qs *QueryService) Stop() { +func (qs *QueryService) Stop() error { panic("implement me") } diff --git a/internal/util/typeutil/service.go b/internal/util/typeutil/service.go index 9fe320b54ab1b03b4b00912f983579d3c3b06a7a..e04c7e35a064bef1ecdc85e09203000d15318ef6 100644 --- a/internal/util/typeutil/service.go +++ b/internal/util/typeutil/service.go @@ -5,9 +5,9 @@ import ( ) type Service interface { - Init() - Start() - Stop() + Init() error + Start() error + Stop() error } type Component interface {