From b70665ed89e9672de69d285d25e72a91cd52e35c Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Mon, 27 Sep 2021 22:48:03 +0800 Subject: [PATCH] Add comment for index interface (#8712) Signed-off-by: cai.zhang --- internal/types/types.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/types/types.go b/internal/types/types.go index ed7c1ab5de..698a171aee 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -86,7 +86,10 @@ type IndexNode interface { Component TimeTickProvider + // CreateIndex receives request from IndexCoordinator to build an index. + // Index building is asynchronous, so when an index building request comes, IndexNode records the task and returns. CreateIndex(ctx context.Context, req *indexpb.CreateIndexRequest) (*commonpb.Status, error) + // GetMetrics gets the metrics about IndexNode. GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) } @@ -94,10 +97,20 @@ type IndexCoord interface { Component TimeTickProvider + // BuildIndex receives request from RootCoordinator to build an index. + // Index building is asynchronous, so when an index building request comes, an IndexBuildID is assigned to the task and + // the task is recorded in Meta. The background process assignTaskLoop will find this task and assign it to IndexNode for + // execution. BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequest) (*indexpb.BuildIndexResponse, error) + // DropIndex deletes indexes based on IndexID. One IndexID corresponds to the index of an entire column. A column is + // divided into many segments, and each segment corresponds to an IndexBuildID. IndexCoord uses IndexBuildID to record + // index tasks. Therefore, when DropIndex is called, delete all tasks corresponding to IndexBuildID corresponding to IndexID. DropIndex(ctx context.Context, req *indexpb.DropIndexRequest) (*commonpb.Status, error) + // GetIndexStates gets the index states of the IndexBuildIDs in the request from RootCoordinator. GetIndexStates(ctx context.Context, req *indexpb.GetIndexStatesRequest) (*indexpb.GetIndexStatesResponse, error) + // GetIndexFilePaths gets the index files of the IndexBuildIDs in the request from RootCoordinator. GetIndexFilePaths(ctx context.Context, req *indexpb.GetIndexFilePathsRequest) (*indexpb.GetIndexFilePathsResponse, error) + // GetMetrics gets the metrics about IndexCoord. GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) }